dp-arm | 1cebefd | 2016-09-19 11:21:03 +0100 | [diff] [blame] | 1 | /* |
J-Alves | 8676f24 | 2023-10-04 17:16:45 +0100 | [diff] [blame] | 2 | * Copyright (c) 2016-2019,2021-2024, Arm Limited and Contributors. All rights reserved. |
dp-arm | 1cebefd | 2016-09-19 11:21:03 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
dp-arm | 1cebefd | 2016-09-19 11:21:03 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Antonio Nino Diaz | 05fdb83 | 2018-10-25 16:53:04 +0100 | [diff] [blame] | 7 | #ifndef ARM_SIP_SVC_H |
| 8 | #define ARM_SIP_SVC_H |
| 9 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <lib/utils_def.h> |
dp-arm | 1cebefd | 2016-09-19 11:21:03 +0100 | [diff] [blame] | 11 | |
| 12 | /* SMC function IDs for SiP Service queries */ |
| 13 | |
Antonio Nino Diaz | 05fdb83 | 2018-10-25 16:53:04 +0100 | [diff] [blame] | 14 | #define ARM_SIP_SVC_CALL_COUNT U(0x8200ff00) |
| 15 | #define ARM_SIP_SVC_UID U(0x8200ff01) |
| 16 | /* U(0x8200ff02) is reserved */ |
| 17 | #define ARM_SIP_SVC_VERSION U(0x8200ff03) |
dp-arm | 1cebefd | 2016-09-19 11:21:03 +0100 | [diff] [blame] | 18 | |
Govindraj Raja | cd29ad5 | 2024-04-15 12:42:13 -0500 | [diff] [blame] | 19 | /* Deprecated FID's Range and will be removed */ |
Ambroise Vincent | 9660dc1 | 2019-07-12 13:47:03 +0100 | [diff] [blame] | 20 | /* PMF_SMC_GET_TIMESTAMP_32 0x82000010 */ |
| 21 | /* PMF_SMC_GET_TIMESTAMP_64 0xC2000010 */ |
| 22 | |
Jeenu Viswambharan | bc1a929 | 2017-02-16 14:55:15 +0000 | [diff] [blame] | 23 | /* Function ID for requesting state switch of lower EL */ |
Antonio Nino Diaz | 05fdb83 | 2018-10-25 16:53:04 +0100 | [diff] [blame] | 24 | #define ARM_SIP_SVC_EXE_STATE_SWITCH U(0x82000020) |
Jeenu Viswambharan | bc1a929 | 2017-02-16 14:55:15 +0000 | [diff] [blame] | 25 | |
Govindraj Raja | 79cd7a0 | 2024-03-07 15:24:19 -0600 | [diff] [blame] | 26 | /* Deprecated FID's Range and will be removed */ |
Ambroise Vincent | 9660dc1 | 2019-07-12 13:47:03 +0100 | [diff] [blame] | 27 | /* DEBUGFS_SMC_32 0x82000030U */ |
| 28 | /* DEBUGFS_SMC_64 0xC2000030U */ |
| 29 | |
Mikael Olsson | 7da6619 | 2021-02-12 17:30:22 +0100 | [diff] [blame] | 30 | /* |
Mikael Olsson | 3288b46 | 2022-08-15 17:12:58 +0200 | [diff] [blame] | 31 | * Arm(R) Ethos(TM)-N NPU SiP SMC function IDs |
Mikael Olsson | 7da6619 | 2021-02-12 17:30:22 +0100 | [diff] [blame] | 32 | * 0xC2000050-0xC200005F |
| 33 | * 0x82000050-0x8200005F |
| 34 | */ |
| 35 | |
dp-arm | 1cebefd | 2016-09-19 11:21:03 +0100 | [diff] [blame] | 36 | /* ARM SiP Service Calls version numbers */ |
Govindraj Raja | 79cd7a0 | 2024-03-07 15:24:19 -0600 | [diff] [blame] | 37 | #define ARM_SIP_SVC_VERSION_MAJOR U(0x1) |
| 38 | #define ARM_SIP_SVC_VERSION_MINOR U(0x0) |
dp-arm | 1cebefd | 2016-09-19 11:21:03 +0100 | [diff] [blame] | 39 | |
Madhukar Pappireddy | 3b228e1 | 2023-08-24 16:57:22 -0500 | [diff] [blame] | 40 | /* |
| 41 | * Arm SiP SMC calls that are primarily used for testing purposes. |
| 42 | */ |
| 43 | #if PLAT_TEST_SPM |
| 44 | #define ARM_SIP_SET_INTERRUPT_PENDING U(0x82000100) |
| 45 | #endif |
| 46 | |
J-Alves | 8676f24 | 2023-10-04 17:16:45 +0100 | [diff] [blame] | 47 | /** |
| 48 | * Arm SiP Service Call for the SPM to leverage RME to protect a give memory range. |
| 49 | * Protected memory range is one whose PAS was made secure. |
| 50 | * Unprotect relates to reverting a protect operation. |
| 51 | */ |
| 52 | #if SPMD_SPM_AT_SEL2 && ENABLE_RME |
| 53 | #define PLAT_PROTECT_MEM_SMC64 0xC2000101 |
| 54 | #define PLAT_UNPROTECT_MEM_SMC64 0xC2000102 |
| 55 | #endif |
| 56 | |
Madhukar Pappireddy | cc30710 | 2023-09-09 23:02:34 -0500 | [diff] [blame] | 57 | /* SiP handler specific to each Arm platform. */ |
| 58 | uintptr_t plat_arm_sip_handler(uint32_t smc_fid, |
| 59 | u_register_t x1, |
| 60 | u_register_t x2, |
| 61 | u_register_t x3, |
| 62 | u_register_t x4, |
| 63 | void *cookie, |
| 64 | void *handle, |
| 65 | u_register_t flags); |
| 66 | |
Antonio Nino Diaz | 05fdb83 | 2018-10-25 16:53:04 +0100 | [diff] [blame] | 67 | #endif /* ARM_SIP_SVC_H */ |