Author: quozl Date: Fri May 17 04:29:37 2013 New Revision: 3659 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3659
Log: OLPC XO-1 - backport lid and ebook switch test, #12514.
Added: cpu/x86/pc/olpc/switches.fth Modified: cpu/x86/pc/olpc/fw.bth cpu/x86/pc/olpc/olpc.bth cpu/x86/pc/olpc/testitems.fth
Modified: cpu/x86/pc/olpc/fw.bth ============================================================================== --- cpu/x86/pc/olpc/fw.bth Thu May 16 07:00:21 2013 (r3658) +++ cpu/x86/pc/olpc/fw.bth Fri May 17 04:29:37 2013 (r3659) @@ -344,6 +344,7 @@ fload ${BP}/cpu/x86/pc/olpc/help.fth fload ${BP}/cpu/x86/pc/olpc/gui.fth fload ${BP}/cpu/x86/pc/olpc/suspend.fth \ Suspend/resume setup +fload ${BP}/cpu/x86/pc/olpc/switches.fth fload ${BP}/cpu/x86/pc/olpc/disptest.fth dev /keyboard fload ${BP}/dev/olpc/keyboard/selftest.fth \ Keyboard diagnostic @@ -486,9 +487,6 @@
" dhcp" ' ip-address set-config-string-default
-: lid? ( -- flag ) h# 30 >hi gpio@ h# 24 >hi gpio@ xor h# 400 and 0= ; -fload ${BP}/dev/olpc/lid.fth - : c1-idle ( -- ) interrupts-enabled? if halt then do-lid ; ' c1-idle to stdin-idle
Modified: cpu/x86/pc/olpc/olpc.bth ============================================================================== --- cpu/x86/pc/olpc/olpc.bth Thu May 16 07:00:21 2013 (r3658) +++ cpu/x86/pc/olpc/olpc.bth Fri May 17 04:29:37 2013 (r3659) @@ -102,6 +102,7 @@ " testicons/wifi.565" " wifi.565" $add-deflated-dropin " testicons/clock.565" " clock.565" $add-deflated-dropin " testicons/timer.565" " timer.565" $add-deflated-dropin + " ${BP}/cpu/x86/pc/olpc/images/ebook.di" $add-file
/rom h# 400 - pad-file \ rmstart image must start 0x400 from end " rmstart.img" $add-file
Added: cpu/x86/pc/olpc/switches.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/x86/pc/olpc/switches.fth Fri May 17 04:29:37 2013 (r3659) @@ -0,0 +1,41 @@ +\ See license at end of file +purpose: Driver/selftest for OLPC lid and ebook switches + +defer do-lid : lid-off ( -- ) ['] noop to do-lid ; lid-off + +0 0 " 0" " /" begin-package +" switches" device-name + +0 0 reg \ So test-all will run the test + +: lid? ( -- flag ) h# 30 >hi gpio@ h# 24 >hi gpio@ xor h# 400 and 0= ; +alias ebook? ebook-mode? + +fload ${BP}/dev/olpc/lidtest.fth +fload ${BP}/dev/olpc/lid.fth + +end-package + +\ LICENSE_BEGIN +\ Copyright (c) 2013 FirmWorks +\ +\ Permission is hereby granted, free of charge, to any person obtaining +\ a copy of this software and associated documentation files (the +\ "Software"), to deal in the Software without restriction, including +\ without limitation the rights to use, copy, modify, merge, publish, +\ distribute, sublicense, and/or sell copies of the Software, and to +\ permit persons to whom the Software is furnished to do so, subject to +\ the following conditions: +\ +\ The above copyright notice and this permission notice shall be +\ included in all copies or substantial portions of the Software. +\ +\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +\ +\ LICENSE_END
Modified: cpu/x86/pc/olpc/testitems.fth ============================================================================== --- cpu/x86/pc/olpc/testitems.fth Thu May 16 07:00:21 2013 (r3658) +++ cpu/x86/pc/olpc/testitems.fth Fri May 17 04:29:37 2013 (r3659) @@ -17,6 +17,7 @@ icon: keyboard.icon rom:keyboard.565 icon: timer.icon rom:timer.565 icon: clock.icon rom:clock.565 +icon: ebook.icon rom:ebook.565
: cpu-item ( -- ) " /cpu" mfg-test-dev ; : battery-item ( -- ) " /battery" mfg-test-dev ; @@ -32,6 +33,7 @@ : timer-item ( -- ) " /timer" mfg-test-dev ; : touchpad-item ( -- ) " /8042/mouse" mfg-test-dev ; : keyboard-item ( -- ) " /8042/keyboard" mfg-test-dev ; +: switch-item ( -- ) " /switches" mfg-test-dev ;
: olpc-test-menu-items ( -- ) 0 to #mfgtests @@ -78,6 +80,9 @@
" Touchpad" ['] touchpad-item touchpad.icon add-icon + + " Switches" + ['] switch-item ebook.icon add-icon
; ' olpc-test-menu-items to test-menu-items