Skip to content

k3: migrate SPL_TEXT_BASE to new address

Anshul Dalal u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4spl: Kconfig: k3: set SPL_TEXT_BASE to 0x82200000common/spl/Kconfig+1 -10 replies
2/4mach-k3: add a jump stub to support older ATF buildsarch/arm/mach-k3/Makefile arch/arm/mach-k3/jump_stub.S+23 -00 replies
3/4binman: k3: add jump-stub to tispl.binarch/arm/dts/k3-binman.dtsi+31 -00 replies
4/4binman: k3: add jump-stub as loadablearch/arm/dts/k3-am625-beagleplay-u-boot.dtsi arch/arm/dts/k3-am625-phycore-som-binman.dtsi arch/arm/dts/k3-am625-sk-binman.dtsi +15 more+34 -340 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/4] k3: migrate SPL_TEXT_BASE to new address

The change to ATF's PRELOADED_BL33_BASE[1] requires respective changes to SPL_TEXT_BASE on u-boot side. This is necessary to allow the ATF to jump directly to linux kernel (like in falcon mode) which requires a 2MiB aligned load address[2]. The current address ATF jumps to is 0x80080000 which is not 2MiB aligned.

Therefore in parallel to the ATF change, this patch set makes the corresponding changes to u-boot. To maintain backwards compatibility with older ATF builds (that still use older address of 0x80080000), the patch set also adds a jump-stub which modifies the execution as follows:

Old ATF -> 0x80080000 -> 0x822000000 (Main domain SPL or kernel image)
jump stub SPL_TEXT_BASE

With the following instructions loaded by the jump-stub:

ADDR       | Instruction
0x80080000 |   mov x15, CONFIG_SPL_TEXT_BASE (0x822000000)
0x80080004 |   br x15

Depends on:
* [PATCH v3] configs: set SPL_TEXT_BASE by default for k3 platforms
https://lore.kernel.org/u-boot/[email protected]/

[1]:
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/37447
[2]:
"The Image must be placed text_offset bytes from a 2MB aligned base address anywhere in usable system RAM and called there."
- Documentation/arch/arm64/booting.rst (linux kernel)

Anshul Dalal (4):
spl: Kconfig: k3: set SPL_TEXT_BASE to 0x82200000
mach-k3: add a jump stub to support older ATF builds
binman: k3: add jump-stub to tispl.bin
binman: k3: add jump-stub as loadable

 arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi  |  2 +-
 arch/arm/dts/k3-am625-phycore-som-binman.dtsi |  4 +--
 arch/arm/dts/k3-am625-sk-binman.dtsi          |  4 +--
 .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  |  4 +--
 arch/arm/dts/k3-am62a-phycore-som-binman.dtsi |  4 +--
 arch/arm/dts/k3-am62a-sk-binman.dtsi          |  4 +--
 arch/arm/dts/k3-am62p-sk-binman.dtsi          |  2 +-
 arch/arm/dts/k3-am642-phycore-som-binman.dtsi |  8 ++---
 arch/arm/dts/k3-am64x-binman.dtsi             |  8 ++---
 arch/arm/dts/k3-am65-iot2050-boot-image.dtsi  |  2 +-
 arch/arm/dts/k3-am65x-binman.dtsi             |  4 +--
 arch/arm/dts/k3-am67a-beagley-ai-u-boot.dtsi  |  2 +-
 arch/arm/dts/k3-binman.dtsi                   | 31 +++++++++++++++++++
 arch/arm/dts/k3-j7200-binman.dtsi             |  4 +--
 .../dts/k3-j721e-beagleboneai64-u-boot.dtsi   |  2 +-
 arch/arm/dts/k3-j721e-binman.dtsi             |  4 +--
 arch/arm/dts/k3-j721s2-binman.dtsi            |  4 +--
 arch/arm/dts/k3-j722s-binman.dtsi             |  2 +-
 arch/arm/dts/k3-j784s4-binman.dtsi            |  4 +--
 arch/arm/mach-k3/Makefile                     |  7 +++++
 arch/arm/mach-k3/jump_stub.S                  | 16 ++++++++++
 common/spl/Kconfig                            |  2 +-
 22 files changed, 89 insertions(+), 35 deletions(-)
 create mode 100644 arch/arm/mach-k3/jump_stub.S
Signature · 1 line
2.49.0