omap3: Calculate CS1 size only when SDRC is
authorVaibhav Hiremath <hvaibhav@ti.com>
Mon, 7 Jun 2010 19:20:29 +0000 (15:20 -0400)
committerTom <Tom@bumblecow.com>
Tue, 8 Jun 2010 15:07:18 +0000 (10:07 -0500)
initialized for CS1

From: Vaibhav Hiremath <hvaibhav@ti.com>

The patch makes sure that size for SDRC CS1 gets calculated
only when the CS1 SDRC is initialized.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
arch/arm/cpu/arm_cortexa8/omap3/board.c

index 7b78fa448b3d7fb7ef431a2e709c059c06c30a41..69a08fd5fbe0ec99449567e51595a218ffb31f53 100644 (file)
@@ -282,6 +282,8 @@ int dram_init(void)
        DECLARE_GLOBAL_DATA_PTR;
        unsigned int size0 = 0, size1 = 0;
 
+       size0 = get_sdr_cs_size(CS0);
+
        /*
         * If a second bank of DDR is attached to CS1 this is
         * where it can be started.  Early init code will init
@@ -290,10 +292,9 @@ int dram_init(void)
        if ((sysinfo.mtype == DDR_COMBO) || (sysinfo.mtype == DDR_STACKED)) {
                do_sdrc_init(CS1, NOT_EARLY);
                make_cs1_contiguous();
-       }
 
-       size0 = get_sdr_cs_size(CS0);
-       size1 = get_sdr_cs_size(CS1);
+               size1 = get_sdr_cs_size(CS1);
+       }
 
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = size0;