Merge branch 'fpga' of git://www.denx.de/git/u-boot-microblaze
[oweals/u-boot.git] / board / compulab / cm_fx6 / spl.c
index 3948ba23ae9e4267bfaa7b3d6f59aeb5b894c1ac..5b4b76f5b7329ca7b99e2da04272848a10f01fb4 100644 (file)
@@ -235,10 +235,11 @@ static int cm_fx6_spl_dram_init(void)
 
                spl_mx6s_dram_init(DDR_32BIT_1GB, false);
                bank1_size = get_ram_size((long int *)PHYS_SDRAM_1, 0x80000000);
-               if (bank1_size == 0x40000000)
-                       return 0;
-
+               bank2_size = get_ram_size((long int *)PHYS_SDRAM_2, 0x80000000);
                if (bank1_size == 0x20000000) {
+                       if (bank2_size == 0x20000000)
+                               return 0;
+
                        spl_mx6s_dram_init(DDR_32BIT_512MB, true);
                        return 0;
                }
@@ -312,7 +313,6 @@ void board_init_f(ulong dummy)
 {
        struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
 
-       gd = &gdata;
        /*
         * We don't use DMA in SPL, but we do need it in U-Boot. U-Boot
         * initializes DMA very early (before all board code), so the only