summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-02-19 22:03:47 -0600
committerMarian Balakowicz <m8@semihalf.com>2008-02-29 13:15:24 +0100
commit4648c2e7a173b0d7f17bef4adaa0623090c9e904 (patch)
tree5b1e121418fc6271aee3464b9c783ff9c4deb17d
parent274cea2bddbca10cdad7daa518951b75c44ef6bc (diff)
downloadu-boot-imx-4648c2e7a173b0d7f17bef4adaa0623090c9e904.zip
u-boot-imx-4648c2e7a173b0d7f17bef4adaa0623090c9e904.tar.gz
u-boot-imx-4648c2e7a173b0d7f17bef4adaa0623090c9e904.tar.bz2
[new uImage] ppc: Allow boards to specify effective amount of memory
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 capable of doing up to 2G). Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Marian Balakowicz <m8@semihalf.com>
-rw-r--r--lib_ppc/board.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 45d1328..fbf1c5d 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -361,6 +361,20 @@ init_fnc_t *init_sequence[] = {
NULL, /* Terminate this list */
};
+#ifndef CONFIG_MAX_MEM_MAPPED
+#define CONFIG_MAX_MEM_MAPPED (256 << 20)
+#endif
+ulong get_effective_memsize(void)
+{
+#ifndef CONFIG_VERY_BIG_RAM
+ return gd->ram_size;
+#else
+ /* limit stack to what we can reasonable map */
+ return ((gd->ram_size > CONFIG_MAX_MEM_MAPPED) ?
+ CONFIG_MAX_MEM_MAPPED : gd->ram_size);
+#endif
+}
+
/************************************************************************
*
* This is the first part of the initialization sequence that is
@@ -419,13 +433,7 @@ void board_init_f (ulong bootflag)
*/
len = (ulong)&_end - CFG_MONITOR_BASE;
-#ifndef CONFIG_VERY_BIG_RAM
- addr = CFG_SDRAM_BASE + gd->ram_size;
-#else
- /* only allow stack below 256M */
- addr = CFG_SDRAM_BASE +
- (gd->ram_size > 256 << 20) ? 256 << 20 : gd->ram_size;
-#endif
+ addr = CFG_SDRAM_BASE + get_effective_memsize();
#ifdef CONFIG_LOGBUFFER
/* reserve kernel log buffer */