From patchwork Fri Jul 6 11:50:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerlando Falauto X-Patchwork-Id: 169460 X-Patchwork-Delegate: prafulla@marvell.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 C44EA2C007B for ; Fri, 6 Jul 2012 21:50:45 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 11521280B3; Fri, 6 Jul 2012 13:50:42 +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 cPYaloEak1sK; Fri, 6 Jul 2012 13:50:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 75DF0280C1; Fri, 6 Jul 2012 13:50:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 470C4280B4 for ; Fri, 6 Jul 2012 13:50:35 +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 oH4XE1nO3p3C for ; Fri, 6 Jul 2012 13:50:33 +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-de.keymile.com (mail-de.keymile.com [195.8.104.1]) by theia.denx.de (Postfix) with SMTP id 10382280AA for ; Fri, 6 Jul 2012 13:50:31 +0200 (CEST) Received: from mailrelay.de.keymile.net ([10.9.1.54]) by eSafe SMTP Relay 1341562233; Fri, 06 Jul 2012 13:50:31 +0200 Received: from chber1-10555x.ch.keymile.net (chber1-10555x.ch.keymile.net [172.31.40.82]) by mailrelay.de.keymile.net (8.12.2/8.12.2) with ESMTP id q66BnTjP022704; Fri, 6 Jul 2012 13:49:32 +0200 (MEST) From: Gerlando Falauto To: u-boot@lists.denx.de Date: Fri, 6 Jul 2012 13:50:17 +0200 Message-Id: <1341575417-7719-2-git-send-email-gerlando.falauto@keymile.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1341498492-2648-1-git-send-email-gerlando.falauto@keymile.com> References: <1341498492-2648-1-git-send-email-gerlando.falauto@keymile.com> X-ESAFE-STATUS: [srvhellgate.de.keymile.net] Mail clean Cc: Valentin Longchamp , Holger Brunck , Gerlando Falauto Subject: [U-Boot] [PATCH v2 2/2] km_arm: enable SDRAM window size fixup 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 Size of the SDRAM chips might differ between any two (otherwise identical) instances of the same board. So change board_early_init_f() to use km_sdram_bs_set(), in order to fixup the window size register at runtime, according to the detected SDRAM size. Signed-off-by: Gerlando Falauto Cc: Valentin Longchamp Cc: Holger Brunck --- changes for v2: - rebase to current u-boot-marvell.git master branch board/keymile/km_arm/km_arm.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index 2b2ca39..24cf6c7 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -241,6 +241,17 @@ int misc_init_r(void) return 0; } +static void dram_size_fixup(void) +{ + u32 size; + + /* probe currently equipped RAM size */ + size = get_ram_size((void *)kw_sdram_bar(0), kw_sdram_bs(0)); + + /* fixup SDRAM window size accordingly */ + kw_sdram_bs_set(0, size); +} + int board_early_init_f(void) { #if defined(CONFIG_SOFT_I2C) @@ -251,6 +262,7 @@ int board_early_init_f(void) writel(tmp & (~KM_KIRKWOOD_SOFT_I2C_GPIOS) , KW_GPIO0_BASE + 4); #endif + dram_size_fixup(); kirkwood_mpp_conf(kwmpp_config, NULL); return 0; }