blob: a8d2c817e3d324f8c8ba3dda52039a189b368f99 [file] [log] [blame]
Andrew Geisslerea144b032023-01-27 16:03:57 -06001From e4e7ccc77a4e6930a768cc1c1f6daf8907ac16c3 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
Andrew Geisslerea144b032023-01-27 16:03:57 -06004Subject: [PATCH 14/25] 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
Andrew Geisslerea144b032023-01-27 16:03:57 -060025index d9eed33ac8..88f2d050be 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040026--- a/lib/efi_loader/efi_boottime.c
27+++ b/lib/efi_loader/efi_boottime.c
Andrew Geisslerea144b032023-01-27 16:03:57 -060028@@ -30,6 +30,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 */
Andrew Geisslerea144b032023-01-27 16:03:57 -060040@@ -2120,10 +2125,12 @@ static int efi_corstone1000_kernel_started_event(void)
Patrick Williams8dd68482022-10-04 07:57:18 -050041 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
Andrew Geisslerea144b032023-01-27 16:03:57 -060054 return ffa_bus_ops_get()->sync_send_receive(CORSTONE1000_SEPROXY_PART_ID, &msg, 0);
Patrick Williams8dd68482022-10-04 07:57:18 -050055 }
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