From 6103d9b5971c61c897ea43e11ee8559c0df04832 Mon Sep 17 00:00:00 2001 From: Xuanhao Shi Date: Fri, 22 Jul 2022 09:33:41 -0500 Subject: [PATCH] boot/arm-trusted-firmware: add target board options Some platforms such as TI's k3 outputs a TARGET_BOARD directory in their ATF build output paths after PLATFORM. $(@D)/build// does not contain the debug or release directories for these platforms. They are under $(@D)/build/// Signed-off-by: Xuanhao Shi Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- boot/arm-trusted-firmware/Config.in | 6 ++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index b1fc03e10b..c6c138420f 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -68,6 +68,12 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM help Target plaform to build for. +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD + string "ATF target board" + help + Target board to build for. In many cases, this can be left + empty. + config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH string "Device Tree Source file paths" help diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 998de4b814..30ecb187ae 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -41,18 +41,29 @@ endif ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)) +ARM_TRUSTED_FIRMWARE_TARGET_BOARD = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD)) + ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG),y) ARM_TRUSTED_FIRMWARE_MAKE_OPTS += DEBUG=1 +ifneq ($(ARM_TRUSTED_FIRMWARE_TARGET_BOARD),) +ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD)/debug +else ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/debug +endif +else +ifneq ($(ARM_TRUSTED_FIRMWARE_TARGET_BOARD),) +ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD)/release else ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release endif +endif ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \ $(if $(BR2_PIC_PIE),CFLAGS="-fno-PIE") \ $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \ - PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) + PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) \ + TARGET_BOARD=$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD) ARM_TRUSTED_FIRMWARE_MAKE_ENV += \ $(TARGET_MAKE_ENV) \