boot/arm-trusted-firmware: support debug mode
authorEtienne Carriere <etienne.carriere@linaro.org>
Mon, 18 Mar 2019 23:21:04 +0000 (00:21 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 20 Mar 2019 21:57:12 +0000 (22:57 +0100)
When the trusted firmware is built with debug support (DEBUG defined),
the generated images are located in a different path compared to a
build without debug support. The non debug images are located in
generated directory build/<platform>/release/ while the debug images
are located in generated directory build/<platform>/debug/.

This change introduces the boolean option
BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG to define whether the release or
debug configuration is used to build trusted firmware.

Note that enabling trusted firmware debug support using
BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="... DEBUG=1 ..."
would not work since Buildroot will try to copy the generated files
from the wrong path.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
boot/arm-trusted-firmware/Config.in
boot/arm-trusted-firmware/arm-trusted-firmware.mk

index 92cd6e56428b8722e31318534155472a77a5959f..beb95fbf063aaee21ff57e2a491043365815518d 100644 (file)
@@ -130,4 +130,9 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES
          Additional parameters for the ATF build
          E.G. 'DEBUG=1 LOG_LEVEL=20'
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG
+       bool "Build in debug mode"
+       help
+         Enable this option to build ATF with DEBUG=1.
+
 endif
index f35e91eefe8db44ad8caf58f0929974e938fe277..9a23e3d3366b54829071cb86b3c9952eb6e3e025 100644 (file)
@@ -28,7 +28,13 @@ endif
 ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES
 
 ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM))
+
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += DEBUG=1
+ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/debug
+else
 ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release
+endif
 
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
        CROSS_COMPILE="$(TARGET_CROSS)" \