* [yocto][meta-rockchip][PATCH 0/4] Add RockPi 4 support
@ 2020-01-23 16:08 Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 1/4] arm-trusted-firmware: Add recipe Joshua Watt
` (4 more replies)
0 siblings, 5 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 16:08 UTC (permalink / raw)
To: yocto; +Cc: twoerner, Joshua Watt
Add support for building the Raxada Rock Pi 4 development board
Joshua Watt (4):
arm-trusted-firmware: Add recipe
gcc-arm-none-eabi-native: Add recipe
rk3399: Add generic rk3399 support
rock-pi-4-rk3399: Add machine
conf/machine/include/rk3066.inc | 3 +
conf/machine/include/rk3188.inc | 3 +
conf/machine/include/rk3288.inc | 3 +
conf/machine/include/rk3399.inc | 27 ++++++
conf/machine/include/rockchip-defaults.inc | 2 -
conf/machine/rock-pi-4-rk3399.conf | 28 ++++++
...hip-Prevent-macro-expansion-in-paths.patch | 94 +++++++++++++++++++
.../arm-trusted-firmware_2.2.bb | 44 +++++++++
recipes-bsp/u-boot/u-boot%.bbappend | 8 ++
...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 ++++++++
recipes-graphics/mesa/mesa_%.bbappend | 1 +
wic/rk3399-boot.wks | 24 +++++
wic/rock-pi-4-rk3399.wks | 7 ++
13 files changed, 279 insertions(+), 2 deletions(-)
create mode 100644 conf/machine/include/rk3399.inc
create mode 100644 conf/machine/rock-pi-4-rk3399.conf
create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch
create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
create mode 100644 wic/rk3399-boot.wks
create mode 100644 wic/rock-pi-4-rk3399.wks
--
2.24.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH 1/4] arm-trusted-firmware: Add recipe
2020-01-23 16:08 [yocto][meta-rockchip][PATCH 0/4] Add RockPi 4 support Joshua Watt
@ 2020-01-23 16:08 ` Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: " Joshua Watt
` (3 subsequent siblings)
4 siblings, 0 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 16:08 UTC (permalink / raw)
To: yocto; +Cc: twoerner, Joshua Watt
Adds a recipe to build Arm Trusted Firmware
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
.../arm-trusted-firmware_2.2.bb | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
new file mode 100644
index 0000000..710336a
--- /dev/null
+++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
@@ -0,0 +1,38 @@
+# Copyright (C) 2019 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Arm Trusted Firmware"
+HOMEPAGE = "https://developer.trustedfirmware.org/"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+
+PROVIDES = "virtual/atf"
+
+BRANCH = "master"
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=http;branch=${BRANCH}"
+SRCREV = "a04808c16cfc126d9fe572ae7c4b5a3d39de5796"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+
+inherit deploy
+
+ATF_SUFFIX ??= "bin"
+
+do_compile() {
+ unset LDFLAGS
+ unset CFLAGS
+ unset CPPFLAGS
+
+ oe_runmake -C ${S} BUILD_BASE=${B} DEBUG=0 CROSS_COMPILE=${TARGET_PREFIX} \
+ PLAT=${ATF_PLATFORM} ${ATF_TARGET}
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_deploy() {
+ install -m 644 ${B}/${ATF_PLATFORM}/release/${ATF_TARGET}/${ATF_TARGET}.${ATF_SUFFIX} \
+ ${DEPLOYDIR}/${ATF_TARGET}.${ATF_SUFFIX}
+}
+addtask deploy after do_compile
+
--
2.24.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: Add recipe
2020-01-23 16:08 [yocto][meta-rockchip][PATCH 0/4] Add RockPi 4 support Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 1/4] arm-trusted-firmware: Add recipe Joshua Watt
@ 2020-01-23 16:08 ` Joshua Watt
2020-01-23 19:49 ` Khem Raj
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 3/4] rk3399: Add generic rk3399 support Joshua Watt
` (2 subsequent siblings)
4 siblings, 1 reply; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 16:08 UTC (permalink / raw)
To: yocto; +Cc: twoerner, Joshua Watt
Adds a recipe to pull down the prebuilt GCC for compiling on Cortex-R
and Cortex-M processors from ARM. This toolchain is required to build
Arm Trusted Firmware for the Rockchip rk3399 SoC, since it must compile
some firmware for the M0 coprocessor.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
new file mode 100644
index 0000000..a0c832d
--- /dev/null
+++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
@@ -0,0 +1,37 @@
+# Copyright (C) 2019 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Baremetal GCC for ARM-R and ARM-M processors"
+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
+
+LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=c18349634b740b7b95f2c2159af888f5"
+
+PROVIDES = "virtual/arm-none-eabi-gcc"
+
+SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/${BPN}-${PV}-x86_64-linux.tar.bz2"
+
+SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
+SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+inherit native
+
+COMPATIBLE_HOST = "x86_64.*-linux"
+
+do_install() {
+ install -d ${D}${datadir}/arm-none-eabi/
+ cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
+
+ install -d ${D}${bindir}
+ # Symlink all executables into bindir
+ for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
+ lnr $f ${D}${bindir}/$(basename $f)
+ done
+}
+
+INSANE_SKIP_${PN} = "already-stripped"
+
+INHIBIT_SYSROOT_STRIP = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
--
2.24.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH 3/4] rk3399: Add generic rk3399 support
2020-01-23 16:08 [yocto][meta-rockchip][PATCH 0/4] Add RockPi 4 support Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 1/4] arm-trusted-firmware: Add recipe Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: " Joshua Watt
@ 2020-01-23 16:08 ` Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 4/4] rock-pi-4-rk3399: Add machine Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 0/4] Add Rock Pi 4 Support Joshua Watt
4 siblings, 0 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 16:08 UTC (permalink / raw)
To: yocto; +Cc: twoerner, Joshua Watt
Adds support for the rk3399 SoC. Notably:
*) Split out the default kernel config and image type from
rockchip-defaults.inc now that not all support chips are ARMv7
*) Apply a patch to Arm Trusted Firmware to fix a compile issue
*) Arm Trusted Firmware requires the arm-none-eabi-native compiler to
compile the M0 firmware.
*) Modify u-boot to pull in the ATF files when compiling
*) The rk3399 is support by the panfrost driver in mesa, so enable it
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
conf/machine/include/rk3066.inc | 3 +
conf/machine/include/rk3188.inc | 3 +
conf/machine/include/rk3288.inc | 3 +
conf/machine/include/rk3399.inc | 27 ++++++
conf/machine/include/rockchip-defaults.inc | 2 -
...hip-Prevent-macro-expansion-in-paths.patch | 94 +++++++++++++++++++
.../arm-trusted-firmware_2.2.bb | 8 +-
recipes-bsp/u-boot/u-boot%.bbappend | 8 ++
recipes-graphics/mesa/mesa_%.bbappend | 1 +
wic/rk3399-boot.wks | 24 +++++
10 files changed, 170 insertions(+), 3 deletions(-)
create mode 100644 conf/machine/include/rk3399.inc
create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch
create mode 100644 wic/rk3399-boot.wks
diff --git a/conf/machine/include/rk3066.inc b/conf/machine/include/rk3066.inc
index 91fbbaa..dffbee0 100644
--- a/conf/machine/include/rk3066.inc
+++ b/conf/machine/include/rk3066.inc
@@ -6,3 +6,6 @@ SOC_FAMILY = "rk3066"
require conf/machine/include/tune-cortexa9.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
+
+KBUILD_DEFCONFIG = "multi_v7_defconfig"
+KERNEL_IMAGETYPE = "zImage"
diff --git a/conf/machine/include/rk3188.inc b/conf/machine/include/rk3188.inc
index bd36837..59e65d1 100644
--- a/conf/machine/include/rk3188.inc
+++ b/conf/machine/include/rk3188.inc
@@ -6,3 +6,6 @@ SOC_FAMILY = "rk3188"
require conf/machine/include/tune-cortexa9.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
+
+KBUILD_DEFCONFIG = "multi_v7_defconfig"
+KERNEL_IMAGETYPE = "zImage"
diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
index b261692..a7edac5 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -7,6 +7,9 @@ require conf/machine/include/tune-cortexa17.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
+KBUILD_DEFCONFIG = "multi_v7_defconfig"
+KERNEL_IMAGETYPE = "zImage"
+
SERIAL_CONSOLES = "115200;ttyS2"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
diff --git a/conf/machine/include/rk3399.inc b/conf/machine/include/rk3399.inc
new file mode 100644
index 0000000..1fd8fd6
--- /dev/null
+++ b/conf/machine/include/rk3399.inc
@@ -0,0 +1,27 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SOC_FAMILY = "rk3399"
+
+DEFAULTTUNE ?= "cortexa72-cortexa53-crypto"
+
+require conf/machine/include/tune-cortexa72-cortexa53.inc
+require conf/machine/include/soc-family.inc
+require conf/machine/include/rockchip-defaults.inc
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_CLASSES = "kernel-fitimage"
+KERNEL_IMAGETYPE = "fitImage"
+
+ATF_PLATFORM ?= "rk3399"
+ATF_TARGET ?= "bl31"
+ATF_SUFFIX ?= "elf"
+
+UBOOT_SUFFIX ?= "itb"
+UBOOT_ENTRYPOINT ?= "0x06000000"
+
+SERIAL_CONSOLES = "115200;ttyS2"
+
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
+SPL_BINARY ?= "idbloader.img"
+
diff --git a/conf/machine/include/rockchip-defaults.inc b/conf/machine/include/rockchip-defaults.inc
index ed180f9..0507017 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -3,8 +3,6 @@
# kernel
PREFERRED_PROVIDER_virtual/kernel ?= "linux-stable"
LINUX_VERSION_EXTENSION ?= "-rockchip"
-KBUILD_DEFCONFIG = "multi_v7_defconfig"
-KERNEL_IMAGETYPE = "zImage"
# xserver
PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch
new file mode 100644
index 0000000..755b618
--- /dev/null
+++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch
@@ -0,0 +1,94 @@
+From 39a97dce61aca9f618e28e26c6e441c8976f3172 Mon Sep 17 00:00:00 2001
+From: Joshua Watt <JPEWhacker@gmail.com>
+Date: Fri, 13 Dec 2019 13:44:55 -0600
+Subject: [PATCH] rockchip: Prevent macro expansion in paths
+
+Instead of stringizing the paths to binary files, add them as string
+defines on the command line (e.g. -DFOO=\"BAR\" instead of -DFOO=BAR).
+This prevents macros from being expanded inside the string value itself.
+For example, -DFOO=/path/with-linux-in-it would have been expanded to
+"/path/with-1-in-it" because `linux=1` is one of the standard GCC
+defines.
+
+Upstream-Status: Accepted [https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/2813]
+Change-Id: I7b65df3c9930faed4f1aff75ad726982ae3671e6
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+---
+ plat/rockchip/rk3399/drivers/dp/cdn_dp.c | 2 +-
+ plat/rockchip/rk3399/drivers/pmu/pmu_fw.c | 24 +++++++++++------------
+ plat/rockchip/rk3399/platform.mk | 6 +++---
+ 3 files changed, 15 insertions(+), 17 deletions(-)
+
+diff --git a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
+index aa71fdea..a8773f4f 100644
+--- a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
++++ b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
+@@ -18,7 +18,7 @@ __asm__(
+ ".global hdcp_handler\n"
+ ".balign 4\n"
+ "hdcp_handler:\n"
+- ".incbin \"" __XSTRING(HDCPFW) "\"\n"
++ ".incbin \"" HDCPFW "\"\n"
+ ".type hdcp_handler, %function\n"
+ ".size hdcp_handler, .- hdcp_handler\n"
+ ".popsection\n"
+diff --git a/plat/rockchip/rk3399/drivers/pmu/pmu_fw.c b/plat/rockchip/rk3399/drivers/pmu/pmu_fw.c
+index a09ad21e..25596b18 100644
+--- a/plat/rockchip/rk3399/drivers/pmu/pmu_fw.c
++++ b/plat/rockchip/rk3399/drivers/pmu/pmu_fw.c
+@@ -5,20 +5,18 @@
+ */
+
+ /* convoluted way to make sure that the define is pasted just the right way */
+-#define _INCBIN(file, sym, sec) \
++#define INCBIN(file, sym, sec) \
+ __asm__( \
+- ".section " #sec "\n" \
+- ".global " #sym "\n" \
+- ".type " #sym ", %object\n" \
++ ".section " sec "\n" \
++ ".global " sym "\n" \
++ ".type " sym ", %object\n" \
+ ".align 4\n" \
+- #sym ":\n" \
+- ".incbin \"" #file "\"\n" \
+- ".size " #sym ", .-" #sym "\n" \
+- ".global " #sym "_end\n" \
+- #sym "_end:\n" \
++ sym ":\n" \
++ ".incbin \"" file "\"\n" \
++ ".size " sym ", .-" sym "\n" \
++ ".global " sym "_end\n" \
++ sym "_end:\n" \
+ )
+
+-#define INCBIN(file, sym, sec) _INCBIN(file, sym, sec)
+-
+-INCBIN(RK3399M0FW, rk3399m0_bin, ".sram.incbin");
+-INCBIN(RK3399M0PMUFW, rk3399m0pmu_bin, ".pmusram.incbin");
++INCBIN(RK3399M0FW, "rk3399m0_bin", ".sram.incbin");
++INCBIN(RK3399M0PMUFW, "rk3399m0pmu_bin", ".pmusram.incbin");
+diff --git a/plat/rockchip/rk3399/platform.mk b/plat/rockchip/rk3399/platform.mk
+index cfc48e8f..643c24f5 100644
+--- a/plat/rockchip/rk3399/platform.mk
++++ b/plat/rockchip/rk3399/platform.mk
+@@ -82,13 +82,13 @@ PLAT_M0 := ${PLAT}m0
+ BUILD_M0 := ${BUILD_PLAT}/m0
+
+ RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin
+-$(eval $(call add_define,RK3399M0FW))
++$(eval $(call add_define_val,RK3399M0FW,\"$(RK3399M0FW)\"))
+
+ RK3399M0PMUFW=${BUILD_M0}/${PLAT_M0}pmu.bin
+-$(eval $(call add_define,RK3399M0PMUFW))
++$(eval $(call add_define_val,RK3399M0PMUFW,\"$(RK3399M0PMUFW)\"))
+
+ HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin
+-$(eval $(call add_define,HDCPFW))
++$(eval $(call add_define_val,HDCPFW,\"$(HDCPFW)\"))
+
+ # CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin
+ export CCACHE_EXTRAFILES
+--
+2.23.0
+
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
index 710336a..602ce30 100644
--- a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
+++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
@@ -6,10 +6,16 @@ HOMEPAGE = "https://developer.trustedfirmware.org/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+# Rockchip RK3399 compiles some M0 firmware which requires an arm-none-eabi GCC
+# toolchain
+DEPENDS_rk3399 = "virtual/arm-none-eabi-gcc"
+
PROVIDES = "virtual/atf"
BRANCH = "master"
-SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=http;branch=${BRANCH}"
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=http;branch=${BRANCH} \
+ file://0001-rockchip-Prevent-macro-expansion-in-paths.patch \
+ "
SRCREV = "a04808c16cfc126d9fe572ae7c4b5a3d39de5796"
S = "${WORKDIR}/git"
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index 801f710..401d649 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -4,3 +4,11 @@ do_compile_append_rock2-square () {
cp ${B}/spl/${SPL_BINARY} ${B}
fi
}
+
+ATF_DEPENDS ??= ""
+
+EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31.elf"
+ATF_DEPENDS_rk3399 = "virtual/atf:do_deploy"
+
+do_compile[depends] += "${ATF_DEPENDS}"
+
diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend
index 5856c71..3e8711c 100644
--- a/recipes-graphics/mesa/mesa_%.bbappend
+++ b/recipes-graphics/mesa/mesa_%.bbappend
@@ -1 +1,2 @@
PACKAGECONFIG_append_rk3288 = " kmsro panfrost"
+PACKAGECONFIG_append_rk3399 = " kmsro panfrost"
diff --git a/wic/rk3399-boot.wks b/wic/rk3399-boot.wks
new file mode 100644
index 0000000..100b94d
--- /dev/null
+++ b/wic/rk3399-boot.wks
@@ -0,0 +1,24 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidiaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# Disk layout
+# Note that the reference documentation refers to 512 byte disk sectors, but
+# wic uses 1KB blocks
+#
+# Partition Start Sector Number of Sectors
+# loader1 64 8000
+# reserved1 8064 128
+# reserved2 8192 8192
+# loader2 16384 8192
+# atf 24576 8192
+# boot 32768 229376
+# root 262144 -
+#
+
+part loader1 --align 32 --size 4000K --source rawcopy --sourceparams="file=idbloader.img"
+part reserved1 --align 4032 --size 64K
+part reserved2 --align 4096 --size 4096K
+part loader2 --align 8192 --size 4096K --source rawcopy --sourceparams="file=u-boot.itb"
+part atf --align 12288 --size 4096K
+part /boot --align 16384 --size=114688K --active --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"
+
--
2.24.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH 4/4] rock-pi-4-rk3399: Add machine
2020-01-23 16:08 [yocto][meta-rockchip][PATCH 0/4] Add RockPi 4 support Joshua Watt
` (2 preceding siblings ...)
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 3/4] rk3399: Add generic rk3399 support Joshua Watt
@ 2020-01-23 16:08 ` Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 0/4] Add Rock Pi 4 Support Joshua Watt
4 siblings, 0 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 16:08 UTC (permalink / raw)
To: yocto; +Cc: twoerner, Joshua Watt
Adds the machine definition for the Rock Pi 4 based around the RK3399
SoC.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
conf/machine/rock-pi-4-rk3399.conf | 28 ++++++++++++++++++++++++++++
wic/rock-pi-4-rk3399.wks | 7 +++++++
2 files changed, 35 insertions(+)
create mode 100644 conf/machine/rock-pi-4-rk3399.conf
create mode 100644 wic/rock-pi-4-rk3399.wks
diff --git a/conf/machine/rock-pi-4-rk3399.conf b/conf/machine/rock-pi-4-rk3399.conf
new file mode 100644
index 0000000..ca02b8e
--- /dev/null
+++ b/conf/machine/rock-pi-4-rk3399.conf
@@ -0,0 +1,28 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+#@TYPE: Machine
+#@NAME: Rock Pi 4 RK3288
+#@DESCRIPTION: Rock Pi 4 is a Raspberry Pi 4 Alternative based on Rockchip RK3399 Processor.
+
+require conf/machine/include/rk3399.inc
+
+KERNEL_DEVICETREE = "rockchip/rk3399-rock-pi-4.dtb"
+UBOOT_MACHINE = "rock-pi-4-rk3399_defconfig"
+
+WKS_FILE ?= "rock-pi-4-rk3399.wks"
+IMAGE_FSTYPES += "wic wic.bmap"
+
+WKS_FILE_DEPENDS ?= " \
+ mtools-native \
+ dosfstools-native \
+ virtual/bootloader \
+ virtual/kernel \
+ "
+IMAGE_BOOT_FILES ?= "\
+ ${KERNEL_IMAGETYPE} \
+ "
+
+SERIAL_CONSOLES = "1500000;ttyS2"
+
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
diff --git a/wic/rock-pi-4-rk3399.wks b/wic/rock-pi-4-rk3399.wks
new file mode 100644
index 0000000..8e4b37c
--- /dev/null
+++ b/wic/rock-pi-4-rk3399.wks
@@ -0,0 +1,7 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidiaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+include rk3399-boot.wks
+part / --align 131072 --source rootfs --fstype=ext4 --label root
+
+bootloader --ptable gpt --append="console=tty1 console=ttyS2,1500000n8 rw root=/dev/mmcblk1p7 rootfstype=ext4 init=/sbin/init"
--
2.24.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH v2 0/4] Add Rock Pi 4 Support
2020-01-23 16:08 [yocto][meta-rockchip][PATCH 0/4] Add RockPi 4 support Joshua Watt
` (3 preceding siblings ...)
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 4/4] rock-pi-4-rk3399: Add machine Joshua Watt
@ 2020-01-23 19:46 ` Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 1/4] arm-trusted-firmware: Add recipe Joshua Watt
` (3 more replies)
4 siblings, 4 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 19:46 UTC (permalink / raw)
To: yocto; +Cc: Joshua Watt
Add support for building the Raxada Rock Pi 4 development board
V2: Machine has been renamed "rock-pi-4" to match the manufacturers name
Joshua Watt (4):
arm-trusted-firmware: Add recipe
gcc-arm-none-eabi-native: Add recipe
rk3399: Add generic rk3399 support
rock-pi-4: Add machine
README | 1 +
conf/machine/include/rk3066.inc | 3 +
conf/machine/include/rk3188.inc | 3 +
conf/machine/include/rk3288.inc | 3 +
conf/machine/include/rk3399.inc | 27 ++++++
conf/machine/include/rockchip-defaults.inc | 2 -
conf/machine/rock-pi-4.conf | 28 ++++++
...hip-Prevent-macro-expansion-in-paths.patch | 94 +++++++++++++++++++
.../arm-trusted-firmware_2.2.bb | 44 +++++++++
recipes-bsp/u-boot/u-boot%.bbappend | 8 ++
...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 ++++++++
recipes-graphics/mesa/mesa_%.bbappend | 1 +
wic/rk3399-boot.wks | 24 +++++
wic/rock-pi-4.wks | 7 ++
14 files changed, 280 insertions(+), 2 deletions(-)
create mode 100644 conf/machine/include/rk3399.inc
create mode 100644 conf/machine/rock-pi-4.conf
create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch
create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
create mode 100644 wic/rk3399-boot.wks
create mode 100644 wic/rock-pi-4.wks
--
2.24.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH v2 1/4] arm-trusted-firmware: Add recipe
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 0/4] Add Rock Pi 4 Support Joshua Watt
@ 2020-01-23 19:46 ` Joshua Watt
2020-01-23 20:39 ` Denys Dmytriyenko
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 2/4] gcc-arm-none-eabi-native: " Joshua Watt
` (2 subsequent siblings)
3 siblings, 1 reply; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 19:46 UTC (permalink / raw)
To: yocto; +Cc: Joshua Watt
Adds a recipe to build Arm Trusted Firmware
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
.../arm-trusted-firmware_2.2.bb | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
new file mode 100644
index 0000000..710336a
--- /dev/null
+++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
@@ -0,0 +1,38 @@
+# Copyright (C) 2019 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Arm Trusted Firmware"
+HOMEPAGE = "https://developer.trustedfirmware.org/"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+
+PROVIDES = "virtual/atf"
+
+BRANCH = "master"
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=http;branch=${BRANCH}"
+SRCREV = "a04808c16cfc126d9fe572ae7c4b5a3d39de5796"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+
+inherit deploy
+
+ATF_SUFFIX ??= "bin"
+
+do_compile() {
+ unset LDFLAGS
+ unset CFLAGS
+ unset CPPFLAGS
+
+ oe_runmake -C ${S} BUILD_BASE=${B} DEBUG=0 CROSS_COMPILE=${TARGET_PREFIX} \
+ PLAT=${ATF_PLATFORM} ${ATF_TARGET}
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_deploy() {
+ install -m 644 ${B}/${ATF_PLATFORM}/release/${ATF_TARGET}/${ATF_TARGET}.${ATF_SUFFIX} \
+ ${DEPLOYDIR}/${ATF_TARGET}.${ATF_SUFFIX}
+}
+addtask deploy after do_compile
+
--
2.24.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH v2 2/4] gcc-arm-none-eabi-native: Add recipe
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 0/4] Add Rock Pi 4 Support Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 1/4] arm-trusted-firmware: Add recipe Joshua Watt
@ 2020-01-23 19:46 ` Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 3/4] rk3399: Add generic rk3399 support Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 4/4] rock-pi-4: Add machine Joshua Watt
3 siblings, 0 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 19:46 UTC (permalink / raw)
To: yocto; +Cc: Joshua Watt
Adds a recipe to pull down the prebuilt GCC for compiling on Cortex-R
and Cortex-M processors from ARM. This toolchain is required to build
Arm Trusted Firmware for the Rockchip rk3399 SoC, since it must compile
some firmware for the M0 coprocessor.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
new file mode 100644
index 0000000..a0c832d
--- /dev/null
+++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
@@ -0,0 +1,37 @@
+# Copyright (C) 2019 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Baremetal GCC for ARM-R and ARM-M processors"
+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
+
+LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=c18349634b740b7b95f2c2159af888f5"
+
+PROVIDES = "virtual/arm-none-eabi-gcc"
+
+SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/${BPN}-${PV}-x86_64-linux.tar.bz2"
+
+SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
+SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+inherit native
+
+COMPATIBLE_HOST = "x86_64.*-linux"
+
+do_install() {
+ install -d ${D}${datadir}/arm-none-eabi/
+ cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
+
+ install -d ${D}${bindir}
+ # Symlink all executables into bindir
+ for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
+ lnr $f ${D}${bindir}/$(basename $f)
+ done
+}
+
+INSANE_SKIP_${PN} = "already-stripped"
+
+INHIBIT_SYSROOT_STRIP = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
--
2.24.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH v2 3/4] rk3399: Add generic rk3399 support
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 0/4] Add Rock Pi 4 Support Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 1/4] arm-trusted-firmware: Add recipe Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 2/4] gcc-arm-none-eabi-native: " Joshua Watt
@ 2020-01-23 19:46 ` Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 4/4] rock-pi-4: Add machine Joshua Watt
3 siblings, 0 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 19:46 UTC (permalink / raw)
To: yocto; +Cc: Joshua Watt
Adds support for the rk3399 SoC. Notably:
*) Split out the default kernel config and image type from
rockchip-defaults.inc now that not all support chips are ARMv7
*) Apply a patch to Arm Trusted Firmware to fix a compile issue
*) Arm Trusted Firmware requires the arm-none-eabi-native compiler to
compile the M0 firmware.
*) Modify u-boot to pull in the ATF files when compiling
*) The rk3399 is support by the panfrost driver in mesa, so enable it
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
conf/machine/include/rk3066.inc | 3 +
conf/machine/include/rk3188.inc | 3 +
conf/machine/include/rk3288.inc | 3 +
conf/machine/include/rk3399.inc | 27 ++++++
conf/machine/include/rockchip-defaults.inc | 2 -
...hip-Prevent-macro-expansion-in-paths.patch | 94 +++++++++++++++++++
.../arm-trusted-firmware_2.2.bb | 8 +-
recipes-bsp/u-boot/u-boot%.bbappend | 8 ++
recipes-graphics/mesa/mesa_%.bbappend | 1 +
wic/rk3399-boot.wks | 24 +++++
10 files changed, 170 insertions(+), 3 deletions(-)
create mode 100644 conf/machine/include/rk3399.inc
create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch
create mode 100644 wic/rk3399-boot.wks
diff --git a/conf/machine/include/rk3066.inc b/conf/machine/include/rk3066.inc
index 91fbbaa..dffbee0 100644
--- a/conf/machine/include/rk3066.inc
+++ b/conf/machine/include/rk3066.inc
@@ -6,3 +6,6 @@ SOC_FAMILY = "rk3066"
require conf/machine/include/tune-cortexa9.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
+
+KBUILD_DEFCONFIG = "multi_v7_defconfig"
+KERNEL_IMAGETYPE = "zImage"
diff --git a/conf/machine/include/rk3188.inc b/conf/machine/include/rk3188.inc
index bd36837..59e65d1 100644
--- a/conf/machine/include/rk3188.inc
+++ b/conf/machine/include/rk3188.inc
@@ -6,3 +6,6 @@ SOC_FAMILY = "rk3188"
require conf/machine/include/tune-cortexa9.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
+
+KBUILD_DEFCONFIG = "multi_v7_defconfig"
+KERNEL_IMAGETYPE = "zImage"
diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
index b261692..a7edac5 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -7,6 +7,9 @@ require conf/machine/include/tune-cortexa17.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
+KBUILD_DEFCONFIG = "multi_v7_defconfig"
+KERNEL_IMAGETYPE = "zImage"
+
SERIAL_CONSOLES = "115200;ttyS2"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
diff --git a/conf/machine/include/rk3399.inc b/conf/machine/include/rk3399.inc
new file mode 100644
index 0000000..1fd8fd6
--- /dev/null
+++ b/conf/machine/include/rk3399.inc
@@ -0,0 +1,27 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SOC_FAMILY = "rk3399"
+
+DEFAULTTUNE ?= "cortexa72-cortexa53-crypto"
+
+require conf/machine/include/tune-cortexa72-cortexa53.inc
+require conf/machine/include/soc-family.inc
+require conf/machine/include/rockchip-defaults.inc
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_CLASSES = "kernel-fitimage"
+KERNEL_IMAGETYPE = "fitImage"
+
+ATF_PLATFORM ?= "rk3399"
+ATF_TARGET ?= "bl31"
+ATF_SUFFIX ?= "elf"
+
+UBOOT_SUFFIX ?= "itb"
+UBOOT_ENTRYPOINT ?= "0x06000000"
+
+SERIAL_CONSOLES = "115200;ttyS2"
+
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
+SPL_BINARY ?= "idbloader.img"
+
diff --git a/conf/machine/include/rockchip-defaults.inc b/conf/machine/include/rockchip-defaults.inc
index ed180f9..0507017 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -3,8 +3,6 @@
# kernel
PREFERRED_PROVIDER_virtual/kernel ?= "linux-stable"
LINUX_VERSION_EXTENSION ?= "-rockchip"
-KBUILD_DEFCONFIG = "multi_v7_defconfig"
-KERNEL_IMAGETYPE = "zImage"
# xserver
PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch
new file mode 100644
index 0000000..755b618
--- /dev/null
+++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware/0001-rockchip-Prevent-macro-expansion-in-paths.patch
@@ -0,0 +1,94 @@
+From 39a97dce61aca9f618e28e26c6e441c8976f3172 Mon Sep 17 00:00:00 2001
+From: Joshua Watt <JPEWhacker@gmail.com>
+Date: Fri, 13 Dec 2019 13:44:55 -0600
+Subject: [PATCH] rockchip: Prevent macro expansion in paths
+
+Instead of stringizing the paths to binary files, add them as string
+defines on the command line (e.g. -DFOO=\"BAR\" instead of -DFOO=BAR).
+This prevents macros from being expanded inside the string value itself.
+For example, -DFOO=/path/with-linux-in-it would have been expanded to
+"/path/with-1-in-it" because `linux=1` is one of the standard GCC
+defines.
+
+Upstream-Status: Accepted [https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/2813]
+Change-Id: I7b65df3c9930faed4f1aff75ad726982ae3671e6
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+---
+ plat/rockchip/rk3399/drivers/dp/cdn_dp.c | 2 +-
+ plat/rockchip/rk3399/drivers/pmu/pmu_fw.c | 24 +++++++++++------------
+ plat/rockchip/rk3399/platform.mk | 6 +++---
+ 3 files changed, 15 insertions(+), 17 deletions(-)
+
+diff --git a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
+index aa71fdea..a8773f4f 100644
+--- a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
++++ b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
+@@ -18,7 +18,7 @@ __asm__(
+ ".global hdcp_handler\n"
+ ".balign 4\n"
+ "hdcp_handler:\n"
+- ".incbin \"" __XSTRING(HDCPFW) "\"\n"
++ ".incbin \"" HDCPFW "\"\n"
+ ".type hdcp_handler, %function\n"
+ ".size hdcp_handler, .- hdcp_handler\n"
+ ".popsection\n"
+diff --git a/plat/rockchip/rk3399/drivers/pmu/pmu_fw.c b/plat/rockchip/rk3399/drivers/pmu/pmu_fw.c
+index a09ad21e..25596b18 100644
+--- a/plat/rockchip/rk3399/drivers/pmu/pmu_fw.c
++++ b/plat/rockchip/rk3399/drivers/pmu/pmu_fw.c
+@@ -5,20 +5,18 @@
+ */
+
+ /* convoluted way to make sure that the define is pasted just the right way */
+-#define _INCBIN(file, sym, sec) \
++#define INCBIN(file, sym, sec) \
+ __asm__( \
+- ".section " #sec "\n" \
+- ".global " #sym "\n" \
+- ".type " #sym ", %object\n" \
++ ".section " sec "\n" \
++ ".global " sym "\n" \
++ ".type " sym ", %object\n" \
+ ".align 4\n" \
+- #sym ":\n" \
+- ".incbin \"" #file "\"\n" \
+- ".size " #sym ", .-" #sym "\n" \
+- ".global " #sym "_end\n" \
+- #sym "_end:\n" \
++ sym ":\n" \
++ ".incbin \"" file "\"\n" \
++ ".size " sym ", .-" sym "\n" \
++ ".global " sym "_end\n" \
++ sym "_end:\n" \
+ )
+
+-#define INCBIN(file, sym, sec) _INCBIN(file, sym, sec)
+-
+-INCBIN(RK3399M0FW, rk3399m0_bin, ".sram.incbin");
+-INCBIN(RK3399M0PMUFW, rk3399m0pmu_bin, ".pmusram.incbin");
++INCBIN(RK3399M0FW, "rk3399m0_bin", ".sram.incbin");
++INCBIN(RK3399M0PMUFW, "rk3399m0pmu_bin", ".pmusram.incbin");
+diff --git a/plat/rockchip/rk3399/platform.mk b/plat/rockchip/rk3399/platform.mk
+index cfc48e8f..643c24f5 100644
+--- a/plat/rockchip/rk3399/platform.mk
++++ b/plat/rockchip/rk3399/platform.mk
+@@ -82,13 +82,13 @@ PLAT_M0 := ${PLAT}m0
+ BUILD_M0 := ${BUILD_PLAT}/m0
+
+ RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin
+-$(eval $(call add_define,RK3399M0FW))
++$(eval $(call add_define_val,RK3399M0FW,\"$(RK3399M0FW)\"))
+
+ RK3399M0PMUFW=${BUILD_M0}/${PLAT_M0}pmu.bin
+-$(eval $(call add_define,RK3399M0PMUFW))
++$(eval $(call add_define_val,RK3399M0PMUFW,\"$(RK3399M0PMUFW)\"))
+
+ HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin
+-$(eval $(call add_define,HDCPFW))
++$(eval $(call add_define_val,HDCPFW,\"$(HDCPFW)\"))
+
+ # CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin
+ export CCACHE_EXTRAFILES
+--
+2.23.0
+
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
index 710336a..602ce30 100644
--- a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
+++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
@@ -6,10 +6,16 @@ HOMEPAGE = "https://developer.trustedfirmware.org/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+# Rockchip RK3399 compiles some M0 firmware which requires an arm-none-eabi GCC
+# toolchain
+DEPENDS_rk3399 = "virtual/arm-none-eabi-gcc"
+
PROVIDES = "virtual/atf"
BRANCH = "master"
-SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=http;branch=${BRANCH}"
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=http;branch=${BRANCH} \
+ file://0001-rockchip-Prevent-macro-expansion-in-paths.patch \
+ "
SRCREV = "a04808c16cfc126d9fe572ae7c4b5a3d39de5796"
S = "${WORKDIR}/git"
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index 801f710..401d649 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -4,3 +4,11 @@ do_compile_append_rock2-square () {
cp ${B}/spl/${SPL_BINARY} ${B}
fi
}
+
+ATF_DEPENDS ??= ""
+
+EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31.elf"
+ATF_DEPENDS_rk3399 = "virtual/atf:do_deploy"
+
+do_compile[depends] += "${ATF_DEPENDS}"
+
diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend
index 5856c71..3e8711c 100644
--- a/recipes-graphics/mesa/mesa_%.bbappend
+++ b/recipes-graphics/mesa/mesa_%.bbappend
@@ -1 +1,2 @@
PACKAGECONFIG_append_rk3288 = " kmsro panfrost"
+PACKAGECONFIG_append_rk3399 = " kmsro panfrost"
diff --git a/wic/rk3399-boot.wks b/wic/rk3399-boot.wks
new file mode 100644
index 0000000..100b94d
--- /dev/null
+++ b/wic/rk3399-boot.wks
@@ -0,0 +1,24 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidiaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# Disk layout
+# Note that the reference documentation refers to 512 byte disk sectors, but
+# wic uses 1KB blocks
+#
+# Partition Start Sector Number of Sectors
+# loader1 64 8000
+# reserved1 8064 128
+# reserved2 8192 8192
+# loader2 16384 8192
+# atf 24576 8192
+# boot 32768 229376
+# root 262144 -
+#
+
+part loader1 --align 32 --size 4000K --source rawcopy --sourceparams="file=idbloader.img"
+part reserved1 --align 4032 --size 64K
+part reserved2 --align 4096 --size 4096K
+part loader2 --align 8192 --size 4096K --source rawcopy --sourceparams="file=u-boot.itb"
+part atf --align 12288 --size 4096K
+part /boot --align 16384 --size=114688K --active --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"
+
--
2.24.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [yocto][meta-rockchip][PATCH v2 4/4] rock-pi-4: Add machine
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 0/4] Add Rock Pi 4 Support Joshua Watt
` (2 preceding siblings ...)
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 3/4] rk3399: Add generic rk3399 support Joshua Watt
@ 2020-01-23 19:46 ` Joshua Watt
3 siblings, 0 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 19:46 UTC (permalink / raw)
To: yocto; +Cc: Joshua Watt
Adds the machine definition for the Rock Pi 4 based around the RK3399
SoC.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
README | 1 +
conf/machine/rock-pi-4.conf | 28 ++++++++++++++++++++++++++++
wic/rock-pi-4.wks | 7 +++++++
3 files changed, 36 insertions(+)
create mode 100644 conf/machine/rock-pi-4.conf
create mode 100644 wic/rock-pi-4.wks
diff --git a/README b/README
index 77506c8..5486b29 100644
--- a/README
+++ b/README
@@ -14,6 +14,7 @@ Dependencies:
Status of supported boards:
--------------------------
builds and boots gpt image:
+ rock-pi-4
tinker-rk3288
vyasa-rk3288
firefly-rk3288
diff --git a/conf/machine/rock-pi-4.conf b/conf/machine/rock-pi-4.conf
new file mode 100644
index 0000000..4cbfc3f
--- /dev/null
+++ b/conf/machine/rock-pi-4.conf
@@ -0,0 +1,28 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+#@TYPE: Machine
+#@NAME: Rock Pi 4 RK3288
+#@DESCRIPTION: Rock Pi 4 is a Raspberry Pi 4 Alternative based on Rockchip RK3399 Processor.
+
+require conf/machine/include/rk3399.inc
+
+KERNEL_DEVICETREE = "rockchip/rk3399-rock-pi-4.dtb"
+UBOOT_MACHINE = "rock-pi-4-rk3399_defconfig"
+
+WKS_FILE ?= "rock-pi-4.wks"
+IMAGE_FSTYPES += "wic wic.bmap"
+
+WKS_FILE_DEPENDS ?= " \
+ mtools-native \
+ dosfstools-native \
+ virtual/bootloader \
+ virtual/kernel \
+ "
+IMAGE_BOOT_FILES ?= "\
+ ${KERNEL_IMAGETYPE} \
+ "
+
+SERIAL_CONSOLES = "1500000;ttyS2"
+
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
diff --git a/wic/rock-pi-4.wks b/wic/rock-pi-4.wks
new file mode 100644
index 0000000..8e4b37c
--- /dev/null
+++ b/wic/rock-pi-4.wks
@@ -0,0 +1,7 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidiaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+include rk3399-boot.wks
+part / --align 131072 --source rootfs --fstype=ext4 --label root
+
+bootloader --ptable gpt --append="console=tty1 console=ttyS2,1500000n8 rw root=/dev/mmcblk1p7 rootfstype=ext4 init=/sbin/init"
--
2.24.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: Add recipe
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: " Joshua Watt
@ 2020-01-23 19:49 ` Khem Raj
2020-01-23 19:59 ` Joshua Watt
0 siblings, 1 reply; 17+ messages in thread
From: Khem Raj @ 2020-01-23 19:49 UTC (permalink / raw)
To: Joshua Watt; +Cc: yocto, Trevor Woerner
On Thu, Jan 23, 2020 at 8:08 AM Joshua Watt <JPEWhacker@gmail.com> wrote:
>
> Adds a recipe to pull down the prebuilt GCC for compiling on Cortex-R
> and Cortex-M processors from ARM. This toolchain is required to build
> Arm Trusted Firmware for the Rockchip rk3399 SoC, since it must compile
> some firmware for the M0 coprocessor.
>
can this use mutliconfig ?
This seems then can be avoided
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
> ...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 +++++++++++++++++++
> 1 file changed, 37 insertions(+)
> create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
>
> diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> new file mode 100644
> index 0000000..a0c832d
> --- /dev/null
> +++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> @@ -0,0 +1,37 @@
> +# Copyright (C) 2019 Garmin Ltd. or its subsidaries
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +DESCRIPTION = "Baremetal GCC for ARM-R and ARM-M processors"
> +LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
> +
> +LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=c18349634b740b7b95f2c2159af888f5"
> +
> +PROVIDES = "virtual/arm-none-eabi-gcc"
> +
> +SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/${BPN}-${PV}-x86_64-linux.tar.bz2"
> +
> +SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
> +SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
> +
> +S = "${WORKDIR}/${BPN}-${PV}"
> +
> +inherit native
> +
> +COMPATIBLE_HOST = "x86_64.*-linux"
> +
> +do_install() {
> + install -d ${D}${datadir}/arm-none-eabi/
> + cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
> +
> + install -d ${D}${bindir}
> + # Symlink all executables into bindir
> + for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
> + lnr $f ${D}${bindir}/$(basename $f)
> + done
> +}
> +
> +INSANE_SKIP_${PN} = "already-stripped"
> +
> +INHIBIT_SYSROOT_STRIP = "1"
> +INHIBIT_PACKAGE_STRIP = "1"
> +INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
> --
> 2.24.1
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: Add recipe
2020-01-23 19:49 ` Khem Raj
@ 2020-01-23 19:59 ` Joshua Watt
2020-01-23 20:06 ` Khem Raj
0 siblings, 1 reply; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 19:59 UTC (permalink / raw)
To: Khem Raj; +Cc: yocto, Trevor Woerner
On 1/23/20 1:49 PM, Khem Raj wrote:
> On Thu, Jan 23, 2020 at 8:08 AM Joshua Watt <JPEWhacker@gmail.com> wrote:
>> Adds a recipe to pull down the prebuilt GCC for compiling on Cortex-R
>> and Cortex-M processors from ARM. This toolchain is required to build
>> Arm Trusted Firmware for the Rockchip rk3399 SoC, since it must compile
>> some firmware for the M0 coprocessor.
>>
> can this use mutliconfig ?
> This seems then can be avoided
I'm not sure if multiconfig is applicable in this case; This is required
because the same recipe (arm-trusted-firmware) requires 2 different
compilers to be available; the target compiler (aarch64-poky-linux), and
an arm-none-eabi-gcc compiler specifically to compile some M0 firmware
that goes into ATF.
Multiconfig would work (I think), if the recipe only needed one or the
other, but not in this case where it needs both.
I also looked at building an additional gcc-cross recipe that explicitly
targets arm-none-eabi, but the maintenance was going to be a pain unless
A) the recipe lived in OE-core or B) this layer copied all of the GCC
recipes. Neither of those was appealing at the moment, but I plan on
revisiting it. Even when I did have it in OE-core, I had some trouble
with some manifest warnings, so I'm not quite sure I was doing it correctly.
>
>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
>> ---
>> ...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 +++++++++++++++++++
>> 1 file changed, 37 insertions(+)
>> create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
>>
>> diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
>> new file mode 100644
>> index 0000000..a0c832d
>> --- /dev/null
>> +++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
>> @@ -0,0 +1,37 @@
>> +# Copyright (C) 2019 Garmin Ltd. or its subsidaries
>> +# Released under the MIT license (see COPYING.MIT for the terms)
>> +
>> +DESCRIPTION = "Baremetal GCC for ARM-R and ARM-M processors"
>> +LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
>> +
>> +LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=c18349634b740b7b95f2c2159af888f5"
>> +
>> +PROVIDES = "virtual/arm-none-eabi-gcc"
>> +
>> +SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/${BPN}-${PV}-x86_64-linux.tar.bz2"
>> +
>> +SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
>> +SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
>> +
>> +S = "${WORKDIR}/${BPN}-${PV}"
>> +
>> +inherit native
>> +
>> +COMPATIBLE_HOST = "x86_64.*-linux"
>> +
>> +do_install() {
>> + install -d ${D}${datadir}/arm-none-eabi/
>> + cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
>> +
>> + install -d ${D}${bindir}
>> + # Symlink all executables into bindir
>> + for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
>> + lnr $f ${D}${bindir}/$(basename $f)
>> + done
>> +}
>> +
>> +INSANE_SKIP_${PN} = "already-stripped"
>> +
>> +INHIBIT_SYSROOT_STRIP = "1"
>> +INHIBIT_PACKAGE_STRIP = "1"
>> +INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
>> --
>> 2.24.1
>>
>>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: Add recipe
2020-01-23 19:59 ` Joshua Watt
@ 2020-01-23 20:06 ` Khem Raj
2020-01-23 20:14 ` Joshua Watt
0 siblings, 1 reply; 17+ messages in thread
From: Khem Raj @ 2020-01-23 20:06 UTC (permalink / raw)
To: Joshua Watt; +Cc: yocto, Trevor Woerner
On Thu, Jan 23, 2020 at 11:59 AM Joshua Watt <jpewhacker@gmail.com> wrote:
>
>
> On 1/23/20 1:49 PM, Khem Raj wrote:
> > On Thu, Jan 23, 2020 at 8:08 AM Joshua Watt <JPEWhacker@gmail.com> wrote:
> >> Adds a recipe to pull down the prebuilt GCC for compiling on Cortex-R
> >> and Cortex-M processors from ARM. This toolchain is required to build
> >> Arm Trusted Firmware for the Rockchip rk3399 SoC, since it must compile
> >> some firmware for the M0 coprocessor.
> >>
> > can this use mutliconfig ?
> > This seems then can be avoided
>
> I'm not sure if multiconfig is applicable in this case; This is required
> because the same recipe (arm-trusted-firmware) requires 2 different
> compilers to be available; the target compiler (aarch64-poky-linux), and
> an arm-none-eabi-gcc compiler specifically to compile some M0 firmware
> that goes into ATF.
>
> Multiconfig would work (I think), if the recipe only needed one or the
> other, but not in this case where it needs both.
right, so question is if this recipe can be effectively two such recipes. If not
then perhaps this solution is ok or perhaps we can just use prebuilts for the M0
>
> I also looked at building an additional gcc-cross recipe that explicitly
> targets arm-none-eabi, but the maintenance was going to be a pain unless
> A) the recipe lived in OE-core or B) this layer copied all of the GCC
> recipes. Neither of those was appealing at the moment, but I plan on
> revisiting it. Even when I did have it in OE-core, I had some trouble
> with some manifest warnings, so I'm not quite sure I was doing it correctly.
>
> >
> >> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> >> ---
> >> ...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 +++++++++++++++++++
> >> 1 file changed, 37 insertions(+)
> >> create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >>
> >> diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >> new file mode 100644
> >> index 0000000..a0c832d
> >> --- /dev/null
> >> +++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >> @@ -0,0 +1,37 @@
> >> +# Copyright (C) 2019 Garmin Ltd. or its subsidaries
> >> +# Released under the MIT license (see COPYING.MIT for the terms)
> >> +
> >> +DESCRIPTION = "Baremetal GCC for ARM-R and ARM-M processors"
> >> +LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
> >> +
> >> +LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=c18349634b740b7b95f2c2159af888f5"
> >> +
> >> +PROVIDES = "virtual/arm-none-eabi-gcc"
> >> +
> >> +SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/${BPN}-${PV}-x86_64-linux.tar.bz2"
> >> +
> >> +SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
> >> +SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
> >> +
> >> +S = "${WORKDIR}/${BPN}-${PV}"
> >> +
> >> +inherit native
> >> +
> >> +COMPATIBLE_HOST = "x86_64.*-linux"
> >> +
> >> +do_install() {
> >> + install -d ${D}${datadir}/arm-none-eabi/
> >> + cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
> >> +
> >> + install -d ${D}${bindir}
> >> + # Symlink all executables into bindir
> >> + for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
> >> + lnr $f ${D}${bindir}/$(basename $f)
> >> + done
> >> +}
> >> +
> >> +INSANE_SKIP_${PN} = "already-stripped"
> >> +
> >> +INHIBIT_SYSROOT_STRIP = "1"
> >> +INHIBIT_PACKAGE_STRIP = "1"
> >> +INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
> >> --
> >> 2.24.1
> >>
> >>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: Add recipe
2020-01-23 20:06 ` Khem Raj
@ 2020-01-23 20:14 ` Joshua Watt
2020-01-23 20:46 ` Denys Dmytriyenko
2020-01-23 22:34 ` Khem Raj
0 siblings, 2 replies; 17+ messages in thread
From: Joshua Watt @ 2020-01-23 20:14 UTC (permalink / raw)
To: Khem Raj; +Cc: yocto, Trevor Woerner
On 1/23/20 2:06 PM, Khem Raj wrote:
> On Thu, Jan 23, 2020 at 11:59 AM Joshua Watt <jpewhacker@gmail.com> wrote:
>>
>> On 1/23/20 1:49 PM, Khem Raj wrote:
>>> On Thu, Jan 23, 2020 at 8:08 AM Joshua Watt <JPEWhacker@gmail.com> wrote:
>>>> Adds a recipe to pull down the prebuilt GCC for compiling on Cortex-R
>>>> and Cortex-M processors from ARM. This toolchain is required to build
>>>> Arm Trusted Firmware for the Rockchip rk3399 SoC, since it must compile
>>>> some firmware for the M0 coprocessor.
>>>>
>>> can this use mutliconfig ?
>>> This seems then can be avoided
>> I'm not sure if multiconfig is applicable in this case; This is required
>> because the same recipe (arm-trusted-firmware) requires 2 different
>> compilers to be available; the target compiler (aarch64-poky-linux), and
>> an arm-none-eabi-gcc compiler specifically to compile some M0 firmware
>> that goes into ATF.
>>
>> Multiconfig would work (I think), if the recipe only needed one or the
>> other, but not in this case where it needs both.
> right, so question is if this recipe can be effectively two such recipes. If not
> then perhaps this solution is ok or perhaps we can just use prebuilts for the M0
It *might* be possible to build it in two passes, but I'd rather not
because its not the way the ATF is intended to be built. The code
currently expects that it can build with the arm-none-eabi-gcc, so
anything thing we do differently is more likely to break. Right now, the
AFT recipe should be pretty easy to maintain; breaking it apart will
make it quite a bit more complicated.
I'd rather have a prebuilt (for now) GCC building some firmware from
source that download a prebuilt firmware image :)
Like I said, long term I'd like to build up the arm-none-eabi-gcc from
gcc-cross in OE-core, I just haven't figured out the best way to do that
yet.
>
>> I also looked at building an additional gcc-cross recipe that explicitly
>> targets arm-none-eabi, but the maintenance was going to be a pain unless
>> A) the recipe lived in OE-core or B) this layer copied all of the GCC
>> recipes. Neither of those was appealing at the moment, but I plan on
>> revisiting it. Even when I did have it in OE-core, I had some trouble
>> with some manifest warnings, so I'm not quite sure I was doing it correctly.
>>
>>>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
>>>> ---
>>>> ...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 +++++++++++++++++++
>>>> 1 file changed, 37 insertions(+)
>>>> create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
>>>>
>>>> diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
>>>> new file mode 100644
>>>> index 0000000..a0c832d
>>>> --- /dev/null
>>>> +++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
>>>> @@ -0,0 +1,37 @@
>>>> +# Copyright (C) 2019 Garmin Ltd. or its subsidaries
>>>> +# Released under the MIT license (see COPYING.MIT for the terms)
>>>> +
>>>> +DESCRIPTION = "Baremetal GCC for ARM-R and ARM-M processors"
>>>> +LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
>>>> +
>>>> +LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=c18349634b740b7b95f2c2159af888f5"
>>>> +
>>>> +PROVIDES = "virtual/arm-none-eabi-gcc"
>>>> +
>>>> +SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/${BPN}-${PV}-x86_64-linux.tar.bz2"
>>>> +
>>>> +SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
>>>> +SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
>>>> +
>>>> +S = "${WORKDIR}/${BPN}-${PV}"
>>>> +
>>>> +inherit native
>>>> +
>>>> +COMPATIBLE_HOST = "x86_64.*-linux"
>>>> +
>>>> +do_install() {
>>>> + install -d ${D}${datadir}/arm-none-eabi/
>>>> + cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
>>>> +
>>>> + install -d ${D}${bindir}
>>>> + # Symlink all executables into bindir
>>>> + for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
>>>> + lnr $f ${D}${bindir}/$(basename $f)
>>>> + done
>>>> +}
>>>> +
>>>> +INSANE_SKIP_${PN} = "already-stripped"
>>>> +
>>>> +INHIBIT_SYSROOT_STRIP = "1"
>>>> +INHIBIT_PACKAGE_STRIP = "1"
>>>> +INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
>>>> --
>>>> 2.24.1
>>>>
>>>>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [yocto][meta-rockchip][PATCH v2 1/4] arm-trusted-firmware: Add recipe
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 1/4] arm-trusted-firmware: Add recipe Joshua Watt
@ 2020-01-23 20:39 ` Denys Dmytriyenko
0 siblings, 0 replies; 17+ messages in thread
From: Denys Dmytriyenko @ 2020-01-23 20:39 UTC (permalink / raw)
To: Joshua Watt; +Cc: yocto
Heh, I've been sitting on arm-trusted-firmware recipe in meta-ti for some
time[1], wondering if I should submit it to oe-core, as it's being used more
widely among arm64 platforms these days...
I know each SoC/platform has few customizations on top of generic ATF/TF-A,
but we can probably have a common base in oe-core and then add our own pieces
on top in each BSP layer.
I already had some preliminary work done in making the recipe more generic,
but after seeing your version here, I borrowed couple things. Would you mind
if I submit that to oe-core and we can beef it up as needed to be usable as a
common base for differen BSPs, if accepted to oe-core?
[Though, I'm not a big fan of vanity copyright banners, but I can add your SoB
line, if needed.]
Denys
[1] http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/tree/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
On Thu, Jan 23, 2020 at 01:46:42PM -0600, Joshua Watt wrote:
> Adds a recipe to build Arm Trusted Firmware
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
> .../arm-trusted-firmware_2.2.bb | 38 +++++++++++++++++++
> 1 file changed, 38 insertions(+)
> create mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
>
> diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
> new file mode 100644
> index 0000000..710336a
> --- /dev/null
> +++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.2.bb
> @@ -0,0 +1,38 @@
> +# Copyright (C) 2019 Garmin Ltd. or its subsidaries
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +SUMMARY = "Arm Trusted Firmware"
> +HOMEPAGE = "https://developer.trustedfirmware.org/"
> +LICENSE = "BSD-3-Clause"
> +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
> +
> +PROVIDES = "virtual/atf"
> +
> +BRANCH = "master"
> +SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=http;branch=${BRANCH}"
> +SRCREV = "a04808c16cfc126d9fe572ae7c4b5a3d39de5796"
> +
> +S = "${WORKDIR}/git"
> +B = "${WORKDIR}/build"
> +
> +inherit deploy
> +
> +ATF_SUFFIX ??= "bin"
> +
> +do_compile() {
> + unset LDFLAGS
> + unset CFLAGS
> + unset CPPFLAGS
> +
> + oe_runmake -C ${S} BUILD_BASE=${B} DEBUG=0 CROSS_COMPILE=${TARGET_PREFIX} \
> + PLAT=${ATF_PLATFORM} ${ATF_TARGET}
> +}
> +
> +PACKAGE_ARCH = "${MACHINE_ARCH}"
> +
> +do_deploy() {
> + install -m 644 ${B}/${ATF_PLATFORM}/release/${ATF_TARGET}/${ATF_TARGET}.${ATF_SUFFIX} \
> + ${DEPLOYDIR}/${ATF_TARGET}.${ATF_SUFFIX}
> +}
> +addtask deploy after do_compile
> +
> --
> 2.24.1
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: Add recipe
2020-01-23 20:14 ` Joshua Watt
@ 2020-01-23 20:46 ` Denys Dmytriyenko
2020-01-23 22:34 ` Khem Raj
1 sibling, 0 replies; 17+ messages in thread
From: Denys Dmytriyenko @ 2020-01-23 20:46 UTC (permalink / raw)
To: Joshua Watt; +Cc: Khem Raj, yocto, Trevor Woerner
On Thu, Jan 23, 2020 at 02:14:57PM -0600, Joshua Watt wrote:
>
> On 1/23/20 2:06 PM, Khem Raj wrote:
> >On Thu, Jan 23, 2020 at 11:59 AM Joshua Watt <jpewhacker@gmail.com> wrote:
> >>
> >>On 1/23/20 1:49 PM, Khem Raj wrote:
> >>>On Thu, Jan 23, 2020 at 8:08 AM Joshua Watt <JPEWhacker@gmail.com> wrote:
> >>>>Adds a recipe to pull down the prebuilt GCC for compiling on Cortex-R
> >>>>and Cortex-M processors from ARM. This toolchain is required to build
> >>>>Arm Trusted Firmware for the Rockchip rk3399 SoC, since it must compile
> >>>>some firmware for the M0 coprocessor.
> >>>>
> >>>can this use mutliconfig ?
> >>>This seems then can be avoided
> >>I'm not sure if multiconfig is applicable in this case; This is required
> >>because the same recipe (arm-trusted-firmware) requires 2 different
> >>compilers to be available; the target compiler (aarch64-poky-linux), and
> >>an arm-none-eabi-gcc compiler specifically to compile some M0 firmware
> >>that goes into ATF.
> >>
> >>Multiconfig would work (I think), if the recipe only needed one or the
> >>other, but not in this case where it needs both.
> >right, so question is if this recipe can be effectively two such recipes. If not
> >then perhaps this solution is ok or perhaps we can just use prebuilts for the M0
>
> It *might* be possible to build it in two passes, but I'd rather not
> because its not the way the ATF is intended to be built. The code
> currently expects that it can build with the arm-none-eabi-gcc, so
> anything thing we do differently is more likely to break. Right now,
> the AFT recipe should be pretty easy to maintain; breaking it apart
> will make it quite a bit more complicated.
>
> I'd rather have a prebuilt (for now) GCC building some firmware from
> source that download a prebuilt firmware image :)
>
> Like I said, long term I'd like to build up the arm-none-eabi-gcc
> from gcc-cross in OE-core, I just haven't figured out the best way
> to do that yet.
Ha, this is quite familiar as well! We had these gcc-arm-none-eabi-native and
other recipes in meta-ti for compiling different pieces for secondary cores in
our SoCs - MCUs, DSPs, etc. That was way before multiconfig was available.
Recently I was looking into converting the old model into multiconfig - there
was a discussion with fray last month regarding this and he posted a more
generic proposal to oe-architecture list. I still need to get back to that
activity - kind of got busy after the holidays...
--
Denys
> >>I also looked at building an additional gcc-cross recipe that explicitly
> >>targets arm-none-eabi, but the maintenance was going to be a pain unless
> >>A) the recipe lived in OE-core or B) this layer copied all of the GCC
> >>recipes. Neither of those was appealing at the moment, but I plan on
> >>revisiting it. Even when I did have it in OE-core, I had some trouble
> >>with some manifest warnings, so I'm not quite sure I was doing it correctly.
> >>
> >>>>Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> >>>>---
> >>>> ...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 +++++++++++++++++++
> >>>> 1 file changed, 37 insertions(+)
> >>>> create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >>>>
> >>>>diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >>>>new file mode 100644
> >>>>index 0000000..a0c832d
> >>>>--- /dev/null
> >>>>+++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >>>>@@ -0,0 +1,37 @@
> >>>>+# Copyright (C) 2019 Garmin Ltd. or its subsidaries
> >>>>+# Released under the MIT license (see COPYING.MIT for the terms)
> >>>>+
> >>>>+DESCRIPTION = "Baremetal GCC for ARM-R and ARM-M processors"
> >>>>+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
> >>>>+
> >>>>+LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=c18349634b740b7b95f2c2159af888f5"
> >>>>+
> >>>>+PROVIDES = "virtual/arm-none-eabi-gcc"
> >>>>+
> >>>>+SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/${BPN}-${PV}-x86_64-linux.tar.bz2"
> >>>>+
> >>>>+SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
> >>>>+SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
> >>>>+
> >>>>+S = "${WORKDIR}/${BPN}-${PV}"
> >>>>+
> >>>>+inherit native
> >>>>+
> >>>>+COMPATIBLE_HOST = "x86_64.*-linux"
> >>>>+
> >>>>+do_install() {
> >>>>+ install -d ${D}${datadir}/arm-none-eabi/
> >>>>+ cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
> >>>>+
> >>>>+ install -d ${D}${bindir}
> >>>>+ # Symlink all executables into bindir
> >>>>+ for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
> >>>>+ lnr $f ${D}${bindir}/$(basename $f)
> >>>>+ done
> >>>>+}
> >>>>+
> >>>>+INSANE_SKIP_${PN} = "already-stripped"
> >>>>+
> >>>>+INHIBIT_SYSROOT_STRIP = "1"
> >>>>+INHIBIT_PACKAGE_STRIP = "1"
> >>>>+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
> >>>>--
> >>>>2.24.1
> >>>>
> >>>>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: Add recipe
2020-01-23 20:14 ` Joshua Watt
2020-01-23 20:46 ` Denys Dmytriyenko
@ 2020-01-23 22:34 ` Khem Raj
1 sibling, 0 replies; 17+ messages in thread
From: Khem Raj @ 2020-01-23 22:34 UTC (permalink / raw)
To: Joshua Watt; +Cc: yocto, Trevor Woerner
I know you have a working solution, however, I was thinking if
we want ATF to work well with yocto build system and therefore
might require better re-architecting upstream. Since arm and aarch32
backends are different you will need two compiler backends
essentially, it wont work like x86 could work. So perhaps
its best for ATF to build these components separately ot atleast
have possibility to do so.
On Thu, Jan 23, 2020 at 12:14 PM Joshua Watt <jpewhacker@gmail.com> wrote:
>
>
> On 1/23/20 2:06 PM, Khem Raj wrote:
> > On Thu, Jan 23, 2020 at 11:59 AM Joshua Watt <jpewhacker@gmail.com> wrote:
> >>
> >> On 1/23/20 1:49 PM, Khem Raj wrote:
> >>> On Thu, Jan 23, 2020 at 8:08 AM Joshua Watt <JPEWhacker@gmail.com> wrote:
> >>>> Adds a recipe to pull down the prebuilt GCC for compiling on Cortex-R
> >>>> and Cortex-M processors from ARM. This toolchain is required to build
> >>>> Arm Trusted Firmware for the Rockchip rk3399 SoC, since it must compile
> >>>> some firmware for the M0 coprocessor.
> >>>>
> >>> can this use mutliconfig ?
> >>> This seems then can be avoided
> >> I'm not sure if multiconfig is applicable in this case; This is required
> >> because the same recipe (arm-trusted-firmware) requires 2 different
> >> compilers to be available; the target compiler (aarch64-poky-linux), and
> >> an arm-none-eabi-gcc compiler specifically to compile some M0 firmware
> >> that goes into ATF.
> >>
> >> Multiconfig would work (I think), if the recipe only needed one or the
> >> other, but not in this case where it needs both.
> > right, so question is if this recipe can be effectively two such recipes. If not
> > then perhaps this solution is ok or perhaps we can just use prebuilts for the M0
>
> It *might* be possible to build it in two passes, but I'd rather not
> because its not the way the ATF is intended to be built. The code
> currently expects that it can build with the arm-none-eabi-gcc, so
> anything thing we do differently is more likely to break. Right now, the
> AFT recipe should be pretty easy to maintain; breaking it apart will
> make it quite a bit more complicated.
>
> I'd rather have a prebuilt (for now) GCC building some firmware from
> source that download a prebuilt firmware image :)
>
> Like I said, long term I'd like to build up the arm-none-eabi-gcc from
> gcc-cross in OE-core, I just haven't figured out the best way to do that
> yet.
>
>
> >
> >> I also looked at building an additional gcc-cross recipe that explicitly
> >> targets arm-none-eabi, but the maintenance was going to be a pain unless
> >> A) the recipe lived in OE-core or B) this layer copied all of the GCC
> >> recipes. Neither of those was appealing at the moment, but I plan on
> >> revisiting it. Even when I did have it in OE-core, I had some trouble
> >> with some manifest warnings, so I'm not quite sure I was doing it correctly.
> >>
> >>>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> >>>> ---
> >>>> ...cc-arm-none-eabi-native_9-2019-q4-major.bb | 37 +++++++++++++++++++
> >>>> 1 file changed, 37 insertions(+)
> >>>> create mode 100644 recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >>>>
> >>>> diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >>>> new file mode 100644
> >>>> index 0000000..a0c832d
> >>>> --- /dev/null
> >>>> +++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi-native_9-2019-q4-major.bb
> >>>> @@ -0,0 +1,37 @@
> >>>> +# Copyright (C) 2019 Garmin Ltd. or its subsidaries
> >>>> +# Released under the MIT license (see COPYING.MIT for the terms)
> >>>> +
> >>>> +DESCRIPTION = "Baremetal GCC for ARM-R and ARM-M processors"
> >>>> +LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
> >>>> +
> >>>> +LIC_FILES_CHKSUM = "file://share/doc/gcc-arm-none-eabi/license.txt;md5=c18349634b740b7b95f2c2159af888f5"
> >>>> +
> >>>> +PROVIDES = "virtual/arm-none-eabi-gcc"
> >>>> +
> >>>> +SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/${BPN}-${PV}-x86_64-linux.tar.bz2"
> >>>> +
> >>>> +SRC_URI[md5sum] = "fe0029de4f4ec43cf7008944e34ff8cc"
> >>>> +SRC_URI[sha256sum] = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a"
> >>>> +
> >>>> +S = "${WORKDIR}/${BPN}-${PV}"
> >>>> +
> >>>> +inherit native
> >>>> +
> >>>> +COMPATIBLE_HOST = "x86_64.*-linux"
> >>>> +
> >>>> +do_install() {
> >>>> + install -d ${D}${datadir}/arm-none-eabi/
> >>>> + cp -r ${S}/. ${D}${datadir}/arm-none-eabi/
> >>>> +
> >>>> + install -d ${D}${bindir}
> >>>> + # Symlink all executables into bindir
> >>>> + for f in ${D}${datadir}/arm-none-eabi/bin/arm-none-eabi-*; do
> >>>> + lnr $f ${D}${bindir}/$(basename $f)
> >>>> + done
> >>>> +}
> >>>> +
> >>>> +INSANE_SKIP_${PN} = "already-stripped"
> >>>> +
> >>>> +INHIBIT_SYSROOT_STRIP = "1"
> >>>> +INHIBIT_PACKAGE_STRIP = "1"
> >>>> +INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
> >>>> --
> >>>> 2.24.1
> >>>>
> >>>>
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2020-01-23 22:34 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-23 16:08 [yocto][meta-rockchip][PATCH 0/4] Add RockPi 4 support Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 1/4] arm-trusted-firmware: Add recipe Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 2/4] gcc-arm-none-eabi-native: " Joshua Watt
2020-01-23 19:49 ` Khem Raj
2020-01-23 19:59 ` Joshua Watt
2020-01-23 20:06 ` Khem Raj
2020-01-23 20:14 ` Joshua Watt
2020-01-23 20:46 ` Denys Dmytriyenko
2020-01-23 22:34 ` Khem Raj
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 3/4] rk3399: Add generic rk3399 support Joshua Watt
2020-01-23 16:08 ` [yocto][meta-rockchip][PATCH 4/4] rock-pi-4-rk3399: Add machine Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 0/4] Add Rock Pi 4 Support Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 1/4] arm-trusted-firmware: Add recipe Joshua Watt
2020-01-23 20:39 ` Denys Dmytriyenko
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 2/4] gcc-arm-none-eabi-native: " Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 3/4] rk3399: Add generic rk3399 support Joshua Watt
2020-01-23 19:46 ` [yocto][meta-rockchip][PATCH v2 4/4] rock-pi-4: Add machine Joshua Watt
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.