* [Buildroot] [PATCH 1/1] boot/arm-trusted-firmware: support debug mode
@ 2018-11-22 15:22 Etienne Carriere
2018-11-29 22:05 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Etienne Carriere @ 2018-11-22 15:22 UTC (permalink / raw)
To: buildroot
When the trusted firmware is built with debug support (DEBUG defined),
the generated images are located at a specific path. 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 boolean 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, i.e
BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="... DEBUG=1 ..."
without enabling BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG will fail since
buildroot will get generated files from the wrong path.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
boot/arm-trusted-firmware/Config.in | 7 +++++++
boot/arm-trusted-firmware/arm-trusted-firmware.mk | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
index 885d93e..6991a45 100644
--- a/boot/arm-trusted-firmware/Config.in
+++ b/boot/arm-trusted-firmware/Config.in
@@ -94,4 +94,11 @@ 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 "Debug mode of the trusted firmware"
+ default n
+ help
+ Enable this directive if trusted firmware is built in debug
+ mode.
+
endif
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 23f4936..96e8203 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -25,7 +25,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)" \
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] boot/arm-trusted-firmware: support debug mode
2018-11-22 15:22 [Buildroot] [PATCH 1/1] boot/arm-trusted-firmware: support debug mode Etienne Carriere
@ 2018-11-29 22:05 ` Thomas Petazzoni
2018-11-30 9:07 ` Etienne Carriere
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2018-11-29 22:05 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 22 Nov 2018 16:22:38 +0100, Etienne Carriere wrote:
> When the trusted firmware is built with debug support (DEBUG defined),
> the generated images are located at a specific path. 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 boolean 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, i.e
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="... DEBUG=1 ..."
> without enabling BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG will fail since
> buildroot will get generated files from the wrong path.
>
> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
What is this debug mode doing exactly ?
We already have a global BR2_ENABLE_DEBUG option to enable building
with debugging symbols. I am wondering if we should use that option as
well, or like you did, introduce a separate option. Perhaps for
something like ATF, that is very low-level and HW-specific, a separate
debug option is OK.
> +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG
> + bool "Debug mode of the trusted firmware"
> + default n
"default n" is not needed, since it's the default. Not need to resend
just for that, we can fixup when applying.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] boot/arm-trusted-firmware: support debug mode
2018-11-29 22:05 ` Thomas Petazzoni
@ 2018-11-30 9:07 ` Etienne Carriere
0 siblings, 0 replies; 3+ messages in thread
From: Etienne Carriere @ 2018-11-30 9:07 UTC (permalink / raw)
To: buildroot
On Thu, 29 Nov 2018 at 23:06, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello,
>
> On Thu, 22 Nov 2018 16:22:38 +0100, Etienne Carriere wrote:
> > When the trusted firmware is built with debug support (DEBUG defined),
> > the generated images are located at a specific path. 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 boolean 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, i.e
> > BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="... DEBUG=1 ..."
> > without enabling BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG will fail since
> > buildroot will get generated files from the wrong path.
> >
> > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
>
> What is this debug mode doing exactly ?
Hello Thomas,
This enable few debug support in ATF: disable compilation optims,
generate debug symbols, enable assertions, increase trace level.
... and it also makes the generates boot binary images be located at
a specific path (compared to when not in debug mode).
> We already have a global BR2_ENABLE_DEBUG option to enable building
> with debugging symbols. I am wondering if we should use that option as
> well, or like you did, introduce a separate option. Perhaps for
> something like ATF, that is very low-level and HW-specific, a separate
> debug option is OK.
I think this feature is quite specific to people interested in want
happens during the boot stages and/or the ATF specific runtime
services.
One may want specific ATF traces without forcing debug mode for the
whole system.
Yet I not that used the BR conventions and habits and I let you decide
whether such debug should be driven from the BR generic debug
directive or not.
I have no strong opinion on this.
> > +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG
> > + bool "Debug mode of the trusted firmware"
> > + default n
>
> "default n" is not needed, since it's the default. Not need to resend
> just for that, we can fixup when applying.
Ok. Feel free to fix straight if you agree with the other changes.
regards,
etienne
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-30 9:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-22 15:22 [Buildroot] [PATCH 1/1] boot/arm-trusted-firmware: support debug mode Etienne Carriere
2018-11-29 22:05 ` Thomas Petazzoni
2018-11-30 9:07 ` Etienne Carriere
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox