Topics

[meta-rockchip][PATCH] Use TF-A recipe from meta-arm


Joshua Watt
 

Converts the build to pull the canonical TF-A recipe from meta-arm
instead of duplicating it in this layer.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
README | 4 ++
conf/layer.conf | 2 +-
conf/machine/include/rk3399.inc | 5 +--
.../arm-trusted-firmware_2.3.bb | 43 -------------------
.../trusted-firmware-a_%.bbappend | 6 +++
recipes-bsp/u-boot/u-boot%.bbappend | 6 +--
6 files changed, 16 insertions(+), 50 deletions(-)
delete mode 100644 recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.3.bb
create mode 100644 recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend

diff --git a/README b/README
index a97b89e..e1cfe3e 100644
--- a/README
+++ b/README
@@ -11,6 +11,10 @@ Dependencies:
layers: meta
branch: matched branches (e.g. master, sumo, ...)

+ URI: git://git.yoctoproject.org/meta-arm
+ layers: meta-arm
+ branch: matched branches (e.g. master, sumo, ...)
+
Status of supported boards:
--------------------------
builds and boots wic image:
diff --git a/conf/layer.conf b/conf/layer.conf
index 72d5366..4168391 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -15,4 +15,4 @@ BBFILE_PRIORITY_rockchip = "1"
# cause compatibility issues with other layers
LAYERVERSION_rockchip = "1"
LAYERSERIES_COMPAT_rockchip = "dunfell"
-LAYERDEPENDS_rockchip = "core"
+LAYERDEPENDS_rockchip = "core meta-arm"
diff --git a/conf/machine/include/rk3399.inc b/conf/machine/include/rk3399.inc
index 1fd8fd6..4019988 100644
--- a/conf/machine/include/rk3399.inc
+++ b/conf/machine/include/rk3399.inc
@@ -13,9 +13,8 @@ KBUILD_DEFCONFIG ?= "defconfig"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE = "fitImage"

-ATF_PLATFORM ?= "rk3399"
-ATF_TARGET ?= "bl31"
-ATF_SUFFIX ?= "elf"
+TFA_PLATFORM = "rk3399"
+TFA_BUILD_TARGET = "bl31"

UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.3.bb b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.3.bb
deleted file mode 100644
index 8d36d66..0000000
--- a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2.3.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-# 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"
-
-# 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} \
- "
-SRCREV = "8ff55a9e14a23d7c7f89f52465bcc6307850aa33"
-
-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
-
diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
new file mode 100644
index 0000000..ecde25d
--- /dev/null
+++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
@@ -0,0 +1,6 @@
+# Rockchip RK3399 compiles some M0 firmware which requires an arm-none-eabi GCC
+# toolchain
+DEPENDS_append_rk3399 = " virtual/arm-none-eabi-gcc"
+
+COMPATIBLE_MACHINE_append_rk3399 = "|rk3399"
+
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index 401d649..042507d 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -7,8 +7,8 @@ do_compile_append_rock2-square () {

ATF_DEPENDS ??= ""

-EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31.elf"
-ATF_DEPENDS_rk3399 = "virtual/atf:do_deploy"
+EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
+ATF_DEPENDS_rk3399 = " virtual/trusted-firmware-a:do_deploy"

-do_compile[depends] += "${ATF_DEPENDS}"
+do_compile[depends] .= "${ATF_DEPENDS}"

--
2.26.2


Trevor Woerner
 

On Fri 2020-06-12 @ 12:38:23 PM, Joshua Watt wrote:
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index 401d649..042507d 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -7,8 +7,8 @@ do_compile_append_rock2-square () {

ATF_DEPENDS ??= ""

-EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31.elf"
-ATF_DEPENDS_rk3399 = "virtual/atf:do_deploy"
+EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
The space you've included at the start of the following string makes me stop
and double-check... did you mean to add an "_append" in the following symbol?

+ATF_DEPENDS_rk3399 = " virtual/trusted-firmware-a:do_deploy"


Trevor Woerner
 

On Wed 2020-06-24 @ 11:30:57 PM, Trevor Woerner wrote:
On Fri 2020-06-12 @ 12:38:23 PM, Joshua Watt wrote:
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index 401d649..042507d 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -7,8 +7,8 @@ do_compile_append_rock2-square () {

ATF_DEPENDS ??= ""

-EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31.elf"
-ATF_DEPENDS_rk3399 = "virtual/atf:do_deploy"
+EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
The space you've included at the start of the following string makes me stop
and double-check... did you mean to add an "_append" in the following symbol?

+ATF_DEPENDS_rk3399 = " virtual/trusted-firmware-a:do_deploy"
Ah… I should have read the next line before replying. I see you switched from
+= to .= and hence the space. A bit curious, though?


Joshua Watt
 

On 6/24/20 10:44 PM, Trevor Woerner wrote:
On Wed 2020-06-24 @ 11:30:57 PM, Trevor Woerner wrote:
On Fri 2020-06-12 @ 12:38:23 PM, Joshua Watt wrote:
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index 401d649..042507d 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -7,8 +7,8 @@ do_compile_append_rock2-square () {
ATF_DEPENDS ??= ""
-EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31.elf"
-ATF_DEPENDS_rk3399 = "virtual/atf:do_deploy"
+EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
The space you've included at the start of the following string makes me stop
and double-check... did you mean to add an "_append" in the following symbol?

+ATF_DEPENDS_rk3399 = " virtual/trusted-firmware-a:do_deploy"
Ah… I should have read the next line before replying. I see you switched from
+= to .= and hence the space. A bit curious, though?
It prevents the recipe adding in an extra space to the task depends when the machine is not an rk3399, which helps the layer by YP 2.0 compatible


Trevor Woerner
 

On Thu 2020-06-25 @ 11:03:17 AM, Joshua Watt wrote:

On 6/24/20 10:44 PM, Trevor Woerner wrote:
On Wed 2020-06-24 @ 11:30:57 PM, Trevor Woerner wrote:
On Fri 2020-06-12 @ 12:38:23 PM, Joshua Watt wrote:
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index 401d649..042507d 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -7,8 +7,8 @@ do_compile_append_rock2-square () {
ATF_DEPENDS ??= ""
-EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31.elf"
-ATF_DEPENDS_rk3399 = "virtual/atf:do_deploy"
+EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
The space you've included at the start of the following string makes me stop
and double-check... did you mean to add an "_append" in the following symbol?

+ATF_DEPENDS_rk3399 = " virtual/trusted-firmware-a:do_deploy"
Ah… I should have read the next line before replying. I see you switched from
+= to .= and hence the space. A bit curious, though?
It prevents the recipe adding in an extra space to the task depends when the
machine is not an rk3399, which helps the layer by YP 2.0 compatible
Ah, thanks for the clarification.

Applied to master, thanks!