arm: armv8: mmu: add mem_map_from_dram_banks
authorAnshul Dalal <anshuld@ti.com>
Fri, 17 Oct 2025 13:15:27 +0000 (18:45 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 22 Oct 2025 18:05:52 +0000 (12:05 -0600)
commitfe2647f2a0d4e4df5d47fdf068aeb2a1edd3d533
treeb4295c11924d5987ae1ba835fe8f31b7b789c6e4
parent9ebdbbc43e5fb5841d85ec7ebcb1dbf07f4c87b0
arm: armv8: mmu: add mem_map_from_dram_banks

For armv8, U-Boot uses a static map defined as 'mem_map' for configuring
the MMU as part of mmu_setup.

But since the exact configuration of memory banks might not be known at
build time, many platforms such as imx9, versal2 etc. utilize
gd->bd->bi_dram to configure the static map at runtime.

Therefore this patch adds a new API mem_map_from_dram_banks that
modifies the static map in a similar way. Allowing the caller to map all
dram banks by just passing the index to last entry in their mem_map and
it's length.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
arch/arm/cpu/armv8/cache_v8.c
arch/arm/include/asm/armv8/mmu.h