Author: wmb Date: 2009-08-20 09:58:25 +0200 (Thu, 20 Aug 2009) New Revision: 1311
Modified: cpu/x86/pc/olpc/via/boardrev.fth cpu/x86/pc/olpc/via/startcominit.fth cpu/x86/pc/olpc/via/suspend.fth Log: Via - moved the atest check for serial enabling into the assembly language startup code.
Modified: cpu/x86/pc/olpc/via/boardrev.fth =================================================================== --- cpu/x86/pc/olpc/via/boardrev.fth 2009-08-20 06:43:38 UTC (rev 1310) +++ cpu/x86/pc/olpc/via/boardrev.fth 2009-08-20 07:58:25 UTC (rev 1311) @@ -44,11 +44,6 @@ \ Cache the board revision in CMOS RAM so the early startup code \ can get it without having to wait for the EC. board-revision dup h# 82 cmos! invert h# 83 cmos! - - \ Force the serial port back on for A-test, even when SERIAL_EN is - \ not asserted, because many developers use serial on A-test systems - \ and it is not easy to jumper SERIAL_EN on A-test. - atest? if enable-uart then ; warning !
Modified: cpu/x86/pc/olpc/via/startcominit.fth =================================================================== --- cpu/x86/pc/olpc/via/startcominit.fth 2009-08-20 06:43:38 UTC (rev 1310) +++ cpu/x86/pc/olpc/via/startcominit.fth 2009-08-20 07:58:25 UTC (rev 1311) @@ -21,18 +21,65 @@ h# 80 # al or al bl mov \ Set south module pad share enable 78 3c4 port-wb 3c5 # dx mov bl al mov al dx out
- \ If the SERIAL_EN jumper is installed, routing the external pin to - \ the UART; otherwise leave it connected to the VCP port. + \ If the SERIAL_EN jumper is installed, or if the machine is an A-test, + \ route the external pin to the UART; otherwise leave it connected to the VCP port.
acpi-io-base 48 + port-rb h# 10 # al test 0= if + \ SERIAL_EN is installed, so put the A-test ID in AL so we can check + \ a single condition at the end of the logic. + h# d0 # al mov + else + \ SERIAL_EN is not installed. Determine the board ID.
+ \ First we check for a cached board ID in CMOS RAM, to avoid the + \ possibly time-consuming operation of asking the EC. + + \ To read the high half of CMOS RAM we must enable it d# 17 0 devfunc + 4e 18 18 mreg \ Enable ports 74/75 for CMOS RAM access - 10 res be like Phx + end-table + + h# 83 # al mov al h# 74 # out h# 75 # al in \ check byte - should be ~board-id + al ah mov ah not \ ~check byte in AH + h# 82 # al mov al h# 74 # out h# 75 # al in \ board-id in AL + + al ah cmp 0<> if \ If the check byte matches, fall through with the ID in AL + + \ If check byte is wrong, we have to ask the EC + + h# 6c # al in \ EC status register + 2 # al and \ input buffer full bit + 0<> if \ If the bit is nonzero, we can't send a command yet + \ We don't wait for the EC; if it is busy we assume B-test + \ It shouldn't be busy at this point because we haven't tried to talk to it yet + h# d1 # al mov \ EC busy - report B-test + else + h# 19 # al mov al h# 6c # out \ Send board ID command to EC + d# 200 # cx mov \ Wait up to 200 mS for the EC to respond + begin + d# 1000 wait-us \ 1 mS delay so we don't pound on the EC + h# 6c # al in \ Get status register + 3 # al and \ Check for output buffer full + 1 # al cmp + loopne + <> if \ Not equal means timeout + h# d1 # al mov \ EC timeout - report B-test + else + h# 68 # al in \ Get board ID byte from EC + then + then + then + then + + \ Now AL contains the board ID or a surrogate that will cause the + \ desired result for the test below. + h# d1 # al cmp u< if + d# 17 0 devfunc \ The following is for UART on VCP port 46 c0 40 mreg \ The following is for UART on DVP port \ 46 c0 c0 mreg end-table - then
d# 17 0 devfunc
Modified: cpu/x86/pc/olpc/via/suspend.fth =================================================================== --- cpu/x86/pc/olpc/via/suspend.fth 2009-08-20 06:43:38 UTC (rev 1310) +++ cpu/x86/pc/olpc/via/suspend.fth 2009-08-20 07:58:25 UTC (rev 1311) @@ -31,8 +31,6 @@ sp@ 4 - h# f0000 ax-call \ sp@ 4 - is a dummy pdir-va location [then] \ sum-forth - - atest? if enable-uart then ukey? if ukey drop then ; : kb-suspend ( -- ) sci-wakeup
openfirmware@openfirmware.info