From patchwork Mon Mar 25 17:33:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 230789 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 288212C009D for ; Tue, 26 Mar 2013 04:36:19 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF31B4A136; Mon, 25 Mar 2013 18:35: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 LrCVdNWUsvJc; Mon, 25 Mar 2013 18:35:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6F3FF4A137; Mon, 25 Mar 2013 18:34:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BA0694A0EB for ; Mon, 25 Mar 2013 18:34:18 +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 JydrzSaybgYl for ; Mon, 25 Mar 2013 18:34:15 +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 co1outboundpool.messaging.microsoft.com (co1ehsobe003.messaging.microsoft.com [216.32.180.186]) by theia.denx.de (Postfix) with ESMTPS id B551B4A0C5 for ; Mon, 25 Mar 2013 18:34:00 +0100 (CET) Received: from mail62-co1-R.bigfish.com (10.243.78.231) by CO1EHSOBE035.bigfish.com (10.243.66.100) with Microsoft SMTP Server id 14.1.225.23; Mon, 25 Mar 2013 17:33:59 +0000 Received: from mail62-co1 (localhost [127.0.0.1]) by mail62-co1-R.bigfish.com (Postfix) with ESMTP id 265B3840163 for ; Mon, 25 Mar 2013 17:33:59 +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(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) Received: from mail62-co1 (localhost.localdomain [127.0.0.1]) by mail62-co1 (MessageSwitch) id 1364232837348155_8131; Mon, 25 Mar 2013 17:33:57 +0000 (UTC) Received: from CO1EHSMHS005.bigfish.com (unknown [10.243.78.253]) by mail62-co1.bigfish.com (Postfix) with ESMTP id 515E87400F2 for ; Mon, 25 Mar 2013 17:33:57 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS005.bigfish.com (10.243.66.15) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 25 Mar 2013 17:33:56 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-004.039d.mgd.msft.net (10.84.1.14) with Microsoft SMTP Server (TLS) id 14.2.328.11; Mon, 25 Mar 2013 17:33:55 +0000 Received: from oslab-l1.am.freescale.net ([10.214.80.134]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r2PHXhsv018974; Mon, 25 Mar 2013 10:33:55 -0700 From: York Sun To: Date: Mon, 25 Mar 2013 10:33:20 -0700 Message-ID: <1364232811-30856-12-git-send-email-yorksun@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364232811-30856-1-git-send-email-yorksun@freescale.com> References: <1364232811-30856-1-git-send-email-yorksun@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: u-boot@lists.denx.de, York Sun Subject: [U-Boot] [Patch v2, batch 2 12/23] powerpc/mpc8xxx: Fix DDR 3-way interleaving 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 Should check if interleaving is enabled before using interleaving mode. Signed-off-by: York Sun --- arch/powerpc/cpu/mpc8xxx/ddr/main.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/main.c b/arch/powerpc/cpu/mpc8xxx/ddr/main.c index 5311a26..1a8d593 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/main.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/main.c @@ -541,14 +541,17 @@ phys_size_t fsl_ddr_sdram(void) total_memory = fsl_ddr_compute(&info, STEP_GET_SPD, 0); /* setup 3-way interleaving before enabling DDRC */ - switch (info.memctl_opts[0].memctl_interleaving_mode) { - case FSL_DDR_3WAY_1KB_INTERLEAVING: - case FSL_DDR_3WAY_4KB_INTERLEAVING: - case FSL_DDR_3WAY_8KB_INTERLEAVING: - fsl_ddr_set_intl3r(info.memctl_opts[0].memctl_interleaving_mode); - break; - default: - break; + if (info.memctl_opts[0].memctl_interleaving) { + switch (info.memctl_opts[0].memctl_interleaving_mode) { + case FSL_DDR_3WAY_1KB_INTERLEAVING: + case FSL_DDR_3WAY_4KB_INTERLEAVING: + case FSL_DDR_3WAY_8KB_INTERLEAVING: + fsl_ddr_set_intl3r( + info.memctl_opts[0].memctl_interleaving_mode); + break; + default: + break; + } } /* Program configuration registers. */