]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/arm926ejs/kirkwood/dram.c
Merge branch 'master' of git://git.denx.de/u-boot-marvell
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / kirkwood / dram.c
index 342afe9cd06726316e5c64521c09104b4a0c96f2..2441554ae3c011c1ae062734dc8369544adf431d 100644 (file)
@@ -81,6 +81,16 @@ int dram_init(void)
                gd->ram_size += gd->bd->bi_dram[i].size;
 
        }
+
+       for (; i < CONFIG_NR_DRAM_BANKS; i++) {
+               /* If above loop terminated prematurely, we need to set
+                * remaining banks' start address & size as 0. Otherwise other
+                * u-boot functions and Linux kernel gets wrong values which
+                * could result in crash */
+               gd->bd->bi_dram[i].start = 0;
+               gd->bd->bi_dram[i].size = 0;
+       }
+
        return 0;
 }