
On Mon, 24 Jan 2022 at 18:15, Andre Przywara andre.przywara@arm.com wrote:
Currently we do some magic "SRAM setup" MMIO writes in s_init(), copied from the original BSP U-Boot. The comment speaks of this being required before DRAM access gets enabled, but there is no indication that this would actually be required that early.
Move this out of s_init(), into board_init_f(). Since this actually only affects a very few older SoCs, the actual code goes into the cpu/armv7 directory, to move it out of the way for all other SoCs.
This also uses the opportunity to convert some #ifdefs over to the fancy IS_ENABLED() macros used in actual C code.
We keep the s_init() stub around for now, since armv8's lowlevel_init still relies on it.
Signed-off-by: Andre Przywara andre.przywara@arm.com
arch/arm/cpu/armv7/sunxi/Makefile | 3 +++ arch/arm/cpu/armv7/sunxi/sram.c | 45 +++++++++++++++++++++++++++++++ arch/arm/mach-sunxi/board.c | 38 +++++--------------------- 3 files changed, 54 insertions(+), 32 deletions(-) create mode 100644 arch/arm/cpu/armv7/sunxi/sram.c
Reviewed-by: Simon Glass sjg@chromium.org Tested on: orangepi_pc2, orangepi_pc, A20-OLinuXino_MICRO Tested-by: Simon Glass sjg@chromium.org