Author: wmb Date: Thu Feb 25 01:54:44 2010 New Revision: 1758 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1758
Log: OLPC trac 10043 - Fix USB keyboard operation for XO-1.
Modified: cpu/x86/pc/olpc/devices.fth dev/geode/usb.fth
Modified: cpu/x86/pc/olpc/devices.fth ============================================================================== --- cpu/x86/pc/olpc/devices.fth Fri Feb 19 00:34:41 2010 (r1757) +++ cpu/x86/pc/olpc/devices.fth Thu Feb 25 01:54:44 2010 (r1758) @@ -225,14 +225,14 @@ : report-keyboard ( -- ) " /usb@f,4/keyboard" locate-device 0= if drop - " keyboard" " /usb@f,4/keyboard" $devalias + " usb-keyboard" " /usb@f,4/keyboard" $devalias exit then
\ In case the keyboard is behind a USB 2 hub " /usb@f,5/keyboard" locate-device 0= if drop - " keyboard" " /usb@f,5/keyboard" $devalias + " usb-keyboard" " /usb@f,5/keyboard" $devalias then ;
Modified: dev/geode/usb.fth ============================================================================== --- dev/geode/usb.fth Fri Feb 19 00:34:41 2010 (r1757) +++ dev/geode/usb.fth Thu Feb 25 01:54:44 2010 (r1758) @@ -50,12 +50,32 @@ alias probe-usb2 probe-usb alias p2 probe-usb2
-: ?usb-keyboard ( -- ) - " keyboard" expand-alias if ( devspec$ ) - drop " /usb" comp 0= if ( ) - red-letters ." Using USB keyboard." cr black-letters - " keyboard" input +0 value usb-keyboard-ih + +: attach-usb-keyboard ( -- ) + " usb-keyboard" expand-alias if ( devspec$ ) + drop " /usb" comp 0= if ( ) + " usb-keyboard" open-dev to usb-keyboard-ih + usb-keyboard-ih add-input + exit then + else ( devspec$ ) + 2drop + then +; + +: detach-usb-keyboard ( -- ) + usb-keyboard-ih if + usb-keyboard-ih remove-input + usb-keyboard-ih close-dev + 0 to usb-keyboard-ih + then +; + +: ?usb-keyboard ( -- ) + attach-usb-keyboard + " /usb/serial" open-dev ?dup if + add-input then ;
openfirmware@openfirmware.info