Skip to contentSkip to conversation

ppc: Allow boards to specify effective amount of memory

PATCH New Kumar Gala 2 participants 2 messages Feb 18, 2008 – Feb 22, 2008

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 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).

---

This patch superseded my previous patch 'ppc: Allow boards to specify how much memory they can map'.

 lib_ppc/board.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)
lib_ppc/board.c +15 -7
index 45d1328..fbf1c5d 100644
@@ -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 */
Signature · 1 line
1.5.3.8
#1 lore raw

PATCH 1/1 ppc: Allow boards to specify effective amount of memory

Quoted 5 lines · In message <[email protected]> you wrote:

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).

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"We shall reach greater and greater platitudes of achievement."
- Richard J. Daley