start.S: remove omap3 specific code from start.S
[oweals/u-boot.git] / arch / arm / cpu / armv7 / omap3 / emif4.c
index fae5b1161b03408a1af654f6ad5a98bf7f799633..30856372b3f9aa4f640488f4c4b60fdd29237eb6 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/emif4.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 extern omap3_sysinfo sysinfo;
 
 static emif4_t *emif4_base = (emif4_t *)OMAP34XX_SDRC_BASE;
@@ -48,10 +49,11 @@ u32 is_mem_sdr(void)
  */
 u32 get_sdr_cs_size(u32 cs)
 {
-       u32 size;
+       u32 size = 0;
 
        /* TODO: Calculate the size based on EMIF4 configuration */
-       size = CONFIG_SYS_CS0_SIZE;
+       if (cs == CS0)
+               size = CONFIG_SYS_CS0_SIZE;
 
        return size;
 }
@@ -138,7 +140,6 @@ void do_emif4_init(void)
  */
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int size0 = 0, size1 = 0;
 
        size0 = get_sdr_cs_size(CS0);
@@ -150,12 +151,21 @@ int dram_init(void)
        if ((sysinfo.mtype == DDR_COMBO) || (sysinfo.mtype == DDR_STACKED))
                size1 = get_sdr_cs_size(CS1);
 
+       gd->ram_size = size0 + size1;
+       return 0;
+}
+
+void dram_init_banksize (void)
+{
+       unsigned int size0 = 0, size1 = 0;
+
+       size0 = get_sdr_cs_size(CS0);
+       size1 = get_sdr_cs_size(CS1);
+
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = size0;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_1 + get_sdr_cs_offset(CS1);
        gd->bd->bi_dram[1].size = size1;
-
-       return 0;
 }
 
 /*