From patchwork Wed Jan 12 16:20:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 78585 X-Patchwork-Delegate: galak@kernel.crashing.org 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 E778BB70B3 for ; Thu, 13 Jan 2011 03:20:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 59C492809D; Wed, 12 Jan 2011 17:20:31 +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 qAZKgXRPdu0i; Wed, 12 Jan 2011 17:20:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E66F628088; Wed, 12 Jan 2011 17:20:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1B15A28088 for ; Wed, 12 Jan 2011 17:20:28 +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 cnnSnC+lrJWF for ; Wed, 12 Jan 2011 17:20:25 +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 TX2EHSOBE002.bigfish.com (tx2ehsobe001.messaging.microsoft.com [65.55.88.11]) by theia.denx.de (Postfix) with ESMTPS id 193C828086 for ; Wed, 12 Jan 2011 17:20:23 +0100 (CET) Received: from mail142-tx2-R.bigfish.com (10.9.14.246) by TX2EHSOBE002.bigfish.com (10.9.40.22) with Microsoft SMTP Server id 14.1.225.8; Wed, 12 Jan 2011 16:20:21 +0000 Received: from mail142-tx2 (localhost.localdomain [127.0.0.1]) by mail142-tx2-R.bigfish.com (Postfix) with ESMTP id 5EDECFC01A7 for ; Wed, 12 Jan 2011 16:20:21 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:de01egw02.freescale.net; RD:de01egw02.freescale.net; EFVD:NLI Received: from mail142-tx2 (localhost.localdomain [127.0.0.1]) by mail142-tx2 (MessageSwitch) id 1294849221187203_27698; Wed, 12 Jan 2011 16:20:21 +0000 (UTC) Received: from TX2EHSMHS020.bigfish.com (unknown [10.9.14.254]) by mail142-tx2.bigfish.com (Postfix) with ESMTP id 2AECE1268058 for ; Wed, 12 Jan 2011 16:20:21 +0000 (UTC) Received: from de01egw02.freescale.net (192.88.165.103) by TX2EHSMHS020.bigfish.com (10.9.99.120) with Microsoft SMTP Server (TLS) id 14.1.225.8; Wed, 12 Jan 2011 16:20:18 +0000 Received: from az33smr02.freescale.net (az33smr02.freescale.net [10.64.34.200]) by de01egw02.freescale.net (8.14.3/8.14.3) with ESMTP id p0CGKHMh001022 for ; Wed, 12 Jan 2011 09:20:17 -0700 (MST) Received: from localhost.localdomain (mvp-10-214-72-66.am.freescale.net [10.214.72.66]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p0CGKEYE001552; Wed, 12 Jan 2011 10:20:15 -0600 (CST) From: York Sun To: Date: Wed, 12 Jan 2011 08:20:14 -0800 Message-ID: <1294849214-7727-1-git-send-email-yorksun@freescale.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH] corenet_ds: Update to use new hwconfig APIs 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hwconfig is called before relocating. Use the new hwconfig APIs. Signed-off-by: York Sun --- arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c index 5bcf91a..9e00a61 100644 --- a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c +++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c @@ -33,6 +33,8 @@ static u32 serdes_prtcl_map; +#define HWCONFIG_BUFFER_SIZE 128 + #ifdef DEBUG static const char *serdes_prtcl_str[] = { [NONE] = "NA", @@ -277,6 +279,15 @@ void fsl_serdes_init(void) const char *srds_lpd_arg; size_t arglen; #endif + char buffer[HWCONFIG_BUFFER_SIZE]; + char *buf = NULL; + + /* + * Extract hwconfig from environment since we have not properly setup + * the environment but need it for ddr config params + */ + if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0) + buf = buffer; /* Is serdes enabled at all? */ if (!(in_be32(&gur->rcwsr[5]) & FSL_CORENET_RCWSR5_SRDS_EN)) @@ -295,8 +306,8 @@ void fsl_serdes_init(void) if (!IS_SVR_REV(get_svr(), 1, 0)) for (bank = 1; bank < ARRAY_SIZE(srds_lpd_b); bank++) { sprintf(srds_lpd_opt, "fsl_srds_lpd_b%u", bank + 1); - srds_lpd_arg = hwconfig_subarg("serdes", srds_lpd_opt, - &arglen); + srds_lpd_arg = hwconfig_subarg_f("serdes", srds_lpd_opt, + &arglen, buf); if (srds_lpd_arg) srds_lpd_b[bank] = simple_strtoul(srds_lpd_arg, NULL, 0);