boot/arm-trusted-firmware: optional Linux as BL33

Arm Trusted Firmware (TF-A) can be used to load U-Boot or another
bootloader, which in turn loads the Linux kernel. However, TF-A is
capable of loading the kernel directly. To this end, we need to define
the BL33 and BL33_CFG compile options containing, respectively, the
zImage and the DTB.

This config introduces a new config option,
BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33, which sets the BL33 and
BL33_CFG parameters, and ensures that the kernel is built before the
TF-A by having linux as a _DEPENDENCY of the TF-A.

Signed-off-by: Jakob Kastelic <kastelic.jakob@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Jakob Kastelic
2025-09-16 19:45:40 -07:00
committed by Thomas Petazzoni
parent 38e0521a79
commit 8e4c663529
2 changed files with 21 additions and 0 deletions

View File

@@ -196,6 +196,19 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
for the 'qemu_sbsa' platform. In this case, due to the EDK2
build system, the dependency between ATF and EDK is reversed.
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33
bool "Linux kernel"
depends on BR2_LINUX_KERNEL
depends on (BR2_arm || BR2_armeb)
depends on (BR2_LINUX_KERNEL_ZIMAGE || BR2_LINUX_KERNEL_APPENDED_ZIMAGE)
help
This option allows to embed the Linux kernel as the BL33
part of the ARM Trusted Firmware.
Do not choose this option if you intend to use U-Boot or
another second-stage bootloader. With this option, TF-A
starts Linux directly.
endchoice
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_BAREBOX_AS_BL33

View File

@@ -129,6 +129,14 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UB
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
endif
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33),y)
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/zImage
ifeq ($(ARM_TRUSTED_FIRMWARE_PLATFORM),stm32mp1)
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33_CFG=$(BINARIES_DIR)/$(LINUX_DTBS)
endif
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += linux
endif
ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y)
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware