Author: wmb
Date: 2009-12-02 08:13:30 +0100 (Wed, 02 Dec 2009)
New Revision: 1529
Modified:
cpu/x86/pc/olpc/via/fw.bth
dev/usb2/hcd/ehci/qhtd.fth
Log:
OLPC trac 9423 and 9769 - added some debugging code to make the trac 9423
problem happen more often, and made it switchable (default off) so it
doesn't affect normal users (per trac 9769) but can be turned on for testing.
The command to switch on the "fail more often" code is "no-usb-delay".
There is also a "null-fsdisk" command that can be used before "fs-update ..."
to discard the fs-update output instead of writing it to SD - since fs-update
is a very good way to trigger the USB problem.
Modified: cpu/x86/pc/olpc/via/fw.bth
===================================================================
--- cpu/x86/pc/olpc/via/fw.bth 2009-12-02 07:07:27 UTC (rev 1528)
+++ cpu/x86/pc/olpc/via/fw.bth 2009-12-02 07:13:30 UTC (rev 1529)
@@ -578,12 +578,8 @@
" TS" find-tag if ( adr len )
?-null " DL" $= 0= ( in-factory? )
else ( )
- \ Missing TS tag is treated as in factory
-[ifdef] Later
- true ( in-factory? )
-[else]
+ \ Missing TS tag is treated as not factory mode
false
-[then]
then ( in-factory? )
if ( )
" /prober /usb/ethernet disk:\boot\olpc.fth int:\boot\olpc.fth /xp ext:\boot\olpc.fth /wlan"
@@ -707,6 +703,11 @@
\ " flash http:\\18.85.46.172\new.rom" eval
;
: urom " flash! u:\new.rom" eval ;
+: no-usb-delay " dev /usb false to delay? dend" evaluate ;
+: null-fsdisk
+ " dev /null : write-blocks-start 3drop ; : write-blocks-finish ; dend" evaluate
+ " devalias fsdisk //null" evaluate
+;
\ Fancy battery charge logger.
fload ${BP}/cpu/x86/pc/olpc/charge.fth
Modified: dev/usb2/hcd/ehci/qhtd.fth
===================================================================
--- dev/usb2/hcd/ehci/qhtd.fth 2009-12-02 07:07:27 UTC (rev 1528)
+++ dev/usb2/hcd/ehci/qhtd.fth 2009-12-02 07:13:30 UTC (rev 1529)
@@ -548,13 +548,17 @@
>hcqh-cur-pqtd le-l@ dup if qtd-done? then ( done? )
;
+true value delay?
+: poll-delay ( -- ) d# 100 " us" evaluate ;
: done? ( qh -- usberr )
+ delay? if poll-delay then
begin dup qh-done? 0= while ( qh )
1 ms
dup >qh-timeout ( qh timeout-adr )
dup l@ 1- ( qh timeout-adr timeout' )
dup rot l! ( qh timeout' )
0= if ( qh )
+delay? 0= if cr 7 emit 7 emit ." TIMEOUT" cr debug-me then
" Timeout" USB_ERR_TIMEOUT set-usb-error ( qh )
drop ( )
usb-error ( usberr )