[openfirmware] [commit] r3349 - in cpu: arm/olpc arm/olpc/1.75 arm/olpc/3.0 arm/olpc/4.0 arm/olpc/cl4 x86/pc/olpc x86/pc/olpc/via

repository service svn at openfirmware.info
Wed Oct 3 23:40:58 CEST 2012


Author: wmb
Date: Wed Oct  3 23:40:57 2012
New Revision: 3349
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3349

Log:
OLPC trac 12129 - Changed the search order for .zip bundles to look for the platform-specific suffix first, falling back to the generic name.

Modified:
   cpu/arm/olpc/1.75/config.fth
   cpu/arm/olpc/3.0/config.fth
   cpu/arm/olpc/4.0/config.fth
   cpu/arm/olpc/build-fw.fth
   cpu/arm/olpc/cl4/config.fth
   cpu/x86/pc/olpc/config.fth
   cpu/x86/pc/olpc/security.fth
   cpu/x86/pc/olpc/via/config.fth
   cpu/x86/pc/olpc/via/fw.bth

Modified: cpu/arm/olpc/1.75/config.fth
==============================================================================
--- cpu/arm/olpc/1.75/config.fth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/arm/olpc/1.75/config.fth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -26,6 +26,7 @@
 : model$        " olpc,XO-1.75"  ;
 : compatible$   " olpc,xo-1.75"  ;
 : ec-platform$  ( -- adr len )  " 4"  ;
+: bundle-suffix$  ( -- adr len )  " 4"  ;
 
 d#  9999 constant machine-type  \ Backwards compatibility with non-device-tree kernel
 

Modified: cpu/arm/olpc/3.0/config.fth
==============================================================================
--- cpu/arm/olpc/3.0/config.fth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/arm/olpc/3.0/config.fth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -25,6 +25,7 @@
 : model$       " olpcXO-3.0"  ;
 : compatible$  " olpcxo-3.0"  ;
 : ec-platform$  ( -- adr len )  " 5"  ;
+: bundle-suffix$  ( -- adr len )  " 3"  ;
 
 d# 10000 constant machine-type  \ Backwards compatibility with non-device-tree kernel
 

Modified: cpu/arm/olpc/4.0/config.fth
==============================================================================
--- cpu/arm/olpc/4.0/config.fth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/arm/olpc/4.0/config.fth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -23,6 +23,7 @@
 : model$       " olpc,XO-4.0"  ;
 : compatible$  " olpc,xo-cl4"  ;
 : ec-platform$  ( -- adr len )  " 7"  ;
+: bundle-suffix$  ( -- adr len )  " 5"  ;
 
 d# 10001 constant machine-type  \ Backwards compatibility with non-device-tree kernel
 

Modified: cpu/arm/olpc/build-fw.fth
==============================================================================
--- cpu/arm/olpc/build-fw.fth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/arm/olpc/build-fw.fth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -668,7 +668,6 @@
 fload ${BP}/cpu/x86/pc/olpc/sound.fth
 fload ${BP}/cpu/x86/pc/olpc/guardrtc.fth
 fload ${BP}/cpu/x86/pc/olpc/security.fth
-[ifdef] olpc-cl4  4  [else]  2  [then]  to bundle-suffix
 
 stand-init: xid
    h# 83 cmos@  dup 1+  h# 83 cmos!   ( n )

Modified: cpu/arm/olpc/cl4/config.fth
==============================================================================
--- cpu/arm/olpc/cl4/config.fth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/arm/olpc/cl4/config.fth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -22,6 +22,7 @@
 : model$       " olpc,XO-CL4"  ;
 : compatible$  " olpc,xo-cl4"  ;
 : ec-platform$  ( -- adr len )  " 7"  ;
+: bundle-suffix$  ( -- adr len )  " 4"  ;
 
 d# 10001 constant machine-type  \ Backwards compatibility with non-device-tree kernel
 

Modified: cpu/x86/pc/olpc/config.fth
==============================================================================
--- cpu/x86/pc/olpc/config.fth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/x86/pc/olpc/config.fth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -40,6 +40,7 @@
 
 create machine-signature ," CL1"
 : signature$  machine-signature count  ;
+: bundle-suffix$  ( -- adr len )  " 0"  ;
 
 fload ${BP}/cpu/x86/pc/olpc/addrs.fth
 

Modified: cpu/x86/pc/olpc/security.fth
==============================================================================
--- cpu/x86/pc/olpc/security.fth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/x86/pc/olpc/security.fth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -441,27 +441,21 @@
 : .trying  ( name$ -- name$ )
    " Trying " ?lease-debug  2dup ?lease-debug-cr
 ;
-0 value bundle-suffix
-: bundle-present?  ( fn$ -- flag )
-   fn-buf place
-
-   \ unadorned names not supported from XO-4 onwards
-   bundle-suffix 4 < if
-      \ Try the unadorned name first
-      bundle-name$  .trying
-      ['] (boot-read) catch  0=  if  true exit  then   ( x x )
-      2drop                                            ( )
-   then
-
-   \ Unadorned name not present; try again with architecture-dependent numeric suffix
-   bundle-suffix push-decimal (.) pop-base   ( adr len )
-   fn-buf $cat                               ( )
 
+: $try-name  ( basename$ suffix$ -- found? )
+   2swap fn-buf place  fn-buf $cat
    bundle-name$  .trying
-   ['] (boot-read) catch  0=  if  true exit  then   ( x x )
-   2drop                                            ( )
+   ['] (boot-read) catch  if  2drop false  else  true  then
+;
+
+: bundle-present?  ( fn$ -- found? )
+   \ Try first with architecture-dependent numeric suffix
+   2dup bundle-suffix$ $try-name  if   ( fn$ )
+      2drop true exit                  ( -- true )
+   then                                ( fn$ )
 
-   false
+   \ Failing that, try the unadorned name
+   " "  $try-name
 ;
 
 \ exp-hashname$ remembers the most recently used hashname to guard against

Modified: cpu/x86/pc/olpc/via/config.fth
==============================================================================
--- cpu/x86/pc/olpc/via/config.fth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/x86/pc/olpc/via/config.fth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -52,6 +52,7 @@
 
 create machine-signature ," CL1"
 : signature$  machine-signature count  ;
+: bundle-suffix$  ( -- adr len )  " 1"  ;
 
 fload ${BP}/cpu/x86/pc/olpc/via/addrs.fth
 

Modified: cpu/x86/pc/olpc/via/fw.bth
==============================================================================
--- cpu/x86/pc/olpc/via/fw.bth	Tue Oct  2 03:48:06 2012	(r3348)
+++ cpu/x86/pc/olpc/via/fw.bth	Wed Oct  3 23:40:57 2012	(r3349)
@@ -431,7 +431,6 @@
 fload ${BP}/cpu/x86/pc/olpc/via/sound.fth
 fload ${BP}/cpu/x86/pc/olpc/guardrtc.fth
 fload ${BP}/cpu/x86/pc/olpc/security.fth
-1 to bundle-suffix
 fload ${BP}/cpu/x86/pc/olpc/xpsecure.fth
 fload ${BP}/ofw/gui/ofpong.fth
 fload ${BP}/cpu/x86/pc/olpc/life.fth



More information about the openfirmware mailing list