Patchwork [U-Boot,6/9,v3] integratorap: fixup SDRAM memory size detection

login
register
mail settings
Submitter Linus Walleij
Date July 23, 2011, 1:38 p.m.
Message ID <1311428297-14903-1-git-send-email-linus.walleij@linaro.org>
Download mbox | patch
Permalink /patch/106467/
State Superseded
Delegated to: Albert ARIBAUD
Headers show

Comments

Linus Walleij - July 23, 2011, 1:38 p.m.
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 <linus.walleij@linaro.org>
---
 board/armltd/integrator/integrator.c |   17 +++++++----------
 include/configs/integratorap.h       |    2 +-
 2 files changed, 8 insertions(+), 11 deletions(-)

Patch

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