Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board
v5 cover Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board
From: Suniel Mahesh <[email protected]>
This patch set does the following:
Fix ATF v2.2 build for rk3399 SoC's.
Add arm-gnu-a-toolchain package, which acts as a secondary bare metal toolchain to build ATF for Rockchip rk3399 platform (has a cortex-m0 core). The required pre-built toolchain is taken from ARM developers site and installed in host filesystem only. Add config options for building ATF, targets must enable these configs based on their requirements in board defconfig.
Add new defconfig file for roc-rk3399-pc.
Update DEVELOPERS file.
The patch set is tested on roc-rk3399-pc, a rk3399 based target. Compile tested on orangepi.
---
Changes for v5:
- Dropped patch #1(Disable bin copy for rk3399), as it is no longer needed.
- Based on suggestions from thomas pettazzoni and Sergey, instead of encoding platform-specific stuff in config files, introduced new config options which need to be enabled in board defconfig as per requirement.
- patch #2(new package) is now patch #1
- patch #3(add support for rockchip rk3399), title and description is changed and is now patch #2
- patch #4(new defconfig) is now patch #3
Changes for v4:
- As per suggestions from Heiko Thiery and Thomas Pettazoni, changed DEVELOPERS file accordingly.
- Updated Developers file accordingly whenever a new package(patch #2) or target is added(patch #4).
- dropped patch #5, as it is no longer needed.
- Its a four patch series like earlier v2 and v1.
Changes for v3:
Added one patch to this series. Split one changeset from patch #4 and made it patch #5
patch #1 (Disable bin copy for rk3399)
- Based on suggestions from sergey and thomas, instead of encoding platform-specific stuff in config files, made changes in .mk files based on the build flow.
patch #2 (new package)
- no change
patch #3 (add support for rockchip rk3399)
- no change
patch #4 (new defconfig)
- dropped DEVELOPERS file
patch #5 (Add me as a co-maintainer)
- seperated this changeset
Changes for v2:
Changed cover letter description to add more meaning.
patch #1 (Disable bin copy for rk3399)
- Added Cc tag
patch #2 (new package)
- More Description added to justify why a secondary bare metal toolchain is required patch #3 (add support for rockchip rk3399)
- no change
patch #4 (new defconfig)
- updated readme.txt to help with the build/boot process
- modified file permissions of post-build.sh to 'x'
Suniel Mahesh (3):
package/arm-gnu-a-toolchain: new package boot/arm-trusted-firmware: add optional host-arm-gnu-a-toolchain
dependency
configs/roc-rk3399-pc: new defconfig
.gitlab-ci.yml | 1 + DEVELOPERS | 5 ++ board/firefly/roc-rk3399-pc/extlinux.conf | 4 ++ board/firefly/roc-rk3399-pc/genimage.cfg | 22 +++++++++ board/firefly/roc-rk3399-pc/post-build.sh | 5 ++ board/firefly/roc-rk3399-pc/readme.txt | 48 +++++++++++++++++++ boot/arm-trusted-firmware/Config.in | 6 +++ configs/roc_pc_rk3399_defconfig | 56 ++++++++++++++++++++++ package/Config.in.host | 1 + package/arm-gnu-a-toolchain/Config.in.host | 9 ++++ .../arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash | 2 + package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk | 27 +++++++++++ 12 files changed, 186 insertions(+) create mode 100644 board/firefly/roc-rk3399-pc/extlinux.conf create mode 100644 board/firefly/roc-rk3399-pc/genimage.cfg create mode 100755 board/firefly/roc-rk3399-pc/post-build.sh create mode 100644 board/firefly/roc-rk3399-pc/readme.txt create mode 100644 configs/roc_pc_rk3399_defconfig create mode 100644 package/arm-gnu-a-toolchain/Config.in.host create mode 100644 package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash create mode 100644 package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
Signature · 1 line
2.7.4
PATCH v5 1/3 package/arm-gnu-a-toolchain: new package
From: Suniel Mahesh <[email protected]>
arm trusted firmware requires a bare metal toolchain to build platforms which host cortex-m series core, like Rockchip rk3399 which has a cortex-m0 core. Add pre-built cross-compilation ARM-A bare metal toolchain to avoid the following build error.
make[3]: arm-none-eabi-gcc: Command not found
pre-built bate metal ARM GNU-A toolchain installs into the host file system folder /opt/gcc-arm-none-eabi.
---
Changes for v5:
- Introduced a BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN config option based on discussions from Thomas Pettazzoni
- Added to package/Config.in.host
Changes for v4:
- Upated DEVELOPERS file as suggested by Heiko Thiery and Thomas Pettazoni
Changes for v3:
- no change
Changes for v2:
- Added lines in description regarding why bare metal toolchain is required, as suggested by Jagan and pointed out by Sergey
--- DEVELOPERS | 3 +++ package/Config.in.host | 1 + package/arm-gnu-a-toolchain/Config.in.host | 9 ++++++++ .../arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash | 2 ++ package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk | 27 ++++++++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 package/arm-gnu-a-toolchain/Config.in.host create mode 100644 package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash create mode 100644 package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
DEVELOPERS +3 -0
@@ -2389,6 +2389,9 @@ N: Steven Noonan <[email protected]> F: package/hwloc/ F: package/powertop/ +N: Suniel Mahesh <[email protected]> +F: package/arm-gnu-a-toolchain + N: Sven Haardiek <[email protected]> F: package/lcdproc/ F: package/python-influxdb/
package/Config.in.host +1 -0
@@ -2,6 +2,7 @@ menu "Host utilities" source "package/aespipe/Config.in.host" source "package/android-tools/Config.in.host" + source "package/arm-gnu-a-toolchain/Config.in.host" source "package/btrfs-progs/Config.in.host" source "package/cargo/Config.in.host" source "package/cbootimage/Config.in.host"
package/arm-gnu-a-toolchain/Config.in.host new file +9 -0
@@ -0,0 +1,9 @@ +config BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN + bool "host arm-gnu-a-toolchain" + help + arm trusted firmware requires a bare metal toolchain to build some platforms + which host cortex-m series core, for instance rockchip rk3399 has a cortex-m0 core. + This package installs a pre-built cross-compilation ARM-A bare metal toolchain for + the host machine. + + https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-eabi.tar.xz
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally calculated +sha256 ac952d89ae0fc3543e81099e7d34917efc621f5def112eee843fd1ce755eca8c gcc-arm-9.2-2019.12-x86_64-arm-none-eabi.tar.xz
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +27 -0
@@ -0,0 +1,27 @@ +################################################################################ +# +# arm-gnu-a-toolchain +# +################################################################################ + +ARM_GNU_A_TOOLCHAIN_SITE = https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel +ARM_GNU_A_TOOLCHAIN_VERSION = 9.2-2019.12 +ARM_GNU_A_TOOLCHAIN_SOURCE = gcc-arm-$(ARM_GNU_A_TOOLCHAIN_VERSION)-x86_64-arm-none-eabi.tar.xz +ARM_GNU_A_TOOLCHAIN_LICENSE = GPL-3.0+ +ARM_GNU_A_TOOLCHAIN_LICENSE_FILES = + +HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR = $(HOST_DIR)/opt/gcc-arm-none-eabi + +define HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_CMDS + rm -rf $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + mkdir -p $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + cp -rf $(@D)/* $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + + cd $(HOST_DIR)/bin && \ + for i in $(HOST_DIR)/opt/gcc-arm-none-eabi/bin/*; do \ + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \ + done + +endef + +$(eval $(host-generic-package))
Signature · 1 line
2.7.4
PATCH v5 1/3 package/arm-gnu-a-toolchain: new package
Hello,
I've applied your patch, but after doing a number of changes, see below.
Quoted 3 lines · On Sat, 28 Mar 2020 10:34:29 +0530 sunil at amarulasolutions.com wrote:
DEVELOPERS | 3 +++ package/Config.in.host | 1 + package/arm-gnu-a-toolchain/Config.in.host | 9 ++++++++
I've entirely dropped the visible Config.in.host option for this package, it is merely a build dependency of ATF, so we don't need (at this point at least) a visible option.
DEVELOPERS N: Steven Noonan <[email protected]> · line 2393
Quoted 2 lines
DEVELOPERS +2
-0+N: Suniel Mahesh <[email protected]> +F: package/arm-gnu-a-toolchain
Directories end with a / in DEVELOPERS.
package/arm-gnu-a-toolchain/Config.in.host line 7
Quoted 7 lines
package/arm-gnu-a-toolchain/Config.in.host new file +7
-0+config BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN + bool "host arm-gnu-a-toolchain" + help + arm trusted firmware requires a bare metal toolchain to build some platforms + which host cortex-m series core, for instance rockchip rk3399 has a cortex-m0 core. + This package installs a pre-built cross-compilation ARM-A bare metal toolchain for + the host machine.
Lines where way too long: you forgot to run "make check-package", which would have pointed out this coding style issue. Of course, since I dropped the Config.in.host, it was not a big issue.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 7
Quoted 10 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +7
-0@@ -0,0 +1,27 @@ +################################################################################ +# +# arm-gnu-a-toolchain +# +################################################################################ + +ARM_GNU_A_TOOLCHAIN_SITE = https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel
You should have used the <pkg>_VERSION variable here instead of hardcoding 9.2-2019.12.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 11
Quoted 4 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +4
-0+ARM_GNU_A_TOOLCHAIN_VERSION = 9.2-2019.12 +ARM_GNU_A_TOOLCHAIN_SOURCE = gcc-arm-$(ARM_GNU_A_TOOLCHAIN_VERSION)-x86_64-arm-none-eabi.tar.xz +ARM_GNU_A_TOOLCHAIN_LICENSE = GPL-3.0+ +ARM_GNU_A_TOOLCHAIN_LICENSE_FILES =
I've dropped this last variable, since it's empty.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 20
Quoted 8 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +8
-0+HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR = $(HOST_DIR)/opt/gcc-arm-none-eabi + +define HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_CMDS + rm -rf $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + mkdir -p $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + cp -rf $(@D)/* $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + + cd $(HOST_DIR)/bin && \
You need to create $(HOST_DIR)/bin before cd-ing into it, as this directory may not exist.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 22
Quoted 2 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +2
-0+ for i in $(HOST_DIR)/opt/gcc-arm-none-eabi/bin/*; do \ + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
Simplified as:
cd $(HOST_DIR)/bin && \
for i in ../opt/gcc-arm-none-eabi/bin/*; do \
ln -sf $$i; \
doneI was also not sure these symlinks where really useful, it would have been possible to pass an explicit path to the toolchain when building ATF. But ok, I've kept the symlinks, we'll see how it goes.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v5 1/3 package/arm-gnu-a-toolchain: new package
Hi
Quoted 29 lines · Thomas Petazzoni
Hello,
I've applied your patch, but after doing a number of changes, see below.
Quoted 3 lines · On Sat, 28 Mar 2020 10:34:29 +0530 sunil at amarulasolutions.com wrote:
DEVELOPERS | 3 +++ package/Config.in.host | 1 + package/arm-gnu-a-toolchain/Config.in.host | 9 ++++++++I've entirely dropped the visible Config.in.host option for this package, it is merely a build dependency of ATF, so we don't need (at this point at least) a visible option.
DEVELOPERS N: Steven Noonan <[email protected]> · line 2393
Quoted 2 lines
DEVELOPERS +2
-0+N: Suniel Mahesh <[email protected]> +F: package/arm-gnu-a-toolchainDirectories end with a / in DEVELOPERS.
package/arm-gnu-a-toolchain/Config.in.host line 7
Quoted 7 lines
package/arm-gnu-a-toolchain/Config.in.host new file +7
-0+config BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN + bool "host arm-gnu-a-toolchain" + help + arm trusted firmware requires a bare metal toolchain to build some platforms + which host cortex-m series core, for instance rockchip rk3399 has a cortex-m0 core. + This package installs a pre-built cross-compilation ARM-A bare metal toolchain for + the host machine.
Quoted 3 lines
Lines where way too long: you forgot to run "make check-package", which would have pointed out this coding style issue. Of course, since I dropped the Config.in.host, it was not a big issue.
Does it mean that with this we can enable same for nanopi NEO4 (which was dropped in 8af7b11bd8a95bc41e4de46f727f3b0afde465a4) with comment:
This defconfig tries to build an ARM Trusted Firmware version that
needs an ARM32 toolchain, which is not available as the platform is an ARM64 one. The correct solution for this is to have a package in Buildroot for an ARM32 bare-metal toolchain, but this wasn't done in time for the 2019.08 release.
but when I just reverted mentioned commit NEO4 boots fine without issue. So I'm bit confused if I need to add support for NEO4 with this changes to NEO4 and resurrect it? Thanks.
Quoted 49 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 7
Quoted 11 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +7
-0@@ -0,0 +1,27 @@ +################################################################################ +# +# arm-gnu-a-toolchain +# +################################################################################ + +ARM_GNU_A_TOOLCHAIN_SITE = https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrelYou should have used the <pkg>_VERSION variable here instead of hardcoding 9.2-2019.12.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 11
Quoted 4 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +4
-0+ARM_GNU_A_TOOLCHAIN_VERSION = 9.2-2019.12 +ARM_GNU_A_TOOLCHAIN_SOURCE = gcc-arm-$(ARM_GNU_A_TOOLCHAIN_VERSION)-x86_64-arm-none-eabi.tar.xz +ARM_GNU_A_TOOLCHAIN_LICENSE = GPL-3.0+ +ARM_GNU_A_TOOLCHAIN_LICENSE_FILES =I've dropped this last variable, since it's empty.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 20
Quoted 8 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +8
-0+HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR = $(HOST_DIR)/opt/gcc-arm-none-eabi + +define HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_CMDS + rm -rf $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + mkdir -p $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + cp -rf $(@D)/* $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + + cd $(HOST_DIR)/bin && \You need to create $(HOST_DIR)/bin before cd-ing into it, as this directory may not exist.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 22
Quoted 2 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +2
-0+ for i in $(HOST_DIR)/opt/gcc-arm-none-eabi/bin/*; do \ + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \Simplified as:
cd $(HOST_DIR)/bin && \ for i in ../opt/gcc-arm-none-eabi/bin/*; do \ ln -sf $$i; \ doneI was also not sure these symlinks where really useful, it would have been possible to pass an explicit path to the toolchain when building ATF. But ok, I've kept the symlinks, we'll see how it goes.
Thanks!
Quoted 9 lines
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
BR,
marek
PATCH v5 1/3 package/arm-gnu-a-toolchain: new package
Quoted 46 lines
Hi
Quoted 29 lines · Thomas Petazzoni
Hello,
I've applied your patch, but after doing a number of changes, see below.
Quoted 3 lines · On Sat, 28 Mar 2020 10:34:29 +0530 sunil at amarulasolutions.com wrote:
DEVELOPERS | 3 +++ package/Config.in.host | 1 + package/arm-gnu-a-toolchain/Config.in.host | 9 ++++++++I've entirely dropped the visible Config.in.host option for this package, it is merely a build dependency of ATF, so we don't need (at this point at least) a visible option.
DEVELOPERS N: Steven Noonan <[email protected]> · line 2393
Quoted 2 lines
DEVELOPERS +2
-0+N: Suniel Mahesh <[email protected]> +F: package/arm-gnu-a-toolchainDirectories end with a / in DEVELOPERS.
package/arm-gnu-a-toolchain/Config.in.host line 7
Quoted 7 lines
package/arm-gnu-a-toolchain/Config.in.host new file +7
-0+config BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN + bool "host arm-gnu-a-toolchain" + help + arm trusted firmware requires a bare metal toolchain to build some platforms + which host cortex-m series core, for instance rockchip rk3399 has a cortex-m0 core. + This package installs a pre-built cross-compilation ARM-A bare metal toolchain for + the host machine.Quoted 3 lines
Lines where way too long: you forgot to run "make check-package", which would have pointed out this coding style issue. Of course, since I dropped the Config.in.host, it was not a big issue.
Does it mean that with this we can enable same for nanopi NEO4 (which was dropped in
8af7b11bd8a95bc41e4de46f727f3b0afde465a4) with comment:This defconfig tries to build an ARM Trusted Firmware version that
needs an ARM32 toolchain, which is not available as the platform is an ARM64 one. The correct solution for this is to have a package in Buildroot for an ARM32 bare-metal toolchain, but this wasn't done in time for the 2019.08 release.
Quoted 3 lines
but when I just reverted mentioned commit NEO4 boots fine without issue. So I'm bit confused if I need to add support for NEO4 with this changes to NEO4 and resurrect it? Thanks.
You mean if you revert that commit w/o any changes, NEO4 builds and boots fine ? Probably you have already installed arm32 toolchain on your build server, that is why it works fine for you.
Looking at the patches from Sunil, you have to add BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN=y into ATF section of NEO4 board defconfig.
Regards,
Sergey
PATCH v5 1/3 package/arm-gnu-a-toolchain: new package
Quoted 47 lines · Sergey Matyukevich
Quoted 47 lines
Hi
Quoted 29 lines · Thomas Petazzoni
Hello,
I've applied your patch, but after doing a number of changes, see below.
Quoted 3 lines · On Sat, 28 Mar 2020 10:34:29 +0530 sunil at amarulasolutions.com wrote:
DEVELOPERS | 3 +++ package/Config.in.host | 1 + package/arm-gnu-a-toolchain/Config.in.host | 9 ++++++++I've entirely dropped the visible Config.in.host option for this package, it is merely a build dependency of ATF, so we don't need (at this point at least) a visible option.
DEVELOPERS N: Steven Noonan <[email protected]> · line 2393
Quoted 2 lines
DEVELOPERS +2
-0+N: Suniel Mahesh <[email protected]> +F: package/arm-gnu-a-toolchainDirectories end with a / in DEVELOPERS.
package/arm-gnu-a-toolchain/Config.in.host line 7
Quoted 7 lines
package/arm-gnu-a-toolchain/Config.in.host new file +7
-0+config BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN + bool "host arm-gnu-a-toolchain" + help + arm trusted firmware requires a bare metal toolchain to build some platforms + which host cortex-m series core, for instance rockchip rk3399 has a cortex-m0 core. + This package installs a pre-built cross-compilation ARM-A bare metal toolchain for + the host machine.Quoted 3 lines
Lines where way too long: you forgot to run "make check-package", which would have pointed out this coding style issue. Of course, since I dropped the Config.in.host, it was not a big issue.
Does it mean that with this we can enable same for nanopi NEO4 (which was dropped in
8af7b11bd8a95bc41e4de46f727f3b0afde465a4) with comment:This defconfig tries to build an ARM Trusted Firmware version that
needs an ARM32 toolchain, which is not available as the platform is an ARM64 one. The correct solution for this is to have a package in Buildroot for an ARM32 bare-metal toolchain, but this wasn't done in time for the 2019.08 release.
Quoted 7 lines
Quoted 3 lines
but when I just reverted mentioned commit NEO4 boots fine without issue. So I'm bit confused if I need to add support for NEO4 with this changes to NEO4 and resurrect it? Thanks.
You mean if you revert that commit w/o any changes, NEO4 builds and boots fine ? Probably you have already installed arm32 toolchain on your build server, that is why it works fine for you.
OK taht could be an option as I have arm-none-eabi installed on my laptop and that is the reason why it works ;).
Quoted 4 lines
Looking at the patches from Sunil, you have to add BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN=y into ATF section of NEO4 board defconfig.
OK I'll revert patch which remove NEO4 board and add this option to defconfig. Thanks a lot.
Quoted 3 lines
Regards,
Sergey
BR,
marek
PATCH v5 1/3 package/arm-gnu-a-toolchain: new package
In reply to Thomas PetazzoniQuoted 4 lines · Thomas Petazzoni
Hello,
I've applied your patch, but after doing a number of changes, see below.
Thanks for all the changes and suggestions. Next time I will make sure that I do make check-package before submitting.
Suniel
Quoted 82 lines
Quoted 3 lines · On Sat, 28 Mar 2020 10:34:29 +0530 sunil at amarulasolutions.com wrote:
DEVELOPERS | 3 +++ package/Config.in.host | 1 + package/arm-gnu-a-toolchain/Config.in.host | 9 ++++++++I've entirely dropped the visible Config.in.host option for this package, it is merely a build dependency of ATF, so we don't need (at this point at least) a visible option.
DEVELOPERS N: Steven Noonan <[email protected]> · line 2393
Quoted 2 lines
DEVELOPERS +2
-0+N: Suniel Mahesh <[email protected]> +F: package/arm-gnu-a-toolchainDirectories end with a / in DEVELOPERS.
package/arm-gnu-a-toolchain/Config.in.host line 7
Quoted 7 lines
package/arm-gnu-a-toolchain/Config.in.host new file +7
-0+config BR2_PACKAGE_HOST_ARM_GNU_A_TOOLCHAIN + bool "host arm-gnu-a-toolchain" + help + arm trusted firmware requires a bare metal toolchain to build some platforms + which host cortex-m series core, for instance rockchip rk3399 has a cortex-m0 core. + This package installs a pre-built cross-compilation ARM-A bare metal toolchain for + the host machine.Lines where way too long: you forgot to run "make check-package", which would have pointed out this coding style issue. Of course, since I dropped the Config.in.host, it was not a big issue.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 7
Quoted 10 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +7
-0@@ -0,0 +1,27 @@ +################################################################################ +# +# arm-gnu-a-toolchain +# +################################################################################ + +ARM_GNU_A_TOOLCHAIN_SITE = https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrelYou should have used the <pkg>_VERSION variable here instead of hardcoding 9.2-2019.12.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 11
Quoted 4 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +4
-0+ARM_GNU_A_TOOLCHAIN_VERSION = 9.2-2019.12 +ARM_GNU_A_TOOLCHAIN_SOURCE = gcc-arm-$(ARM_GNU_A_TOOLCHAIN_VERSION)-x86_64-arm-none-eabi.tar.xz +ARM_GNU_A_TOOLCHAIN_LICENSE = GPL-3.0+ +ARM_GNU_A_TOOLCHAIN_LICENSE_FILES =I've dropped this last variable, since it's empty.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 20
Quoted 8 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +8
-0+HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR = $(HOST_DIR)/opt/gcc-arm-none-eabi + +define HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_CMDS + rm -rf $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + mkdir -p $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + cp -rf $(@D)/* $(HOST_ARM_GNU_A_TOOLCHAIN_INSTALL_DIR) + + cd $(HOST_DIR)/bin && \You need to create $(HOST_DIR)/bin before cd-ing into it, as this directory may not exist.
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk line 22
Quoted 2 lines
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +2
-0+ for i in $(HOST_DIR)/opt/gcc-arm-none-eabi/bin/*; do \ + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \Simplified as:
cd $(HOST_DIR)/bin && \ for i in ../opt/gcc-arm-none-eabi/bin/*; do \ ln -sf $$i; \ doneI was also not sure these symlinks where really useful, it would have been possible to pass an explicit path to the toolchain when building ATF. But ok, I've kept the symlinks, we'll see how it goes.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH v5 2/3 boot/arm-trusted-firmware: add optional host-arm-gnu-a-toolchain dependency
In reply to sunil at amarulasolutions.comFrom: Suniel Mahesh <[email protected]>
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.
---
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(+)
boot/arm-trusted-firmware/Config.in +6 -0
@@ -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
Signature · 1 line
2.7.4
PATCH v5 2/3 boot/arm-trusted-firmware: add optional host-arm-gnu-a-toolchain dependency
boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC · line 171
Quoted 2 lines · On Sat, 28 Mar 2020 10:34:30 +0530 sunil at amarulasolutions.com wrote:
boot/arm-trusted-firmware/Config.in +2
-0+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN + bool "Needs arm32 bare metal toolchain"
Reworded to:
bool "Needs arm-none-eabi toolchain"
boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC · line 172
Quoted 1 line
boot/arm-trusted-firmware/Config.in +1
-0+ 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.
boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC · line 175
Quoted 3 lines
boot/arm-trusted-firmware/Config.in +3
-0+ 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
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v5 3/3 configs/roc-rk3399-pc: new defconfig
In reply to sunil at amarulasolutions.comFrom: Suniel Mahesh <[email protected]>
This initial support includes:
Linux 5.4
U-Boot 2020.01
Arm Trusted Firmware v2.2
Buildroot default packages.
---
Changes for v5:
- Updated defconfig
- enabled BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN in board defconfig
- BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES is assigned an empty string in board defconfig, because rockchip platforms doesn't require a binary generation.
This binary generation is disabled in v2.2 of TF-A on below commit:
commit <33218d2a8143> "rockchip: Disable binary generation for all SoCs."
Changes for v4:
- Updated DEVELOPERS file
Changes for v3:
- dropped changes in DEVELOPERS file
Changes for v2:
- update readme.txt.
- changed file permissions to 'x' for post-build.sh.
--- .gitlab-ci.yml | 1 + DEVELOPERS | 2 ++ board/firefly/roc-rk3399-pc/extlinux.conf | 4 +++ board/firefly/roc-rk3399-pc/genimage.cfg | 22 ++++++++++++ board/firefly/roc-rk3399-pc/post-build.sh | 5 +++ board/firefly/roc-rk3399-pc/readme.txt | 48 ++++++++++++++++++++++++++ configs/roc_pc_rk3399_defconfig | 56 +++++++++++++++++++++++++++++++ 7 files changed, 138 insertions(+) create mode 100644 board/firefly/roc-rk3399-pc/extlinux.conf create mode 100644 board/firefly/roc-rk3399-pc/genimage.cfg create mode 100755 board/firefly/roc-rk3399-pc/post-build.sh create mode 100644 board/firefly/roc-rk3399-pc/readme.txt create mode 100644 configs/roc_pc_rk3399_defconfig
.gitlab-ci.yml +1 -0
@@ -303,6 +303,7 @@ raspberrypi4_64_defconfig: { extends: .defconfig } raspberrypi4_defconfig: { extends: .defconfig } raspberrypi_defconfig: { extends: .defconfig } riotboard_defconfig: { extends: .defconfig } +roc_pc_rk3399_defconfig: { extends: .defconfig } rock64_defconfig: { extends: .defconfig } roseapplepi_defconfig: { extends: .defconfig } s6lx9_microboard_defconfig: { extends: .defconfig }
DEVELOPERS +2 -0
@@ -2390,6 +2390,8 @@ F: package/hwloc/ F: package/powertop/ N: Suniel Mahesh <[email protected]> +F: board/firefly/ +F: configs/roc_pc_rk3399_defconfig F: package/arm-gnu-a-toolchain N: Sven Haardiek <[email protected]>
board/firefly/roc-rk3399-pc/extlinux.conf new file +4 -0
@@ -0,0 +1,4 @@ +label RK3399RocPC linux + kernel /boot/Image + devicetree /boot/rk3399-roc-pc.dtb + append earlycon=uart8250,mmio32,0xff1a0000 root=/dev/mmcblk0p1 rootwait
board/firefly/roc-rk3399-pc/genimage.cfg new file +22 -0
@@ -0,0 +1,22 @@ +image sdcard.img { + hdimage { + } + + partition u-boot-tpl-spl-dtb { + in-partition-table = "no" + image = "idbloader.img" + offset = 32K + } + + partition u-boot-dtb { + in-partition-table = "no" + image = "u-boot.itb" + offset = 8M + size = 30M + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + } +}
board/firefly/roc-rk3399-pc/post-build.sh new file +5 -0
@@ -0,0 +1,5 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" + +install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
board/firefly/roc-rk3399-pc/readme.txt new file +48 -0
48 lines not on this page · raw message
configs/roc_pc_rk3399_defconfig new file +56 -0
56 lines not on this page · raw message
Signature · 1 line
2.7.4
Thomas Petazzoni
AppliedPATCH v5 3/3 configs/roc-rk3399-pc: new defconfig
Hello,
Quoted 9 lines · On Sat, 28 Mar 2020 10:34:31 +0530 sunil at amarulasolutions.com wrote:
From: Suniel Mahesh <[email protected]>
This initial support includes:
Linux 5.4
U-Boot 2020.01
Arm Trusted Firmware v2.2
Buildroot default packages.Signed-off-by Suniel Mahesh <[email protected]>
Applied to master with minor tweaks, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com