diff options
author | Tanmay Upadhyay <[tanmay.upadhyay@einfochips.com]> | 2010-10-28 20:06:22 +0530 |
---|---|---|
committer | Prafulla Wadaskar <prafulla@marvell.com> | 2010-10-28 20:06:22 +0530 |
commit | 28e57108a61bd0e554d9847170b8ad9dad093e07 (patch) | |
tree | 85f4238317b8f6b4fd043bca5a2b7de753a0b5b9 | |
parent | 31d80c77ff672e0202b4ada5215c4666c949ffc2 (diff) | |
download | u-boot-imx-28e57108a61bd0e554d9847170b8ad9dad093e07.zip u-boot-imx-28e57108a61bd0e554d9847170b8ad9dad093e07.tar.gz u-boot-imx-28e57108a61bd0e554d9847170b8ad9dad093e07.tar.bz2 |
Kirkwood: bugfix: DRAM size initialization
If start of any DRAM bank is greater than total DDR size, remaining DDR banks' start address & size were left un-initialized in dram_init function. This could break other functions who uses array 'gd->bd->bi_dram'. Kirkwood network driver is one example. This also stops Linux kernel from booting.
v2 - Set start address also to 0. Without this Linux kernel couldn't
boot up
Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
-rw-r--r-- | arch/arm/cpu/arm926ejs/kirkwood/dram.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c b/arch/arm/cpu/arm926ejs/kirkwood/dram.c index 7439c87..a4344b8 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c @@ -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; } |