[openfirmware] [commit] r3041 - in cpu/arm: . olpc

repository service svn at openfirmware.info
Sat Jul 7 04:20:04 CEST 2012


Author: wmb
Date: Sat Jul  7 04:20:04 2012
New Revision: 3041
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3041

Log:
OLPC ARM - move the flattened device tree and the initrd to the end of memory, ensuring that they don't collide with one another (OLPC trac #11998).

Modified:
   cpu/arm/linux.fth
   cpu/arm/olpc/build-fw.fth

Modified: cpu/arm/linux.fth
==============================================================================
--- cpu/arm/linux.fth	Sat Jul  7 04:18:02 2012	(r3040)
+++ cpu/arm/linux.fth	Sat Jul  7 04:20:04 2012	(r3041)
@@ -9,6 +9,7 @@
 
 0 value linux-memtop
 
+defer mapped-limit
 defer memory-limit
 \ Find the end of the largest piece of memory
 : (memory-limit)  ( -- limit )
@@ -32,6 +33,7 @@
    +                                 ( limit )
 ;
 ' (memory-limit) to memory-limit  \ Override by platform code if necessary
+' memory-limit to mapped-limit    \ Override by platform code if necessary
 
 \ see http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
 
@@ -92,6 +94,7 @@
 true value use-fdt?
 : use-fdt  ( -- )  true to use-fdt?  ;
 
+h# 10000 constant /fdt-max
 : linux-fixup  ( -- )
 [ifdef] linux-logo  linux-logo  [then]
 \   use-fdt? 0=  if
@@ -104,8 +107,8 @@
    arm-linux-machine-type to r1
 [ifdef] flatten-device-tree
    use-fdt?  if
-      load-base h# 40000 - to linux-params
-      linux-params h# 40000 flatten-device-tree
+      ramdisk-adr ?dup 0=  if  mapped-limit  then  /fdt-max -  to linux-params
+      linux-params /fdt-max flatten-device-tree
    else
       args-buf cscount linux-params set-parameters
    then
@@ -122,7 +125,7 @@
 : linux-place-ramdisk  ( adr len -- )
    to /ramdisk                                    ( adr )
 
-   dup memory-limit  umin  /ramdisk -             ( adr new-ramdisk-adr )
+   mapped-limit  /ramdisk -                       ( adr new-ramdisk-adr )
    tuck /ramdisk move                             ( new-ramdisk-adr )
 \  dup to linux-memtop
    to ramdisk-adr

Modified: cpu/arm/olpc/build-fw.fth
==============================================================================
--- cpu/arm/olpc/build-fw.fth	Sat Jul  7 04:18:02 2012	(r3040)
+++ cpu/arm/olpc/build-fw.fth	Sat Jul  7 04:20:04 2012	(r3041)
@@ -490,6 +490,8 @@
 \ We give everything up to that address to Linux.
 : olpc-memory-limit  ( -- adr )  extra-mem-va >physical  ;
 ' olpc-memory-limit to memory-limit
+: olpc-mapped-limit  ( -- adr )  dma-mem-va >physical  ;
+' olpc-mapped-limit to mapped-limit
 
 \+ olpc-cl2 d#  9999 to arm-linux-machine-type  \ XO-1.75
 \+ olpc-cl3 d# 10000 to arm-linux-machine-type  \ XO-3



More information about the openfirmware mailing list