From patchwork Fri Aug 24 01:48:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 179759 X-Patchwork-Delegate: afleming@freescale.com 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 4FCB92C00C9 for ; Fri, 24 Aug 2012 11:49:10 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2CF492807E; Fri, 24 Aug 2012 03:49:06 +0200 (CEST) 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 z5MJDnPfGHKI; Fri, 24 Aug 2012 03:49:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BE11D28080; Fri, 24 Aug 2012 03:49:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF7172807E for ; Fri, 24 Aug 2012 03:49:01 +0200 (CEST) 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 a6GaJ85fPbB5 for ; Fri, 24 Aug 2012 03:49:01 +0200 (CEST) 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 ch1outboundpool.messaging.microsoft.com (ch1ehsobe006.messaging.microsoft.com [216.32.181.186]) by theia.denx.de (Postfix) with ESMTPS id C9A0F2807D for ; Fri, 24 Aug 2012 03:48:59 +0200 (CEST) Received: from mail47-ch1-R.bigfish.com (10.43.68.253) by CH1EHSOBE002.bigfish.com (10.43.70.52) with Microsoft SMTP Server id 14.1.225.23; Fri, 24 Aug 2012 01:48:56 +0000 Received: from mail47-ch1 (localhost [127.0.0.1]) by mail47-ch1-R.bigfish.com (Postfix) with ESMTP id B98EE16006F; Fri, 24 Aug 2012 01:48:56 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bhf0ah107ah1155h) Received: from mail47-ch1 (localhost.localdomain [127.0.0.1]) by mail47-ch1 (MessageSwitch) id 1345772935316684_18356; Fri, 24 Aug 2012 01:48:55 +0000 (UTC) Received: from CH1EHSMHS013.bigfish.com (snatpool2.int.messaging.microsoft.com [10.43.68.236]) by mail47-ch1.bigfish.com (Postfix) with ESMTP id 49FF414008F; Fri, 24 Aug 2012 01:48:55 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS013.bigfish.com (10.43.70.13) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 24 Aug 2012 01:48:55 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.309.3; Thu, 23 Aug 2012 20:48:54 -0500 Received: from snotra.am.freescale.net ([10.214.82.253]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q7O1mpjU021886; Thu, 23 Aug 2012 18:48:52 -0700 From: Scott Wood To: Andy Fleming Date: Thu, 23 Aug 2012 20:48:50 -0500 Message-ID: <1345772931-26567-1-git-send-email-scottwood@freescale.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/2] nand_spl: p1010rdb: don't write to global variable before reloc X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Pass it on the stack instead. Besides being the right thing to do, it also should save a few bytes. Signed-off-by: Scott Wood --- nand_spl/board/freescale/p1010rdb/nand_boot.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nand_spl/board/freescale/p1010rdb/nand_boot.c b/nand_spl/board/freescale/p1010rdb/nand_boot.c index 9c35690..444d2f2 100644 --- a/nand_spl/board/freescale/p1010rdb/nand_boot.c +++ b/nand_spl/board/freescale/p1010rdb/nand_boot.c @@ -31,9 +31,7 @@ DECLARE_GLOBAL_DATA_PTR; -unsigned long ddr_freq_mhz; - -void sdram_init(void) +void sdram_init(u32 ddr_freq_mhz) { ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC85xx_DDR_ADDR; /* mask off E bit */ @@ -91,7 +89,7 @@ void sdram_init(void) void board_init_f(ulong bootflag) { - u32 plat_ratio, ddr_ratio; + u32 plat_ratio, ddr_ratio, ddr_freq_mhz; ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; /* initialize selected port with appropriate baud rate */ @@ -109,7 +107,7 @@ void board_init_f(ulong bootflag) puts("\nNAND boot... "); /* Initialize the DDR3 */ - sdram_init(); + sdram_init(ddr_freq_mhz); /* copy code to RAM and jump to it - this should not return */ /* NOTE - code has to be copied out of NAND buffer before