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] [PATCH] powerpc/85xx: Relocate env_addr if we CONFIG_SYS_RAMBOOT
Date: Wed, 17 Nov 2010 09:41:01 -0600	[thread overview]
Message-ID: <1290008461-21171-1-git-send-email-galak@kernel.crashing.org> (raw)

We use CONFIG_SYS_RAMBOOT for when boot out of NAND, SPI, SDHC/MMC
and utilize a L2 or L3 cache in SRAM mode.  In this case we will
end up changing the cache from SRAM mode back to cache before we
relocate the environment properly in env_relocate().

So we need to manual relocate the env pointer out of SRAM into DDR.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/lib/board.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 2e0749d..5ce9caa 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -645,6 +645,18 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	gd->cpu += dest_addr - CONFIG_SYS_MONITOR_BASE;
 #endif
 
+#if defined(CONFIG_MPC85xx) && defined(CONFIG_SYS_RAMBOOT)
+	/*
+	 * We use CONFIG_SYS_RAMBOOT for when boot out of NAND, SPI, SDHC/MMC
+	 * and utilize a L2 or L3 cache in SRAM mode.  In this case we will
+	 * end up changing the cache from SRAM mode back to cache before we
+	 * relocate the environment properly in env_relocate().
+	 *
+	 * So we need to manual relocate the env pointer out of SRAM into DDR.
+	 */
+	gd->env_addr += dest_addr - CONFIG_SYS_MONITOR_BASE;
+#endif
+
 #ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
 #endif
-- 
1.7.2.3

             reply	other threads:[~2010-11-17 15:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17 15:41 Kumar Gala [this message]
2010-11-17 20:58 ` [U-Boot] [PATCH] powerpc/85xx: Relocate env_addr if we CONFIG_SYS_RAMBOOT Wolfgang Denk
2010-11-17 21:41   ` Scott Wood

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=1290008461-21171-1-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