[openfirmware] [commit] r2043 - in cpu: arm/olpc/1.75 x86/pc/olpc/via
repository service
svn at openfirmware.info
Thu Nov 25 05:57:42 CET 2010
Author: wmb
Date: Thu Nov 25 05:57:42 2010
New Revision: 2043
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2043
Log:
OLPC XO-1.75 - factored out HDD LED setting code, added game key reading code.
Modified:
cpu/arm/olpc/1.75/fw.bth
cpu/x86/pc/olpc/via/fsupdate.fth
cpu/x86/pc/olpc/via/fw.bth
Modified: cpu/arm/olpc/1.75/fw.bth
==============================================================================
--- cpu/arm/olpc/1.75/fw.bth Thu Nov 25 05:55:14 2010 (r2042)
+++ cpu/arm/olpc/1.75/fw.bth Thu Nov 25 05:57:42 2010 (r2043)
@@ -76,7 +76,7 @@
disable-interrupts
d# 1000
i-key-wait if
-\ protect-fw
+ protect-fw
." Interacting" cr hex interact
then
\ Turn on USB power here to overlap the time with other startup actions
@@ -154,7 +154,15 @@
fload ${BP}/cpu/x86/pc/olpc/gridmap.fth \ Gridded display tools
fload ${BP}/cpu/x86/pc/olpc/via/copynand.fth
-: game-key@ ( -- n ) 0 ; \ Implement me!!!
+: game-key@ ( -- n )
+ 0
+ d# 16 gpio-pin@ 0= if h# 80 or then \ O
+ d# 17 gpio-pin@ 0= if h# 02 or then \ Check
+ d# 18 gpio-pin@ 0= if h# 100 or then \ X
+ d# 19 gpio-pin@ 0= if h# 01 or then \ Square
+ d# 20 gpio-pin@ 0= if h# 40 or then \ Rotate
+;
+
fload ${BP}/cpu/x86/pc/olpc/gamekeys.fth
: emacs ( -- )
false to already-go?
@@ -192,6 +200,10 @@
: show-temperature ;
[then]
+: hdd-led-off ( -- ) d# 10 gpio-clr ;
+: hdd-led-on ( -- ) d# 10 gpio-set ;
+: hdd-led-toggle ( -- ) d# 10 gpio-pin@ if hdd-led-off else hdd-led-on then ;
+
fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth
fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth
devalias fsdisk int:0
@@ -295,12 +307,11 @@
protect-fw text-on ['] scan-nand guarded
then
;
+[then]
: ?fs-update ( -- )
button-check button-x or button-o or button-square or ( mask )
game-key-mask = if protect-fw try-fs-update then
;
-[then]
-
: startup ( -- )
standalone? 0= if exit then
@@ -313,9 +324,7 @@
disable-user-aborts
console-start
-[ifdef] notyet
read-game-keys
-[then]
factory-test? if text-off then
Modified: cpu/x86/pc/olpc/via/fsupdate.fth
==============================================================================
--- cpu/x86/pc/olpc/via/fsupdate.fth Thu Nov 25 05:55:14 2010 (r2042)
+++ cpu/x86/pc/olpc/via/fsupdate.fth Thu Nov 25 05:57:42 2010 (r2043)
@@ -64,20 +64,8 @@
vocabulary nand-commands
also nand-commands definitions
-: flash-led ( -- )
- h# 4c acpi-l@
- h# 400000 xor
- h# 4c acpi-l!
-;
-
-: clear-led ( -- )
- h# 4c acpi-l@
- h# 400000 or
- h# 4c acpi-l!
-;
-
: zblocks: ( "eblock-size" "#eblocks" ... -- )
- flash-led
+ hdd-led-toggle
?compare-spec-line
get-hex# to /nand-block
get-hex# to #image-eblocks
@@ -100,7 +88,7 @@
" write-blocks-end" $call-nand ( error? )
" Write error" ?nand-abort
\ #image-eblocks erase-gap
- clear-led
+ hdd-led-off
release-inflater
fexit
;
@@ -229,7 +217,7 @@
dup to last-eblock# ( eblock# )
show-written ( )
show-temperature
- flash-led
+ hdd-led-toggle
;
previous definitions
Modified: cpu/x86/pc/olpc/via/fw.bth
==============================================================================
--- cpu/x86/pc/olpc/via/fw.bth Thu Nov 25 05:55:14 2010 (r2042)
+++ cpu/x86/pc/olpc/via/fw.bth Thu Nov 25 05:57:42 2010 (r2043)
@@ -521,6 +521,8 @@
fload ${BP}/cpu/x86/pc/olpc/via/nbtx.fth
fload ${BP}/cpu/x86/pc/olpc/via/nbrx.fth
fload ${BP}/cpu/x86/pc/olpc/via/blockfifo.fth
+: hdd-led-toggle ( -- ) h# 4c acpi-l@ h# 400000 xor h# 4c acpi-l! ;
+: hdd-led-off ( -- ) h# 4c acpi-l@ h# 400000 or h# 4c acpi-l! ;
fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth
fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth
devalias fsdisk int:0
More information about the openfirmware
mailing list