freescale-layer: optee-os: sync with meta-freescale

The recipe for 4.2.0.imx has been upstreamed, so merge both of our .bb files
for 4.0.0.imx and 4.2.0.imx into a single .bbappend file. Adapt our patches to
support the ccimx93 and ccimx91, and while at it, add the "Upstream-Status"
tag to them to avoid QA errors

https://onedigi.atlassian.net/browse/DEL-9011
https://onedigi.atlassian.net/browse/DEL-9081

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2024-05-13 14:10:08 +02:00
parent ab6f1a6448
commit 63ac1e3ad3
6 changed files with 39 additions and 96 deletions

View File

@ -2,6 +2,8 @@ From: Javier Viguera <javier.viguera@digi.com>
Date: Mon, 19 Aug 2024 17:42:24 +0200
Subject: [PATCH] core: imx: support ccimx91-dvk
Upstream-Status: Inappropriate [digi specific]
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
---
core/arch/arm/plat-imx/conf.mk | 6 ++++++

View File

@ -4,6 +4,8 @@ Subject: [PATCH] core: imx: support ccimx93-dvk
SOC revision A0 requires a different build.
Upstream-Status: Inappropriate [digi specific]
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
---
core/arch/arm/plat-imx/conf.mk | 13 +++++++++++++
@ -11,10 +13,10 @@ Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2 files changed, 18 insertions(+)
diff --git a/core/arch/arm/plat-imx/conf.mk b/core/arch/arm/plat-imx/conf.mk
index 0bd9ccd6bef1..5e4c02e27d2e 100644
index 9ab3e1e95..202cceb5c 100644
--- a/core/arch/arm/plat-imx/conf.mk
+++ b/core/arch/arm/plat-imx/conf.mk
@@ -88,6 +88,8 @@ mx8ulp-flavorlist = \
@@ -89,6 +89,8 @@ mx8ulp-flavorlist = \
mx8ulpevk \
mx93-flavorlist = \
@ -22,9 +24,9 @@ index 0bd9ccd6bef1..5e4c02e27d2e 100644
+ ccimx93dvk_a0 \
mx93evk \
ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6ul-flavorlist)))
@@ -451,6 +453,17 @@ CFG_DDR_SIZE ?= 0x80000000
CFG_UART_BASE ?= UART1_BASE
mx95-flavorlist = \
@@ -499,6 +501,17 @@ CFG_NSEC_DDR_1_SIZE ?= 0x380000000UL
CFG_CORE_ARM64_PA_BITS ?= 40
endif
+ifneq (,$(filter $(PLATFORM_FLAVOR),ccimx93dvk))
@ -42,7 +44,7 @@ index 0bd9ccd6bef1..5e4c02e27d2e 100644
ifeq ($(filter y, $(CFG_MX6QP) $(CFG_MX6Q) $(CFG_MX6D) $(CFG_MX6DL) $(CFG_MX6S) \
$(CFG_MX6SL) $(CFG_MX6SLL) $(CFG_MX6SX)), y)
diff --git a/core/arch/arm/plat-imx/registers/imx93.h b/core/arch/arm/plat-imx/registers/imx93.h
index 21080da82d04..29070eb917ac 100644
index 21080da82..29070eb91 100644
--- a/core/arch/arm/plat-imx/registers/imx93.h
+++ b/core/arch/arm/plat-imx/registers/imx93.h
@@ -9,11 +9,16 @@

View File

@ -4,6 +4,8 @@ Subject: [PATCH] core: ccimx93: enable AES_HUK trusted application
This provides the support for u-boot environment encryption.
Upstream-Status: Inappropriate [digi specific]
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
---
core/arch/arm/plat-imx/conf.mk | 2 +
@ -24,10 +26,10 @@ Signed-off-by: Javier Viguera <javier.viguera@digi.com>
create mode 100644 ta/aes_huk/user_ta_header_defines.h
diff --git a/core/arch/arm/plat-imx/conf.mk b/core/arch/arm/plat-imx/conf.mk
index 5e4c02e27d2e..40d0bb4116dd 100644
index 202cceb5c..42297508c 100644
--- a/core/arch/arm/plat-imx/conf.mk
+++ b/core/arch/arm/plat-imx/conf.mk
@@ -456,12 +456,14 @@ endif
@@ -504,12 +504,14 @@ endif
ifneq (,$(filter $(PLATFORM_FLAVOR),ccimx93dvk))
CFG_DDR_SIZE ?= 0x40000000
CFG_UART_BASE ?= UART6_BASE
@ -44,7 +46,7 @@ index 5e4c02e27d2e..40d0bb4116dd 100644
# i.MX6 Solo/SL/SoloX/DualLite/Dual/Quad specific config
diff --git a/ta/aes_huk/Android.mk b/ta/aes_huk/Android.mk
new file mode 100644
index 000000000000..931f8e4065c9
index 000000000..931f8e406
--- /dev/null
+++ b/ta/aes_huk/Android.mk
@@ -0,0 +1,4 @@
@ -54,7 +56,7 @@ index 000000000000..931f8e4065c9
+include $(BUILD_OPTEE_MK)
diff --git a/ta/aes_huk/Makefile b/ta/aes_huk/Makefile
new file mode 100644
index 000000000000..e41d9913e6ae
index 000000000..e41d9913e
--- /dev/null
+++ b/ta/aes_huk/Makefile
@@ -0,0 +1,13 @@
@ -73,7 +75,7 @@ index 000000000000..e41d9913e6ae
+endif
diff --git a/ta/aes_huk/aes_ta.c b/ta/aes_huk/aes_ta.c
new file mode 100644
index 000000000000..036d64b83478
index 000000000..036d64b83
--- /dev/null
+++ b/ta/aes_huk/aes_ta.c
@@ -0,0 +1,477 @@
@ -556,7 +558,7 @@ index 000000000000..036d64b83478
+}
diff --git a/ta/aes_huk/include/aes_ta.h b/ta/aes_huk/include/aes_ta.h
new file mode 100644
index 000000000000..c07b4bc479ee
index 000000000..c07b4bc47
--- /dev/null
+++ b/ta/aes_huk/include/aes_ta.h
@@ -0,0 +1,82 @@
@ -644,7 +646,7 @@ index 000000000000..c07b4bc479ee
+#endif /* __AES_TA_H */
diff --git a/ta/aes_huk/sub.mk b/ta/aes_huk/sub.mk
new file mode 100644
index 000000000000..cfce14e6c119
index 000000000..cfce14e6c
--- /dev/null
+++ b/ta/aes_huk/sub.mk
@@ -0,0 +1,3 @@
@ -653,14 +655,14 @@ index 000000000000..cfce14e6c119
+srcs-y += aes_ta.c
diff --git a/ta/aes_huk/user_ta.mk b/ta/aes_huk/user_ta.mk
new file mode 100644
index 000000000000..d49d309558ba
index 000000000..d49d30955
--- /dev/null
+++ b/ta/aes_huk/user_ta.mk
@@ -0,0 +1 @@
+user-ta-uuid := c2fad363-5d9f-4fc4-a417-555841e05745
diff --git a/ta/aes_huk/user_ta_header_defines.h b/ta/aes_huk/user_ta_header_defines.h
new file mode 100644
index 000000000000..9f944b8b9ab3
index 000000000..9f944b8b9
--- /dev/null
+++ b/ta/aes_huk/user_ta_header_defines.h
@@ -0,0 +1,48 @@

View File

@ -1,30 +0,0 @@
From db9e44af75c7cfd3316cab15aaa387383df3e57e Mon Sep 17 00:00:00 2001
From: Brett Warren <brett.warren@arm.com>
Date: Wed, 23 Sep 2020 09:27:34 +0100
Subject: [PATCH] optee: enable clang support
When compiling with clang, the LIBGCC_LOCATE_CFLAG variable used
to provide a sysroot wasn't included, which results in not locating
compiler-rt. This is mitigated by including the variable as ammended.
Upstream-Status: Pending
ChangeId: 8ba69a4b2eb8ebaa047cb266c9aa6c2c3da45701
Signed-off-by: Brett Warren <brett.warren@arm.com>
---
mk/clang.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mk/clang.mk b/mk/clang.mk
index c141a3f2..7d067cc0 100644
--- a/mk/clang.mk
+++ b/mk/clang.mk
@@ -27,7 +27,7 @@ comp-cflags-warns-clang := -Wno-language-extension-token \
# Note, use the compiler runtime library (libclang_rt.builtins.*.a) instead of
# libgcc for clang
-libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \
+libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) \
-rtlib=compiler-rt -print-libgcc-file-name 2> /dev/null)
# Core ASLR relies on the executable being ready to run from its preferred load

View File

@ -1,27 +0,0 @@
# Copyright (C) 2024, Digi International Inc.
#
# Reuse meta-freescale's optee-os_3.19.0.imx.bb
#
require recipes-security/optee-imx/optee-os_3.19.0.imx.bb
SRC_URI = " \
git://github.com/nxp-imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \
file://0007-allow-setting-sysroot-for-clang.patch \
file://0001-core-imx-support-ccimx91-dvk.patch \
file://environment.d-optee-sdk.sh \
"
SRCBRANCH = "lf-6.6.23_2.0.0"
# Tag: lf-6.6.23-2.0.0
SRCREV = "c6be5b572452a2808d1a34588fd10e71715e23cf"
PLATFORM_FLAVOR:ccimx91 = "ccimx91dvk"
do_install:append:ccimx91 () {
mkdir -p ${D}/environment-setup.d
sed -e "s,#OPTEE_ARCH#,${OPTEE_ARCH},g" ${WORKDIR}/environment.d-optee-sdk.sh > ${D}/environment-setup.d/optee-sdk.sh
}
FILES:${PN}-staticdev += "/environment-setup.d/"
COMPATIBLE_MACHINE = "(ccimx91)"

View File

@ -1,37 +1,31 @@
# Copyright (C) 2023,2024, Digi International Inc.
# Copyright (C) 2024, Digi International Inc.
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
#
# Reuse meta-freescale's optee-os_3.19.0.imx.bb
#
require recipes-security/optee-imx/optee-os_3.19.0.imx.bb
SRC_URI = " \
git://github.com/nxp-imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \
file://0007-allow-setting-sysroot-for-clang.patch \
file://0001-core-imx-support-ccimx93-dvk.patch \
file://0002-core-ccimx93-enable-AES_HUK-trusted-application.patch \
SRC_URI:append:ccimx91 = " \
file://0001-core-imx-support-ccimx91-dvk.patch \
file://environment.d-optee-sdk.sh \
"
SRCBRANCH = "lf-6.1.55_2.2.0"
# Tag: lf-6.1.55-2.2.0
SRCREV = "a303fc80f7c4bd713315687a1fa1d6ed136e78ee"
SRC_URI:append:ccimx93 = " \
file://0001-core-imx-support-ccimx93-dvk.patch \
file://0002-core-ccimx93-enable-AES_HUK-trusted-application.patch \
"
PLATFORM_FLAVOR:ccimx91 = "ccimx91dvk"
PLATFORM_FLAVOR:ccimx93 = "ccimx93dvk"
do_compile:append:ccimx93 () {
oe_runmake PLATFORM=imx-${PLATFORM_FLAVOR}_a0 O=${B}-A0 all
}
do_compile[cleandirs] += "${B}-A0"
do_install:append:ccimx93 () {
do_install:append:ccimx91 () {
mkdir -p ${D}/environment-setup.d
sed -e "s,#OPTEE_ARCH#,${OPTEE_ARCH},g" ${WORKDIR}/environment.d-optee-sdk.sh > ${D}/environment-setup.d/optee-sdk.sh
}
FILES:${PN}-staticdev:ccimx91 += "/environment-setup.d/"
do_compile:append:ccimx93 () {
oe_runmake PLATFORM=imx-${PLATFORM_FLAVOR}_a0 O=${B}-A0 all
}
do_compile:ccimx93[cleandirs] += "${B}-A0"
do_deploy:append:ccimx93 () {
cp ${B}-A0/core/tee-raw.bin ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}_a0.bin
}
FILES:${PN}-staticdev += "/environment-setup.d/"
COMPATIBLE_MACHINE = "(ccimx93)"