[PATCH -next v8 09/11] mach-k3: add reserved memory fixups for next boot stage

Dhruva Gole d-gole at ti.com
Wed Oct 8 15:34:49 CEST 2025


On Oct 06, 2025 at 13:58:47 +0530, Anshul Dalal wrote:
> 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.
> 
> Signed-off-by: Anshul Dalal <anshuld at ti.com>
> Tested-by: Wadim Egorov <w.egorov at phytec.de>
> ---
>  arch/arm/mach-k3/common.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
> index 0a73b1fa296..581a7246630 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);
> +}
> +

Reviewed-by: Dhruva Gole <d-gole at ti.com>

-- 
Best regards,
Dhruva Gole
Texas Instruments Incorporated


More information about the U-Boot mailing list