Skip to contentSkip to conversation

Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board

PATCH Superseded sunil at amarulasolutions.com 5 participants 25 messages Feb 13, 2020 – Mar 20, 2020

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 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 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.
---
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'

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             | 48 ++++++++++++++++++++
 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, 172 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 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/arm-gnu-a-toolchain.hash
 create mode 100644 package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 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.

Cc linux-amarula at amarulasolutions.com

---
Changes for v2:
- added Cc tag.

---
 boot/arm-trusted-firmware/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/arm-trusted-firmware/Config.in +1 -1
index 373591d..0006931 100644
@@ -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
#2 lore raw

v3 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 rk3399 support for building ATF.
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 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'

Jagan Teki (1):
boot/arm-trusted-firmware: Disable bin copy for rk3399

Suniel Mahesh (4):
package/arm-gnu-a-toolchain: new package boot/arm-trusted-firmware: add support for rockchip rk3399 configs/roc-rk3399-pc: new defconfig
DEVELOPERS: add me as a co-maintainer for rk3399 based targets

 .gitlab-ci.yml                                     |  1 +
 DEVELOPERS                                         |  3 ++
 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/arm-trusted-firmware.mk  | 10 +++-
 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 +++++++++++
 10 files changed, 174 insertions(+), 2 deletions(-)
 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/arm-gnu-a-toolchain.hash
 create mode 100644 package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
Signature · 1 line
2.7.4
#3 lore raw

PATCH v3 1/5 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."

Buildroot generally looks for a *.bin in the TF-A build directory but v2.2 is not creating any bin since rk3399 (or rockchip) doesn't need bins, because of which build fails.

This changeset checks for a *.bin in the respective TF-A build directory, if available it copies to the output directory, otherwise skips copy.

This fixes the atf build on rk3399 with v2.2 and above.

Note: the same can be applied to rest of rockchip platforms if they use v2.2 TF-A and above.

Cc linux-amarula at amarulasolutions.com

---
Changes for v3:
- 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.
- Tested on roc-rk3399-pc, a rk3399 based target. Compile tested for orangepi

Changes for v2:
- added Cc tag.

 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4 -2
index 3473701..7722954 100644
@@ -150,9 +150,11 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
 endef
 
 define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
+if [ -e $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin ]; then \
 	$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \
-		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/
-	)
+		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ \
+	) ; \
+fi
 	$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL)
 	$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF)
 endef
Signature · 1 line
2.7.4
#4 lore raw

PATCH v3 2/5 package/arm-gnu-a-toolchain: new package

In reply to sunil at amarulasolutions.com

From: Suniel Mahesh <[email protected]>

arm trusted firmware requires a bare metal toolchain to build Rockchip rk3399 platform and rk3399 has a cortex-m0 core. 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.

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

---
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

 .../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
new file mode 100644
index 0000000..aa0a23a
@@ -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
new file mode 100644
index 0000000..55dce4d
@@ -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
#5 lore raw

PATCH v3 3/5 boot/arm-trusted-firmware: add support for rockchip rk3399

In reply to sunil at amarulasolutions.com

From: Suniel Mahesh <[email protected]>

Add support for TF-A image builds for Rockchip rk3399 chip.

---
Changes for v3:
- no change

Changes for v2:
- no changes

 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
 1 file changed, 4 insertions(+)
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4 -0
index 7722954..3002f5f 100644
@@ -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
#6 lore raw

PATCH v3 4/5 configs/roc-rk3399-pc: new defconfig

In reply to sunil at amarulasolutions.com

From: 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 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 +
 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           | 53 +++++++++++++++++++++++++++++++
 6 files changed, 133 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
index 4b84a5b..d9519c3 100644
@@ -302,6 +302,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 }
board/firefly/roc-rk3399-pc/extlinux.conf new file +4 -0
new file mode 100644
index 0000000..50a358f
@@ -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
new file mode 100644
index 0000000..966c869
@@ -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
new file mode 100755
index 0000000..1f5ff6a
@@ -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 +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.7.4
#7 lore raw

PATCH v3 5/5 DEVELOPERS: add me as a co-maintainer for rk3399 based targets

In reply to sunil at amarulasolutions.com

From: Suniel Mahesh <[email protected]>

---
Changes for v3:
New patch added to this series. Split one changeset from patch #4 and made it patch #5

Changes for v2:
didn't exist

 DEVELOPERS | 3 +++
 1 file changed, 3 insertions(+)
DEVELOPERS +3 -0
index 98220a9..faa72a4 100644
@@ -1114,6 +1114,7 @@ N:	Ismael Luceno <[email protected]>
 F:	package/axel/
 
 N:	Jagan Teki <[email protected]>
+N:	Suniel Mahesh <[email protected]>
 F:	board/amarula/
 F:	board/asus/
 F:	board/bananapi/
@@ -1129,6 +1130,7 @@ F:	board/orangepi/orangepi-prime/
 F:	board/orangepi/orangepi-win/
 F:	board/orangepi/orangepi-zero-plus2/
 F:	board/pine64/
+F:	board/firefly/
 F:	configs/amarula_a64_relic_defconfig
 F:	configs/amarula_vyasa_rk3288_defconfig
 F:	configs/asus_tinker_rk3288_defconfig
@@ -1151,6 +1153,7 @@ F:	configs/orangepi_win_defconfig
 F:	configs/orangepi_zero_plus2_defconfig
 F:	configs/pine64_defconfig
 F:	configs/pine64_sopine_defconfig
+F:	configs/roc_pc_rk3399_defconfig
 
 N:	James Hilliard <[email protected]>
 F:	package/gensio/
Signature · 1 line
2.7.4
#8 lore raw

PATCH v3 5/5 DEVELOPERS: add me as a co-maintainer for rk3399 based targets

Hi Sunil,

Am Mi., 18. M?rz 2020 um 14:46 Uhr schrieb <[email protected]>:

Quoted 20 lines

From: Suniel Mahesh <[email protected]>

---
Changes for v3:
New patch added to this series. Split one changeset from patch #4 and made it patch #5

Changes for v2:
didn't exist

 DEVELOPERS | 3 +++
 1 file changed, 3 insertions(+)
DEVELOPERS +0 -0
index 98220a9..faa72a4 100644

DEVELOPERS N: Ismael Luceno <[email protected]> · line 1117

Quoted 4 lines
DEVELOPERS +1 -0
@@ -1114,6 +1114,7 @@ N:        Ismael Luceno <[email protected]>
 F:     package/axel/
 
 N:     Jagan Teki <[email protected]>
+N:     Suniel Mahesh <[email protected]>

I think what you're are doing here will not work. You have to have your own list of supported files or pathes. And put your name at the right position in the DEVELOPERS file (alphabetically sorted).

Quoted 26 lines
DEVELOPERS +2 -1
 F:     board/amarula/
 F:     board/asus/
 F:     board/bananapi/
@@ -1129,6 +1130,7 @@ F:        board/orangepi/orangepi-prime/
 F:     board/orangepi/orangepi-win/
 F:     board/orangepi/orangepi-zero-plus2/
 F:     board/pine64/
+F:     board/firefly/
 F:     configs/amarula_a64_relic_defconfig
 F:     configs/amarula_vyasa_rk3288_defconfig
 F:     configs/asus_tinker_rk3288_defconfig
@@ -1151,6 +1153,7 @@ F:        configs/orangepi_win_defconfig
 F:     configs/orangepi_zero_plus2_defconfig
 F:     configs/pine64_defconfig
 F:     configs/pine64_sopine_defconfig
+F:     configs/roc_pc_rk3399_defconfig
 
 N:     James Hilliard <[email protected]>
 F:     package/gensio/
--

2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 1 line
Heiko
#9 lore raw

PATCH v3 5/5 DEVELOPERS: add me as a co-maintainer for rk3399 based targets

Hi Heiko,

Quoted 26 lines · Heiko Thiery

Hi Sunil,

Am Mi., 18. M?rz 2020 um 14:46 Uhr schrieb <[email protected]>:

Quoted 22 lines

From: Suniel Mahesh <[email protected]>

---
Changes for v3:
New patch added to this series. Split one changeset from patch #4 and made it patch #5

Changes for v2:
didn't exist

 DEVELOPERS | 3 +++
 1 file changed, 3 insertions(+)
DEVELOPERS +0 -0
index 98220a9..faa72a4 100644
@@ -1114,6 +1114,7 @@ N:        Ismael Luceno <[email protected]>
 F:     package/axel/
 
Quoted 6 lines

DEVELOPERS N: Ismael Luceno <[email protected]> · line 1117

Quoted 2 lines
DEVELOPERS +1 -0
 N:     Jagan Teki <[email protected]>
+N:     Suniel Mahesh <[email protected]>

I think what you're are doing here will not work. You have to have your own list of supported files or pathes. And put your name at the right position in the DEVELOPERS file (alphabetically sorted).

Doesn't it have a possibility of co-developer concept in buildroot like we do have linux maintainers file? I feel it makes sense to have it or the goal of this DEVELOPERS file seems different as what we think?

Jagan.

#10 lore raw

PATCH v3 5/5 DEVELOPERS: add me as a co-maintainer for rk3399 based targets

Hi,

Jagan Teki <[email protected]> schrieb am Mi., 18. M?rz 2020, 18:07:

Quoted 38 lines

Hi Heiko,

Quoted 11 lines · Heiko Thiery

Hi Sunil,

Am Mi., 18. M?rz 2020 um 14:46 Uhr schrieb <[email protected]>:

Quoted 7 lines

From: Suniel Mahesh <[email protected]>

---
Changes for v3:
New patch added to this series. Split one changeset from patch #4 and

made

Quoted 15 lines
Quoted 15 lines

it patch #5

Changes for v2:
didn't exist

 DEVELOPERS | 3 +++
 1 file changed, 3 insertions(+)
DEVELOPERS +0 -0
index 98220a9..faa72a4 100644
@@ -1114,6 +1114,7 @@ N:        Ismael Luceno <[email protected]>
 F:     package/axel/
 
Quoted 6 lines

DEVELOPERS N: Ismael Luceno <[email protected]> · line 1117

Quoted 2 lines
DEVELOPERS +1 -0
 N:     Jagan Teki <[email protected]>
+N:     Suniel Mahesh <[email protected]>

I think what you're are doing here will not work. You have to have your own list of supported files or pathes. And put your name at the right position in the DEVELOPERS file (alphabetically sorted).

Quoted 7 lines

Doesn't it have a possibility of co-developer concept in buildroot like we do have linux maintainers file? I feel it makes sense to have it or the goal of this DEVELOPERS file seems different as what we think?

Jagan.

I'm not sure and I will check that.

Signature · 1 line
Heiko
Quoted 1 line

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200318/ce94d77a/attachment.html>

#11 lore raw

PATCH v3 5/5 DEVELOPERS: add me as a co-maintainer for rk3399 based targets

In reply to Jagan Teki

Hello Jagan,

Quoted 4 lines · On Wed, 18 Mar 2020 22:37:30 +0530 Jagan Teki <[email protected]>…

Doesn't it have a possibility of co-developer concept in buildroot like we do have linux maintainers file? I feel it makes sense to have it or the goal of this DEVELOPERS file seems different as what we think?

The Linux MAINTAINERS file and the Buildroot DEVELOPERS are organized differently.

The Linux MAINTAINERS file is organized by topic/subsystem, and gives for this subsystem the list of persons in charge of it.

The Buildroot DEVELOPERS is organized by person, and gives for each person the list of packages/defconfigs/areas this person is interested in.

It is unlikely that two different developers will have exactly the same set of packages/defconfigs/areas they are interested in, so we don't support having multiple name/e-mail in front of a single list of packages/defconfigs. In addition, that would break the alphabetic ordering of the file.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#12 lore raw

v4 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 rk3399 support for building ATF.
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 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'

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                                         |  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/arm-trusted-firmware.mk  | 10 +++-
 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 +++++++++++
 10 files changed, 176 insertions(+), 2 deletions(-)
 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/arm-gnu-a-toolchain.hash
 create mode 100644 package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
Signature · 1 line
2.7.4
#13 lore raw

PATCH v4 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."

Buildroot generally looks for a *.bin in the TF-A build directory but v2.2 is not creating any bin since rk3399 (or rockchip) doesn't need bins, because of which build fails.

This changeset checks for a *.bin in the respective TF-A build directory, if available it copies to the output directory, otherwise skips copy.

This fixes the atf build on rk3399 with v2.2 and above.

Note: the same can be applied to rest of rockchip platforms if they use v2.2 TF-A and above.

Cc linux-amarula at amarulasolutions.com

---
Changes for v4:
- no changes

Changes for v3:
- 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.
- Tested on roc-rk3399-pc, a rk3399 based target. Compile tested for orangepi

Changes for v2:
- added Cc tag.

 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4 -2
index 3473701..7722954 100644
@@ -150,9 +150,11 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
 endef
 
 define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
+if [ -e $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin ]; then \
 	$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \
-		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/
-	)
+		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ \
+	) ; \
+fi
 	$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL)
 	$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF)
 endef
Signature · 1 line
2.7.4
#14 lore raw

PATCH v4 1/4 boot/arm-trusted-firmware: Disable bin copy for rk3399

Hello Sunil,

boot/arm-trusted-firmware/arm-trusted-firmware.mk define ARM_TRUSTED_FIRMWARE_BUILD_CMDS · line 157

Quoted 8 lines · On Thu, 19 Mar 2020 16:16:49 +0530 sunil at amarulasolutions.com wrote:

define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS

boot/arm-trusted-firmware/arm-trusted-firmware.mk +4 -2
+if [ -e $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin ]; then \
 	$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \
-		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/
-	)
+		cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ \
+	) ; \
+fi

I'm sorry, but this is still not good. First, why checking for *.bin ? The value of $(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES) can be something else ?

In your case, the solution is simple: define BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES to the empty value in your defconfig. This loop will then install nothing, which is what you want.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#15 lore raw

PATCH v4 2/4 package/arm-gnu-a-toolchain: new package

In reply to sunil at amarulasolutions.com

From: Suniel Mahesh <[email protected]>

arm trusted firmware requires a bare metal toolchain to build Rockchip rk3399 platform and rk3399 has a cortex-m0 core. 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.

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

---
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 +++
 .../arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash   |  3 +++
 package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk | 27 ++++++++++++++++++++++
 3 files changed, 33 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
DEVELOPERS +3 -0
index 98220a9..a90ad78 100644
@@ -2370,6 +2370,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/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash new file +3 -0
new file mode 100644
index 0000000..aa0a23a
@@ -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
new file mode 100644
index 0000000..55dce4d
@@ -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
#16 lore raw

PATCH v4 3/4 boot/arm-trusted-firmware: add support for rockchip rk3399

In reply to sunil at amarulasolutions.com

From: Suniel Mahesh <[email protected]>

Add support for TF-A image builds for Rockchip rk3399 chip.

---
Changes for v4:
- no change

Changes for v3:
- no change

Changes for v2:
- no changes

 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
 1 file changed, 4 insertions(+)
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4 -0
index 7722954..3002f5f 100644
@@ -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
#17 lore raw

PATCH v4 3/4 boot/arm-trusted-firmware: add support for rockchip rk3399

boot/arm-trusted-firmware/arm-trusted-firmware.mk ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR) · line 95

Quoted 3 lines · On Thu, 19 Mar 2020 16:16:51 +0530 sunil at amarulasolutions.com wrote:
boot/arm-trusted-firmware/arm-trusted-firmware.mk +3 -0
+ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)),rk3399)
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-a-toolchain
+endif

I already mentioned we don't want platform-specific conditionals like this in previous reviews of this patch series.

I think here what we want is a BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN option.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#18 lore raw

PATCH v4 4/4 configs/roc-rk3399-pc: new defconfig

In reply to sunil at amarulasolutions.com

From: 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 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           | 53 +++++++++++++++++++++++++++++++
 7 files changed, 135 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 -1
index 4b84a5b..d9519c3 100644
@@ -302,6 +302,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 }
- 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           | 53 +++++++++++++++++++++++++++++++
 7 files changed, 135 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
index 4b84a5b..d9519c3 100644
@@ -302,6 +302,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
index a90ad78..2f9982f 100644
@@ -2372,6 +2372,8 @@ F:	package/powertop/
 
 N:	Suniel Mahesh <[email protected]>
 F:	package/arm-gnu-a-toolchain
+F:	board/firefly/
+F:	configs/roc_pc_rk3399_defconfig
 
 N:	Sven Haardiek <[email protected]>
 F:	package/lcdproc/
board/firefly/roc-rk3399-pc/extlinux.conf new file +4 -0
new file mode 100644
index 0000000..50a358f
@@ -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
new file mode 100644
index 0000000..966c869
@@ -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
new file mode 100755
index 0000000..1f5ff6a
@@ -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 +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.7.4
#19 lore raw

PATCH v2 2/4 package/arm-gnu-a-toolchain: new package

In reply to sunil at amarulasolutions.com

From: Suniel Mahesh <[email protected]>

arm trusted firmware requires a bare metal toolchain to build Rockchip rk3399 platform and rk3399 has a cortex-m0 core. 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.

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

---
Changes for v2:
- Added lines in description regarding why bare metal toolchain is required, as suggested by Jagan and pointed out by Sergey

---
 .../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
new file mode 100644
index 0000000..aa0a23a
@@ -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
new file mode 100644
index 0000000..55dce4d
@@ -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
#20 lore raw

PATCH v2 2/4 package/arm-gnu-a-toolchain: new package

Am 2020-02-13 11:44, schrieb sunil at amarulasolutions.com:

Quoted 10 lines

From: Suniel Mahesh <[email protected]>

arm trusted firmware requires a bare metal toolchain to build Rockchip rk3399
platform and rk3399 has a cortex-m0 core. Add pre-built cross-compilation
ARM-A bare metal toolchain for Arm Cortex-A family processors to avoid the
following build error.

Quoted 7 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.

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

Can this be some kind of virtual package? What if I don't like a prebuild
binary, if I don't have a x86_64 buildhost or want to have another gcc version.

-michael

Quoted 66 lines

---
Changes for v2:
- Added lines in description regarding why bare metal toolchain is required,
as suggested by Jagan and pointed out by Sergey

---
 .../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 +2 -0
new file mode 100644
index 0000000..aa0a23a
@@ -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 +7 -0
new file mode 100644
index 0000000..55dce4d
@@ -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

package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +2 -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

package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +4 -0
+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

package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk new file +14 -0
+
+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))
#21 lore raw

PATCH v2 2/4 package/arm-gnu-a-toolchain: new package

Hello,

Quoted 10 lines · On Fri, 14 Feb 2020 13:32:46 +0100 Michael Walle <[email protected]> wrote:
Quoted 5 lines

pre-built bate metal ARM GNU-A toolchain installs into the host file system folder
/opt/gcc-arm-none-eabi.

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

Can this be some kind of virtual package? What if I don't like a prebuild
binary, if I don't have a x86_64 buildhost or want to have another gcc version.

We can only support a pre-built toolchain for this: our toolchain infrastructure only supports building a single toolchain, which is the toolchain targetting Linux. Here, it's only for the case where the target architecture is ARM64, *but* some firmware needs to be built for ARM32 that we need a secondary toolchain.

To solve this, in the context of Buildroot, there is not much choice besides using a pre-built toolchain for this secondary toolchain.

If you need another toolchain for some other firmware, then just create a different package for it, and use it when building your firmware.

Creating a virtual package would make things more complicated here: one can only "depends on" a virtual package, so the user would have to know that he needs to enable this toolchain package in order to be able to build ATF.

I believe what is being proposed here is the most reasonable solution we can do while keeping things simple.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#22 lore raw

PATCH v2 3/4 boot/arm-trusted-firmware: add support for rockchip rk3399

In reply to sunil at amarulasolutions.com

From: Suniel Mahesh <[email protected]>

Add support for TF-A image builds for Rockchip rk3399 chip.

---
Changes for v2:
- no changes

---
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
 1 file changed, 4 insertions(+)
boot/arm-trusted-firmware/arm-trusted-firmware.mk +4 -0
index 3473701..cc757b5 100644
@@ -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
#23 lore raw

PATCH v2 4/4 configs/roc-rk3399-pc: new defconfig

In reply to sunil at amarulasolutions.com

From: 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 v2:
- update readme.txt.
- changed file permissions to 'x' for post-build.sh.

---
 .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    | 48 ++++++++++++++++++++++++++++
 configs/roc_pc_rk3399_defconfig           | 53 +++++++++++++++++++++++++++++++
 7 files changed, 137 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
index a6436a8..8140243 100644
@@ -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
index cb13035..a60c9fd 100644
@@ -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
new file mode 100644
index 0000000..50a358f
@@ -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
new file mode 100644
index 0000000..966c869
@@ -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
new file mode 100755
index 0000000..1f5ff6a
@@ -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 +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.7.4
#24 lore raw

PATCH v2 4/4 configs/roc-rk3399-pc: new defconfig

Quoted 167 lines · On Thu, Feb 13, 2020 at 4:15 PM <[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.

---
Changes for v2:
- update readme.txt.
- changed file permissions to 'x' for post-build.sh.

---
 .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    | 48 ++++++++++++++++++++++++++++
 configs/roc_pc_rk3399_defconfig           | 53 +++++++++++++++++++++++++++++++
 7 files changed, 137 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
index a6436a8..8140243 100644
@@ -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
index cb13035..a60c9fd 100644
@@ -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
new file mode 100644
index 0000000..50a358f
@@ -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
new file mode 100644
index 0000000..966c869
@@ -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
new file mode 100755
index 0000000..1f5ff6a
@@ -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
new file mode 100644
index 0000000..ebf91c1
@@ -0,0 +1,48 @@
+Libre Computer Board ROC-RK3399-PC
+===================================
+
+ROC-RK3399-PC is highest performance platforms leveraging the popular
+Rockchip RK3399 SoC from Firefly and Libretech.
+
+Build:
+
+  $ make roc_pc_rk3399_defconfig
+  $ make
+
+Files created in output directory
+=================================
+
+output/images
+
+??? bl31.elf
+??? idbloader.img
+??? Image
+??? rk3399-roc-pc.dtb
+??? rootfs.ext2
+??? rootfs.ext4 -> rootfs.ext2
+??? rootfs.tar
+??? sdcard.img
+??? u-boot.bin
+??? u-boot.itb
+
+Creating bootable SD card:
+==========================
+
+Simply invoke (as root)
+
+sudo dd if=output/images/sdcard.img of=/dev/sdX && sync
+
+Where X is your SD card device
+
+Serial console
+--------------
+
+Baudrate for this board is 1500000
+
+
+Wiki link:
+https://wiki.amarulasolutions.com/bsp/rockchip/rk3399/roc-rk3399-pc.html
+
+--
+Suniel Mahesh <[email protected]>
+10-Feb-2020
configs/roc_pc_rk3399_defconfig new file +2 -0
new file mode 100644
index 0000000..e5a82da
@@ -0,0 +1,53 @@
+# Architecture
+BR2_aarch64=y

configs/roc_pc_rk3399_defconfig line 12

Quoted 10 lines
configs/roc_pc_rk3399_defconfig new file +10 -0
+BR2_cortex_a72_a53=y
+
+# Linux headers same as kernel, a 5.4 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y
+
+# Firmware
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v2.2"

Mainline Linux can't reboot with v2.2. ATF has some changes related pmu on master better use one of the sha1 related to rockchip. May be 11a0a46a899fcc3b1fdb214b382f3d7495d88eca

Jagan.