blob: db2ff32ced370f3d5871f54494c42a596adcab9c [file] [log] [blame]
Patrick Williams8dd68482022-10-04 07:57:18 -05001From 668fe40ccb0db5542ef333cd4655511dbb8572f9 Mon Sep 17 00:00:00 2001
Brad Bishopbec4ebc2022-08-03 09:55:16 -04002From: Vishnu Banavath <vishnu.banavath@arm.com>
3Date: Fri, 10 Dec 2021 20:10:41 +0000
Patrick Williams8dd68482022-10-04 07:57:18 -05004Subject: [PATCH 20/26] efi_boottime: corstone1000: pass interface id and
Brad Bishopbec4ebc2022-08-03 09:55:16 -04005 kernel event id using register w4
6
7Initially the interface/event IDs are passed to the SP using register
8w3 and w5.
9
10Now the SE proxy SP requires this arguments to be in register w4.
11
12This change is to pass interface ID(31:16) and kernel started
13event ID(15:0) to SE proxy SP to trigger an event to
14secure enclave just before ExitbootService().
15
16Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
17Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
18Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Patrick Williams8dd68482022-10-04 07:57:18 -050019Upstream-Status: Pending [Not submitted to upstream yet]
Brad Bishopbec4ebc2022-08-03 09:55:16 -040020---
21 lib/efi_loader/efi_boottime.c | 13 ++++++++++---
22 1 file changed, 10 insertions(+), 3 deletions(-)
23
24diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
Patrick Williams8dd68482022-10-04 07:57:18 -050025index 9bf2596597..de815484d2 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040026--- a/lib/efi_loader/efi_boottime.c
27+++ b/lib/efi_loader/efi_boottime.c
28@@ -27,6 +27,11 @@
Patrick Williams8dd68482022-10-04 07:57:18 -050029 #include <arm_ffa.h>
Brad Bishopbec4ebc2022-08-03 09:55:16 -040030 #endif
31
32+#if IS_ENABLED(CONFIG_TARGET_CORSTONE1000)
33+#include <linux/bitfield.h>
34+#include <linux/bitops.h>
35+#endif
36+
37 DECLARE_GLOBAL_DATA_PTR;
38
39 /* Task priority level */
Patrick Williams8dd68482022-10-04 07:57:18 -050040@@ -2112,10 +2117,12 @@ static int efi_corstone1000_kernel_started_event(void)
41 log_debug("[%s]\n", __func__);
Brad Bishopbec4ebc2022-08-03 09:55:16 -040042
43 /*
44- * setting the kernel started event arguments
45+ * setting the kernel started event arguments:
46+ * setting capsule update interface ID(31:16)
47+ * the kernel started event ID(15:0)
48 */
Patrick Williams8dd68482022-10-04 07:57:18 -050049- msg.data0 = CORSTONE1000_SEPROXY_UPDATE_SVC_ID; /* x3 */
50- msg.data2 = CORSTONE1000_KERNEL_STARTED_EVT; /* x5 */
51+ msg.data1 = PREP_SEPROXY_SVC_ID(CORSTONE1000_SEPROXY_UPDATE_SVC_ID) |
52+ PREP_SEPROXY_EVT(CORSTONE1000_KERNEL_STARTED_EVT); /* w4 */
Brad Bishopbec4ebc2022-08-03 09:55:16 -040053
Patrick Williams8dd68482022-10-04 07:57:18 -050054 return ffa_bus_ops_get()->sync_send_receive(CORSTONE1000_SEPROXY_PART_ID, &msg);
55 }
Brad Bishopbec4ebc2022-08-03 09:55:16 -040056--
Patrick Williams8dd68482022-10-04 07:57:18 -0500572.17.1
Brad Bishopbec4ebc2022-08-03 09:55:16 -040058