From 7ab8fb621176c09313fcba39ed7ce95fd664ec8e Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Thu, 18 May 2023 13:46:46 -0400 Subject: [PATCH] atf: convert to use meta-arm trusted-firmware-a recipe Instead of using and maintaining a unique recipe for trusted-firmware-a (formerly known as ARM trusted firmware, or ATF), use the recipe located in meta-arm. It is well maintained and in use in multiple other layers. Tested with pine64-plus Signed-off-by: Jon Mason --- conf/layer.conf | 2 +- ...0001-Use-same-type-as-in-declaration.patch | 26 -------------- ...th-z-noexecstack-no-warn-rwx-segment.patch | 35 ------------------- recipes-bsp/atf/atf-sunxi_git.bb | 32 ----------------- .../trusted-firmware-a_%.bbappend | 6 ++++ recipes-bsp/u-boot/u-boot_%.bbappend | 4 +-- 6 files changed, 9 insertions(+), 96 deletions(-) delete mode 100644 recipes-bsp/atf/atf-sunxi/0001-Use-same-type-as-in-declaration.patch delete mode 100644 recipes-bsp/atf/atf-sunxi/Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch delete mode 100644 recipes-bsp/atf/atf-sunxi_git.bb create mode 100644 recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend diff --git a/conf/layer.conf b/conf/layer.conf index 9e75ab3..5a57a42 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -12,6 +12,6 @@ BBFILE_PRIORITY_sunxi = "10" # cause compatibility issues with other layers LAYERVERSION_sunxi = "1" -LAYERDEPENDS_sunxi = "core meta-python" +LAYERDEPENDS_sunxi = "core meta-python meta-arm" LAYERSERIES_COMPAT_sunxi = "honister kirkstone langdale mickledore" diff --git a/recipes-bsp/atf/atf-sunxi/0001-Use-same-type-as-in-declaration.patch b/recipes-bsp/atf/atf-sunxi/0001-Use-same-type-as-in-declaration.patch deleted file mode 100644 index 21d4782..0000000 --- a/recipes-bsp/atf/atf-sunxi/0001-Use-same-type-as-in-declaration.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 087b9306659effac870b4794c0f775ce3d7208c5 Mon Sep 17 00:00:00 2001 -From: Marek Belisko -Date: Wed, 13 Apr 2022 08:09:29 +0200 -Subject: [PATCH] Use same type as in declaration - -Signed-off-by: Marek Belisko ---- - services/std_svc/psci/psci_common.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/services/std_svc/psci/psci_common.c b/services/std_svc/psci/psci_common.c -index 75f52f538..918a719f6 100644 ---- a/services/std_svc/psci/psci_common.c -+++ b/services/std_svc/psci/psci_common.c -@@ -261,7 +261,7 @@ void psci_acquire_afflvl_locks(int start_afflvl, - ******************************************************************************/ - void psci_release_afflvl_locks(int start_afflvl, - int end_afflvl, -- aff_map_node_t *mpidr_nodes[]) -+ mpidr_aff_map_nodes_t mpidr_nodes) - { - int level; - --- -2.25.1 - diff --git a/recipes-bsp/atf/atf-sunxi/Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch b/recipes-bsp/atf/atf-sunxi/Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch deleted file mode 100644 index 397279f..0000000 --- a/recipes-bsp/atf/atf-sunxi/Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 69d2c1ccb42942980064c12d3ea3904bac450feb Mon Sep 17 00:00:00 2001 -From: pbiel -Date: Thu, 23 Feb 2023 16:30:01 +0100 -Subject: [PATCH] Makefile: link with -z noexecstack --no-warn-rwx-segments - ---- - Makefile | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/Makefile b/Makefile -index 578083221..e70888cf2 100644 ---- a/Makefile -+++ b/Makefile -@@ -445,6 +445,8 @@ endif - - GCC_V_OUTPUT := $(shell $(CC) -v 2>&1) - -+TF_LDFLAGS += --no-warn-rwx-segment -+ - # LD = armlink - ifneq ($(findstring armlink,$(notdir $(LD))),) - TF_LDFLAGS += --diag_error=warning --lto_level=O1 -@@ -471,6 +473,9 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) - - # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other - else -+# With ld.bfd version 2.39 and newer new warnings are added. Skip those since we -+# are not loaded by a elf loader. -+TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments) - TF_LDFLAGS += -O1 - TF_LDFLAGS += --gc-sections - # ld.lld doesn't recognize the errata flags, --- -2.34.1 - diff --git a/recipes-bsp/atf/atf-sunxi_git.bb b/recipes-bsp/atf/atf-sunxi_git.bb deleted file mode 100644 index e67cf29..0000000 --- a/recipes-bsp/atf/atf-sunxi_git.bb +++ /dev/null @@ -1,32 +0,0 @@ -DESCRIPTION = "ARM Trusted Firmware Allwinner" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde" - -SRC_URI = " \ - git://github.com/ARM-software/arm-trusted-firmware;nobranch=1;protocol=https \ - file://Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch \ -" - -SRCREV = "ba12668a65f9b10bc18f3b49a71999ed5d32714a" - -S = "${WORKDIR}/git" -B = "${WORKDIR}/build" - -COMPATIBLE_MACHINE = "(sun50i|sun50i-h616)" - -PLATFORM:sun50i = "sun50i_a64" -PLATFORM:sun50i-h616 = "sun50i_h616" - -LDFLAGS[unexport] = "1" - -do_compile() { - oe_runmake -C ${S} BUILD_BASE=${B} \ - CROSS_COMPILE=${TARGET_PREFIX} \ - PLAT=${PLATFORM} \ - bl31 \ - all -} - -do_install() { - install -D -p -m 0644 ${B}/${PLATFORM}/release/bl31.bin ${DEPLOY_DIR_IMAGE}/bl31.bin -} 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..fc0d715 --- /dev/null +++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend @@ -0,0 +1,6 @@ +COMPATIBLE_MACHINE = "(sun50i|sun50i-h616)" + +TFA_PLATFORM:sun50i = "sun50i_a64" +TFA_PLATFORM:sun50i-h616 = "sun50i_h616" + +TFA_BUILD_TARGET = "bl31" diff --git a/recipes-bsp/u-boot/u-boot_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend index 8bf4a87..1d57bee 100644 --- a/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/recipes-bsp/u-boot/u-boot_%.bbappend @@ -1,7 +1,7 @@ FILESEXTRAPATHS:prepend:sunxi := "${THISDIR}/files:" DEPENDS:append:sunxi = " bc-native dtc-native swig-native python3-native flex-native bison-native " -DEPENDS:append:sun50i = " atf-sunxi " +DEPENDS:append:sun50i = " trusted-firmware-a" COMPATIBLE_MACHINE:sunxi = "(sun4i|sun5i|sun7i|sun8i|sun50i)" @@ -23,7 +23,7 @@ UBOOT_ENV:sunxi = "boot" EXTRA_OEMAKE:append:sunxi = ' HOSTLDSHARED="${BUILD_CC} -shared ${BUILD_LDFLAGS} ${BUILD_CFLAGS}" ' EXTRA_OEMAKE:append:sun50i = " BL31=${DEPLOY_DIR_IMAGE}/bl31.bin SCP=/dev/null" -do_compile_sun50i[depends] += "atf-sunxi:do_deploy" +do_compile:sun50i[depends] += "trusted-firmware-a:do_deploy" do_compile:append:sunxi() { ${B}/tools/mkimage -C none -A arm -T script -d ${WORKDIR}/boot.cmd ${WORKDIR}/${UBOOT_ENV_BINARY}