Skip to contentSkip to conversation

Ensure gd->ram_size end stays on 4k page boundary when 'hiding' RAM

PATCH Superseded Gray Remlin 2 participants 2 messages Oct 15, 2010 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Ensure gd->ram_size end stays on 4k page boundary when 'hiding' RAM

---
 arch/arm/lib/board.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/lib/board.c +2 -1
index 22bd2c9..c1b21f5 100644
@@ -531,8 +531,9 @@ void board_init_f (ulong bootflag)
         * arch/powerpc with bootwrapper support, that recalculate the
         * memory size from the SDRAM controller setup will have to
         * get fixed.
+        * Ensure gd->ram_size end is still on a 4k page boundary.
         */
-       gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
+       gd->ram_size -= ((CONFIG_SYS_MEM_TOP_HIDE + 0xFFF) & ~(0xFFF));
 #endif
 
        addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
#1 lore raw

PATCH 1/1 Ensure gd->ram_size end stays on 4k page boundary when 'hiding' RAM

Quoted 10 lines · Gray Remlin
---
 arch/arm/lib/board.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/lib/board.c +0 -0
index 22bd2c9..c1b21f5 100644

arch/arm/lib/board.c void board_init_f (ulong bootflag) · line 537

Quoted 8 lines
arch/arm/lib/board.c +2 -1
@@ -531,8 +531,9 @@ void board_init_f (ulong bootflag)
         * arch/powerpc with bootwrapper support, that recalculate the
         * memory size from the SDRAM controller setup will have to
         * get fixed.
+        * Ensure gd->ram_size end is still on a 4k page boundary.
         */
-       gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
+       gd->ram_size -= ((CONFIG_SYS_MEM_TOP_HIDE + 0xFFF) & ~(0xFFF));
 #endif

How about this easier to read version:
gd->ram_size -= roundup(CONFIG_SYS_MEM_TOP_HIDE, 4096);

Ira

Quoted 7 lines
arch/arm/lib/board.c +0 -1
        addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
-- 

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot