arm-bsp: tc: use proper UUID in optee and linux kernel

Message ID 20220119144549.52195-1-davidson.kumaresan@arm.com
State New
Headers show
Series arm-bsp: tc: use proper UUID in optee and linux kernel | expand

Commit Message

Davidson Kumaresan Jan. 19, 2022, 2:45 p.m. UTC
Recently the way of handling Secure Partitions UUID changed in TF-A
and that needs corresponding changes in required components.  Hence
changing them for optee and linux kernel.

Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
---
 .../linux/linux-arm-platforms.inc             |  1 -
 ...-optee-hack-for-UUID-endianess-issue.patch | 58 -------------------
 .../optee-os/tc/0001-Fix-optee-UUID.patch     | 27 +++++++++
 .../optee/optee-os-generic-tc.inc             |  1 +
 4 files changed, 28 insertions(+), 59 deletions(-)
 delete mode 100644 meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack-5.10/tc/0020-drivers-optee-hack-for-UUID-endianess-issue.patch
 create mode 100644 meta-arm-bsp/recipes-security/optee/files/optee-os/tc/0001-Fix-optee-UUID.patch

Comments

Jon Mason Jan. 19, 2022, 6:59 p.m. UTC | #1
On Wed, 19 Jan 2022 20:15:49 +0530, Davidson K wrote:
> Recently the way of handling Secure Partitions UUID changed in TF-A
> and that needs corresponding changes in required components.  Hence
> changing them for optee and linux kernel.

Applied, thanks!

[1/1] arm-bsp: tc: use proper UUID in optee and linux kernel
      commit: 8734d146744ef3b1845889e00a2d213625214bc3

Best regards,

Patch

diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc b/meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc
index 5dadc44..1e09da3 100644
--- a/meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc
+++ b/meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc
@@ -272,7 +272,6 @@  SRC_URI:append:tc = " \
     file://0017-optee-refactor-driver-with-internal-callbacks.patch \
     file://0018-optee-add-a-FF-A-memory-pool.patch \
     file://0019-optee-add-FF-A-support.patch \
-    file://0020-drivers-optee-hack-for-UUID-endianess-issue.patch \
     file://0021-arm_ffa-add-support-for-FFA-v1.1.patch \
     "
 KERNEL_FEATURES:append:tc = " bsp/arm-platforms/tc.scc"
diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack-5.10/tc/0020-drivers-optee-hack-for-UUID-endianess-issue.patch b/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack-5.10/tc/0020-drivers-optee-hack-for-UUID-endianess-issue.patch
deleted file mode 100644
index 45319fc..0000000
--- a/meta-arm-bsp/recipes-kernel/linux/linux-arm64-ack-5.10/tc/0020-drivers-optee-hack-for-UUID-endianess-issue.patch
+++ /dev/null
@@ -1,58 +0,0 @@ 
-From 62e38805a966c1bc66a72bcdc83af7031c6a95df Mon Sep 17 00:00:00 2001
-From: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
-Date: Thu, 27 May 2021 13:40:33 +0100
-Subject: [PATCH 20/22] drivers: optee: hack for UUID endianess issue
-
-Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
-Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-Change-Id: Id5c42e4fe491a448f746b9d132dae20c85666554
-
-Upstream-Status: Inappropriate [will not be submitted as its only a workaround]
----
- drivers/firmware/arm_ffa/driver.c | 19 +++++++++++++++++++
- 1 file changed, 19 insertions(+)
-
-diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
-index 056a3fca14d1..82c84fe10be2 100644
---- a/drivers/firmware/arm_ffa/driver.c
-+++ b/drivers/firmware/arm_ffa/driver.c
-@@ -275,8 +275,18 @@ ffa_partition_probe(const uuid_t *uuid, struct ffa_partition_info **buffer)
- 	struct ffa_partition_info *pbuf;
- 
- 	export_uuid((u8 *)uuid0_4, uuid);
-+
-+#if 0
- 	count = __ffa_partition_info_get(uuid0_4[0], uuid0_4[1], uuid0_4[2],
- 					 uuid0_4[3], NULL, 0);
-+#else
-+	/* hack for optee UUID endianess issue */
-+	count = __ffa_partition_info_get(be32_to_cpup(&uuid0_4[0]),
-+					 be32_to_cpup(&uuid0_4[1]),
-+					 be32_to_cpup(&uuid0_4[2]),
-+					 be32_to_cpup(&uuid0_4[3]), NULL, 0);
-+#endif
-+
- 	if (count <= 0)
- 		return count;
- 
-@@ -284,8 +294,17 @@ ffa_partition_probe(const uuid_t *uuid, struct ffa_partition_info **buffer)
- 	if (!pbuf)
- 		return -ENOMEM;
- 
-+#if 0
- 	count = __ffa_partition_info_get(uuid0_4[0], uuid0_4[1], uuid0_4[2],
- 					 uuid0_4[3], pbuf, count);
-+#else
-+	/* hack for optee UUID endianess issue */
-+	count = __ffa_partition_info_get(be32_to_cpup(&uuid0_4[0]),
-+					 be32_to_cpup(&uuid0_4[1]),
-+					 be32_to_cpup(&uuid0_4[2]),
-+					 be32_to_cpup(&uuid0_4[3]),
-+					 pbuf, count);
-+#endif
- 	if (count <= 0)
- 		kfree(pbuf);
- 
--- 
-2.17.1
-
diff --git a/meta-arm-bsp/recipes-security/optee/files/optee-os/tc/0001-Fix-optee-UUID.patch b/meta-arm-bsp/recipes-security/optee/files/optee-os/tc/0001-Fix-optee-UUID.patch
new file mode 100644
index 0000000..5374c02
--- /dev/null
+++ b/meta-arm-bsp/recipes-security/optee/files/optee-os/tc/0001-Fix-optee-UUID.patch
@@ -0,0 +1,27 @@ 
+From 37fd6f3c18015bcad2c099bf9269e72140e55557 Mon Sep 17 00:00:00 2001
+From: Davidson K <davidson.kumaresan@arm.com>
+Date: Wed, 12 Jan 2022 17:14:03 +0530
+Subject: [PATCH] Fix optee UUID
+
+Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/commit/a9a8e483b6ff7f6e40c5ed95310a18e0bd1993c3#diff-2a310f8cc43d961b2efc05ac1619521653ba8977ff5e6dc5bb89754fd60fe954]
+Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
+---
+ core/arch/arm/plat-totalcompute/fdts/optee_sp_manifest.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/core/arch/arm/plat-totalcompute/fdts/optee_sp_manifest.dts b/core/arch/arm/plat-totalcompute/fdts/optee_sp_manifest.dts
+index 04847c4d..3b76fc7d 100644
+--- a/core/arch/arm/plat-totalcompute/fdts/optee_sp_manifest.dts
++++ b/core/arch/arm/plat-totalcompute/fdts/optee_sp_manifest.dts
+@@ -14,7 +14,7 @@
+ 	/* Properties */
+ 	description = "op-tee";
+ 	ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
+-	uuid = <0x486178e0 0xe7f811e3 0xbc5e0002 0xa5d5c51b>;
++	uuid = <0xe0786148 0xe311f8e7 0x02005ebc 0x1bc5d5a5>;
+ 	id = <1>;
+ 	execution-ctx-count = <8>;
+ 	exception-level = <2>; /* S-EL1 */
+-- 
+2.17.1
+
diff --git a/meta-arm-bsp/recipes-security/optee/optee-os-generic-tc.inc b/meta-arm-bsp/recipes-security/optee/optee-os-generic-tc.inc
index 644af42..5f64f5a 100644
--- a/meta-arm-bsp/recipes-security/optee/optee-os-generic-tc.inc
+++ b/meta-arm-bsp/recipes-security/optee/optee-os-generic-tc.inc
@@ -11,6 +11,7 @@  SRC_URI:append:tc = " \
     file://0001-WIP-Enable-managed-exit.patch \
     file://0003-ffa-Update-function-ID-according-to-FFA-v1.1-spec.patch \
     file://0001-plat-totalcompute-Specify-managed-exit-in-the-partit.patch \
+    file://0001-Fix-optee-UUID.patch \
     "
 
 COMPATIBLE_MACHINE = "(tc?)"