From patchwork Sat Jul 23 13:38:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 106467 X-Patchwork-Delegate: albert.aribaud@free.fr 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 A46F0B6F68 for ; Sat, 23 Jul 2011 23:38:53 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE16A280BC; Sat, 23 Jul 2011 15:38:44 +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 dLn5pNDxit5w; Sat, 23 Jul 2011 15:38:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D5A6280DF; Sat, 23 Jul 2011 15:38:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 02C4A280DC for ; Sat, 23 Jul 2011 15:38:28 +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 UjZ1cT46nyfK for ; Sat, 23 Jul 2011 15:38:27 +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.df.lth.se (mail.df.lth.se [194.47.250.12]) by theia.denx.de (Postfix) with ESMTPS id 88170280CC for ; Sat, 23 Jul 2011 15:38:19 +0200 (CEST) Received: from localhost.localdomain (78-73-45-70-no184.tbcn.telia.com [78.73.45.70]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPSA id BE08265D92; Sat, 23 Jul 2011 15:38:18 +0200 (CEST) From: Linus Walleij To: Wolfgang Denk , u-boot@lists.denx.de Date: Sat, 23 Jul 2011 15:38:17 +0200 Message-Id: <1311428297-14903-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.6 Subject: [U-Boot] [PATCH 6/9 v3] integratorap: fixup SDRAM memory size 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 This fixes up the SDRAM memory detection code to work with the latest relocation code, moves it all into dram_init() and activates memory size detection for the Integrator AP. Signed-off-by: Linus Walleij --- board/armltd/integrator/integrator.c | 17 +++++++---------- include/configs/integratorap.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c index a0d8de7..c8d2bc7 100644 --- a/board/armltd/integrator/integrator.c +++ b/board/armltd/integrator/integrator.c @@ -86,17 +86,9 @@ int misc_init_r (void) return (0); } -void dram_init_banksize(void) -{ - gd->bd->bi_dram[0].start = PHYS_SDRAM_1; - gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; -} - int dram_init (void) { - gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, - PHYS_SDRAM_1_SIZE); - + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; #ifdef CONFIG_CM_SPD_DETECT { extern void dram_query(void); @@ -120,8 +112,13 @@ extern void dram_query(void); */ sdram_shift = ((cm_reg_sdram & 0x0000001C)/4)%4; gd->bd->bi_dram[0].size = 0x01000000 << sdram_shift; - + gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, + 0x01000000 << sdram_shift); } +#else + gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, + PHYS_SDRAM_1_SIZE); #endif /* CM_SPD_DETECT */ return 0; diff --git a/include/configs/integratorap.h b/include/configs/integratorap.h index 26eac8b..90f21e8 100644 --- a/include/configs/integratorap.h +++ b/include/configs/integratorap.h @@ -47,7 +47,7 @@ #define CONFIG_SKIP_LOWLEVEL_INIT #define CONFIG_CM_INIT 1 #define CONFIG_CM_REMAP 1 -#undef CONFIG_CM_SPD_DETECT +#define CONFIG_CM_SPD_DETECT /* * Size of malloc() pool