Hi Alexey,

On 10/2/26 12:04 PM, Alexey Charkov wrote:
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..cc108e9679d3 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_ASSUME_UNALIGNED_ACCESS_OK 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

No? Only RK3399, anbernic-rgxx3-rk3566, jaguar-rk3588, RK3066, ringneck-px30 have CONFIG_SPL_BOARD_INIT() enabled AND it does not seem to be doing anything related to the MMU. I think you meant board_init_f() from SPL? But then the arch_reserve_mmu+enable_caches is only called when TPL is disabled (note that it is NOT "not in the TPL phase" check, it's whether U-Boot will have a TPL built at all), or SPL_RAM is enabled, which doesn't match the dependencies listed above too. Please add a comment next to the ifdef condition, the calls to arch_reserve_mmu+enable_caches and as a Kconfig comment next to the select that they need to be kept in sync.

Cheers,
Quentin

Reply via email to