]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Include/IndustryStandard/ArmTrustZoneSmc.h
ArmPkg/IndustryStandard: Added definition for some SMC IDs
[mirror_edk2.git] / ArmPkg / Include / IndustryStandard / ArmTrustZoneSmc.h
1 /** @file
2 *
3 * Copyright (c) 2012-2013, ARM Limited. All rights reserved.
4 *
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
9 *
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 *
13 **/
14
15 #ifndef __ARM_TRUSTZONE_SMC_H__
16 #define __ARM_TRUSTZONE_SMC_H__
17
18 #define ARM_TRUSTZONE_UID_4LETTERID 0x1
19 #define ARM_TRUSTZONE_UID_MD5 0x2
20
21 #define IS_ARM_TRUSTZONE_SUPPORTED_SMC(Rx,Region) (((UINTN)(Rx) >= (UINTN)ARM_TRUSTZONE_##Region##_SMC_ID_START) && ((UINTN)(Rx) <= (UINTN)ARM_TRUSTZONE_##Region##_SMC_ID_END))
22
23 #define IS_ARM_TRUSTZONE_DEPRECIATED_SMC(Rx) ((UINTN)(Rx) <= (UINTN)ARM_TRUSTZONE_DEPRECIATED_SMC_ID_END)
24 #define IS_ARM_TRUSTZONE_TRUSTED_OS_SMC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC(Rx,TRUSTED_OS)
25 #define IS_ARM_TRUSTZONE_ARM_FAST_SMC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC(Rx,ARM_FAST)
26 #define IS_ARM_TRUSTZONE_SIP_FAST_SMC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC(Rx,SIP_FAST)
27 #define IS_ARM_TRUSTZONE_ODM_FAST_SMC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC(Rx,ODM_FAST)
28 #define IS_ARM_TRUSTZONE_OEM_FAST_SMC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC(Rx,OEM_FAST)
29 #define IS_ARM_TRUSTZONE_TRUSTED_USER_FAST_SMC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC(Rx,TRUSTED_USER_FAST)
30 #define IS_ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC(Rx,TRUSTED_OS_FAST)
31
32 #define IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_PRESENCE(Rx,Region) ((Rx) == ARM_TRUSTZONE_##Region##_SMC_ID_PRESENCE)
33 #define IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID(Rx,Region) (((Rx) == ARM_TRUSTZONE_##Region##_SMC_ID_UID) || \
34 ((Rx) == ARM_TRUSTZONE_##Region##_SMC_ID_UID+1) || \
35 ((Rx) == ARM_TRUSTZONE_##Region##_SMC_ID_UID+2) || \
36 ((Rx) == ARM_TRUSTZONE_##Region##_SMC_ID_UID+3) || \
37 ((Rx) == ARM_TRUSTZONE_##Region##_SMC_ID_UID+4))
38 #define IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION(Rx,Region) (((Rx) == ARM_TRUSTZONE_##Region##_SMC_ID_REVISION) || \
39 ((Rx) == ARM_TRUSTZONE_##Region##_SMC_ID_REVISION+1))
40 #define IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC(Rx,Region) (((Rx) >= ARM_TRUSTZONE_##Region##_SMC_ID_RPC_START) && \
41 ((Rx) <= ARM_TRUSTZONE_##Region##_SMC_ID_RPC_END))
42
43 #define ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID_INDEX(Rx,Region) ((Rx) - ARM_TRUSTZONE_##Region##_SMC_ID_UID)
44 #define ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION_INDEX(Rx,Region) ((Rx) - ARM_TRUSTZONE_##Region##_SMC_ID_REVISION)
45 #define ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC_INDEX(Rx,Region) ((Rx) - ARM_TRUSTZONE_##Region##_SMC_ID_RPC_START)
46
47 #define ARM_TRUSTZONE_TRUSTED_OS_SMC_ID_RPC_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC_INDEX(Rx,TRUSTED_OS)
48
49 #define IS_ARM_TRUSTZONE_ARM_FAST_SMC_ID_PRESENCE(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_PRESENCE(Rx,ARM_FAST)
50 #define IS_ARM_TRUSTZONE_ARM_FAST_SMC_ID_UID(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID(Rx,ARM_FAST)
51 #define IS_ARM_TRUSTZONE_ARM_FAST_SMC_ID_REVISION(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION(Rx,ARM_FAST)
52 #define IS_ARM_TRUSTZONE_ARM_FAST_SMC_ID_RPC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC(Rx,ARM_FAST)
53 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_UID_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID_INDEX(Rx,ARM_FAST)
54 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_REVISION_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION_INDEX(Rx,ARM_FAST)
55 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_RPC_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC_INDEX(Rx,ARM_FAST)
56
57 #define IS_ARM_TRUSTZONE_ODM_FAST_SMC_ID_PRESENCE(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_PRESENCE(Rx,ODM_FAST)
58 #define IS_ARM_TRUSTZONE_ODM_FAST_SMC_ID_UID(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID(Rx,ODM_FAST)
59 #define IS_ARM_TRUSTZONE_ODM_FAST_SMC_ID_REVISION(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION(Rx,ODM_FAST)
60 #define IS_ARM_TRUSTZONE_ODM_FAST_SMC_ID_RPC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC(Rx,ODM_FAST)
61 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_UID_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID_INDEX(Rx,ODM_FAST)
62 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_REVISION_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION_INDEX(Rx,ODM_FAST)
63 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_RPC_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC_INDEX(Rx,ODM_FAST)
64
65 #define IS_ARM_TRUSTZONE_OEM_FAST_SMC_ID_PRESENCE(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_PRESENCE(Rx,OEM_FAST)
66 #define IS_ARM_TRUSTZONE_OEM_FAST_SMC_ID_UID(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID(Rx,OEM_FAST)
67 #define IS_ARM_TRUSTZONE_OEM_FAST_SMC_ID_REVISION(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION(Rx,OEM_FAST)
68 #define IS_ARM_TRUSTZONE_OEM_FAST_SMC_ID_RPC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC(Rx,OEM_FAST)
69 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_UID_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID_INDEX(Rx,OEM_FAST)
70 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_REVISION_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION_INDEX(Rx,OEM_FAST)
71 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_RPC_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC_INDEX(Rx,OEM_FAST)
72
73 #define IS_ARM_TRUSTZONE_SIP_FAST_SMC_ID_PRESENCE(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_PRESENCE(Rx,SIP_FAST)
74 #define IS_ARM_TRUSTZONE_SIP_FAST_SMC_ID_UID(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID(Rx,SIP_FAST)
75 #define IS_ARM_TRUSTZONE_SIP_FAST_SMC_ID_REVISION(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION(Rx,SIP_FAST)
76 #define IS_ARM_TRUSTZONE_SIP_FAST_SMC_ID_RPC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC(Rx,SIP_FAST)
77 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_UID_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID_INDEX(Rx,SIP_FAST)
78 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_REVISION_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION_INDEX(Rx,SIP_FAST)
79 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_RPC_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC_INDEX(Rx,SIP_FAST)
80
81 #define ARM_TRUSTZONE_TRUSTED_USER_FAST_SMC_ID_RPC_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC_INDEX(Rx,TRUSTED_USER_FAST)
82
83 #define IS_ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_PRESENCE(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_PRESENCE(Rx,TRUSTED_OS_FAST)
84 #define IS_ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_UID(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID(Rx,TRUSTED_OS_FAST)
85 #define IS_ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_REVISION(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION(Rx,TRUSTED_OS_FAST)
86 #define IS_ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_RPC(Rx) IS_ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC(Rx,TRUSTED_OS_FAST)
87 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_UID_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_UID_INDEX(Rx,TRUSTED_OS_FAST)
88 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_REVISION_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_REVISION_INDEX(Rx,TRUSTED_OS_FAST)
89 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_RPC_INDEX(Rx) ARM_TRUSTZONE_SUPPORTED_SMC_ID_RPC_INDEX(Rx,TRUSTED_OS_FAST)
90
91
92 #define ARM_TRUSTZONE_DEPRECIATED_SMC_ID_START 0x00000000
93 #define ARM_TRUSTZONE_DEPRECIATED_SMC_ID_END 0x01FFFFFF
94
95
96 #define ARM_TRUSTZONE_TRUSTED_OS_SMC_ID_START 0x02000000
97 #define ARM_TRUSTZONE_TRUSTED_OS_SMC_ID_END 0x1FFFFFFF
98
99 #define ARM_TRUSTZONE_TRUSTED_OS_SMC_ID_RPC_START 0x02000000
100 #define ARM_TRUSTZONE_TRUSTED_OS_SMC_ID_RPC_END 0x1FFFFFFF
101
102
103 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_START 0x80000000
104 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_END 0x80FFFFFF
105
106 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_RPC_START 0x80000000
107 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_RPC_END 0x80FFFEFF
108 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_PRESENCE 0x80FFFF00
109 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_UID 0x80FFFF10
110 #define ARM_TRUSTZONE_ARM_FAST_SMC_ID_REVISION 0x80FFFF20
111
112
113 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_START 0x81000000
114 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_END 0x81FFFFFF
115
116 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_RPC_START 0x81000000
117 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_RPC_END 0x81FFFEFF
118 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_PRESENCE 0x81FFFF00
119 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_UID 0x81FFFF10
120 #define ARM_TRUSTZONE_SIP_FAST_SMC_ID_REVISION 0x81FFFF20
121
122
123 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_START 0x82000000
124 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_END 0x82FFFFFF
125
126 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_RPC_START 0x82000000
127 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_RPC_END 0x82FFFEFF
128 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_PRESENCE 0x82FFFF00
129 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_UID 0x82FFFF10
130 #define ARM_TRUSTZONE_ODM_FAST_SMC_ID_REVISION 0x82FFFF20
131
132
133 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_START 0x83000000
134 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_END 0x83FFFFFF
135
136 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_RPC_START 0x83000000
137 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_RPC_END 0x83FFFEFF
138 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_PRESENCE 0x83FFFF00
139 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_UID 0x83FFFF10
140 #define ARM_TRUSTZONE_OEM_FAST_SMC_ID_REVISION 0x83FFFF20
141
142
143 #define ARM_TRUSTZONE_TRUSTED_USER_FAST_SMC_ID_START 0xF0000000
144 #define ARM_TRUSTZONE_TRUSTED_USER_FAST_SMC_ID_END 0xF1FFFFFF
145
146 #define ARM_TRUSTZONE_TRUSTED_USER_FAST_SMC_ID_RPC_START 0xF0000000
147 #define ARM_TRUSTZONE_TRUSTED_USER_FAST_SMC_ID_RPC_END 0xF1FFFEFF
148
149
150 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_START 0xF2000000
151 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_END 0xFFFFFFFF
152
153 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_RPC_START 0xF2000000
154 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_RPC_END 0xFFFFFEFF
155 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_PRESENCE 0xF2FFFF00
156 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_UID 0xF2FFFF10
157 #define ARM_TRUSTZONE_TRUSTED_OS_FAST_SMC_ID_REVISION 0xF2FFFF20
158
159 #endif