mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 12:13:00 -04:00
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>
This commit is contained in:
parent
31d80c77ff
commit
28e57108a6
@ -81,6 +81,16 @@ int dram_init(void)
|
|||||||
gd->ram_size += gd->bd->bi_dram[i].size;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user