aboutsummaryrefslogtreecommitdiff
path: root/core/arch/arm/include/sm/std_smc.h
blob: ce8606dcfdd711747c9b8de31c3e5bb57e4810e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef __STD_SMC_H__
#define __STD_SMC_H__

#include <sm/sm.h>

/* SMC function IDs for Standard Service queries */

#define ARM_STD_SVC_CALL_COUNT		0x8400ff00
#define ARM_STD_SVC_UID			0x8400ff01
/*                                      0x8400ff02 is reserved */
#define ARM_STD_SVC_VERSION		0x8400ff03

#define ARM_SMCCC_VERSION		0x80000000
#define ARM_SMCCC_ARCH_FEATURES		0x80000001
#define ARM_SMCCC_ARCH_SOC_ID		0x80000002
#define ARM_SMCCC_ARCH_WORKAROUND_1	0x80008000
#define ARM_SMCCC_ARCH_WORKAROUND_2	0x80007fff

#define ARM_SMCCC_RET_SUCCESS		0
#define ARM_SMCCC_RET_NOT_SUPPORTED	0xffffffff
#define ARM_SMCCC_RET_NOT_REQUIRED	0xfffffffe
#define ARM_SMCCC_RET_INVALID_PARAMETER	0xfffffffd

#define SMCCC_V_1_0			0x10000
#define SMCCC_V_1_1			0x10001
#define SMCCC_V_1_2			0x10002

/* ARM Standard Service Calls version numbers */
#define STD_SVC_VERSION_MAJOR		0x0
#define STD_SVC_VERSION_MINOR		0x1

/* The macros below are used to identify PSCI calls from the SMC function ID */
#define PSCI_FID_MASK			0xffe0u
#define PSCI_FID_VALUE			0u
#define is_psci_fid(_fid) \
	(((_fid) & PSCI_FID_MASK) == PSCI_FID_VALUE)

void smc_std_handler(struct thread_smc_args *args, struct sm_nsec_ctx *nsec);
#endif