From patchwork Tue Jun 7 01:42:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 99067 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 A37F1B6FB4 for ; Tue, 7 Jun 2011 11:42:52 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E20128199; Tue, 7 Jun 2011 03:42:39 +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 6cnz8tH3b7iO; Tue, 7 Jun 2011 03:42:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9C36B281A2; Tue, 7 Jun 2011 03:42:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 14FD62818E for ; Tue, 7 Jun 2011 03:42:32 +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 22eyu5ghNWJE for ; Tue, 7 Jun 2011 03:42:31 +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 CH1EHSOBE010.bigfish.com (ch1ehsobe005.messaging.microsoft.com [216.32.181.185]) by theia.denx.de (Postfix) with ESMTPS id 1CD3128115 for ; Tue, 7 Jun 2011 03:42:29 +0200 (CEST) Received: from mail2-ch1-R.bigfish.com (216.32.181.168) by CH1EHSOBE010.bigfish.com (10.43.70.60) with Microsoft SMTP Server id 14.1.225.22; Tue, 7 Jun 2011 01:42:27 +0000 Received: from mail2-ch1 (localhost.localdomain [127.0.0.1]) by mail2-ch1-R.bigfish.com (Postfix) with ESMTP id 55D08EC81A7 for ; Tue, 7 Jun 2011 01:42:27 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-SS: 0, Received: from mail2-ch1 (localhost.localdomain [127.0.0.1]) by mail2-ch1 (MessageSwitch) id 1307410947266076_15422; Tue, 7 Jun 2011 01:42:27 +0000 (UTC) Received: from CH1EHSMHS012.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.248]) by mail2-ch1.bigfish.com (Postfix) with ESMTP id 338C3B9804F for ; Tue, 7 Jun 2011 01:42:27 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS012.bigfish.com (10.43.70.12) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 7 Jun 2011 01:42:26 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.289.8; Mon, 6 Jun 2011 20:42:26 -0500 Received: from localhost.localdomain (udp143610uds.ap.freescale.net [10.192.208.68] (may be forged)) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p571gGHc001926; Mon, 6 Jun 2011 20:42:23 -0500 (CDT) From: York Sun To: Date: Tue, 7 Jun 2011 09:42:17 +0800 Message-ID: <1307410937-13861-3-git-send-email-yorksun@freescale.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1307410937-13861-1-git-send-email-yorksun@freescale.com> References: <1307410937-13861-1-git-send-email-yorksun@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [Patch v2 2/2] powerpc/mpc8xxx: Adding fallback to raw timing on supported boards 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 In case of empty SPD or checksum error, fallback to raw timing on supported boards. Signed-off-by: York Sun --- arch/powerpc/cpu/mpc8xxx/ddr/main.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/main.c b/arch/powerpc/cpu/mpc8xxx/ddr/main.c index 3c49fa9..249fd7d 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/main.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/main.c @@ -343,12 +343,20 @@ fsl_ddr_compute(fsl_ddr_info_t *pinfo, unsigned int start_step, &(pinfo->dimm_params[i][j]); retval = compute_dimm_parameters(spd, pdimm, i); +#ifdef CONFIG_SYS_DDR_RAW_TIMING + if (retval != 0) { + printf("SPD error! Trying fallback to " + "raw timing calculation\n"); + fsl_ddr_get_dimm_params(pdimm, i, j); + } +#else if (retval == 2) { printf("Error: compute_dimm_parameters" " non-zero returned FATAL value " "for memctl=%u dimm=%u\n", i, j); return 0; } +#endif if (retval) { debug("Warning: compute_dimm_parameters" " non-zero return value for memctl=%u "