Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board
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. The required pre-built toolchain is taken from ARM developers site and installed in host filesystem only.
Add rk3399 support for building ATF.
Add new defconfig file for roc-rk3399-pc.
The patch set is tested on roc-rk3399-pc, a rk3399 based target.
Jagan Teki (1):
boot/arm-trusted-firmware: Disable bin copy for rk3399
Suniel Mahesh (3):
package/arm-gnu-a-toolchain: new package boot/arm-trusted-firmware: add support for rockchip rk3399 configs/roc-rk3399-pc: new defconfig
.gitlab-ci.yml | 1 + DEVELOPERS | 4 ++ 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 | 17 +++++++ boot/arm-trusted-firmware/Config.in | 2 +- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++ configs/roc_pc_rk3399_defconfig | 53 ++++++++++++++++++++++ .../arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash | 3 ++ package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk | 27 +++++++++++ 11 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 board/firefly/roc-rk3399-pc/extlinux.conf create mode 100644 board/firefly/roc-rk3399-pc/genimage.cfg create mode 100644 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/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 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
From: Jagan Teki <[email protected]>
Unlike other SoC platforms, rockchip platforms doesn't require a binary generation on TF-A project.
This is due to rockchip platforms have non-continuous memory areas in the linker script with a huge gap between them, so generating the binary would require addition padding which indeed increases the size of the binary.
Interestingly this binary generation is disabled in v2.2 of TF-A on below commit:
commit <33218d2a8143> "rockchip: Disable binary generation for all SoCs."
So, select default binary boot images as *.bin only if it's not rk3399.
This fixes the atf build on rk3399 with v2.2.
Note: the same can be applied to rest of rockchip platforms if they use v2.2 TF-A.
--- boot/arm-trusted-firmware/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
boot/arm-trusted-firmware/Config.in +1 -1
@@ -155,7 +155,7 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG config BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES string "Binary boot images" - default "*.bin" + default "*.bin" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM!=rk3399 help Names of generated image files that are installed in the output images/ directory.
Signature · 1 line
2.7.4
PATCH 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
Hi,
Quoted 23 lines
Unlike other SoC platforms, rockchip platforms doesn't require a binary generation on TF-A project.
This is due to rockchip platforms have non-continuous memory areas in the linker script with a huge gap between them, so generating the binary would require addition padding which indeed increases the size of the binary.
Interestingly this binary generation is disabled in v2.2 of TF-A on below commit:
commit <33218d2a8143> "rockchip: Disable binary generation for all SoCs."So, select default binary boot images as *.bin only if it's not rk3399.
This fixes the atf build on rk3399 with v2.2.
Note: the same can be applied to rest of rockchip platforms if they use v2.2 TF-A.
Signed-off-by Jagan Teki <[email protected]>Tested-by Suniel Mahesh <[email protected]>--- boot/arm-trusted-firmware/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
...
boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG · line 161
Quoted 7 lines
config
BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGESboot/arm-trusted-firmware/Config.in +1
-1string "Binary boot images" - default "*.bin" + default "*.bin" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM!=rk3399 help Names of generated image files that are installed in the output images/ directory.
IIUC, it should be customized in your board defconfig.
Regards,
Sergey
PATCH 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
Quoted 37 lines · Sergey Matyukevich
Hi,
Quoted 23 lines
Unlike other SoC platforms, rockchip platforms doesn't require a binary generation on TF-A project.
This is due to rockchip platforms have non-continuous memory areas in the linker script with a huge gap between them, so generating the binary would require addition padding which indeed increases the size of the binary.
Interestingly this binary generation is disabled in v2.2 of TF-A on below commit:
commit <33218d2a8143> "rockchip: Disable binary generation for all SoCs."So, select default binary boot images as *.bin only if it's not rk3399.
This fixes the atf build on rk3399 with v2.2.
Note: the same can be applied to rest of rockchip platforms if they use v2.2 TF-A.
Signed-off-by Jagan Teki <[email protected]>Tested-by Suniel Mahesh <[email protected]>--- boot/arm-trusted-firmware/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)...
boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG · line 161
Quoted 7 lines
config
BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES
string "Binary boot images"boot/arm-trusted-firmware/Config.in +1
-1- default "*.bin" + default "*.bin" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM!=rk3399 help Names of generated image files that are installed in the output images/ directory.
Quoted 1 line
IIUC, it should be customized in your board defconfig.
Not sure of it. Technically this is how rockchip SoC behaves wrt ATF build. If we mark BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="" to all supporting boards of rockchip start with rk3399, rk3288 etc.. it ended up huge and meaningless change, IMHO.
Jagan.
PATCH 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
Quoted 8 lines · On Thu, 13 Feb 2020 13:36:53 +0530 Jagan Teki <[email protected]>…
Quoted 8 lines
Quoted 7 lines
config
BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES
string "Binary boot images"boot/arm-trusted-firmware/Config.in +1
-1- default "*.bin" + default "*.bin" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM!=rk3399 help Names of generated image files that are installed in the output images/ directory.
Quoted 6 lines
Quoted 1 line
IIUC, it should be customized in your board defconfig.
Not sure of it. Technically this is how rockchip SoC behaves wrt ATF build. If we mark BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="" to all supporting boards of rockchip start with rk3399, rk3288 etc.. it ended up huge and meaningless change, IMHO.
Sergey is right here: I don't think we want to encode platform-specific stuff like this in Kconfig files.
What is the problem if you leave this to the default of *.bin ?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
Quoted 19 lines · Thomas Petazzoni
Quoted 8 lines · On Thu, 13 Feb 2020 13:36:53 +0530 Jagan Teki <[email protected]>…
Quoted 8 lines
Quoted 7 lines
config
BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES
string "Binary boot images"boot/arm-trusted-firmware/Config.in +1
-1- default "*.bin" + default "*.bin" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM!=rk3399 help Names of generated image files that are installed in the output images/ directory.Quoted 6 lines
Quoted 1 line
IIUC, it should be customized in your board defconfig.
Not sure of it. Technically this is how rockchip SoC behaves wrt ATF build. If we mark BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="" to all supporting boards of rockchip start with rk3399, rk3288 etc.. it ended up huge and meaningless change, IMHO.
Quoted 4 lines
Sergey is right here: I don't think we want to encode platform-specific stuff like this in
Kconfigfiles.What is the problem if you leave this to the default of *.bin ?
Is looking for *.bin in build/rk3399/release/*.bin but v2.2 is not creating any bin since rk3399 (or rockchip) doesn't need bins.
.mk file change:
define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \
cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/
)Build log:
Quoted 1 line
Quoted 1 line
Quoted 1 line
arm-trusted-firmware v2.2 Installing to images directory
cp -dpf /mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin /mnt/out/images/
cp: cannot stat '/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin':
No such file or directorypackage/pkg-generic.mk:339: recipe for target '/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed' failed
make[1]: *** [/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed] Error 1
Makefile:23: recipe for target '_all' failed
make: *** [_all] Error 2
So, we have tried 3 set of changes
1. Kconfig (like in this patch)
2. *.mk check for rk3399, and v2.2 to not to execute above foreach loop
3. defined BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="" board defconfig
Out of the above 3 possibilities, option 1) seem meaningful for me. Let us know your comments?
Jagan.
PATCH 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
Quoted 18 lines · On Fri, 14 Feb 2020 12:25:37 +0530 Jagan Teki <[email protected]>…
Quoted 4 lines
Sergey is right here: I don't think we want to encode platform-specific stuff like this in
Kconfigfiles.What is the problem if you leave this to the default of *.bin ?
Is looking for *.bin in build/rk3399/release/*.bin but v2.2 is not creating any bin since rk3399 (or rockchip) doesn't need bins.
.mk file change:
define
ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \ cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ )Build log:
Quoted 1 line
Quoted 1 line
Quoted 1 line
arm-trusted-firmware v2.2 Installing to images directory
Quoted 12 lines
cp -dpf
/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin/mnt/out/images/
cp: cannot stat '/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin':
No such file or directorypackage/pkg-generic.mk:339: recipe for target '/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed' failed
make[1]: *** [/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed] Error 1
Makefile:23: recipe for target '_all' failed
make: *** [_all] Error 2
What is your image name then? You don't install any image?
One possibility is to change:
- $(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \
+ $(foreach f,$(wilard $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES))), \
But still, it would be nice to understand what is your image name. I guess I could find that out by doing a build, though :)
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
Quoted 35 lines · Thomas Petazzoni
Quoted 18 lines · On Fri, 14 Feb 2020 12:25:37 +0530 Jagan Teki <[email protected]>…
Quoted 4 lines
Sergey is right here: I don't think we want to encode platform-specific stuff like this in
Kconfigfiles.What is the problem if you leave this to the default of *.bin ?
Is looking for *.bin in build/rk3399/release/*.bin but v2.2 is not creating any bin since rk3399 (or rockchip) doesn't need bins.
.mk file change:
define
ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \ cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ )Build log:
Quoted 1 line
Quoted 1 line
Quoted 1 line
arm-trusted-firmware v2.2 Installing to images directory
Quoted 12 lines
cp -dpf
/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin/mnt/out/images/
cp: cannot stat '/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin':
No such file or directorypackage/pkg-generic.mk:339: recipe for target '/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed' failed
make[1]: *** [/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed] Error 1
Makefile:23: recipe for target '_all' failed
make: *** [_all] Error 2
Quoted 1 line
What is your image name then? You don't install any image?
As I said, the image that required for rk3399 is elf it is bl31.elf.
We have enabled BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF in defconfig on this series. elf copy is already supported in buildroot on this commit cab8bd3b46badb11e734e64747aee848c2b4282d
Jagan.
PATCH 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
In reply to Thomas PetazzoniQuoted 40 lines · Thomas Petazzoni
Quoted 18 lines · On Fri, 14 Feb 2020 12:25:37 +0530 Jagan Teki <[email protected]>…
Quoted 4 lines
Sergey is right here: I don't think we want to encode platform-specific stuff like this in
Kconfigfiles.What is the problem if you leave this to the default of *.bin ?
Is looking for *.bin in build/rk3399/release/*.bin but v2.2 is not creating any bin since rk3399 (or rockchip) doesn't need bins.
.mk file change:
define
ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \ cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ )Build log:
Quoted 1 line
Quoted 1 line
Quoted 1 line
arm-trusted-firmware v2.2 Installing to images directory
Quoted 12 lines
cp -dpf
/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin/mnt/out/images/
cp: cannot stat '/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin':
No such file or directorypackage/pkg-generic.mk:339: recipe for target '/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed' failed
make[1]: *** [/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed] Error 1
Makefile:23: recipe for target '_all' failed
make: *** [_all] Error 2What is your image name then? You don't install any image?
One possibility is to change:
Review
Quoted 2 lines
(quoted diff) +1
-1- $(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \ + $(foreach f,$(wilard $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES))), \
Yes wildcard function is working. tested with the above change in BR. Suniel
Quoted 8 lines
But still, it would be nice to understand what is your image name. I guess I could find that out by doing a build, though :)
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399
Quoted 40 lines · Sunil Kumar Mahesh
Quoted 37 lines · Thomas Petazzoni
Quoted 18 lines · On Fri, 14 Feb 2020 12:25:37 +0530 Jagan Teki <[email protected]>…
Quoted 4 lines
Sergey is right here: I don't think we want to encode platform-specific stuff like this in
Kconfigfiles.What is the problem if you leave this to the default of *.bin ?
Is looking for *.bin in build/rk3399/release/*.bin but v2.2 is not creating any bin since rk3399 (or rockchip) doesn't need bins.
.mk file change:
define
ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \ cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ )Build log:
Quoted 1 line
Quoted 1 line
Quoted 1 line
arm-trusted-firmware v2.2 Installing to images directory
Quoted 12 lines
cp -dpf
/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin/mnt/out/images/
cp: cannot stat '/mnt/out/build/arm-trusted-firmware-v2.2/build/rk3399/release/*.bin':
No such file or directorypackage/pkg-generic.mk:339: recipe for target '/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed' failed
make[1]: *** [/mnt/out/build/arm-trusted-firmware-v2.2/.stamp_images_installed] Error 1
Makefile:23: recipe for target '_all' failed
make: *** [_all] Error 2What is your image name then? You don't install any image?
Quoted 8 lines
Review
Quoted 5 lines
One possibility is to change:
(quoted diff) +1
-1- $(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \ + $(foreach f,$(wilard $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES))), \Yes wildcard function is working. tested with the above change in BR. Suniel
Sorry, my bad, need to test other targets which might depend on this changeset. will update
Suniel
Quoted 9 lines
Quoted 9 lines
But still, it would be nice to understand what is your image name. I guess I could find that out by doing a build, though :)
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 2/4 package/arm-gnu-a-toolchain: new package
In reply to sunil at amarulasolutions.comFrom: Suniel Mahesh <[email protected]>
arm trusted firmware requires a bare metal toolchain for its build. Add pre-built cross-compilation ARM-A bare metal toolchain for Arm Cortex-A family processors 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.
--- .../arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash | 3 +++ package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk | 27 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) 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
package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally calculated +#sha256 bb17109f0ee697254a5d4ae6e5e01440e3ea8f0277f2e8169bf95d07c7d5fe69 gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 +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 2/4 package/arm-gnu-a-toolchain: new package
Quoted 4 lines
arm trusted firmware requires a bare metal toolchain for its build. Add pre-built cross-compilation ARM-A bare metal toolchain for Arm Cortex-A family processors to avoid the following build error.
Quoted 9 lines
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.Signed-off-by Suniel Mahesh <[email protected]>
Hi,
Could you please clarify why a separate toolchain is required to build ATF for this platform ? Is there any specific requirements other than this particular build error ?
Regards,
Sergey
PATCH 2/4 package/arm-gnu-a-toolchain: new package
Quoted 12 lines · Sergey Matyukevich
Quoted 12 lines
arm trusted firmware requires a bare metal toolchain for its build. Add pre-built cross-compilation ARM-A bare metal toolchain for Arm Cortex-A family processors 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.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Suniel Mahesh <[email protected]>Hi,
Could you please clarify why a separate toolchain is required to build ATF for this platform ? Is there any specific requirements other than this particular build error ?
Rockchip rk3399 has cortex-m0 and these changes are build during ATF. and then environment should have arm32 cross toolchain to make it build successfully.
I think, Sunil need to write something more on this requirement on commit message.
Jagan.
PATCH 2/4 package/arm-gnu-a-toolchain: new package
Quoted 22 lines · Jagan Teki
Quoted 12 lines · Sergey Matyukevich
Quoted 12 lines
arm trusted firmware requires a bare metal toolchain for its build. Add pre-built cross-compilation ARM-A bare metal toolchain for Arm Cortex-A family processors 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.Quoted 8 lines
Quoted 2 lines
Signed-off-by Suniel Mahesh <[email protected]>Hi,
Could you please clarify why a separate toolchain is required to build ATF for this platform ? Is there any specific requirements other than this particular build error ?
Quoted 6 lines
Rockchip rk3399 has cortex-m0 and these changes are build during ATF. and then environment should have arm32 cross toolchain to make it build successfully.
I think, Sunil need to write something more on this requirement on commit message.
Well, I mean that other ATF firmwares can be built with standard buildroot toolchain. I guess this is the case for Rockchip ATF as well. You just need to specify available toolchain using environment variable or something. In the worst case, some patch modifing Makefiles in Rockchip ATF source tree is needed.
Regards,
Sergey
PATCH 2/4 package/arm-gnu-a-toolchain: new package
Quoted 28 lines · Sergey Matyukevich
Quoted 26 lines · Jagan Teki
Quoted 12 lines · Sergey Matyukevich
Quoted 12 lines
arm trusted firmware requires a bare metal toolchain for its build. Add pre-built cross-compilation ARM-A bare metal toolchain for Arm Cortex-A family processors 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.Quoted 8 lines
Quoted 2 lines
Signed-off-by Suniel Mahesh <[email protected]>Hi,
Could you please clarify why a separate toolchain is required to build ATF for this platform ? Is there any specific requirements other than this particular build error ?
Rockchip rk3399 has cortex-m0 and these changes are build during ATF. and then environment should have arm32 cross toolchain to make it build successfully.
Quoted 8 lines
Quoted 2 lines
I think, Sunil need to write something more on this requirement on commit message.
Well, I mean that other ATF firmwares can be built with standard buildroot toolchain. I guess this is the case for Rockchip ATF as well. You just need to specify available toolchain using environment variable or something. In the worst case, some patch modifing Makefiles in Rockchip ATF source tree is needed.
It is a known requirement that rockchip rk3399 AFT would require arm32 toolchain as well. For testing, if you try to build ATF manually w/o the environment has arm32 toolchain, build would fail. Since it is not supported earlier, Thomas has reverted rk3399 boards in previous release. This is something similar to "32-bit code generation for Armv8 targets" in this thread [1].
[1] http://lists.busybox.net/pipermail/buildroot/2019-February/242453.html
Jagan.
PATCH 2/4 package/arm-gnu-a-toolchain: new package
In reply to Sergey MatyukevichQuoted 31 lines · Sergey Matyukevich
Quoted 1 line · Jagan Teki
On Thu, Feb 13, 2020 at 1:04 PM Sergey Matyukevich <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
arm trusted firmware requires a bare metal toolchain for its build. Add pre-built cross-compilation ARM-A bare metal toolchain for Arm
Cortex-A
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
family processors 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
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
/opt/gcc-arm-none-eabi.Quoted 14 lines
Quoted 9 lines
Quoted 3 lines
Signed-off-by Suniel Mahesh <[email protected]>Hi,
Could you please clarify why a separate toolchain is required to build ATF for this platform ? Is there any specific requirements other than this particular build error ?
Rockchip rk3399 has cortex-m0 and these changes are build during ATF. and then environment should have arm32 cross toolchain to make it build successfully.
Quoted 9 lines
Quoted 2 lines
I think, Sunil need to write something more on this requirement on commit message.
Well, I mean that other ATF firmwares can be built with standard buildroot toolchain. I guess this is the case for Rockchip ATF as well. You just need to specify available toolchain using environment variable or something. In the worst case, some patch modifing Makefiles in Rockchip ATF source tree is needed.
One of the requirements to build ATF is to have Baremetal GNU GCC tools. This is stated in
ATF documentation (ATF/docs/getting_started/user-guide.rst - section Tools)
Suniel
Quoted 4 lines
Regards,
Sergey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200213/c7734b51/attachment.html>
PATCH 2/4 package/arm-gnu-a-toolchain: new package
Quoted 3 lines · On Thu, 13 Feb 2020 15:31:59 +0530 Sunil Kumar Mahesh…
One of the requirements to build ATF is to have Baremetal GNU GCC tools. This is stated in
ATF documentation (ATF/docs/getting_started/user-guide.rst- section Tools)
No, the problem is not to have access to baremetal GC tools. On most platforms we built ATF with a non-bare metal toolchain, and this works just fine.
What justifies adding this toolchain is that the target platform is ARM64, but ATF needs to be built bits of code for some ARM32 co-processor, and you can't build ARM32 code with an ARM64 toolchain.
Since all we need for ARM32 is to build bare-metal code, we use a bare-metal ARM32 toolchain for that. But everything else in ATF will be built by the regular non-bare-metal ARM64 toolchain built by Buildroot.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/4 package/arm-gnu-a-toolchain: new package
In reply to Sergey MatyukevichQuoted 8 lines · On Thu, 13 Feb 2020 12:20:05 +0300 Sergey Matyukevich <[email protected]>…
Quoted 8 lines
Quoted 3 lines
Could you please clarify why a separate toolchain is required to build ATF for this platform ? Is there any specific requirements other than this particular build error ?
Rockchip rk3399 has cortex-m0 and these changes are build during ATF. and then environment should have arm32 cross toolchain to make it build successfully.
Quoted 8 lines
Quoted 2 lines
I think, Sunil need to write something more on this requirement on commit message.
Well, I mean that other ATF firmwares can be built with standard buildroot toolchain. I guess this is the case for Rockchip ATF as well. You just need to specify available toolchain using environment variable or something. In the worst case, some patch modifing Makefiles in Rockchip ATF source tree is needed.
No, this is not correct. Depending on the platform, ATF may include code that runs on ARM32 co-processors, and ARM32 code cannot be built with an ARM64 toolchain.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 3/4 boot/arm-trusted-firmware: add support for rockchip rk3399
In reply to sunil at amarulasolutions.comFrom: Suniel Mahesh <[email protected]>
Add support for TF-A image builds for Rockchip rk3399 chip.
--- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++ 1 file changed, 4 insertions(+)
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4 -0
@@ -90,6 +90,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR) ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell endif +ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)),rk3399) +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain +endif + ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
Signature · 1 line
2.7.4
PATCH 3/4 boot/arm-trusted-firmware: add support for rockchip rk3399
Quoted 12 lines
Add support for TF-A image builds for Rockchip rk3399 chip.
Signed-off-by Suniel Mahesh <[email protected]>--- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++ 1 file changed, 4 insertions(+)boot/arm-trusted-firmware/arm-trusted-firmware.mk +0
-0
boot/arm-trusted-firmware/arm-trusted-firmware.mk ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR) · line 96
Quoted 7 lines
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4
-0@@ -90,6 +90,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR) ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell endif +ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)),rk3399) +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain +endif +
As per explanation by Thomas and Jagan, RK3399 ATF needs 32bit ARM toolchain. Taking into account that different vendors may re-use the same hardware blocks, it probably makes sense to describe this dependency in a more generic way, not specific to RK3399 chip.
Following the existing patterns in ATF package mk file, new ATF config option can be introduced:
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4 -0
@@ -75,6 +75,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UB ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot endif +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_32BIT_ARM_REQUIRED),y) +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain +endif + ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y)
This option BR2_TARGET_ARM_TRUSTED_FIRMWARE_32BIT_ARM_REQUIRED then can be specified in a defconfig for specific board.
Thoughts ? Comments ?
Regards,
Sergey
PATCH 3/4 boot/arm-trusted-firmware: add support for rockchip rk3399
Quoted 46 lines · Sergey Matyukevich
Quoted 13 lines
Add support for TF-A image builds for Rockchip rk3399 chip.
Signed-off-by Suniel Mahesh <[email protected]>--- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++ 1 file changed, 4 insertions(+)boot/arm-trusted-firmware/arm-trusted-firmware.mk +0
-0boot/arm-trusted-firmware/arm-trusted-firmware.mk ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR) · line 96
Quoted 7 lines
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4
-0@@ -90,6 +90,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR) ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell endif +ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)),rk3399) +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain +endif +As per explanation by Thomas and Jagan, RK3399 ATF needs 32bit ARM toolchain. Taking into account that different vendors may re-use the same hardware blocks, it probably makes sense to describe this dependency in a more generic way, not specific to RK3399 chip.
Following the existing patterns in ATF package mk file, new ATF config option can be introduced:
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4
-0@@ -75,6 +75,10 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UB ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot endif +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_32BIT_ARM_REQUIRED),y) +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain +endif + ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y)This option
BR2_TARGET_ARM_TRUSTED_FIRMWARE_32BIT_ARM_REQUIREDthen can be specified in a defconfig for specific board.
Quoted 1 line
Thoughts ? Comments ?
This will add an extra config option per board (which has such requirement). Is it an appropriate solution ?
Suniel
Quoted 3 lines
Regards,
Sergey
PATCH 4/4 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.
--- .gitlab-ci.yml | 1 + DEVELOPERS | 4 +++ 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 | 17 ++++++++++ configs/roc_pc_rk3399_defconfig | 53 +++++++++++++++++++++++++++++++ 7 files changed, 106 insertions(+) create mode 100644 board/firefly/roc-rk3399-pc/extlinux.conf create mode 100644 board/firefly/roc-rk3399-pc/genimage.cfg create mode 100644 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
@@ -301,6 +301,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 +4 -0
@@ -2342,6 +2342,10 @@ N: Steven Noonan <[email protected]> F: package/hwloc/ F: package/powertop/ +N: Suniel Mahesh <[email protected]> +F: board/firefly/ +F: configs/roc_pc_rk3399_defconfig + N: Sven Haardiek <[email protected]> F: package/lcdproc/ F: package/python-influxdb/
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 +17 -0
@@ -0,0 +1,17 @@ +Libre Computer Board ROC-RK3399-PC +=================================== + +ROC-RK3399-PC is highest performance platforms leveraging the popular +Rockchip RK3399 SoC from Firefly and Libretech. + +Wiki link: +https://wiki.amarulasolutions.com/bsp/rockchip/rk3399/roc-rk3399-pc.html + +Build: + + $ make roc_pc_rk3399_defconfig + $ make + +-- +Suniel Mahesh <[email protected]> +10-Feb-2020
configs/roc_pc_rk3399_defconfig new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 4/4 configs/roc-rk3399-pc: new defconfig
Quoted 58 lines · On Thu, Feb 13, 2020 at 11:23 AM <[email protected]> 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]>--- .gitlab-ci.yml | 1 + DEVELOPERS | 4 +++ 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 | 17 ++++++++++ configs/roc_pc_rk3399_defconfig | 53 +++++++++++++++++++++++++++++++ 7 files changed, 106 insertions(+) create mode 100644 board/firefly/roc-rk3399-pc/extlinux.conf create mode 100644 board/firefly/roc-rk3399-pc/genimage.cfg create mode 100644 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@@ -301,6 +301,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 +4
-0@@ -2342,6 +2342,10 @@ N: Steven Noonan <[email protected]> F: package/hwloc/ F: package/powertop/ +N: Suniel Mahesh <[email protected]> +F: board/firefly/ +F: configs/roc_pc_rk3399_defconfig + N: Sven Haardiek <[email protected]> F: package/lcdproc/ F: package/python-influxdb/board/firefly/roc-rk3399-pc/extlinux.conf new file +0
-0
board/firefly/roc-rk3399-pc/extlinux.conf line 1
Quoted 1 line
board/firefly/roc-rk3399-pc/extlinux.conf new file +1
-0@@ -0,0 +1,4 @@ +label RK3399RocPC linux
s/RK3399RocPC/ROC-RK3399-PC
Quoted 52 lines
board/firefly/roc-rk3399-pc/extlinux.conf new file +3
-0+ kernel /boot/Image + devicetree /boot/rk3399-roc-pc.dtb + append earlycon=uart8250,mmio32,0xff1a0000 root=/dev/mmcblk0p1 rootwaitboard/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.confboard/firefly/roc-rk3399-pc/readme.txt new file +4
-0@@ -0,0 +1,17 @@ +Libre Computer Board ROC-RK3399-PC +=================================== + +ROC-RK3399-PC is highest performance platforms leveraging the popular
board/firefly/roc-rk3399-pc/readme.txt line 14
Quoted 10 lines
board/firefly/roc-rk3399-pc/readme.txt new file +10
-0+Rockchip RK3399 SoC from Firefly and Libretech. + +Wiki link: +https://wiki.amarulasolutions.com/bsp/rockchip/rk3399/roc-rk3399-pc.html + +Build: + + $ make roc_pc_rk3399_defconfig + $ make +
Add information about how to program the image?
Jagan.