Author: wmb Date: Wed Aug 4 19:08:23 2010 New Revision: 1913 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1913
Log: OLPC NANDblaster - renamed some source files so the naming scheme is consistent between XO-1 and XO-1.5
Added: cpu/x86/pc/olpc/nbtx.fth - copied unchanged from r1912, cpu/x86/pc/olpc/nandcastui.fth cpu/x86/pc/olpc/via/nbtx.fth - copied unchanged from r1912, cpu/x86/pc/olpc/nb15tx.fth Deleted: cpu/x86/pc/olpc/nandcastui.fth cpu/x86/pc/olpc/nb15tx.fth Modified: cpu/x86/pc/olpc/fw.bth cpu/x86/pc/olpc/via/fw.bth
Modified: cpu/x86/pc/olpc/fw.bth ============================================================================== --- cpu/x86/pc/olpc/fw.bth Wed Aug 4 18:51:00 2010 (r1912) +++ cpu/x86/pc/olpc/fw.bth Wed Aug 4 19:08:23 2010 (r1913) @@ -466,7 +466,7 @@ create use-mesh fload ${BP}/cpu/x86/bootascall.fth fload ${BP}/cpu/x86/pc/olpc/wifichannel.fth -fload ${BP}/cpu/x86/pc/olpc/nandcastui.fth +fload ${BP}/cpu/x86/pc/olpc/nbtx.fth fload ${BP}/cpu/x86/pc/olpc/nbrx.fth fload ${BP}/cpu/x86/pc/olpc/fsupdate.fth
Copied: cpu/x86/pc/olpc/nbtx.fth (from r1912, cpu/x86/pc/olpc/nandcastui.fth) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/x86/pc/olpc/nbtx.fth Wed Aug 4 19:08:23 2010 (r1913, copy of r1912, cpu/x86/pc/olpc/nandcastui.fth) @@ -0,0 +1,98 @@ +purpose: User interface for NAND multicast updater - transmission +\ See license at end of file + +: mesh-ssids ( -- $ ) + " olpc-mesh"nolpc-mesh"nolpc-mesh"nolpc-mesh"nolpc-mesh"nolpc-mesh" +; + +: select-mesh-mode ( -- ) + \ Check for already set because re-setting it will force rescanning + ['] mesh-ssids to default-ssids + wifi-cfg >wc-ssid pstr@ " olpc-mesh" $= 0= if + " olpc-mesh" $essid + then +; + +: $file-to-mem ( filename$ -- adr len ) + $read-open + ifd @ fsize dup alloc-mem swap ( adr len ) + 2dup ifd @ fgets ( adr len actual ) + ifd @ fclose ( adr len actual ) + over <> abort" Can't read file" cr ( adr len ) +; + +: #nb-clone ( channel# -- ) + depth 1 < abort" Usage: channel# #nb-clone" + redundancy swap + " rom:nb_tx ether:%d nand: %d" sprintf boot-load go +; +: #nb-copy ( image-filename$ channel# -- ) + depth 3 < abort" #nb-copy - too few arguments" + >r 2>r ( placement-filename$ r: channel# image-filename$ ) + redundancy 2r> r> ( redundancy image-filename$ channel# ) + " rom:nb_tx ether:%d %s %d 131072" sprintf boot-load go +; +: #nb-update ( placement-filename$ image-filename$ channel# -- ) + depth 5 < abort" #nb-update - too few arguments" + >r 2>r ( placement-filename$ r: channel# image-filename$ ) + $file-to-mem ( spec$ r: channel# image-filename$ ) + swap redundancy 2r> r> ( speclen specadr redundancy image-filename$ channel# ) + " rom:nb_tx ether:%d %s %d 131072 %d %d" sprintf boot-load go +; +: #nb-secure ( zip-filename$ image-filename$ channel# -- ) + depth 5 < abort" #nb-secure-update - too few arguments" + >r 2>r ( placement-filename$ r: channel# image-filename$ ) + load-read sig$ ?save-string swap ( siglen sigadr r: channel# image-filename$ ) + img$ ?save-string swap ( siglen sigadr speclen specadr r: channel# image-filename$ ) + redundancy 2r> r> ( siglen sigadr speclen specadr redundancy image-filename$ channel# ) + " rom:nb_tx ether:%d %s %d 131072 %d %d %d %d" sprintf boot-load go +; + +: #nb-update-def ( channel# -- ) >r " u:\fs.plc" " u:\fs.img" r> #nb-update ; +: #nb-secure-def ( channel# -- ) >r " u:\fs.zip" " u:\fs.img" r> #nb-secure ; + +: nb-clone ( -- ) nb-auto-channel #nb-clone ; +: nb-secure ( -- ) nb-auto-channel #nb-secure-def ; +: nb-update ( -- ) nb-auto-channel #nb-update-def ; + +: nb-clone1 ( -- ) 1 #nb-clone ; +: nb-clone6 ( -- ) 6 #nb-clone ; +: nb-clone11 ( -- ) d# 11 #nb-clone ; + +: nb-update1 ( -- ) 1 #nb-update-def ; +: nb-update6 ( -- ) 6 #nb-update-def ; +: nb-update11 ( -- ) d# 11 #nb-update-def ; + +: nb-secure1 ( -- ) 1 #nb-secure-def ; +: nb-secure6 ( -- ) 6 #nb-secure-def ; +: nb-secure11 ( -- ) d# 11 #nb-secure-def ; + +: mesh-clone + select-mesh-mode + false to already-go? + redundancy " boot rom:nb_tx udp:239.255.1.2 nand: %d" sprintf eval +; + +\ LICENSE_BEGIN +\ Copyright (c) 2008 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/via/fw.bth ============================================================================== --- cpu/x86/pc/olpc/via/fw.bth Wed Aug 4 18:51:00 2010 (r1912) +++ cpu/x86/pc/olpc/via/fw.bth Wed Aug 4 19:08:23 2010 (r1913) @@ -517,7 +517,7 @@ create use-thinmac fload ${BP}/cpu/x86/bootascall.fth fload ${BP}/cpu/x86/pc/olpc/wifichannel.fth -fload ${BP}/cpu/x86/pc/olpc/nb15tx.fth +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 fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth
Copied: cpu/x86/pc/olpc/via/nbtx.fth (from r1912, cpu/x86/pc/olpc/nb15tx.fth) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/x86/pc/olpc/via/nbtx.fth Wed Aug 4 19:08:23 2010 (r1913, copy of r1912, cpu/x86/pc/olpc/nb15tx.fth) @@ -0,0 +1,110 @@ +purpose: User interface for NAND multicast updater - transmission to XO-1.5 +\ See license at end of file + +\ This sender is for multicast operation over a wired network. +\ It is rarely used, because the wired multicast mode is primarily +\ used in the factory with a big server as the sender. +\ Example: wired-nb-tx: u:\os201.zd 224.0.0.2 +: wired-nb-tx: ( "filename" "multicast-ip-address" -- ) + false to already-go? + safe-parse-word safe-parse-word + " boot rom:nb_tx udp:%s %s 20 131072" sprintf eval +; + +\ This sends to XO-1.5 receivers, but the sender itself can run on either XO-1 or XO-1.5. +\ On XO-1, you must load the special "thin" firmware from a USB stick. +: ?load-thin-wlan-fw ( -- ) + " /wlan" find-package 0= abort" No /wlan device" ( phandle ) + + " thin" rot get-package-property if ( ) + \ Absence of "thin" property means we need to get special firmware + " u:\usb8388t.bin" " wlan-fw" $setenv + \ We have to reset the device and driver to force it to reload + \ the thin firmware, in case firmware has already been loaded. + wlan-reset + " dev /wlan ds-not-ready to driver-state dend" evaluate + else ( adr len ) + \ Presence of "thin" property means we are good to go + 2drop + then +; + +: $nb-tx ( filename$ channel# -- ) + >r 2>r redundancy 2r> r> + ?load-thin-wlan-fw + false to already-go? + + " boot rom:nb_tx thinmac:OLPC-NANDblaster,%d %s %d 131072" sprintf eval +; + +: nb-tx: ( "filename" -- ) + redundancy ( redundancy ) + safe-parse-word ( redundancy filename$ ) + nb-auto-channel ( redundancy filename$ channel# ) + + ?load-thin-wlan-fw + false to already-go? + + " boot rom:nb_tx thinmac:OLPC-NANDblaster,%d %s %d 131072" sprintf eval +; + +: #nb-secure ( zip-filename$ image-filename$ channel# -- ) + depth 5 < abort" #nb-secure-update - too few arguments" + >r 2>r ( placement-filename$ r: channel# image-filename$ ) + load-read sig$ ?save-string swap ( siglen sigadr r: channel# image-filename$ ) + img$ ?save-string swap ( siglen sigadr speclen specadr r: channel# image-filename$ ) + redundancy 2r> r> ( siglen sigadr speclen specadr redundancy image-filename$ channel# ) + " rom:nb_tx thinmac:OLPC-NANDblaster,%d %s %d 131072 %d %d %d %d" sprintf boot-load go +; +: #nb-secure-def ( channel# -- ) >r " u:\fs.zip" " u:\fs.zd" r> #nb-secure ; + +: #nb-update-def ( channel# -- ) >r " u:\fs.zd" r> $nb-tx ; +: nb-update1 ( -- ) 1 #nb-update-def ; +: nb-update6 ( -- ) 6 #nb-update-def ; +: nb-update11 ( -- ) d# 11 #nb-update-def ; + +: nb-secure1 ( -- ) 1 #nb-secure-def ; +: nb-secure6 ( -- ) 6 #nb-secure-def ; +: nb-secure11 ( -- ) d# 11 #nb-secure-def ; + +: nb-secure ( -- ) nb-auto-channel #nb-secure-def ; +: nb-update ( -- ) nb-auto-channel #nb-update-def ; + +[ifdef] use-nb15-precomputed +\ NANDblaster sender using thin firmware on XO-1.5, with precomputed +\ packet data. This turns out to be useless because the packets can +\ be computed on-the-fly faster than the module can send. +: nb15-precomputed: ( "filename" ["delay"]-- ) + false to already-go? + safe-parse-word ( name$ ) + safe-parse-word 2>r ( name$ r: channel$ ) + parse-word 2swap ( delay$ name$ r: channel$ ) + 2r> + " u:\usb8388t.bin" " wlan-fw" $setenv + " boot rom:blaster thinmac:OLPC-NANDblaster,%s %s %s" sprintf eval +; +[then] + +\ LICENSE_BEGIN +\ Copyright (c) 2010 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