summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-03-10 19:09:18 -0400
committerTom Rini <trini@konsulko.com>2015-03-10 19:09:18 -0400
commitb79dadf846e5e140e261bbfa4decd024357702d7 (patch)
treebbfed4207c806f34ceb4b608e62cc4fbfa98f91f /common/board_f.c
parent1fc42018a0fe833a4332f8f32d6aeb675f3dcd1d (diff)
parentd5338c693e6a35a7108c184839d688a7377d117c (diff)
downloadu-boot-imx-b79dadf846e5e140e261bbfa4decd024357702d7.zip
u-boot-imx-b79dadf846e5e140e261bbfa4decd024357702d7.tar.gz
u-boot-imx-b79dadf846e5e140e261bbfa4decd024357702d7.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-tegra
Conflicts: README Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c
index fc3e7dd..731b539 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -360,6 +360,18 @@ static int setup_fdt(void)
/* Get the top of usable RAM */
__weak ulong board_get_usable_ram_top(ulong total_size)
{
+#ifdef CONFIG_SYS_SDRAM_BASE
+ /*
+ * Detect whether we have so much RAM it goes past the end of our
+ * 32-bit address space. If so, clip the usable RAM so it doesn't.
+ */
+ if (gd->ram_top < CONFIG_SYS_SDRAM_BASE)
+ /*
+ * Will wrap back to top of 32-bit space when reservations
+ * are made.
+ */
+ return 0;
+#endif
return gd->ram_top;
}