From 5cbbc702456ceab01b52bda49a2b991fde1658e7 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 8 Feb 2014 05:17:38 -0800 Subject: tegra124: nyan: Keep in memory structures below 4GB. We'd been putting some data structures like the framebuffer and the cbmem at the end of memory, but that may not actually be addressable as identity mapped memory. This change clamps the addresses those structures are placed at so they stay below 4GB. BUG=None TEST=Booted on nyan. Went into recovery mode and verified that there was a recovery screen. Forced memory size to be 4GB and verified that the recovery screen still shows up. BRANCH=None Original-Change-Id: I9e6b28212c113107d4f480b3dd846dd2349b3a91 Original-Signed-off-by: Gabe Black Original-Reviewed-on: https://chromium-review.googlesource.com/185571 Original-Reviewed-by: David Hendricks Original-Commit-Queue: Gabe Black Original-Tested-by: Gabe Black (cherry picked from commit 63ea1274a838dc739d302d7551f1db42034c5bd0) Signed-off-by: Marc Jones Change-Id: I970c1285270cb648bc67fa114d44c0841eab1615 Reviewed-on: http://review.coreboot.org/7397 Reviewed-by: Edward O'Callaghan Tested-by: build bot (Jenkins) --- src/mainboard/google/nyan/romstage.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mainboard/google/nyan') diff --git a/src/mainboard/google/nyan/romstage.c b/src/mainboard/google/nyan/romstage.c index c3e87fba78..7fb9570669 100644 --- a/src/mainboard/google/nyan/romstage.c +++ b/src/mainboard/google/nyan/romstage.c @@ -71,7 +71,6 @@ static void configure_l2actlr(void) static void __attribute__((noinline)) romstage(void) { - int dram_size_mb; #if CONFIG_COLLECT_TIMESTAMPS uint64_t romstage_start_time = timestamp_get(); #endif @@ -84,15 +83,14 @@ static void __attribute__((noinline)) romstage(void) sdram_init(get_sdram_config()); - /* used for MMU and CBMEM setup */ - dram_size_mb = sdram_size_mb(); - + /* used for MMU and CBMEM setup, in MB */ u32 dram_start = (CONFIG_SYS_SDRAM_BASE >> 20); - u32 dram_end = dram_start + dram_size_mb; /* plus one... */ + u32 dram_end = sdram_max_addressable_mb(); /* plus one... */ + u32 dram_size = dram_end - dram_start; mmu_init(); mmu_config_range(0, dram_start, DCACHE_OFF); - mmu_config_range(dram_start, dram_size_mb, DCACHE_WRITEBACK); + mmu_config_range(dram_start, dram_size, DCACHE_WRITEBACK); mmu_config_range(CONFIG_DRAM_DMA_START >> 20, CONFIG_DRAM_DMA_SIZE >> 20, DCACHE_OFF); mmu_config_range(dram_end, 4096 - dram_end, DCACHE_OFF); -- cgit v1.2.3