summaryrefslogtreecommitdiff
path: root/lib_ppc
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-02-15 15:16:18 -0600
committerWolfgang Denk <wd@denx.de>2008-03-25 22:26:11 +0100
commit9c666a7db0b2285a270c68810889ce7d5dba304b (patch)
treecb13edb9f391a9197f0059128dae7eaccca2ef55 /lib_ppc
parenta6f5f317cd074bbbfa2aab4fca05904c811c19fb (diff)
downloadu-boot-imx-9c666a7db0b2285a270c68810889ce7d5dba304b.zip
u-boot-imx-9c666a7db0b2285a270c68810889ce7d5dba304b.tar.gz
u-boot-imx-9c666a7db0b2285a270c68810889ce7d5dba304b.tar.bz2
ppc: Allow boards to specify how much memory they can map
For historical reasons we limited the stack to 256M because some boards could only map that much via BATS. However newer boards are capable of mapping more memory (for example 85xx is capble of doing up to 2G). Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'lib_ppc')
-rw-r--r--lib_ppc/board.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index ee0213e..3ab22f8 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -433,7 +433,18 @@ void board_init_f (ulong bootflag)
*/
len = (ulong)&_end - CFG_MONITOR_BASE;
+#ifndef CONFIG_MAX_MEM_MAPPED
+#define CONFIG_MAX_MEM_MAPPED (256 << 20)
+#endif
+
+#ifndef CONFIG_VERY_BIG_RAM
addr = CFG_SDRAM_BASE + get_effective_memsize();
+#else
+ /* only allow stack below 256M */
+ addr = CFG_SDRAM_BASE +
+ (gd->ram_size > CONFIG_MAX_MEM_MAPPED) ?
+ CONFIG_MAX_MEM_MAPPED : get_effective_memsize();
+#endif
#ifdef CONFIG_LOGBUFFER
#ifndef CONFIG_ALT_LB_ADDR