[OpenBIOS] r704 - cpu/x86/pc/olpc
svn at openbios.org
svn at openbios.org
Mon Oct 29 23:52:22 CET 2007
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
More information about the OpenBIOS
mailing list