Author: wmb
Date: 2007-10-29 23:52:22 +0100 (Mon, 29 Oct 2007)
New Revision: 704
Modified:
cpu/x86/pc/olpc/security.fth
Log:
Added a time delay before reflashing the SPI FLASH, giving the EC time
to detect the battery. Otherwise the check for battery presence fails.
Modified: cpu/x86/pc/olpc/security.fth
===================================================================
--- cpu/x86/pc/olpc/security.fth 2007-10-29 22:02:39 UTC (rev 703)
+++ cpu/x86/pc/olpc/security.fth 2007-10-29 22:52:22 UTC (rev 704)
@@ -624,6 +624,14 @@
u<=
;
+\ Wait until the time-stamp counter indicates a certain time after startup.
+: wait-until ( ms -- )
+ begin ( ms )
+ dup tsc@ ms-factor um/mod nip ( ms ms time-ms )
+ u<= until ( ms )
+ drop
+;
+
: load-from-device ( devname$ -- done? )
d# 16 0 +icon-xy show-dot
@@ -647,12 +655,6 @@
true to file-loaded?
" Updating firmware" ?lease-debug-cr
- ['] ?enough-power catch ?dup if
- visible
- .error
- security-failure
- then
-
ec-indexed-io-off? if
visible
." Restarting to enable SPI FLASH writing." cr
@@ -661,6 +663,14 @@
security-failure
then
+ d# 12,000 wait-until \ Wait for EC to notice the battery
+
+ ['] ?enough-power catch ?dup if
+ visible
+ .error
+ security-failure
+ then
+
\ Latch alternate? flag for next startup
alternate? if [char] A h# 82 cmos! then
Author: wmb
Date: 2007-10-29 17:17:51 +0100 (Mon, 29 Oct 2007)
New Revision: 701
Modified:
cpu/x86/pc/olpc/suspend.fth
dev/usb2/hcd/ehci/probe.fth
Log:
OLPC trac 4501 - If USB enumeration of a device fails,
("Failed to set device address: N"), retry the reset-port /
set-address sequence with a 5-second delay in between.
This has proven to be effective with a problem USB disk
that used to consistently fail to work with OFW. This fix does
not affect startup time in the usual case of quick-response devices.
Modified: cpu/x86/pc/olpc/suspend.fth
===================================================================
--- cpu/x86/pc/olpc/suspend.fth 2007-10-28 21:48:00 UTC (rev 700)
+++ cpu/x86/pc/olpc/suspend.fth 2007-10-29 16:17:51 UTC (rev 701)
@@ -44,7 +44,7 @@
" video-save" stdout @ $call-method \ Freeze display
s3
" video-restore" stdout @ $call-method \ Unfreeze display
- " /usb@f,5" open-dev ?dup if " resume" 2 pick $call-method close-dev then
+ " /usb@f,5" open-dev ?dup if " do-resume" 2 pick $call-method close-dev then
;
alias s suspend
Modified: dev/usb2/hcd/ehci/probe.fth
===================================================================
--- dev/usb2/hcd/ehci/probe.fth 2007-10-28 21:48:00 UTC (rev 700)
+++ dev/usb2/hcd/ehci/probe.fth 2007-10-29 16:17:51 UTC (rev 701)
@@ -12,7 +12,13 @@
0 set-target ( port dev ) \ Address it as device 0
- dup set-address if 2drop exit then ( port dev ) \ Assign it usb addr dev
+ dup set-address if ( port dev ) \ Assign it usb addr dev
+ ." Retrying with a delay" cr
+ over reset-port d# 5000 ms
+ dup set-address if ( port dev ) \ Assign it usb addr dev
+ 2drop exit
+ then
+ then ( port dev )
dup set-target ( port dev ) \ Address it as device dev
make-device-node ( )
@@ -76,7 +82,7 @@
true
;
-: resume ( -- )
+: do-resume ( -- )
init-ehci-regs
start-usb
claim-ownership