boot/arm-trusted-firmware: Add out-of-source ATF device tree support
authorKory Maincent <kory.maincent@bootlin.com>
Fri, 9 Jul 2021 09:49:25 +0000 (11:49 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 19 Aug 2021 21:27:32 +0000 (23:27 +0200)
Similarly to Uboot, this patch adds the ability to copy in and build
out-of-source device tree sources during an ATF build.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
boot/arm-trusted-firmware/Config.in
boot/arm-trusted-firmware/arm-trusted-firmware.mk

index 7e46a1027046002d6230948c5f1002336d0d5697..20a121c2fc5c89de45f97e49a070d5147ca4f8fc 100644 (file)
@@ -68,6 +68,15 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM
        help
          Target plaform to build for.
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH
+       string "Device Tree Source file paths"
+       help
+         Space-separated list of paths to device tree source files
+         that will be copied to fdts/ before starting the build.
+
+         To use this device tree source file, the ATF configuration
+         file must refer to it.
+
 config BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
        bool "Build FIP image"
        help
index 1f08f5dabb6c401aff81dd112633803827f5a862..d1eb72e7ae97950bf8339fbeb5ecd8042f32873e 100644 (file)
@@ -162,7 +162,12 @@ endif
 ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += \
        $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_TARGETS))
 
+ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH))
+
 define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
+       $(if $(ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH),
+               cp -f $(ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH) $(@D)/fdts/
+       )
        $(ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL)
        $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
                $(ARM_TRUSTED_FIRMWARE_MAKE_TARGETS)