diff mbox series

[v5,2/3] boot/arm-trusted-firmware: add optional host-arm-gnu-a-toolchain dependency

Message ID 1585371871-29406-3-git-send-email-sunil@amarulasolutions.com
State Accepted
Headers show
Series Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board | expand

Commit Message

Suniel Mahesh March 28, 2020, 5:04 a.m. UTC
From: Suniel Mahesh <sunil@amarulasolutions.com>

Some ATF configurations, require a pre-built bare metal toolchain to build
some platforms which host cortex-m series core, for instance rockchip rk3399
has a cortex-m0 core. Without a pre-built bare metal toolchain, the build fails:

make[3]: arm-none-eabi-gcc: Command not found

To solve this, this commit implements a
    BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN option. Platforms which
    have such requirement should enable this config option.

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
Changes for v5:
- As suggested by Thomas Pettazoni, introduced BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN
  option. Changed the title and description of the patch.

Changes for v4:
- no change

Changes for v3:
- no change

Changes for v2:
- no changes
---
 boot/arm-trusted-firmware/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Thomas Petazzoni March 29, 2020, 1:16 p.m. UTC | #1
On Sat, 28 Mar 2020 10:34:30 +0530
sunil@amarulasolutions.com wrote:

> +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN
> +	bool "Needs arm32 bare metal toolchain"

Reworded to:

	bool "Needs arm-none-eabi toolchain"

> +	select BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN

I've dropped this line since this option has been removed. However,
I've added:

        depends on BR2_HOSTARCH = "x86_64"

because the pre-built toolchain is only available for x86_64 host
machines.

> +        help
> +          Select this option if your ATF board configuration
> +          requires ARM32-A bare metal toolchain to be available.

Indentation was not correct here: again, "make check-package" would
have told you.

But there was one more important thing that was forgotten: adding
host-arm-gnu-a-toolchain to ATF_DEPENDENCIES, to ensure the toolchain
is installed before ATF is built. So I've added:

ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN),y)
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain
endif

in arm-trusted-firmware.mk

Thanks!

Thomas
diff mbox series

Patch

diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
index 737dc58..15d689a 100644
--- a/boot/arm-trusted-firmware/Config.in
+++ b/boot/arm-trusted-firmware/Config.in
@@ -167,4 +167,10 @@  config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC
 	  Select this option if your ATF board configuration
 	  requires the Device Tree compiler to be available.
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN
+	bool "Needs arm32 bare metal toolchain"
+	select BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN
+        help
+          Select this option if your ATF board configuration
+          requires ARM32-A bare metal toolchain to be available.
 endif