Andrew Geissler | ea144b03 | 2023-01-27 16:03:57 -0600 | [diff] [blame^] | 1 | From e4e7ccc77a4e6930a768cc1c1f6daf8907ac16c3 Mon Sep 17 00:00:00 2001 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 2 | From: Vishnu Banavath <vishnu.banavath@arm.com> |
| 3 | Date: Fri, 10 Dec 2021 20:10:41 +0000 |
Andrew Geissler | ea144b03 | 2023-01-27 16:03:57 -0600 | [diff] [blame^] | 4 | Subject: [PATCH 14/25] efi_boottime: corstone1000: pass interface id and |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 5 | kernel event id using register w4 |
| 6 | |
| 7 | Initially the interface/event IDs are passed to the SP using register |
| 8 | w3 and w5. |
| 9 | |
| 10 | Now the SE proxy SP requires this arguments to be in register w4. |
| 11 | |
| 12 | This change is to pass interface ID(31:16) and kernel started |
| 13 | event ID(15:0) to SE proxy SP to trigger an event to |
| 14 | secure enclave just before ExitbootService(). |
| 15 | |
| 16 | Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com> |
| 17 | Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> |
| 18 | Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 19 | Upstream-Status: Pending [Not submitted to upstream yet] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 20 | --- |
| 21 | lib/efi_loader/efi_boottime.c | 13 ++++++++++--- |
| 22 | 1 file changed, 10 insertions(+), 3 deletions(-) |
| 23 | |
| 24 | diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c |
Andrew Geissler | ea144b03 | 2023-01-27 16:03:57 -0600 | [diff] [blame^] | 25 | index d9eed33ac8..88f2d050be 100644 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 26 | --- a/lib/efi_loader/efi_boottime.c |
| 27 | +++ b/lib/efi_loader/efi_boottime.c |
Andrew Geissler | ea144b03 | 2023-01-27 16:03:57 -0600 | [diff] [blame^] | 28 | @@ -30,6 +30,11 @@ |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 29 | #include <arm_ffa.h> |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 30 | #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 Geissler | ea144b03 | 2023-01-27 16:03:57 -0600 | [diff] [blame^] | 40 | @@ -2120,10 +2125,12 @@ static int efi_corstone1000_kernel_started_event(void) |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 41 | log_debug("[%s]\n", __func__); |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 42 | |
| 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 Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 49 | - 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 53 | |
Andrew Geissler | ea144b03 | 2023-01-27 16:03:57 -0600 | [diff] [blame^] | 54 | return ffa_bus_ops_get()->sync_send_receive(CORSTONE1000_SEPROXY_PART_ID, &msg, 0); |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 55 | } |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 56 | -- |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame] | 57 | 2.17.1 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 58 | |