blob: bca224d5e9efc48a3c80a82ab8310d0696f7302e [file] [log] [blame]
dp-arm1cebefd2016-09-19 11:21:03 +01001/*
J-Alves8676f242023-10-04 17:16:45 +01002 * Copyright (c) 2016-2019,2021-2024, Arm Limited and Contributors. All rights reserved.
dp-arm1cebefd2016-09-19 11:21:03 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
dp-arm1cebefd2016-09-19 11:21:03 +01005 */
6
Antonio Nino Diaz05fdb832018-10-25 16:53:04 +01007#ifndef ARM_SIP_SVC_H
8#define ARM_SIP_SVC_H
9
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <lib/utils_def.h>
dp-arm1cebefd2016-09-19 11:21:03 +010011
12/* SMC function IDs for SiP Service queries */
13
Antonio Nino Diaz05fdb832018-10-25 16:53:04 +010014#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-arm1cebefd2016-09-19 11:21:03 +010018
Govindraj Rajacd29ad52024-04-15 12:42:13 -050019/* Deprecated FID's Range and will be removed */
Ambroise Vincent9660dc12019-07-12 13:47:03 +010020/* PMF_SMC_GET_TIMESTAMP_32 0x82000010 */
21/* PMF_SMC_GET_TIMESTAMP_64 0xC2000010 */
22
Jeenu Viswambharanbc1a9292017-02-16 14:55:15 +000023/* Function ID for requesting state switch of lower EL */
Antonio Nino Diaz05fdb832018-10-25 16:53:04 +010024#define ARM_SIP_SVC_EXE_STATE_SWITCH U(0x82000020)
Jeenu Viswambharanbc1a9292017-02-16 14:55:15 +000025
Govindraj Raja79cd7a02024-03-07 15:24:19 -060026/* Deprecated FID's Range and will be removed */
Ambroise Vincent9660dc12019-07-12 13:47:03 +010027/* DEBUGFS_SMC_32 0x82000030U */
28/* DEBUGFS_SMC_64 0xC2000030U */
29
Mikael Olsson7da66192021-02-12 17:30:22 +010030/*
Mikael Olsson3288b462022-08-15 17:12:58 +020031 * Arm(R) Ethos(TM)-N NPU SiP SMC function IDs
Mikael Olsson7da66192021-02-12 17:30:22 +010032 * 0xC2000050-0xC200005F
33 * 0x82000050-0x8200005F
34 */
35
dp-arm1cebefd2016-09-19 11:21:03 +010036/* ARM SiP Service Calls version numbers */
Govindraj Raja79cd7a02024-03-07 15:24:19 -060037#define ARM_SIP_SVC_VERSION_MAJOR U(0x1)
38#define ARM_SIP_SVC_VERSION_MINOR U(0x0)
dp-arm1cebefd2016-09-19 11:21:03 +010039
Madhukar Pappireddy3b228e12023-08-24 16:57:22 -050040/*
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-Alves8676f242023-10-04 17:16:45 +010047/**
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 Pappireddycc307102023-09-09 23:02:34 -050057/* SiP handler specific to each Arm platform. */
58uintptr_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 Diaz05fdb832018-10-25 16:53:04 +010067#endif /* ARM_SIP_SVC_H */