Author: wmb Date: 2007-05-06 23:38:30 +0200 (Sun, 06 May 2007) New Revision: 365
Modified: cpu/x86/pc/olpc/devices.fth cpu/x86/pc/olpc/versions.fth dev/olpc/kb3700/ecio.fth Log: OLPC - Don't use the new EC commands at all, not even for board ID, because they are so flaky that they often prevent startup. Go back to snooping on internal EC variables.
Modified: cpu/x86/pc/olpc/devices.fth =================================================================== --- cpu/x86/pc/olpc/devices.fth 2007-05-06 09:34:47 UTC (rev 364) +++ cpu/x86/pc/olpc/devices.fth 2007-05-06 21:38:30 UTC (rev 365) @@ -234,12 +234,31 @@ fload ${BP}/dev/olpc/kb3700/ecio.fth \ I/O space access to EC chip
0 value atest? +0 value board-revision + + stand-init: board revision + kb3920? to atest? + atest? if + h# a18 + else + lx? if +\ board-id@ case + snoop-board-id@ case + h# b2 of h# b30 endof \ preB3 + ( board-id ) dup h# 10 * 8 + swap \ E.g. b3 -> b38 + endcase + else + h# 4c00.0014 rdmsr drop ( RSTPLL-value ) + 4 rshift 7 and 7 = if h# b28 else h# b18 then + then + then + to board-revision +; + warning @ warning off stand-init: Wireless reset [ifdef] lx-devel exit [then]
- kb3920? to atest? - \ Hit the reset on the Marvell wireless. It sometimes (infrequently) \ fails to enumerate after a power-cycle, and reset seems to fix it. \ We need > 85 ms between wlan-reset and probe-usb, but console-start @@ -248,19 +267,6 @@ ; warning !
-: board-revision ( -- n ) - atest? if h# a18 exit then - lx? if - board-id@ case - h# b2 of h# b30 endof \ preB3 - ( board-id ) dup h# 10 * 8 + swap \ E.g. b3 -> b38 - endcase - else - h# 4c00.0014 rdmsr drop ( RSTPLL-value ) - 4 rshift 7 and 7 = if h# b28 else h# b18 then - then -; - stand-init: PCI properties " /pci" find-device board-revision h# b18 < if
Modified: cpu/x86/pc/olpc/versions.fth =================================================================== --- cpu/x86/pc/olpc/versions.fth 2007-05-06 09:34:47 UTC (rev 364) +++ cpu/x86/pc/olpc/versions.fth 2007-05-06 21:38:30 UTC (rev 365) @@ -2,7 +2,7 @@
\ The overall firmware revision macro: FW_MAJOR C -macro: FW_MINOR 10 +macro: FW_MINOR 10d
\ The EC microcode macro: EC_VERSION c10
Modified: dev/olpc/kb3700/ecio.fth =================================================================== --- dev/olpc/kb3700/ecio.fth 2007-05-06 09:34:47 UTC (rev 364) +++ dev/olpc/kb3700/ecio.fth 2007-05-06 21:38:30 UTC (rev 365) @@ -29,14 +29,14 @@
: ec-cmd ( cmd -- response ) - h# 6c pc! begin h# 6c pc@ 3 and 1 = until h# 68 pc@ + h# 6c pc! begin 1 ms h# 6c pc@ 3 and 1 = until 1 ms h# 68 pc@ h# ff h# 6c pc! \ Release ownership ;
: ec-cmd66 ( byte -- ) h# 66 pc! \ It typically requires about 200 polls - d# 4000 0 do h# 66 pc@ 2 and 0= if unloop exit then loop + d# 4000 0 do 1 ms h# 66 pc@ 2 and 0= if unloop exit then loop true abort" EC didn't respond to port 66 command" ;
@@ -147,6 +147,8 @@
: kb3920? ( -- flag ) h# 6c pc@ h# ff = if true exit then 9 ec-cmd 9 = ;
+: snoop-board-id@ ( -- id ) h# fa20 ec@ ; + \ While accessing the SPI FLASH, we have to turn off the keyboard controller, \ because it continuously fetches from the SPI FLASH when it's on. That \ interferes with our accesses.