mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-29 08:01:08 +00:00
3e9952be23
U-Boot needs to set up available memory area(s) in dram_init() and dram_init_banksize(). It is platform-dependent how to detect the memory banks. Currently, UniPhier adopts the memory banks _alleged_ by DT. This is based on the assumption that users bind a correct DT in their build process. Come to think of it, the DRAM controller has already been set up before U-Boot is entered (because U-Boot runs on DRAM). So, the DRAM controller setup register seems a more reliable source of any information about DRAM stuff. The DRAM banks are initialized by preliminary firmware (SPL, ARM Trusted Firmware BL2, or whatever), so this means the source of the reliability is shifted from Device Tree to such early-stage firmware. However, if the DRAM controller is wrongly configured, the system will crash. If your system is running, the DRAM setup register is very likely to provide the correct DRAM mapping. Decode the SG_MEMCONF register to get the available DRAM banks. The dram_init() and dram_init_banksize() need similar decoding. It would be nice if dram_init_banksize() could reuse the outcome of dram_init(), but global variables are unavailable at this stage because the .bss section is available only after the relocation. As a result, SG_MEMCONF must be checked twice, but a new helper uniphier_memconf_decode() will help to avoid code duplication. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> |
||
---|---|---|
.. | ||
arm32 | ||
arm64 | ||
bcu | ||
boot-mode | ||
clk | ||
debug-uart | ||
dram | ||
sbc | ||
board_init.c | ||
board_late_init.c | ||
boards.c | ||
cpu-info.c | ||
debug.h | ||
dram_init.c | ||
init.h | ||
Kconfig | ||
Makefile | ||
memconf.c | ||
micro-support-card.c | ||
micro-support-card.h | ||
pinctrl-glue.c | ||
reset.c | ||
sc-regs.h | ||
sc64-regs.h | ||
sg-regs.h | ||
soc-info.c | ||
soc-info.h | ||
spl_board_init.c |