summaryrefslogtreecommitdiff
path: root/src/soc/nvidia/tegra124/sdram.c
diff options
context:
space:
mode:
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);
+}