summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnshul Dalal <[email protected]>2025-10-17 18:45:31 +0530
committerTom Rini <[email protected]>2025-10-22 12:05:52 -0600
commit859f68ed2ee7a0c1f88efaeb769202df01ef7a97 (patch)
treeadc3eb2a8b04ba651ea0df05b10e3909acfb8fc9
parent16ffcff0283d2f10821bad7cbcf89003a86c0063 (diff)
mach-k3: add reserved memory fixups for next boot stage
The boot flow in K3 platforms requires the subsequent boot stages to be aware of the memory reserved for previous boot binaries. In the regular boot sequence of: R5 SPL -> ATF -> OP-TEE -> A-core SPL -> U-Boot -> Kernel, Both A-core SPL and U-Boot should be made aware of the memory reserved for ATF and OP-TEE from their device-tree. Currently this information is absent. Therefore this patch adds the reserved-memory regions as part of spl_perform_arch_fixups for the next stage's DT. This is called during both R5 and A-core SPL which fixes up the DT for their respective next stages: A-core SPL and U-Boot proper. Reviewed-by: Dhruva Gole <[email protected]> Signed-off-by: Anshul Dalal <[email protected]> Tested-by: Wadim Egorov <[email protected]>
-rw-r--r--arch/arm/mach-k3/common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 30ad98a68a2..f734f10b605 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -321,6 +321,17 @@ static __maybe_unused void k3_dma_remove(void)
pr_warn("DMA Device not found (err=%d)\n", rc);
}
+void spl_perform_arch_fixups(struct spl_image_info *spl_image)
+{
+ void *fdt = spl_image_fdt_addr(spl_image);
+
+ if (!fdt)
+ return;
+
+ fdt_fixup_reserved(fdt, "tfa", CONFIG_K3_ATF_LOAD_ADDR, 0x80000);
+ fdt_fixup_reserved(fdt, "optee", CONFIG_K3_OPTEE_LOAD_ADDR, 0x1800000);
+}
+
void spl_board_prepare_for_boot(void)
{
#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))