arm: armv8: mmu: export mmu_setup
authorAnshul Dalal <anshuld@ti.com>
Fri, 17 Oct 2025 13:15:25 +0000 (18:45 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 22 Oct 2025 18:05:52 +0000 (12:05 -0600)
commit567a683e8ced54c3ffa53f62a4ed7e535268c6f2
tree9ea4a7e0433c6bf406fb3db321edb6ba7dc56d20
parente55e57d240e0bdef604efca5b386978b1c70d513
arm: armv8: mmu: export mmu_setup

The mmu_setup function configures the page tables based on the board
supplied mem_map struct array. It is called implicitly as part of
dcache_enable but this limits us to only be able to use APIs such as
mmu_change_region_attr only after caches are enabled.

This might lead to speculative accesses before we can unmap a region
that is marked as cacheable in the static memory map.

Therefore this patch exports the mmu_setup function in mmu.h allowing
users to have more control over when the mmu is configured.

For K3 specifically this allows for the following configuration sequence
as part of enable_caches:

static mem_map fixups (TODO) -> mmu_setup -> carveouts using
mmu_change_region_attr (TODO) -> icache/dcache enable

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
arch/arm/include/asm/armv8/mmu.h
arch/arm/mach-k3/common.c