spl_board_init() enables the MMU from ARM64 SPL, and runs before
boot_from_devices() loads anything, so the decompressors can use
unaligned loads.

Select it under the same condition that code tests before enabling
caches, so the two cannot drift apart. SPL only: U-Boot proper is left
as it is.

Signed-off-by: Alexey Charkov <[email protected]>
---
 arch/arm/mach-rockchip/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 1a2e7847c9e7..e3c9d57c4434 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -631,11 +631,16 @@ config ROCKCHIP_COMMON_BOARD
 config SPL_ROCKCHIP_COMMON_BOARD
        bool "Rockchip SPL common board file"
        depends on SPL
+       select SPL_SAFE_UNALIGNED_ACCESS if ARM64 && !SPL_SYS_DCACHE_OFF
        help
          Rockchip SoCs have similar boot process, SPL is mainly in charge of
          load and boot Trust ATF/U-Boot firmware, and DRAM init if there is
          no TPL for the board.
 
+         On ARM64 it enables the MMU from spl_board_init(), which runs before
+         any image is loaded, hence the SPL_SAFE_UNALIGNED_ACCESS above under
+         the same condition that code tests.
+
 config TPL_ROCKCHIP_COMMON_BOARD
        bool "Rockchip TPL common board file"
        depends on TPL

-- 
2.55.0

Reply via email to