From patchwork Wed Nov 17 15:41:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Gala X-Patchwork-Id: 71577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2A6E6B718A for ; Thu, 18 Nov 2010 02:41:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B5BE328277; Wed, 17 Nov 2010 16:41:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GtLajtswP6jT; Wed, 17 Nov 2010 16:41:17 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F3C428287; Wed, 17 Nov 2010 16:41:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE25828287 for ; Wed, 17 Nov 2010 16:41:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UA01+--AeN3Z for ; Wed, 17 Nov 2010 16:41:07 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by theia.denx.de (Postfix) with ESMTPS id 086D428277 for ; Wed, 17 Nov 2010 16:41:05 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id oAHFf1aT011225 for ; Wed, 17 Nov 2010 09:41:02 -0600 From: Kumar Gala To: u-boot@lists.denx.de Date: Wed, 17 Nov 2010 09:41:01 -0600 Message-Id: <1290008461-21171-1-git-send-email-galak@kernel.crashing.org> X-Mailer: git-send-email 1.6.0.6 Subject: [U-Boot] [PATCH] powerpc/85xx: Relocate env_addr if we CONFIG_SYS_RAMBOOT X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- 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