1 #ifndef __STD_SMC_H__
2 #define __STD_SMC_H__
3 
4 #include <sm/sm.h>
5 
6 /* SMC function IDs for Standard Service queries */
7 
8 #define ARM_STD_SVC_CALL_COUNT		0x8400ff00
9 #define ARM_STD_SVC_UID			0x8400ff01
10 /*                                      0x8400ff02 is reserved */
11 #define ARM_STD_SVC_VERSION		0x8400ff03
12 
13 #define ARM_SMCCC_VERSION		0x80000000
14 #define ARM_SMCCC_ARCH_FEATURES		0x80000001
15 #define ARM_SMCCC_ARCH_SOC_ID		0x80000002
16 #define ARM_SMCCC_ARCH_WORKAROUND_1	0x80008000
17 #define ARM_SMCCC_ARCH_WORKAROUND_2	0x80007fff
18 
19 #define ARM_SMCCC_RET_SUCCESS		0
20 #define ARM_SMCCC_RET_NOT_SUPPORTED	0xffffffff
21 #define ARM_SMCCC_RET_NOT_REQUIRED	0xfffffffe
22 #define ARM_SMCCC_RET_INVALID_PARAMETER	0xfffffffd
23 
24 #define SMCCC_V_1_0			0x10000
25 #define SMCCC_V_1_1			0x10001
26 #define SMCCC_V_1_2			0x10002
27 
28 /* ARM Standard Service Calls version numbers */
29 #define STD_SVC_VERSION_MAJOR		0x0
30 #define STD_SVC_VERSION_MINOR		0x1
31 
32 /* The macros below are used to identify PSCI calls from the SMC function ID */
33 #define PSCI_FID_MASK			0xffe0u
34 #define PSCI_FID_VALUE			0u
35 #define is_psci_fid(_fid) \
36 	(((_fid) & PSCI_FID_MASK) == PSCI_FID_VALUE)
37 
38 void smc_std_handler(struct thread_smc_args *args, struct sm_nsec_ctx *nsec);
39 #endif
40