public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 5/9] [new uImage] ppc: Allow boards to specify effective amount of memory
Date: Tue, 19 Feb 2008 22:03:47 -0600	[thread overview]
Message-ID: <1203480231-30185-6-git-send-email-galak@kernel.crashing.org> (raw)
In-Reply-To: <1203480231-30185-5-git-send-email-galak@kernel.crashing.org>

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>
---
 lib_ppc/board.c |   22 +++++++++++++++-------
 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 */
-- 
1.5.3.8

  reply	other threads:[~2008-02-20  4:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20  4:03 [U-Boot-Users] [PATCH 0/9] [new uImage] Add support for booting images at non-zero addresses Kumar Gala
2008-02-20  4:03 ` [U-Boot-Users] [PATCH 1/9] [new uImage] Don't pass kdb to ramdisk_high since we may not have one Kumar Gala
2008-02-20  4:03   ` [U-Boot-Users] [PATCH 2/9] [new uImage] ppc: Determine if we are booting an OF style Kumar Gala
2008-02-20  4:03     ` [U-Boot-Users] [PATCH 3/9] [new uImage] ppc: Re-order ramdisk/fdt handling sequence Kumar Gala
2008-02-20  4:03       ` [U-Boot-Users] [PATCH 4/9] [new uImage] rework error handling so common functions don't reset Kumar Gala
2008-02-20  4:03         ` Kumar Gala [this message]
2008-02-20  4:03           ` [U-Boot-Users] [PATCH 6/9] [new uImage] Introduce lmb from linux kernel for memory mgmt of boot images Kumar Gala
2008-02-20  4:03             ` [U-Boot-Users] [PATCH 7/9] [new uImage] Use lmb for bootm allocations Kumar Gala
2008-02-20  4:03               ` [U-Boot-Users] [PATCH 8/9] [new uImage] Provide ability to restrict region used for boot images Kumar Gala
2008-02-20  4:03                 ` [U-Boot-Users] [PATCH 9/9] [new uImage] Respect autostart setting in linux bootm Kumar Gala
2008-02-29 14:36           ` [U-Boot-Users] [PATCH 5/9] [new uImage] ppc: Allow boards to specify effective amount of memory Marian Balakowicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1203480231-30185-6-git-send-email-galak@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox