arm-trusted-firmware: add BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 3 Dec 2017 21:48:05 +0000 (22:48 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 8 Dec 2017 11:15:00 +0000 (12:15 +0100)
ATF can be used in different ways:

 - ATF encapsulates U-Boot as the BL33, which is what is done on ARM
   Juno (currently supported in Buildroot) and Marvell platforms (soon
   to be supported)

 - U-Boot encapsulates ATF's BL31, which is what is done on Allwinner
   ARM64 platforms.

Until now we were assumming the former was always the case, but
obviously it isn't. Therefore, this patch adds an option that allows
to explicitly tell ATF that it encapsulates U-Boot as its BL33.

We adapt the only defconfig that uses ATF so that it enables this
option as appropriate.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
boot/arm-trusted-firmware/Config.in
boot/arm-trusted-firmware/arm-trusted-firmware.mk
configs/arm_juno_defconfig

index 05600461a598c985af26f47382eff4c999eae62e..b8b926982ed442276fd27c45f41545e3bc2f466d 100644 (file)
@@ -64,6 +64,15 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
          platforms were ATF encapsulates the second stage bootloader
          (such as U-Boot).
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
+       bool "Use U-Boot as BL33"
+       depends on BR2_TARGET_UBOOT
+       help
+         This option allows to embed u-boot.bin as the BL33 part of
+         the ARM Trusted Firmware. It ensures that the u-boot package
+         gets built before ATF, and that the appropriate BL33
+         variable pointing to u-boot.bin is passed when building ATF.
+
 config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES
        string "Additional ATF build variables"
        help
index bdffb1dbe4c6f791c4d817c829835d4fb4cc28aa..3731829d5d6b61f3afbd9035ff64d010ec7311dc 100644 (file)
@@ -8,8 +8,6 @@ ARM_TRUSTED_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_V
 ARM_TRUSTED_FIRMWARE_LICENSE = BSD-3-Clause
 ARM_TRUSTED_FIRMWARE_LICENSE_FILES = license.rst
 
-ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
-
 ifeq ($(ARM_TRUSTED_FIRMWARE_VERSION),custom)
 # Handle custom ATF tarballs as specified by the configuration
 ARM_TRUSTED_FIRMWARE_TARBALL = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION))
@@ -30,10 +28,14 @@ ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_
 
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
        CROSS_COMPILE="$(TARGET_CROSS)" \
-       BL33=$(BINARIES_DIR)/u-boot.bin \
        $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \
        PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM)
 
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot.bin
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
+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
index 1fb5587488e47c2bd7769de4a95be8dca9295c43..54506d806194b7e5fc3614b0e531ad518f8de1b6 100644 (file)
@@ -15,6 +15,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.2"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="juno"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="vexpress_aemv8a_juno"
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y