Author: rsmith Date: Wed Jul 14 22:34:13 2010 New Revision: 1869 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1869
Log: OLPC XO 1.5: ALPS keyboard support; Trust the EC.
The ALPS keyboard need 500ms to startup before you can successfully talk to it. The previous keyboard routines would try to probe at the same time that the EC is trying to detect what keyboard controller is installed. When OFW dosen't get a response it assumes there is no keyboard.
Now OFW assumes that the EC is properly detecting the keboard controller (Which is does as of Ver 1.9.30) and the only command it sends is the scan enable.
Modified: cpu/x86/pc/olpc/via/devices.fth cpu/x86/pc/olpc/via/ec-version.fth dev/pckbd.fth
Modified: cpu/x86/pc/olpc/via/devices.fth ============================================================================== --- cpu/x86/pc/olpc/via/devices.fth Wed Jul 14 22:08:26 2010 (r1868) +++ cpu/x86/pc/olpc/via/devices.fth Wed Jul 14 22:34:13 2010 (r1869) @@ -121,6 +121,8 @@ [then] : serial-enabled? ( -- flag ) h# 8846 config-b@ h# 40 and 0<> ;
+create trust-ec-keyboard + fload ${BP}/dev/pci/isaall.fth \ We don't need a serial selftest because the serial port is internal only \ and the selftest turns off the diag device
Modified: cpu/x86/pc/olpc/via/ec-version.fth ============================================================================== --- cpu/x86/pc/olpc/via/ec-version.fth Wed Jul 14 22:08:26 2010 (r1868) +++ cpu/x86/pc/olpc/via/ec-version.fth Wed Jul 14 22:34:13 2010 (r1869) @@ -3,5 +3,5 @@
\ Alternate command for getting EC microcode, for testing new versions. \ Temporarily uncomment the line and modify the path as necessary -\ macro: GET_EC cp ~rsmith/olpc/ec/ec-code15/image/ecimage.bin ec.img +macro: GET_EC cp ~rsmith/olpc/ec/ec-code15/image/ecimage.bin ec.img \ macro: GET_EC wget -q http://dev.laptop.org/pub/ec/ec_test.img -O ec.img
Modified: dev/pckbd.fth ============================================================================== --- dev/pckbd.fth Wed Jul 14 22:08:26 2010 (r1868) +++ dev/pckbd.fth Wed Jul 14 22:34:13 2010 (r1869) @@ -257,17 +257,10 @@
[ifdef] olpc [ifndef] demo-board -: ?olpc-keyboard ( -- ) - " enable-intf" $call-parent - begin d# 50 timed-read 0= while - drop - true to keyboard-present? - exit - repeat - keyboard-present? if exit then - kbd-reset 0= to keyboard-present? -;
+[ifdef] trust-ec-keyboard +: ?olpc-keyboard ( -- ) true to keyboard-present? ; +[else] \ For the ENE keyboard controller we have to tell the EC to use \ a different internal mapping table. OLPC switched from an \ ALPS to an ENE controller in late 2007. @@ -284,7 +277,23 @@
\ This looks like an ENE controller, so flip the mapping table h# f7 cmd +; + +: ?olpc-keyboard ( -- ) + " enable-intf" $call-parent + begin d# 50 timed-read 0= while + drop + true to keyboard-present? + exit + repeat + keyboard-present? if exit then + kbd-reset 0= to keyboard-present? + + \ Try resetting the keyboard + kbd-reset 0= to keyboard-present? + keyboard-present? if olpc-set-ec-keymap then ; +[then]
fload ${BP}/cpu/x86/pc/olpc/keymap.fth [then] @@ -423,7 +432,6 @@ clear-state [ifdef] ?olpc-keyboard ?olpc-keyboard - keyboard-present? if olpc-set-ec-keymap exit then [else] get-initial-state
openfirmware@openfirmware.info