1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-01-11 15:00:39 +00:00

arm-bsp/optee-os: corstone-1000: upgrade to 4.6.0

Add recipes for OP-TEE v4.6.0
Upgrade Corstone-1000 OP-TEE revision from 4.4.0 to 4.6.0
Add patch to fix compilation issue with musl and optee-test 4.6.0.

Signed-off-by: Clement Faure <clement.faure@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Clement Faure
2025-06-18 10:10:45 +02:00
committed by Jon Mason
parent eea748608c
commit d782eeeae4
10 changed files with 126 additions and 36 deletions

View File

@@ -14,8 +14,8 @@ TFA_BL2_BINARY = "bl2-corstone1000.bin"
TFA_FIP_BINARY = "fip-corstone1000.bin"
# optee
PREFERRED_VERSION_optee-os ?= "4.4.%"
PREFERRED_VERSION_optee-client ?= "4.4.%"
PREFERRED_VERSION_optee-os ?= "4.6.%"
PREFERRED_VERSION_optee-client ?= "4.6.%"
# Trusted Services
TS_PLATFORM = "arm/corstone1000"

View File

@@ -1,32 +0,0 @@
From d6ee50f581b43b16733b8731369b071d609d5048 Mon Sep 17 00:00:00 2001
From: Emekcan Aras <emekcan.aras@arm.com>
Date: Thu, 31 Aug 2023 10:51:54 +0100
Subject: [PATCH] Handle logging syscall
Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
Upstream-Status: Pending [upstreamed differently in 280b6a3]
---
core/arch/arm/kernel/spmc_sp_handler.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/core/arch/arm/kernel/spmc_sp_handler.c b/core/arch/arm/kernel/spmc_sp_handler.c
index 1f218a0df..0676e8898 100644
--- a/core/arch/arm/kernel/spmc_sp_handler.c
+++ b/core/arch/arm/kernel/spmc_sp_handler.c
@@ -1276,7 +1276,12 @@ void spmc_sp_msg_handler(struct thread_smc_args *args,
handle_console_log(args);
sp_enter(args, caller_sp);
break;
-
+ case 0xdeadbeef:
+ ts_push_current_session(&caller_sp->ts_sess);
+ IMSG("%s", (char *)args->a1);
+ ts_pop_current_session();
+ sp_enter(args, caller_sp);
+ break;
default:
EMSG("Unhandled FFA function ID %#"PRIx32,
(uint32_t)args->a0);
--
2.17.1

View File

@@ -1,7 +1,6 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files/optee-os/corstone1000:"
SRC_URI:append = " \
file://0001-Handle-logging-syscall.patch \
file://0002-plat-corstone1000-increase-CFG_TZDRAM_SIZE.patch \
file://0001-plat-corstone1000-increase-CFG_TZDRAM_SIZE.patch \
"
COMPATIBLE_MACHINE = "corstone1000"

View File

@@ -0,0 +1,9 @@
require recipes-security/optee/optee-client.inc
# v4.6.0
SRCREV = "02e7f9213b0d7db9c35ebf1e41e733fc9c5a3f75"
SRC_URI += "file://0001-tee-supplicant-update-udev-systemd-install-code.patch"
inherit pkgconfig
DEPENDS += "util-linux"
EXTRA_OEMAKE += "PKG_CONFIG=pkg-config"

View File

@@ -0,0 +1,4 @@
require recipes-security/optee/optee-examples.inc
# v4.6.0
SRCREV = "5306d2c7c618bb4a91df17a2d5d79ae4701af4a3"

View File

@@ -0,0 +1,29 @@
require recipes-security/optee/optee-os_${PV}.bb
SUMMARY = "OP-TEE Trusted OS TA devkit"
DESCRIPTION = "OP-TEE TA devkit for build TAs"
HOMEPAGE = "https://www.op-tee.org/"
DEPENDS += "python3-pycryptodome-native"
do_install() {
#install TA devkit
install -d ${D}${includedir}/optee/export-user_ta/
for f in ${B}/export-ta_${OPTEE_ARCH}/* ; do
cp -aR $f ${D}${includedir}/optee/export-user_ta/
done
}
do_deploy() {
echo "Do not inherit do_deploy from optee-os."
}
FILES:${PN} = "${includedir}/optee/"
# Build paths are currently embedded
INSANE_SKIP:${PN}-dev += "buildpaths"
# Include extra headers needed by SPMC tests to TA DEVKIT.
# Supported after op-tee v3.20
EXTRA_OEMAKE:append = "${@bb.utils.contains('MACHINE_FEATURES', 'optee-spmc-test', \
' CFG_SPMC_TESTS=y', '' , d)}"

View File

@@ -0,0 +1,11 @@
require recipes-security/optee/optee-os.inc
DEPENDS += "dtc-native"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
# v4.6.0
SRCREV = "71785645fa6ce42db40dbf5a54e0eaedc4f61591"
SRC_URI += " \
file://0003-optee-enable-clang-support.patch \
"

View File

@@ -0,0 +1,51 @@
From a15be9eca1b7e935917d834284726027dffc8cfb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Faure?= <clement.faure@arm.com>
Date: Wed, 7 May 2025 13:54:36 +0000
Subject: [PATCH] regression_1000: Re-order the include of <sys/stat.h> header
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With musl, the compilation of optee-test would fail:
| GEN optee-test/4.6.0/optee-test-4.6.0/xtest/regression_8100_ca_crt.h
| python3 ../../scripts/file_to_c.py --inf ../../cert/ca.crt --out optee-test/4.6.0/optee-test-4.6.0/xtest/regression_8100_ca_crt.h --name regression_8100_ca_crt
| In file included from optee-test/4.6.0/recipe-sysroot/usr/include/sys/stat.h:30,
| from optee-test/host/xtest/regression_1000.c:24:
| optee-test/4.6.0/recipe-sysroot/usr/include/bits/stat.h:17:26: error: expected identifier or '(' before '[' token
| 17 | unsigned __unused[2];
| | ^
The defintion of OP-TEE macro __unused conflicts with the musl implementation
and its use of variables named __unused.
Re-ordering and including <sys/stat.h> before the macro gets defined is
enough to work around the issue.
Signed-off-by: Clément Faure <clement.faure@arm.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Upstream-Status: Backport [a15be9eca1b7e935917d834284726027dffc8cfb]
---
host/xtest/regression_1000.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/host/xtest/regression_1000.c b/host/xtest/regression_1000.c
index e9d20a8..a427789 100644
--- a/host/xtest/regression_1000.c
+++ b/host/xtest/regression_1000.c
@@ -20,11 +20,11 @@
#ifdef CFG_SECURE_DATA_PATH
#include <sdp_basic.h>
#endif
+#include <sys/stat.h>
#include <signed_hdr.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
#include <sys/types.h>
#include <ta_arm_bti.h>
#include <ta_concurrent.h>
--
2.43.0

View File

@@ -0,0 +1,19 @@
require recipes-security/optee/optee-test.inc
# v4.6.0
SRCREV = "a9e9495f4d57b97022008ad11198195e7e044c5d"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=a8fa504109e4cd7ea575bc49ea4be560"
SRC_URI += " \
file://0001-build-make-cmake-add-Werror-based-on-CFG_WERROR.patch \
file://0001-regression_1000-Re-order-the-include-of-sys-stat.h-h.patch \
"
# Include ffa_spmc test group if the SPMC test is enabled.
# Supported after op-tee v3.20
EXTRA_OEMAKE:append = "${@bb.utils.contains('MACHINE_FEATURES', 'optee-spmc-test', \
' CFG_SPMC_TESTS=y CFG_SECURE_PARTITION=y', '' , d)}"
RDEPENDS:${PN} += "${@bb.utils.contains('MACHINE_FEATURES', 'optee-spmc-test', \
' arm-ffa-user', '' , d)}"