[openfirmware] [commit] r1980 - cpu/x86/build cpu/x86/pc/olpc/via forth/lib

repository service svn at openfirmware.info
Thu Oct 14 10:47:26 CEST 2010


Author: wmb
Date: Thu Oct 14 10:47:26 2010
New Revision: 1980
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1980

Log:
Added new feature to the dropin manager whereby you can declare a reserved area that will be skipped (covered by a dummy dropin module), and used it in the OLPC XO-1.5 build to allow the dropin modules to extend into the fxxxx bank.  Thanks to James Cameron for writing the code.

Modified:
   cpu/x86/build/builder.dic
   cpu/x86/pc/olpc/via/devices.fth
   cpu/x86/pc/olpc/via/olpc.bth
   forth/lib/mkdropin.fth

Modified: cpu/x86/build/builder.dic
==============================================================================
Binary file (source and/or target). No diff available.

Modified: cpu/x86/pc/olpc/via/devices.fth
==============================================================================
--- cpu/x86/pc/olpc/via/devices.fth	Thu Oct 14 03:25:25 2010	(r1979)
+++ cpu/x86/pc/olpc/via/devices.fth	Thu Oct 14 10:47:26 2010	(r1980)
@@ -93,7 +93,7 @@
 0 0  " 10000"  " /flash" begin-package
    " dropins" device-name
 
-   h# d0000 constant /device
+   h# f0000 constant /device
    fload ${BP}/dev/subrange.fth
 end-package
 

Modified: cpu/x86/pc/olpc/via/olpc.bth
==============================================================================
--- cpu/x86/pc/olpc/via/olpc.bth	Thu Oct 14 03:25:25 2010	(r1979)
+++ cpu/x86/pc/olpc/via/olpc.bth	Thu Oct 14 10:47:26 2010	(r1980)
@@ -59,6 +59,10 @@
    ?do  h# ff ofd @ fputc  loop
 ;
 
+\ Tell the dropin manager to skip the area reserved for manufacturing data
+h# e0000 to reserved-start
+h# f0000 to reserved-end
+
 .( --- Saving as )
 " ${FW_VERSION}.rom" expand$  2dup lower  ( adr len )
 2dup type cr  ( adr len )
@@ -69,12 +73,7 @@
 
    dropin-base rom-pa -  pad-file
 
-[ifdef] coreboot-loaded
-   " romstart.di"           $add-file
-[else]
    " romreset.di"           $add-file
-[then]
-
    " resume.di"             $add-file
 
 \ Loads the set of drivers that is common to different output formats
@@ -195,11 +194,7 @@
 
 .( Dropin top is )  ofd @ fsize  .x cr
 
-[ifdef] coreboot-loaded
-   /rom h# 10000 - pad-file	\ coreboot init image must be in last FLASH block
-   " coreboot.img"   $add-file
-[else]
-   /rom h# 10000 - pad-file	\ coreboot init image must be in last FLASH block
+\   /rom h# 10000 - pad-file	\ coreboot init image must be in last FLASH block
 \  " cforth.img"     $add-file  \ Small Forth that runs from cache
 
    /rom h# 400 - pad-file	\ rmstart image must start 0x400 from end
@@ -241,7 +236,6 @@
 
 /rom h# 2c - ofd @ fseek
 crcbuf /l ofd @ fputs
-[then]
 
 ofd @ fclose
 

Modified: forth/lib/mkdropin.fth
==============================================================================
--- forth/lib/mkdropin.fth	Thu Oct 14 03:25:25 2010	(r1979)
+++ forth/lib/mkdropin.fth	Thu Oct 14 10:47:26 2010	(r1980)
@@ -75,6 +75,9 @@
 \   make-dropin test.di test.img test
 \   make-deflated-dropin test.di test.img test
 
+-1 value reserved-start
+-1 value reserved-end
+
 \needs push-decimal  : push-decimal  r> base @ >r >r  decimal  ;
 \needs push-hex      : push-hex      r> base @ >r >r  hex      ;
 \needs pop-base      : pop-base      r> r> base ! >r  ;
@@ -113,7 +116,7 @@
    ifd @ fclose             ( len )
 ;
 : putlong  ( n -- )  lbsplit  4 0 do  ofd @ fputc  loop  ;
-: write-dropin  ( adr len expanded-len name-str -- )
+: write-dropin'  ( adr len expanded-len name-str -- )
    2>r >r                                          ( adr len )
    " OBMD" ofd @ fputs                             ( adr len )
    dup putlong                                     ( adr len )
@@ -126,6 +129,26 @@
    \ Pad out to a 4-byte boundary
    dup 4 round-up swap  ?do  1 ofd @ fputc  loop   ( )
 ;
+: write-dropin  ( adr len expanded-len name-str -- )
+   2>r >r                                   ( adr len  r: name$ expanded-len )
+
+   \ Calculate expected ending position
+   dup  ofd @ ftell +                         ( adr len pos )
+
+   \ Encroaches upon manufacturing data area?  If so, enumerate as a dropin.
+   reserved-start h# 20 -  reserved-end  within  if
+      \ Calculate size of a dropin covering reserved area
+      reserved-end ofd @ ftell -  h# 20 -     ( adr len reslen )
+      \ Allocate memory for it
+      dup alloc-mem swap                      ( adr len resadr reslen )
+      \ Fill it
+      2dup h# ff fill                         ( adr len resadr reslen )
+      \ Write it out
+      2dup 0 " reserved" write-dropin'        ( adr len resadr reslen )
+      free-mem                                ( adr len )
+   then                                       ( adr len  r: name$ expanded-len )
+   r> 2r> write-dropin'
+;
 : write-deflated-dropin  ( adr len name-str -- )
    2>r  tuck $deflate           ( in-len out-adr,len r: name$ )
    \ XXX we should check for out-len=0 and if so, make a non-deflated dropin



More information about the openfirmware mailing list