The older ATF had it's PRELOADED_BL33_BASE set to 0x80080000, changing SPL_TEXT_BASE to the newer address of 0x822000000 is incompatible with older ATF builds.
Therefore, this patch adds a jump stub to move execution back to SPL_TEXT_BASE with the stub being loaded at the older ATF address of 0x80080000. Signed-off-by: Anshul Dalal <ansh...@ti.com> --- arch/arm/mach-k3/Makefile | 7 +++++++ arch/arm/mach-k3/jump_stub.S | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 arch/arm/mach-k3/jump_stub.S diff --git a/arch/arm/mach-k3/Makefile b/arch/arm/mach-k3/Makefile index b2fd5810b67..573956a8a2c 100644 --- a/arch/arm/mach-k3/Makefile +++ b/arch/arm/mach-k3/Makefile @@ -17,3 +17,10 @@ obj-$(CONFIG_SOC_K3_J7200) += j7200/ obj-$(CONFIG_SOC_K3_J721S2) += j721s2/ obj-$(CONFIG_SOC_K3_J722S) += j722s/ obj-$(CONFIG_SOC_K3_J784S4) += j784s4/ + +ifdef CONFIG_ARM64 +obj-y += jump_stub.o +$(src)/jump_stub.o: $(src)/jump_stub.s + $(AS) $(src)/jump_stub.s -o $(src)/jump_stub.o + $(OBJCOPY) -O binary --only-section .text $(src)/jump_stub.o jump_stub.bin +endif diff --git a/arch/arm/mach-k3/jump_stub.S b/arch/arm/mach-k3/jump_stub.S new file mode 100644 index 00000000000..694d4ee47a6 --- /dev/null +++ b/arch/arm/mach-k3/jump_stub.S @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com/ + * Anshul Dalal <ansh...@ti.com> + */ + +/* + This jump stub is to be loaded at the older PRELOADED_BL33_BASE to forward + execution to SPL_TEXT_BASE when using older ATF builds. + */ + +.text + +jump_stub: + mov x15, CONFIG_SPL_TEXT_BASE + br x15 -- 2.49.0