Author: wmb
Date: 2007-08-15 05:06:37 +0200 (Wed, 15 Aug 2007)
New Revision: 539
Added:
cpu/x86/pc/olpc/boardrev.fth
Modified:
cpu/x86/pc/olpc/devices.fth
cpu/x86/pc/olpc/fw.bth
Log:
OLPC - Split the board revision sensing code out into a
separate file and rearranged the code that loads it.
Also added a game to the early startup button sequence.
Added: cpu/x86/pc/olpc/boardrev.fth
===================================================================
--- cpu/x86/pc/olpc/boardrev.fth (rev 0)
+++ cpu/x86/pc/olpc/boardrev.fth 2007-08-15 03:06:37 UTC (rev 539)
@@ -0,0 +1,61 @@
+purpose: Determine the board revision based on hardware and EC info
+\ See license at end of file
+
+0 value atest?
+0 value board-revision
+
+\ Constructs a string like "B4" or "preB4" or "postB4"
+: model-name$ ( -- model$ )
+ board-revision h# 10 /mod ( minor major )
+ swap dup 8 = if ( major minor )
+ drop " " ( major prefix$ )
+ else ( major minor )
+ 8 < if " pre" else " post" then ( major prefix$ )
+ then ( major prefix$ )
+ push-hex
+ rot <# u# u# drop hold$ 0 u#> ( adr len )
+ pop-base
+ 2dup + 2- 2 upper ( model$ ) \ Upper case for base model
+;
+
+stand-init: board revision
+ kb3920? to atest?
+ atest? if
+ h# a18
+ else
+ lx? if
+ board-id@ case
+ h# b2 of h# b30 endof \ preB3
+ ( board-id ) dup h# 10 * 8 + swap \ E.g. b3 -> b38
+ endcase
+ else
+ h# 4c00.0014 rdmsr drop ( RSTPLL-value )
+ 4 rshift 7 and 0= if h# b28 else h# b18 then
+ then
+ then
+ to board-revision
+;
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2007 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/devices.fth
===================================================================
--- cpu/x86/pc/olpc/devices.fth 2007-08-15 03:02:48 UTC (rev 538)
+++ cpu/x86/pc/olpc/devices.fth 2007-08-15 03:06:37 UTC (rev 539)
@@ -243,27 +243,8 @@
fload ${BP}/dev/olpc/kb3700/ecio.fth \ I/O space access to EC chip
-0 value atest?
-0 value board-revision
+fload ${BP}/cpu/x86/pc/olpc/boardrev.fth \ Board revision decoding
- stand-init: board revision
- kb3920? to atest?
- atest? if
- h# a18
- else
- lx? if
- board-id@ case
- h# b2 of h# b30 endof \ preB3
- ( board-id ) dup h# 10 * 8 + swap \ E.g. b3 -> b38
- endcase
- else
- h# 4c00.0014 rdmsr drop ( RSTPLL-value )
- 4 rshift 7 and 0= if h# b28 else h# b18 then
- then
- then
- to board-revision
-;
-
stand-init: Quiet SCI
sci-quiet
;
@@ -327,6 +308,44 @@
fload ${BP}/cpu/x86/adpcm.fth \ ADPCM decoding
+[ifdef] rom-loaded
+fload ${BP}/cpu/x86/pc/olpc/gpioinit.fth
+fload ${BP}/cpu/x86/pc/olpc/chipinit.fth
+[then]
+
+warning @ warning off
+: stand-init
+ stand-init
+ root-device
+ model-name$ 2dup model ( name$ )
+ " OLPC " encode-bytes 2swap encode-string encode+ " banner-name" property
+ board-revision " board-revision-int" integer-property
+ \ The "1-" removes the null byte
+ " SN" find-tag if 1- else " Unknown" then " serial-number" string-property
+
+[ifndef] lx-devel
+ 8 ec-cmd " ec-version" integer-property
+
+ " PQ2" h# fff0.0000 h# 1.0000 sindex dup 0>= if ( offset )
+ h# fff0.0000 + cscount ( name )
+ else
+ drop " UNKNOWN"
+ then
+ " ec-name" string-property
+[then]
+
+ dend
+
+ " /openprom" find-device
+ h# ffff.ffc0 d# 16 " model" string-property
+
+ " sourceurl" find-drop-in if " source-url" string-property then
+ dend
+;
+warning !
+
+fload ${BP}/cpu/x86/pc/olpc/micin.fth \ Microphone input AC/DC coupling
+
\ LICENSE_BEGIN
\ Copyright (c) 2006 FirmWorks
\
Modified: cpu/x86/pc/olpc/fw.bth
===================================================================
--- cpu/x86/pc/olpc/fw.bth 2007-08-15 03:02:48 UTC (rev 538)
+++ cpu/x86/pc/olpc/fw.bth 2007-08-15 03:06:37 UTC (rev 539)
@@ -214,54 +214,6 @@
fload ${BP}/cpu/x86/pc/olpc/devices.fth
-[ifdef] rom-loaded
-fload ${BP}/cpu/x86/pc/olpc/gpioinit.fth
-fload ${BP}/cpu/x86/pc/olpc/chipinit.fth
-[then]
-
-warning @ warning off
-: stand-init
- stand-init
- root-device
- board-revision case
- h# a18 of " A1" " OLPC A-test" endof
- h# b18 of " B1" " OLPC B1" endof
- h# b28 of " B2" " OLPC B2" endof
- h# b30 of " preB3" " OLPC preB3" endof
- h# b38 of " B3" " OLPC B3" endof
- h# b40 of " preB4" " OLPC preB4" endof
- h# b48 of " B4" " OLPC B4" endof
- ( default ) >r " ??" " OLPC ??" r>
- endcase
- encode-string " banner-name" property
- model
- board-revision " board-revision-int" integer-property
- \ The "1-" removes the null byte
- " SN" find-tag if 1- else " Unknown" then " serial-number" string-property
-
-[ifndef] lx-devel
- 8 ec-cmd " ec-version" integer-property
-
- " PQ2" h# fff0.0000 h# 1.0000 sindex dup 0>= if ( offset )
- h# fff0.0000 + cscount ( name )
- else
- drop " UNKNOWN"
- then
- " ec-name" string-property
-[then]
-
- dend
-
- " /openprom" find-device
- h# ffff.ffc0 d# 16 " model" string-property
-
- " sourceurl" find-drop-in if " source-url" string-property then
- dend
-;
-warning !
-
-fload ${BP}/cpu/x86/pc/olpc/micin.fth \ Microphone input AC/DC coupling
-
fload ${BP}/cpu/x86/pc/olpc/countdwn.fth \ Startup countdown
fload ${BP}/dev/scsi/probscsi.fth \ probe-scsi and probe-scsi-all
@@ -380,7 +332,10 @@
fload ${BP}/dev/olpc/touchpad/touchpad.fth \ Touchpad diagnostic
fload ${BP}/dev/olpc/kb3700/battery.fth \ Battery status reports
fload ${BP}/cpu/x86/pc/olpc/copynand.fth
+fload ${BP}/cpu/x86/pc/olpc/nandstat.fth
+\ fload ${BP}/cpu/x86/pc/olpc/carousel.fth \ Carouseled NAND writing
fload ${BP}/cpu/x86/pc/olpc/crypto.fth \ Cryptographic image validation
+fload ${BP}/ofw/gui/ofpong.fth
[then]
\ Eliminate 4 second delay in install console for the case where
@@ -412,7 +367,7 @@
fload ${BP}/ofw/inet/loadtcp.fth
support-package: http
- fload ${BP}/ofw/inet/http.fth \ HTTP client
+ fload ${BP}/ofw/inetv6/http.fth \ HTTP client
end-support-package
fload ${BP}/ofw/wifi/wifi-cfg.fth
@@ -456,7 +411,7 @@
;
: fast-boot? ( -- flag )
[ifdef] rom-loaded
- game-key-mask h# 100 and 0=
+ game-key-mask h# 120 and 0=
[else]
false
[then]
@@ -525,6 +480,9 @@
: ?start-sound ( -- )
game-key-mask h# 40 and if start-sound then
;
+: ?games ( -- )
+ game-key-mask h# 20 and if pong then
+;
: open-keyboard ( -- )
" keyboard" open-dev ?dup if set-stdin then
;
@@ -563,6 +521,7 @@
probe-pci
?start-sound
open-keyboard
+ ?games
optional-startup
interpreter-init
[ifndef] lx-devel
@@ -578,7 +537,9 @@
;
: newrom
- " flash http:\\10.20.0.109\new.rom" eval
+ " flash http:\\10.20.0.104\new.rom" eval
+\ " wifi media lab 802.11" eval
+\ " flash http:\\18.85.46.172\new.rom" eval
;
\ This helps with TeraTerm, which sends ESC-O as the arrow key prefix