All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board
@ 2020-02-13 10:44 sunil at amarulasolutions.com
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-02-13 10:44 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

-- 
2.7.4

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399
  2020-02-13 10:44 [Buildroot] [PATCH v2 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
@ 2020-02-13 10:44 ` sunil at amarulasolutions.com
  2020-03-18 13:45   ` [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-02-13 10:44 UTC (permalink / raw)
  To: buildroot

From: Jagan Teki <jagan@amarulasolutions.com>

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 <jagan@amarulasolutions.com>
Cc: linux-amarula at amarulasolutions.com
Tested-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
Changes for v2:
- added Cc tag.
---
 boot/arm-trusted-firmware/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
index 373591d..0006931 100644
--- a/boot/arm-trusted-firmware/Config.in
+++ b/boot/arm-trusted-firmware/Config.in
@@ -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.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 2/4] package/arm-gnu-a-toolchain: new package
  2020-02-13 10:44 [Buildroot] [PATCH v2 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
@ 2020-02-13 10:44 ` sunil at amarulasolutions.com
  2020-02-14 12:32   ` Michael Walle
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
  3 siblings, 1 reply; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-02-13 10:44 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
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

diff --git a/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
new file mode 100644
index 0000000..aa0a23a
--- /dev/null
+++ b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
@@ -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
diff --git a/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
new file mode 100644
index 0000000..55dce4d
--- /dev/null
+++ b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
@@ -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))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399
  2020-02-13 10:44 [Buildroot] [PATCH v2 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
@ 2020-02-13 10:44 ` sunil at amarulasolutions.com
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
  3 siblings, 0 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-02-13 10:44 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
Changes for v2:
- no changes
---
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 3473701..cc757b5 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 4/4] configs/roc-rk3399-pc: new defconfig
  2020-02-13 10:44 [Buildroot] [PATCH v2 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
                   ` (2 preceding siblings ...)
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
@ 2020-02-13 10:44 ` sunil at amarulasolutions.com
  2020-02-24  9:22   ` Jagan Teki
  3 siblings, 1 reply; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-02-13 10:44 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

This initial support includes:
Linux 5.4
U-Boot 2020.01
Arm Trusted Firmware v2.2
Buildroot default packages.

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a6436a8..8140243 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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 }
diff --git a/DEVELOPERS b/DEVELOPERS
index cb13035..a60c9fd 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2342,6 +2342,10 @@ N:	Steven Noonan <steven@uplinklabs.net>
 F:	package/hwloc/
 F:	package/powertop/
 
+N:	Suniel Mahesh <sunil@amarulasolutions.com>
+F:	board/firefly/
+F:	configs/roc_pc_rk3399_defconfig
+
 N:	Sven Haardiek <sven.haardiek@iotec-gmbh.de>
 F:	package/lcdproc/
 F:	package/python-influxdb/
diff --git a/board/firefly/roc-rk3399-pc/extlinux.conf b/board/firefly/roc-rk3399-pc/extlinux.conf
new file mode 100644
index 0000000..50a358f
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/extlinux.conf
@@ -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
diff --git a/board/firefly/roc-rk3399-pc/genimage.cfg b/board/firefly/roc-rk3399-pc/genimage.cfg
new file mode 100644
index 0000000..966c869
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/genimage.cfg
@@ -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"
+	}
+}
diff --git a/board/firefly/roc-rk3399-pc/post-build.sh b/board/firefly/roc-rk3399-pc/post-build.sh
new file mode 100755
index 0000000..1f5ff6a
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/post-build.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+
+install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
diff --git a/board/firefly/roc-rk3399-pc/readme.txt b/board/firefly/roc-rk3399-pc/readme.txt
new file mode 100644
index 0000000..ebf91c1
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/readme.txt
@@ -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 <sunil@amarulasolutions.com>
+10-Feb-2020
diff --git a/configs/roc_pc_rk3399_defconfig b/configs/roc_pc_rk3399_defconfig
new file mode 100644
index 0000000..e5a82da
--- /dev/null
+++ b/configs/roc_pc_rk3399_defconfig
@@ -0,0 +1,53 @@
+# Architecture
+BR2_aarch64=y
+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"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="rk3399"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
+
+# Bootloader
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.01"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="roc-pc-rk3399"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="idbloader.img"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.4.18"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3399-roc-pc"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+
+# Filesystem
+BR2_TARGET_GENERIC_HOSTNAME="roc-rk3399-pc"
+BR2_TARGET_GENERIC_ISSUE="Welcome to ROC-RK3399-PC!"
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/firefly/roc-rk3399-pc/genimage.cfg"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/firefly/roc-rk3399-pc/post-build.sh"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 2/4] package/arm-gnu-a-toolchain: new package
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
@ 2020-02-14 12:32   ` Michael Walle
  2020-02-16 23:28     ` Thomas Petazzoni
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Walle @ 2020-02-14 12:32 UTC (permalink / raw)
  To: buildroot

Am 2020-02-13 11:44, schrieb sunil at amarulasolutions.com:
> From: Suniel Mahesh <sunil@amarulasolutions.com>
> 
> 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

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

> Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
> ---
> 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
> 
> diff --git a/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
> b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
> new file mode 100644
> index 0000000..aa0a23a
> --- /dev/null
> +++ b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
> @@ -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
> diff --git a/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
> b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
> new file mode 100644
> index 0000000..55dce4d
> --- /dev/null
> +++ b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
> @@ -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))

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 2/4] package/arm-gnu-a-toolchain: new package
  2020-02-14 12:32   ` Michael Walle
@ 2020-02-16 23:28     ` Thomas Petazzoni
  0 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2020-02-16 23:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 14 Feb 2020 13:32:46 +0100
Michael Walle <michael@walle.cc> wrote:

> > 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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 4/4] configs/roc-rk3399-pc: new defconfig
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
@ 2020-02-24  9:22   ` Jagan Teki
  0 siblings, 0 replies; 25+ messages in thread
From: Jagan Teki @ 2020-02-24  9:22 UTC (permalink / raw)
  To: buildroot

On Thu, Feb 13, 2020 at 4:15 PM <sunil@amarulasolutions.com> wrote:
>
> From: Suniel Mahesh <sunil@amarulasolutions.com>
>
> This initial support includes:
> Linux 5.4
> U-Boot 2020.01
> Arm Trusted Firmware v2.2
> Buildroot default packages.
>
> Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
> ---
> 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
>
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index a6436a8..8140243 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -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 }
> diff --git a/DEVELOPERS b/DEVELOPERS
> index cb13035..a60c9fd 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2342,6 +2342,10 @@ N:       Steven Noonan <steven@uplinklabs.net>
>  F:     package/hwloc/
>  F:     package/powertop/
>
> +N:     Suniel Mahesh <sunil@amarulasolutions.com>
> +F:     board/firefly/
> +F:     configs/roc_pc_rk3399_defconfig
> +
>  N:     Sven Haardiek <sven.haardiek@iotec-gmbh.de>
>  F:     package/lcdproc/
>  F:     package/python-influxdb/
> diff --git a/board/firefly/roc-rk3399-pc/extlinux.conf b/board/firefly/roc-rk3399-pc/extlinux.conf
> new file mode 100644
> index 0000000..50a358f
> --- /dev/null
> +++ b/board/firefly/roc-rk3399-pc/extlinux.conf
> @@ -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
> diff --git a/board/firefly/roc-rk3399-pc/genimage.cfg b/board/firefly/roc-rk3399-pc/genimage.cfg
> new file mode 100644
> index 0000000..966c869
> --- /dev/null
> +++ b/board/firefly/roc-rk3399-pc/genimage.cfg
> @@ -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"
> +       }
> +}
> diff --git a/board/firefly/roc-rk3399-pc/post-build.sh b/board/firefly/roc-rk3399-pc/post-build.sh
> new file mode 100755
> index 0000000..1f5ff6a
> --- /dev/null
> +++ b/board/firefly/roc-rk3399-pc/post-build.sh
> @@ -0,0 +1,5 @@
> +#!/bin/sh
> +
> +BOARD_DIR="$(dirname $0)"
> +
> +install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
> diff --git a/board/firefly/roc-rk3399-pc/readme.txt b/board/firefly/roc-rk3399-pc/readme.txt
> new file mode 100644
> index 0000000..ebf91c1
> --- /dev/null
> +++ b/board/firefly/roc-rk3399-pc/readme.txt
> @@ -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 <sunil@amarulasolutions.com>
> +10-Feb-2020
> diff --git a/configs/roc_pc_rk3399_defconfig b/configs/roc_pc_rk3399_defconfig
> new file mode 100644
> index 0000000..e5a82da
> --- /dev/null
> +++ b/configs/roc_pc_rk3399_defconfig
> @@ -0,0 +1,53 @@
> +# Architecture
> +BR2_aarch64=y
> +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.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board
  2020-02-13 10:44 ` [Buildroot] [PATCH v2 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
@ 2020-03-18 13:45   ` sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 1/5] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
                       ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-18 13:45 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

-- 
2.7.4

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 1/5] boot/arm-trusted-firmware: Disable bin copy for rk3399
  2020-03-18 13:45   ` [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
@ 2020-03-18 13:45     ` sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 2/5] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-18 13:45 UTC (permalink / raw)
  To: buildroot

From: Jagan Teki <jagan@amarulasolutions.com>

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
Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@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(-)

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 3473701..7722954 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 2/5] package/arm-gnu-a-toolchain: new package
  2020-03-18 13:45   ` [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 1/5] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
@ 2020-03-18 13:45     ` sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 3/5] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-18 13:45 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
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

diff --git a/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
new file mode 100644
index 0000000..aa0a23a
--- /dev/null
+++ b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
@@ -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
diff --git a/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
new file mode 100644
index 0000000..55dce4d
--- /dev/null
+++ b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
@@ -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))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 3/5] boot/arm-trusted-firmware: add support for rockchip rk3399
  2020-03-18 13:45   ` [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 1/5] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 2/5] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
@ 2020-03-18 13:45     ` sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 4/5] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets sunil at amarulasolutions.com
  4 siblings, 0 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-18 13:45 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
Changes for v3:
- no change

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

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 7722954..3002f5f 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 4/5] configs/roc-rk3399-pc: new defconfig
  2020-03-18 13:45   ` [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
                       ` (2 preceding siblings ...)
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 3/5] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
@ 2020-03-18 13:45     ` sunil at amarulasolutions.com
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets sunil at amarulasolutions.com
  4 siblings, 0 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-18 13:45 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

This initial support includes:
Linux 5.4
U-Boot 2020.01
Arm Trusted Firmware v2.2
Buildroot default packages.

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4b84a5b..d9519c3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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 }
diff --git a/board/firefly/roc-rk3399-pc/extlinux.conf b/board/firefly/roc-rk3399-pc/extlinux.conf
new file mode 100644
index 0000000..50a358f
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/extlinux.conf
@@ -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
diff --git a/board/firefly/roc-rk3399-pc/genimage.cfg b/board/firefly/roc-rk3399-pc/genimage.cfg
new file mode 100644
index 0000000..966c869
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/genimage.cfg
@@ -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"
+	}
+}
diff --git a/board/firefly/roc-rk3399-pc/post-build.sh b/board/firefly/roc-rk3399-pc/post-build.sh
new file mode 100755
index 0000000..1f5ff6a
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/post-build.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+
+install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
diff --git a/board/firefly/roc-rk3399-pc/readme.txt b/board/firefly/roc-rk3399-pc/readme.txt
new file mode 100644
index 0000000..ebf91c1
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/readme.txt
@@ -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 <sunil@amarulasolutions.com>
+10-Feb-2020
diff --git a/configs/roc_pc_rk3399_defconfig b/configs/roc_pc_rk3399_defconfig
new file mode 100644
index 0000000..e5a82da
--- /dev/null
+++ b/configs/roc_pc_rk3399_defconfig
@@ -0,0 +1,53 @@
+# Architecture
+BR2_aarch64=y
+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"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="rk3399"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
+
+# Bootloader
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.01"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="roc-pc-rk3399"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="idbloader.img"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.4.18"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3399-roc-pc"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+
+# Filesystem
+BR2_TARGET_GENERIC_HOSTNAME="roc-rk3399-pc"
+BR2_TARGET_GENERIC_ISSUE="Welcome to ROC-RK3399-PC!"
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/firefly/roc-rk3399-pc/genimage.cfg"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/firefly/roc-rk3399-pc/post-build.sh"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets
  2020-03-18 13:45   ` [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
                       ` (3 preceding siblings ...)
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 4/5] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
@ 2020-03-18 13:45     ` sunil at amarulasolutions.com
  2020-03-18 14:51       ` Heiko Thiery
  4 siblings, 1 reply; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-18 13:45 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
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(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 98220a9..faa72a4 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1114,6 +1114,7 @@ N:	Ismael Luceno <ismael@iodev.co.uk>
 F:	package/axel/
 
 N:	Jagan Teki <jagan@amarulasolutions.com>
+N:	Suniel Mahesh <sunil@amarulasolutions.com>
 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 <james.hilliard1@gmail.com>
 F:	package/gensio/
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets
  2020-03-18 13:45     ` [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets sunil at amarulasolutions.com
@ 2020-03-18 14:51       ` Heiko Thiery
  2020-03-18 17:07         ` Jagan Teki
  0 siblings, 1 reply; 25+ messages in thread
From: Heiko Thiery @ 2020-03-18 14:51 UTC (permalink / raw)
  To: buildroot

Hi Sunil,

Am Mi., 18. M?rz 2020 um 14:46 Uhr schrieb <sunil@amarulasolutions.com>:
>
> From: Suniel Mahesh <sunil@amarulasolutions.com>
>
> Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
> ---
> 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(+)
>
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 98220a9..faa72a4 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1114,6 +1114,7 @@ N:        Ismael Luceno <ismael@iodev.co.uk>
>  F:     package/axel/
>
>  N:     Jagan Teki <jagan@amarulasolutions.com>
> +N:     Suniel Mahesh <sunil@amarulasolutions.com>

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


>  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 <james.hilliard1@gmail.com>
>  F:     package/gensio/
> --
> 2.7.4
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
Heiko

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets
  2020-03-18 14:51       ` Heiko Thiery
@ 2020-03-18 17:07         ` Jagan Teki
  2020-03-18 18:05           ` Heiko Thiery
  2020-03-18 20:52           ` Thomas Petazzoni
  0 siblings, 2 replies; 25+ messages in thread
From: Jagan Teki @ 2020-03-18 17:07 UTC (permalink / raw)
  To: buildroot

Hi Heiko,

On Wed, Mar 18, 2020 at 8:21 PM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> Hi Sunil,
>
> Am Mi., 18. M?rz 2020 um 14:46 Uhr schrieb <sunil@amarulasolutions.com>:
> >
> > From: Suniel Mahesh <sunil@amarulasolutions.com>
> >
> > Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
> > ---
> > 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(+)
> >
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index 98220a9..faa72a4 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -1114,6 +1114,7 @@ N:        Ismael Luceno <ismael@iodev.co.uk>
> >  F:     package/axel/
> >
> >  N:     Jagan Teki <jagan@amarulasolutions.com>
> > +N:     Suniel Mahesh <sunil@amarulasolutions.com>
>
> 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.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets
  2020-03-18 17:07         ` Jagan Teki
@ 2020-03-18 18:05           ` Heiko Thiery
  2020-03-18 20:52           ` Thomas Petazzoni
  1 sibling, 0 replies; 25+ messages in thread
From: Heiko Thiery @ 2020-03-18 18:05 UTC (permalink / raw)
  To: buildroot

Hi,

Jagan Teki <jagan@amarulasolutions.com> schrieb am Mi., 18. M?rz 2020,
18:07:

> Hi Heiko,
>
> On Wed, Mar 18, 2020 at 8:21 PM Heiko Thiery <heiko.thiery@gmail.com>
> wrote:
> >
> > Hi Sunil,
> >
> > Am Mi., 18. M?rz 2020 um 14:46 Uhr schrieb <sunil@amarulasolutions.com>:
> > >
> > > From: Suniel Mahesh <sunil@amarulasolutions.com>
> > >
> > > Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
> > > ---
> > > 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(+)
> > >
> > > diff --git a/DEVELOPERS b/DEVELOPERS
> > > index 98220a9..faa72a4 100644
> > > --- a/DEVELOPERS
> > > +++ b/DEVELOPERS
> > > @@ -1114,6 +1114,7 @@ N:        Ismael Luceno <ismael@iodev.co.uk>
> > >  F:     package/axel/
> > >
> > >  N:     Jagan Teki <jagan@amarulasolutions.com>
> > > +N:     Suniel Mahesh <sunil@amarulasolutions.com>
> >
> > 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.
>

I'm not sure and I will check that.

-- 
Heiko

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets
  2020-03-18 17:07         ` Jagan Teki
  2020-03-18 18:05           ` Heiko Thiery
@ 2020-03-18 20:52           ` Thomas Petazzoni
  2020-03-19 10:46             ` [Buildroot] [PATCH v4 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
  1 sibling, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2020-03-18 20:52 UTC (permalink / raw)
  To: buildroot

Hello Jagan,

On Wed, 18 Mar 2020 22:37:30 +0530
Jagan Teki <jagan@amarulasolutions.com> wrote:

> 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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board
  2020-03-18 20:52           ` Thomas Petazzoni
@ 2020-03-19 10:46             ` sunil at amarulasolutions.com
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
                                 ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-19 10:46 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

-- 
2.7.4

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399
  2020-03-19 10:46             ` [Buildroot] [PATCH v4 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
@ 2020-03-19 10:46               ` sunil at amarulasolutions.com
  2020-03-20 22:13                 ` Thomas Petazzoni
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
                                 ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-19 10:46 UTC (permalink / raw)
  To: buildroot

From: Jagan Teki <jagan@amarulasolutions.com>

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
Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@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(-)

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 3473701..7722954 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 2/4] package/arm-gnu-a-toolchain: new package
  2020-03-19 10:46             ` [Buildroot] [PATCH v4 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
@ 2020-03-19 10:46               ` sunil at amarulasolutions.com
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
  3 siblings, 0 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-19 10:46 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
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

diff --git a/DEVELOPERS b/DEVELOPERS
index 98220a9..a90ad78 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2370,6 +2370,9 @@ N:	Steven Noonan <steven@uplinklabs.net>
 F:	package/hwloc/
 F:	package/powertop/
 
+N:	Suniel Mahesh <sunil@amarulasolutions.com>
+F:	package/arm-gnu-a-toolchain
+
 N:	Sven Haardiek <sven.haardiek@iotec-gmbh.de>
 F:	package/lcdproc/
 F:	package/python-influxdb/
diff --git a/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
new file mode 100644
index 0000000..aa0a23a
--- /dev/null
+++ b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.hash
@@ -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
diff --git a/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
new file mode 100644
index 0000000..55dce4d
--- /dev/null
+++ b/package/arm-gnu-a-toolchain/arm-gnu-a-toolchain.mk
@@ -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))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399
  2020-03-19 10:46             ` [Buildroot] [PATCH v4 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
@ 2020-03-19 10:46               ` sunil at amarulasolutions.com
  2020-03-20 22:14                 ` Thomas Petazzoni
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
  3 siblings, 1 reply; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-19 10:46 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

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

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
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(+)

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 7722954..3002f5f 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 4/4] configs/roc-rk3399-pc: new defconfig
  2020-03-19 10:46             ` [Buildroot] [PATCH v4 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
                                 ` (2 preceding siblings ...)
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
@ 2020-03-19 10:46               ` sunil at amarulasolutions.com
  3 siblings, 0 replies; 25+ messages in thread
From: sunil at amarulasolutions.com @ 2020-03-19 10:46 UTC (permalink / raw)
  To: buildroot

From: Suniel Mahesh <sunil@amarulasolutions.com>

This initial support includes:
Linux 5.4
U-Boot 2020.01
Arm Trusted Firmware v2.2
Buildroot default packages.

Signed-off-by: Suniel Mahesh <sunil@amarulasolutions.com>
---
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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4b84a5b..d9519c3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4b84a5b..d9519c3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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 }
diff --git a/DEVELOPERS b/DEVELOPERS
index a90ad78..2f9982f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2372,6 +2372,8 @@ F:	package/powertop/
 
 N:	Suniel Mahesh <sunil@amarulasolutions.com>
 F:	package/arm-gnu-a-toolchain
+F:	board/firefly/
+F:	configs/roc_pc_rk3399_defconfig
 
 N:	Sven Haardiek <sven.haardiek@iotec-gmbh.de>
 F:	package/lcdproc/
diff --git a/board/firefly/roc-rk3399-pc/extlinux.conf b/board/firefly/roc-rk3399-pc/extlinux.conf
new file mode 100644
index 0000000..50a358f
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/extlinux.conf
@@ -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
diff --git a/board/firefly/roc-rk3399-pc/genimage.cfg b/board/firefly/roc-rk3399-pc/genimage.cfg
new file mode 100644
index 0000000..966c869
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/genimage.cfg
@@ -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"
+	}
+}
diff --git a/board/firefly/roc-rk3399-pc/post-build.sh b/board/firefly/roc-rk3399-pc/post-build.sh
new file mode 100755
index 0000000..1f5ff6a
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/post-build.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+
+install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
diff --git a/board/firefly/roc-rk3399-pc/readme.txt b/board/firefly/roc-rk3399-pc/readme.txt
new file mode 100644
index 0000000..ebf91c1
--- /dev/null
+++ b/board/firefly/roc-rk3399-pc/readme.txt
@@ -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 <sunil@amarulasolutions.com>
+10-Feb-2020
diff --git a/configs/roc_pc_rk3399_defconfig b/configs/roc_pc_rk3399_defconfig
new file mode 100644
index 0000000..e5a82da
--- /dev/null
+++ b/configs/roc_pc_rk3399_defconfig
@@ -0,0 +1,53 @@
+# Architecture
+BR2_aarch64=y
+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"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="rk3399"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
+
+# Bootloader
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.01"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="roc-pc-rk3399"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="idbloader.img"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.4.18"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3399-roc-pc"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+
+# Filesystem
+BR2_TARGET_GENERIC_HOSTNAME="roc-rk3399-pc"
+BR2_TARGET_GENERIC_ISSUE="Welcome to ROC-RK3399-PC!"
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/firefly/roc-rk3399-pc/genimage.cfg"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/firefly/roc-rk3399-pc/post-build.sh"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
@ 2020-03-20 22:13                 ` Thomas Petazzoni
  0 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2020-03-20 22:13 UTC (permalink / raw)
  To: buildroot

Hello Sunil,

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

>  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

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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399
  2020-03-19 10:46               ` [Buildroot] [PATCH v4 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
@ 2020-03-20 22:14                 ` Thomas Petazzoni
  0 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2020-03-20 22:14 UTC (permalink / raw)
  To: buildroot

On Thu, 19 Mar 2020 16:16:51 +0530
sunil at amarulasolutions.com wrote:

> +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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2020-03-20 22:14 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 10:44 [Buildroot] [PATCH v2 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
2020-02-13 10:44 ` [Buildroot] [PATCH v2 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
2020-03-18 13:45   ` [Buildroot] [PATCH v3 0/5] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 1/5] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 2/5] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 3/5] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 4/5] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
2020-03-18 13:45     ` [Buildroot] [PATCH v3 5/5] DEVELOPERS: add me as a co-maintainer for rk3399 based targets sunil at amarulasolutions.com
2020-03-18 14:51       ` Heiko Thiery
2020-03-18 17:07         ` Jagan Teki
2020-03-18 18:05           ` Heiko Thiery
2020-03-18 20:52           ` Thomas Petazzoni
2020-03-19 10:46             ` [Buildroot] [PATCH v4 0/4] Fix ATF v2.2 build for rk3399, add roc-rk3399-pc board sunil at amarulasolutions.com
2020-03-19 10:46               ` [Buildroot] [PATCH v4 1/4] boot/arm-trusted-firmware: Disable bin copy for rk3399 sunil at amarulasolutions.com
2020-03-20 22:13                 ` Thomas Petazzoni
2020-03-19 10:46               ` [Buildroot] [PATCH v4 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
2020-03-19 10:46               ` [Buildroot] [PATCH v4 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
2020-03-20 22:14                 ` Thomas Petazzoni
2020-03-19 10:46               ` [Buildroot] [PATCH v4 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
2020-02-13 10:44 ` [Buildroot] [PATCH v2 2/4] package/arm-gnu-a-toolchain: new package sunil at amarulasolutions.com
2020-02-14 12:32   ` Michael Walle
2020-02-16 23:28     ` Thomas Petazzoni
2020-02-13 10:44 ` [Buildroot] [PATCH v2 3/4] boot/arm-trusted-firmware: add support for rockchip rk3399 sunil at amarulasolutions.com
2020-02-13 10:44 ` [Buildroot] [PATCH v2 4/4] configs/roc-rk3399-pc: new defconfig sunil at amarulasolutions.com
2020-02-24  9:22   ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.