mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-22 19:23:07 +00:00
5776610e9e
At the moment we rely on the infamous get_ram_size() function to learn the actual DRAM size in U-Boot proper. This function has two issues: 1) It only works if the DRAM size is a power of two. We start to see boards which have 3GB of (usable) DRAM, so this does not fit anymore. 2) As U-Boot has no notion of reserved memory so far, it will happily ride through the DRAM, possibly stepping on secure-only memory. This could be a region of DRAM reserved for OP-TEE or some other secure payload, for instance. It will most likely crash in that case. As the SPL DRAM init routine has very accurate knowledge of the actual DRAM size, lets propagate this wisdom to U-Boot proper. We re-purpose a currently reserved word in our SPL header for that. The SPL itself stores the detected DRAM size there, and bumps the SPL header version number in that case. U-Boot proper checks for a valid SPL header and a high enough version number, then uses the DRAM size from there. If the SPL header field is not sufficient, we fall back to the old DRAM scanning routine. Part of the DRAM might be present and probed by SPL, but not accessible by the CPU. They're restricted in the main U-Boot binary, when accessing the DRAM size from SPL header. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Jagan Teki <jagan@openedev.com> |
||
---|---|---|
.. | ||
boot0.h | ||
clock.h | ||
clock_sun4i.h | ||
clock_sun6i.h | ||
clock_sun8i_a83t.h | ||
clock_sun9i.h | ||
clock_sun50i_h6.h | ||
cpu.h | ||
cpu_sun4i.h | ||
cpu_sun9i.h | ||
cpu_sun50i_h6.h | ||
cpucfg.h | ||
display.h | ||
display2.h | ||
dma.h | ||
dma_sun4i.h | ||
dram.h | ||
dram_sun4i.h | ||
dram_sun6i.h | ||
dram_sun8i_a23.h | ||
dram_sun8i_a33.h | ||
dram_sun8i_a83t.h | ||
dram_sun9i.h | ||
dram_sun50i_h6.h | ||
dram_sunxi_dw.h | ||
gpio.h | ||
gtbus.h | ||
gtbus_sun9i.h | ||
i2c.h | ||
lcdc.h | ||
mmc.h | ||
p2wi.h | ||
pmic_bus.h | ||
prcm.h | ||
pwm.h | ||
rsb.h | ||
spl.h | ||
sys_proto.h | ||
timer.h | ||
tve.h | ||
tzpc.h | ||
watchdog.h |