[openfirmware] r1662 - cpu/x86/pc/olpc/via
svn at openfirmware.info
svn at openfirmware.info
Wed Jan 13 00:49:04 CET 2010
Author: rsmith
Date: 2010-01-13 00:49:03 +0100 (Wed, 13 Jan 2010)
New Revision: 1662
Modified:
cpu/x86/pc/olpc/via/smt.fth
Log:
OLPC 1.5: Make smt fw version compare work like in the builds
Version compare now checks for the requested version to be
> the version on the laptop before tries to do a firmware upgrade
Modified: cpu/x86/pc/olpc/via/smt.fth
===================================================================
--- cpu/x86/pc/olpc/via/smt.fth 2010-01-12 22:45:35 UTC (rev 1661)
+++ cpu/x86/pc/olpc/via/smt.fth 2010-01-12 23:49:03 UTC (rev 1662)
@@ -2,6 +2,16 @@
visible
+\ Does a base 36 compare on the firmware versions
+\ true if $2 <= $1
+: fw-$compare ( $1 $2 -- $2>$1 )
+ base @ >r d# 36 base ! ( $1 $2 )
+ $number if exit then ( $1 n2 )
+ -rot $number if exit then ( n2 n1 )
+ pop-base u<=
+;
+
+
: wanted-fw$ ( -- $ ) " q3a23" ;
@@ -21,7 +31,10 @@
: ?update-firmware ( -- )
\ Exit if the existing firmware and the wanted firmware are the same
- fw-version$ wanted-fw$ nocase-$= if exit then
+ fw-version$ wanted-fw$ fw-$compare if
+ fw-version$ type ." >= " wanted-fw$ type cr
+ ." Not updating fimware" cr exit
+ then
." Updating firmware to version " fw-version$ type cr
d# 2000 ms
?enough-power
More information about the openfirmware
mailing list