summaryrefslogtreecommitdiff
path: root/src/soc/nvidia/tegra124/sdram.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2014-02-08 05:17:38 -0800
committerMarc Jones <marc.jones@se-eng.com>2014-11-12 02:25:31 +0100
commit5cbbc702456ceab01b52bda49a2b991fde1658e7 (patch)
tree65ab30a8c7720a013613594dd5ee5289952434bc /src/soc/nvidia/tegra124/sdram.c
parentf220df6ff9876fdc3f9e3abc08f0965ac4f55814 (diff)
downloadcoreboot-5cbbc702456ceab01b52bda49a2b991fde1658e7.tar.xz
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 <gabeblack@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/185571 Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Original-Commit-Queue: Gabe Black <gabeblack@chromium.org> Original-Tested-by: Gabe Black <gabeblack@chromium.org> (cherry picked from commit 63ea1274a838dc739d302d7551f1db42034c5bd0) Signed-off-by: Marc Jones <marc.jones@se-eng.com> Change-Id: I970c1285270cb648bc67fa114d44c0841eab1615 Reviewed-on: http://review.coreboot.org/7397 Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/soc/nvidia/tegra124/sdram.c')
-rw-r--r--src/soc/nvidia/tegra124/sdram.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/soc/nvidia/tegra124/sdram.c b/src/soc/nvidia/tegra124/sdram.c
index dcab810a45..1854e1dbd9 100644
--- a/src/soc/nvidia/tegra124/sdram.c
+++ b/src/soc/nvidia/tegra124/sdram.c
@@ -22,6 +22,7 @@
#include <delay.h>
#include <soc/addressmap.h>
#include <soc/clock.h>
+#include <stdlib.h>
#include "emc.h"
#include "mc.h"
@@ -639,3 +640,8 @@ int sdram_size_mb(void)
printk(BIOS_DEBUG, "%s: Total SDRAM (MB): %u\n", __func__, total_size);
return total_size;
}
+
+uintptr_t sdram_max_addressable_mb(void)
+{
+ return MIN((CONFIG_SYS_SDRAM_BASE/MiB) + sdram_size_mb(), 4096);
+}