Author: wmb Date: 2009-12-13 11:30:04 +0100 (Sun, 13 Dec 2009) New Revision: 1591
Modified: cpu/x86/pc/olpc/via/assy.fth cpu/x86/pc/olpc/via/factory.fth cpu/x86/pc/olpc/via/fw.bth cpu/x86/pc/olpc/via/runin.fth cpu/x86/pc/olpc/via/smt.fth Log: Via manufacturing tests - moved common routines from the mfg scripts into factory.fth to make the scripts shorter and cleaner.
Modified: cpu/x86/pc/olpc/via/assy.fth =================================================================== --- cpu/x86/pc/olpc/via/assy.fth 2009-12-13 09:59:45 UTC (rev 1590) +++ cpu/x86/pc/olpc/via/assy.fth 2009-12-13 10:30:04 UTC (rev 1591) @@ -5,30 +5,6 @@ \ Location of the files containing KA tag data : ka-dir$ ( -- adr len ) " http:\10.0.0.1\ka" ;
-\ Remove possible trailing carriage return from the line -: ?remove-cr ( adr len -- adr len' ) - dup if ( adr len ) - 2dup + 1- c@ carret = if ( adr len ) - 1- - then - then -; - -[ifndef] $read-file -\ Read entire file into allocated memory -: $read-file ( filename$ -- true | data$ false ) - open-dev ?dup 0= if true exit then >r ( r: ih ) - " size" r@ $call-method drop ( len r: ih ) - dup alloc-mem swap ( adr len r: ih ) - 2dup " read" r@ $call-method ( adr len actual r: ih ) - r> close-dev ( adr len actual ) - over <> if ( adr len ) - free-mem true exit - then ( adr len ) - false -; -[then] - : put-ka-tag ( value$ key$ -- ) 2over 8 min ka-dir$ " %s%s" sprintf ( value$ key$ filename$ ) $read-file if ( value$ key$ ) @@ -47,22 +23,11 @@ false ;
-: put-ascii-tag ( value$ name$ -- ) - 2swap dup if add-null then 2swap ( value$' key$ ) - ($add-tag) ( ) -; : put-tag ( value$ key$ -- ) special-tag? if exit then ( value$ key$ ) put-ascii-tag ;
-: .instructions ( adr len -- ) - cr blue-letters type black-letters cr -; -: .problem ( adr len -- ) - red-letters type black-letters cr -; - : check-smt-status ( -- ) " SS" find-tag 0= abort" Board failed SMT !!!" ( adr len ) -null ( adr len' ) @@ -167,10 +132,6 @@
0 0 2value response$
-: clear-mfg-buf ( -- ) - mfg-data-buf /flash-block h# ff fill -; - : execute-downloads ( adr len -- ) begin dup while ( adr len ) linefeed left-parse-string ( rem$ line$ ) @@ -237,16 +198,6 @@ " Response" get-response to response$ ;
-: wired-lan? ( -- flag ) - " /usb/ethernet" locate-device if false else drop true then -; -: wait-lan ( -- ) - wired-lan? 0= if - " Connect USB Ethernet Adapter" .instructions - begin d# 1000 ms silent-probe-usb wired-lan? until - then -; - : start-assy-test ( -- ) wait-lan
Modified: cpu/x86/pc/olpc/via/factory.fth =================================================================== --- cpu/x86/pc/olpc/via/factory.fth 2009-12-13 09:59:45 UTC (rev 1590) +++ cpu/x86/pc/olpc/via/factory.fth 2009-12-13 10:30:04 UTC (rev 1591) @@ -91,6 +91,72 @@ true abort" Server did not respond with 10 seconds" ;
+: .instructions ( adr len -- ) + cr blue-letters type black-letters cr +; +: .problem ( adr len -- ) + red-letters type black-letters cr +; + +: scanner? ( -- flag ) + " usb-keyboard" expand-alias if 2drop true else false then +; +: wait-scanner ( -- ) + scanner? 0= if + " Connect USB barcode scanner" .instructions + begin d# 1000 ms silent-probe-usb scanner? until + then + ; +: wired-lan? ( -- flag ) + " /usb/ethernet" locate-device if false else drop true then +; +: wait-lan ( -- ) + wired-lan? 0= if + " Connect USB Ethernet Adapter" .instructions + begin d# 1000 ms silent-probe-usb wired-lan? until + then +; +: usb-key? ( -- flag ) + " /usb/disk" locate-device if false else drop true then +; +: wait-usb-key ( -- ) + usb-key? 0= if + " Connect USB memory stick" .instructions + begin d# 1000 ms silent-probe-usb usb-key? until + then +; +: stall ( -- ) begin halt again ; + +: accept-to-buf ( buf len -- actual ) + over 1+ swap accept ( buf actual ) + tuck swap c! ( actual ) +; + +: clear-mfg-buf ( -- ) mfg-data-buf /flash-block h# ff fill ; + +\ Remove possible trailing carriage return from the line +: ?remove-cr ( adr len -- adr len' ) + dup if ( adr len ) + 2dup + 1- c@ carret = if ( adr len ) + 1- + then + then +; + +: put-ascii-tag ( value$ name$ -- ) + 2swap dup if add-null then 2swap ( value$' key$ ) + ($add-tag) ( ) +; + +: nocase-$= ( $1 $2 -- flag ) + rot tuck <> if ( adr1 adr2 len2 ) + 3drop false exit ( -- false ) + then ( adr1 adr2 len2 ) + caps-comp 0= ( flag ) +; + + + stand-init: set-boot-device set-test-station
Modified: cpu/x86/pc/olpc/via/fw.bth =================================================================== --- cpu/x86/pc/olpc/via/fw.bth 2009-12-13 09:59:45 UTC (rev 1590) +++ cpu/x86/pc/olpc/via/fw.bth 2009-12-13 10:30:04 UTC (rev 1591) @@ -346,6 +346,8 @@ then ;
+fload ${BP}/cpu/x86/pc/olpc/setwp.fth + fload ${BP}/cpu/x86/pc/olpc/help.fth fload ${BP}/cpu/x86/pc/olpc/gui.fth fload ${BP}/cpu/x86/pc/olpc/via/suspend.fth \ Suspend/resume setup @@ -384,7 +386,6 @@ [then]
fload ${BP}/cpu/x86/firfilter.fth -fload ${BP}/cpu/x86/pc/olpc/setwp.fth fload ${BP}/cpu/x86/pc/olpc/sound.fth fload ${BP}/cpu/x86/pc/olpc/via/sound.fth fload ${BP}/cpu/x86/pc/olpc/security.fth
Modified: cpu/x86/pc/olpc/via/runin.fth =================================================================== --- cpu/x86/pc/olpc/via/runin.fth 2009-12-13 09:59:45 UTC (rev 1590) +++ cpu/x86/pc/olpc/via/runin.fth 2009-12-13 10:30:04 UTC (rev 1591) @@ -5,20 +5,6 @@ \ Location of the files containing KA tag data : ka-dir$ ( -- adr len ) " http:\10.0.0.1\ka" ;
-: nocase-$= ( $1 $2 -- flag ) - rot tuck <> if ( adr1 adr2 len2 ) - 3drop false exit ( -- false ) - then ( adr1 adr2 len2 ) - caps-comp 0= ( flag ) -; - -: .instructions ( adr len -- ) - cr blue-letters type black-letters cr -; -: .problem ( adr len -- ) - red-letters type black-letters cr -; - \ The Linux-based runin selftests put this file at int:\runin\olpc.fth \ after they have finished. On the next reboot, OFW thus boots this \ script instead of int:\boot\olpc.fth . This script either displays @@ -84,10 +70,6 @@ then ;
-: put-ascii-tag ( value$ key$ -- ) - 2swap dup if add-null then 2swap ( value$' key$ ) - ($add-tag) ( ) -; : put-ka-tag ( value$ key$ -- ) 2over 8 min ka-dir$ " %s%s" sprintf ( value$ key$ filename$ ) $read-file if ( value$ key$ ) @@ -145,15 +127,6 @@ then ;
-\ Remove possible trailing carriage return from the line -: ?remove-cr ( adr len -- adr len' ) - dup if ( adr len ) - 2dup + 1- c@ carret = if ( adr len ) - 1- - then - then -; - : parse-tags ( adr len -- ) begin dup while ( adr len ) linefeed left-parse-string ( rem$ line$ ) @@ -266,7 +239,6 @@ drop ;
- \ Upload the result data : final-result ( -- ) final-filename$ open-temp-file @@ -275,34 +247,6 @@ " Result" submit-file ;
-: scanner? ( -- flag ) - " usb-keyboard" expand-alias if 2drop true else false then -; -: wait-scanner ( -- ) - scanner? 0= if - " Connect USB barcode scanner" .instructions - begin d# 1000 ms silent-probe-usb scanner? until - then - ; -: wired-lan? ( -- flag ) - " /usb/ethernet" locate-device if false else drop true then -; -: wait-lan ( -- ) - wired-lan? 0= if - " Connect USB Ethernet Adapter" .instructions - begin d# 1000 ms silent-probe-usb wired-lan? until - then -; -: usb-key? ( -- flag ) - " /usb/disk" locate-device if false else drop true then -; -: wait-usb-key ( -- ) - usb-key? 0= if - " Connect USB memory stick" .instructions - begin d# 1000 ms silent-probe-usb usb-key? until - then -; - : wait-connections ( -- ) silent-probe-usb wait-scanner @@ -368,83 +312,3 @@ ;
after-runin - -0 [if] - -SN:SHC946009D3 -B#:QTFJCA94400297 -P#:1CL11ZU0KDU -M#:CL1 -LA:USA -CC:2222XXXXXX -F#:F6 -L#:J -S#:CL1XL00802000 -T#:TSIMG_V3.0.6 -WM:00-17-C4-B9-39-ED -MN:XO-1 -BV:Q2E34 -U#:A4112195-98FE-419A-A77B-9F33C08FF913 -SD:241109 - IM_IP:10.1.0.2 - IM_ROOT:CL1XL00802000 - IM_NAME:CL1XL00802000 -WP:0 - Countries:Alabama -LO:en_US.UTF-8 -KA:USInternational_Keyboard -KM:olpc -KL:us -KV:olpc -ak:0 -sk:20 -SG:79 -DT:20091124152811 - -SET WO=304027439 - -Use these info to check the tags inside the SPI flash. - -Write the following tags from response file: - -WP: -SG: - -Get date time from NTP server 10.1.0.1 and write MD tag - MD: 20081014T200700Z - -Set TS tag to SHIP - -Send the following information to shop flow - -SN: -B#: -P#: -M#: -LA: -CC: -F#: -L#: -S#: -T#: -WM: -MN: -BV: -U#: -SD: -WP: -LO: - KA -KM: -KL: -KV: - ak - sk - SG - DT - TS: test station - SS: smt status - FQ: ?? - -RESULT:PASS -[then]
Modified: cpu/x86/pc/olpc/via/smt.fth =================================================================== --- cpu/x86/pc/olpc/via/smt.fth 2009-12-13 09:59:45 UTC (rev 1590) +++ cpu/x86/pc/olpc/via/smt.fth 2009-12-13 10:30:04 UTC (rev 1591) @@ -2,16 +2,9 @@
visible
-: wanted-fw$ ( -- $ ) " q3a20" ; +: wanted-fw$ ( -- $ ) " q3a23" ;
-: nocase-$= ( $1 $2 -- flag ) - rot tuck <> if ( adr1 adr2 len2 ) - 3drop false exit ( -- false ) - then ( adr1 adr2 len2 ) - caps-comp 0= ( flag ) -; - : find-firmware-file ( -- name$ ) wanted-fw$ " u:\boot\%s.rom" sprintf ( name$ ) ." Trying " 2dup type cr ( name$ ) @@ -40,21 +33,9 @@ ; ' mfg-ntp-server to ntp-servers
-: .instructions ( adr len -- ) - cr blue-letters type black-letters cr -; -: .problem ( adr len -- ) - red-letters type black-letters cr -; - d# 20 buffer: bn-buf \ Buffer for scanned-in board number string : board#$ ( -- adr len ) bn-buf count ;
-: accept-to-buf ( buf len -- actual ) - over 1+ swap accept ( buf actual ) - tuck swap c! ( actual ) -; - \ Get a board number from the user, retrying until valid \ Usually the number is entered with a barcode scanner : get-board# ( -- ) @@ -147,22 +128,6 @@ " Response" get-response ;
-: clear-mfg-buf ( -- ) mfg-data-buf /flash-block h# ff fill ; - -\ Remove possible trailing carriage return from the line -: ?remove-cr ( adr len -- adr len' ) - dup if ( adr len ) - 2dup + 1- c@ carret = if ( adr len ) - 1- - then - then -; - -: put-ascii-tag ( value$ key$ -- ) - 2swap dup if add-null then 2swap ( value$' key$ ) - ($add-tag) ( ) -; - 1 buffer: sg-buf : special-tag? ( value$ key$ -- true | value$ key$ false ) 2dup " SG" $= if ( value$ key$ ) @@ -233,34 +198,6 @@ then ;
-: scanner? ( -- flag ) - " usb-keyboard" expand-alias if 2drop true else false then -; -: wait-scanner ( -- ) - scanner? 0= if - " Connect USB barcode scanner" .instructions - begin d# 1000 ms silent-probe-usb scanner? until - then - ; -: wired-lan? ( -- flag ) - " /usb/ethernet" locate-device if false else drop true then -; -: wait-lan ( -- ) - wired-lan? 0= if - " Connect USB Ethernet Adapter" .instructions - begin d# 1000 ms silent-probe-usb wired-lan? until - then -; -: usb-key? ( -- flag ) - " /usb/disk" locate-device if false else drop true then -; -: wait-usb-key ( -- ) - usb-key? 0= if - " Connect USB memory stick" .instructions - begin d# 1000 ms silent-probe-usb usb-key? until - then -; -: stall ( -- ) begin halt again ; : require-int-sd ( -- ) " int:0" open-dev ?dup if close-dev exit then " Power off and insert internal SD card" .problem