]> Git Repo - J-u-boot.git/blobdiff - lib_ppc/board.c
ppc: Add CFG_MEM_TOP_HIDE option to hide memory area that doesn't get "touched"
[J-u-boot.git] / lib_ppc / board.c
index 30383027c78d33d310c9468340ec635d7c4aed4a..5e6e1e6a31b581fd2d204d5b2847c5030c8c87ee 100644 (file)
@@ -428,6 +428,7 @@ void board_init_f (ulong bootflag)
         * relocate the code and continue running from DRAM.
         *
         * Reserve memory at end of RAM for (top down in that order):
+        *  - area that won't get touched by U-Boot and Linux (optional)
         *  - kernel log buffer
         *  - protected RAM
         *  - LCD framebuffer
@@ -436,6 +437,18 @@ void board_init_f (ulong bootflag)
         */
        len = (ulong)&_end - CFG_MONITOR_BASE;
 
+       /*
+        * Subtract specified amount of memory to hide so that it won't
+        * get "touched" at all by U-Boot. By fixing up gd->ram_size
+        * the Linux kernel should now get passed the now "corrected"
+        * memory size and won't touch it either. This should work
+        * for arch/ppc and arch/powerpc. Only Linux board ports in
+        * arch/powerpc with bootwrapper support, that recalculate the
+        * memory size from the SDRAM controller setup will have to
+        * get fixed.
+        */
+       gd->ram_size -= CFG_MEM_TOP_HIDE;
+
 #ifndef CONFIG_MAX_MEM_MAPPED
 #define CONFIG_MAX_MEM_MAPPED (256 << 20)
 #endif
This page took 0.025262 seconds and 4 git commands to generate.