From patchwork Fri Mar 8 17:40:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 226180 X-Patchwork-Delegate: trini@ti.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 7BA562C0392 for ; Sat, 9 Mar 2013 04:41:12 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 15FE24A3EE; Fri, 8 Mar 2013 18:41:11 +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 Rms8t1-yuEbO; Fri, 8 Mar 2013 18:41:10 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2BD694A3F6; Fri, 8 Mar 2013 18:41:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 162C94A3F6 for ; Fri, 8 Mar 2013 18:41:07 +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 7H43Ed8ZM9ws for ; Fri, 8 Mar 2013 18:41:06 +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 mail-gh0-f169.google.com (mail-gh0-f169.google.com [209.85.160.169]) by theia.denx.de (Postfix) with ESMTPS id 12C044A3EE for ; Fri, 8 Mar 2013 18:41:04 +0100 (CET) Received: by mail-gh0-f169.google.com with SMTP id r18so305718ghr.0 for ; Fri, 08 Mar 2013 09:41:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=sv8V/Ha+voebQCpMYGY9G/8ug/tnhcg4aBpFspSdN2U=; b=Q5kP1+hrOLf2EjVW4sFSSgPtxeu20beUCegZh8GSnW3USB7w0wbuA0FqkM/m+jytkv j/VAvzH9b8lmuFpsehM+2YVEHCRnFV2lgBKwNlZgxaWX/ehsGE4G4g2lQ1ybfJjUbiK8 Ndv5LfbrZ8mCJXMxUOa7S43EdRzibV6vqpfEcanKKDp5Gy0f9z5xLjG03gV3pYxwVVqe pLbhR1xSrfblsIjq4bFHLs6eS6elFnA3vbhL93CRz9tcPGxvpmW8BkS0dZ7qiZQiACFO Q21Nyb+VA5Yu3yF6PrOsXRr2+slzBwGfQduveOad35GM6nkmGWYU2IF37RhwrTmz+hic dW7A== X-Received: by 10.236.159.8 with SMTP id r8mr2280817yhk.139.1362764463474; Fri, 08 Mar 2013 09:41:03 -0800 (PST) Received: from localhost.localdomain (cpe-065-184-250-089.ec.res.rr.com. [65.184.250.89]) by mx.google.com with ESMTPS id x8sm8937233yhn.12.2013.03.08.09.41.02 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Mar 2013 09:41:02 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Date: Fri, 8 Mar 2013 12:40:58 -0500 Message-Id: <1362764458-15979-1-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 Cc: Steve Kipisz Subject: [U-Boot] [PATCH] am33xx:ddr:Fix config_sdram to work for all DDR 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Steve Kipisz The original write to sdram_config is correct for DDR3 but incorrect for DDR2 so SPL was hanging. For DDR2, the write to sdram_config should be after the writes to ref_ctrl. This was working for DDR3 because there was a write of 0x2800 to ref_ctrl before a write to sdram_config. Tested on: GP EVM 1.1A (DDR2), GP EVM 1.5A (DDR3), Beaglebone A6 (DDR2), Beagleone Blacd A4A (DDR3) Signed-off-by: Steve Kipisz --- arch/arm/cpu/armv7/am33xx/ddr.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/armv7/am33xx/ddr.c b/arch/arm/cpu/armv7/am33xx/ddr.c index 448cc40..7932a39 100644 --- a/arch/arm/cpu/armv7/am33xx/ddr.c +++ b/arch/arm/cpu/armv7/am33xx/ddr.c @@ -54,10 +54,13 @@ void config_sdram(const struct emif_regs *regs) writel(0x2800, &emif_reg->emif_sdram_ref_ctrl); writel(regs->zq_config, &emif_reg->emif_zq_config); writel(regs->sdram_config, &cstat->secure_emif_sdram_config); + writel(regs->sdram_config, &emif_reg->emif_sdram_config); + writel(regs->ref_ctrl, &emif_reg->emif_sdram_ref_ctrl); + writel(regs->ref_ctrl, &emif_reg->emif_sdram_ref_ctrl_shdw); } - writel(regs->sdram_config, &emif_reg->emif_sdram_config); writel(regs->ref_ctrl, &emif_reg->emif_sdram_ref_ctrl); writel(regs->ref_ctrl, &emif_reg->emif_sdram_ref_ctrl_shdw); + writel(regs->sdram_config, &emif_reg->emif_sdram_config); } /**