From patchwork Thu Aug 26 11:55:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rogan Dawes X-Patchwork-Id: 71830 Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id 1EF93157D71 for ; Thu, 26 Aug 2010 13:59:05 +0200 (CEST) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id 00ED5316A7F3 for ; Thu, 26 Aug 2010 13:59:04 +0200 (MEST) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.17) for (single-drop); Thu, 26 Aug 2010 13:59:05 +0200 (MEST) Received: from murder ([192.168.8.180]) by backend2 (Cyrus v2.2.12) with LMTPA; Thu, 26 Aug 2010 13:56:15 +0200 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend1.mail.m-online.net (Cyrus v2.2.12) with LMTPA; Thu, 26 Aug 2010 13:56:14 +0200 Received: from scanner-1.m-online.net (scanner-1.mail.m-online.net [192.168.8.165]) by mail.m-online.net (Postfix) with ESMTP id 1AC771C0025E; Thu, 26 Aug 2010 13:56:14 +0200 (CEST) Received: from mxin-2.m-online.net ([192.168.1.21]) by scanner-1.m-online.net (scanner-1.m-online.net [192.168.8.165]) (amavisd-new, port 10026) with ESMTP id 04379-03; Thu, 26 Aug 2010 13:56:11 +0200 (CEST) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-2.m-online.net (Postfix) with ESMTP id EB24946AF17; Thu, 26 Aug 2010 13:56:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6964D280E9; Thu, 26 Aug 2010 13:56:07 +0200 (CEST) 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 iY7JjDoQ0Q1q; Thu, 26 Aug 2010 13:56:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A6C2280F3; Thu, 26 Aug 2010 13:56:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 21849280D4 for ; Thu, 26 Aug 2010 13:55:58 +0200 (CEST) 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 hxXgy1fbCYy1 for ; Thu, 26 Aug 2010 13:55:56 +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 mail-wy0-f172.google.com (mail-wy0-f172.google.com [74.125.82.172]) by theia.denx.de (Postfix) with ESMTP id 0B466280D3 for ; Thu, 26 Aug 2010 13:55:54 +0200 (CEST) Received: by wyi11 with SMTP id 11so2032243wyi.3 for ; Thu, 26 Aug 2010 04:55:54 -0700 (PDT) Received: by 10.227.133.142 with SMTP id f14mr8895079wbt.2.1282823753888; Thu, 26 Aug 2010 04:55:53 -0700 (PDT) Received: from localhost.localdomain (41-132-93-88.dsl.mweb.co.za [41.132.93.88]) by mx.google.com with ESMTPS id v16sm1586573weq.8.2010.08.26.04.55.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 26 Aug 2010 04:55:53 -0700 (PDT) From: Rogan Dawes To: u-boot@lists.denx.de Date: Thu, 26 Aug 2010 13:55:35 +0200 Message-Id: <1282823735-2941-1-git-send-email-rogan@dawes.za.net> X-Mailer: git-send-email 1.7.1 Subject: [U-Boot] [PATCH] Orion5x: Correct DRAM bank detection 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Virus-Scanned: by amavisd-new at m-online.net This code was referencing the wrong register, and only happened to "work" because the DRAM on both users of this code happened to be a single bank located at address 0. Signed-off-by: Rogan Dawes --- Prafulla, according to Albert, this code was copied from the Kirkwood code, and may be incorrect there too. Rogan arch/arm/cpu/arm926ejs/orion5x/dram.c | 2 +- arch/arm/include/asm/arch-orion5x/orion5x.h | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c b/arch/arm/cpu/arm926ejs/orion5x/dram.c index c719798..90b0a9c 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/dram.c +++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c @@ -38,7 +38,7 @@ u32 orion5x_sdram_bar(enum memory_bank bank) { struct orion5x_ddr_addr_decode_registers *winregs = (struct orion5x_ddr_addr_decode_registers *) - ORION5X_CPU_WIN_BASE; + ORION5X_DRAM_BASE; u32 result = 0; u32 enable = 0x01 & winregs[bank].size; diff --git a/arch/arm/include/asm/arch-orion5x/orion5x.h b/arch/arm/include/asm/arch-orion5x/orion5x.h index e3d3f76..1dd9f65 100644 --- a/arch/arm/include/asm/arch-orion5x/orion5x.h +++ b/arch/arm/include/asm/arch-orion5x/orion5x.h @@ -42,6 +42,7 @@ #define ORION5X_REGISTER(x) (ORION5X_REGS_PHY_BASE + x) /* Documented registers */ +#define ORION5X_DRAM_BASE (ORION5X_REGISTER(0x01500)) #define ORION5X_TWSI_BASE (ORION5X_REGISTER(0x11000)) #define ORION5X_UART0_BASE (ORION5X_REGISTER(0x12000)) #define ORION5X_UART1_BASE (ORION5X_REGISTER(0x12100))