1 | /** @file
|
---|
2 | ACPI IO Remapping Table (IORT) definitions.
|
---|
3 |
|
---|
4 | Copyright (c) 2017, Linaro Limited. All rights reserved.<BR>
|
---|
5 | Copyright (c) 2018 - 2022, Arm Limited. All rights reserved.<BR>
|
---|
6 |
|
---|
7 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
8 |
|
---|
9 | @par Reference(s):
|
---|
10 | - IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022
|
---|
11 | (https://developer.arm.com/documentation/den0049/)
|
---|
12 | - IO Remapping Table, Platform Design Document, Revision E.e, Sept 2022
|
---|
13 | (https://developer.arm.com/documentation/den0049/)
|
---|
14 |
|
---|
15 | @par Glossary:
|
---|
16 | - Ref : Reference
|
---|
17 | - Mem : Memory
|
---|
18 | - Desc : Descriptor
|
---|
19 | **/
|
---|
20 |
|
---|
21 | #ifndef __IO_REMAPPING_TABLE_H__
|
---|
22 | #define __IO_REMAPPING_TABLE_H__
|
---|
23 |
|
---|
24 | #include <IndustryStandard/Acpi.h>
|
---|
25 |
|
---|
26 | #define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 0x0
|
---|
27 | #define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_04 0x4 // Deprecated
|
---|
28 | #define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05 0x5
|
---|
29 | #define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_06 0x6
|
---|
30 |
|
---|
31 | #define EFI_ACPI_IORT_TYPE_ITS_GROUP 0x0
|
---|
32 | #define EFI_ACPI_IORT_TYPE_NAMED_COMP 0x1
|
---|
33 | #define EFI_ACPI_IORT_TYPE_ROOT_COMPLEX 0x2
|
---|
34 | #define EFI_ACPI_IORT_TYPE_SMMUv1v2 0x3
|
---|
35 | #define EFI_ACPI_IORT_TYPE_SMMUv3 0x4
|
---|
36 | #define EFI_ACPI_IORT_TYPE_PMCG 0x5
|
---|
37 | #define EFI_ACPI_IORT_TYPE_RMR 0x6
|
---|
38 |
|
---|
39 | #define EFI_ACPI_IORT_MEM_ACCESS_PROP_CCA BIT0
|
---|
40 |
|
---|
41 | #define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_TR BIT0
|
---|
42 | #define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_WA BIT1
|
---|
43 | #define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_RA BIT2
|
---|
44 | #define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_AHO BIT3
|
---|
45 |
|
---|
46 | #define EFI_ACPI_IORT_MEM_ACCESS_FLAGS_CPM BIT0
|
---|
47 | #define EFI_ACPI_IORT_MEM_ACCESS_FLAGS_DACS BIT1
|
---|
48 | #define EFI_ACPI_IORT_MEM_ACCESS_FLAGS_CANWBS BIT2
|
---|
49 |
|
---|
50 | #define EFI_ACPI_IORT_SMMUv1v2_MODEL_v1 0x0
|
---|
51 | #define EFI_ACPI_IORT_SMMUv1v2_MODEL_v2 0x1
|
---|
52 | #define EFI_ACPI_IORT_SMMUv1v2_MODEL_MMU400 0x2
|
---|
53 | #define EFI_ACPI_IORT_SMMUv1v2_MODEL_MMU500 0x3
|
---|
54 | #define EFI_ACPI_IORT_SMMUv1v2_MODEL_MMU401 0x4
|
---|
55 | #define EFI_ACPI_IORT_SMMUv1v2_MODEL_CAVIUM_THX_v2 0x5
|
---|
56 |
|
---|
57 | #define EFI_ACPI_IORT_SMMUv1v2_FLAG_DVM BIT0
|
---|
58 | #define EFI_ACPI_IORT_SMMUv1v2_FLAG_COH_WALK BIT1
|
---|
59 |
|
---|
60 | #define EFI_ACPI_IORT_SMMUv1v2_INT_FLAG_LEVEL 0x0
|
---|
61 | #define EFI_ACPI_IORT_SMMUv1v2_INT_FLAG_EDGE 0x1
|
---|
62 |
|
---|
63 | #define EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDE BIT0
|
---|
64 | #define EFI_ACPI_IORT_SMMUv3_FLAG_HTTU_OVERRIDE BIT1 // HW update of Access Flag supported
|
---|
65 | #define EFI_ACPI_IORT_SMMUv3_FLAG_HTTU_OVERRIDE_DS BIT2 // HW update of Access Flag + Dirty Flag supported
|
---|
66 | #define EFI_ACPI_IORT_SMMUv3_FLAG_PROXIMITY_DOMAIN BIT3
|
---|
67 | #define EFI_ACPI_IORT_SMMUv3_FLAG_DEVICEID_VALID BIT4
|
---|
68 |
|
---|
69 | #define EFI_ACPI_IORT_SMMUv3_MODEL_GENERIC 0x0
|
---|
70 | #define EFI_ACPI_IORT_SMMUv3_MODEL_HISILICON_HI161X 0x1
|
---|
71 | #define EFI_ACPI_IORT_SMMUv3_MODEL_CAVIUM_CN99XX 0x2
|
---|
72 |
|
---|
73 | #define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED 0x0
|
---|
74 | #define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED BIT0
|
---|
75 |
|
---|
76 | #define EFI_ACPI_IORT_ROOT_COMPLEX_PRI_UNSUPPORTED 0x0
|
---|
77 | #define EFI_ACPI_IORT_ROOT_COMPLEX_PRI_SUPPORTED BIT1
|
---|
78 |
|
---|
79 | #define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_FWD_UNSUPPORTED 0x0
|
---|
80 | #define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_FWD_SUPPORTED BIT2
|
---|
81 |
|
---|
82 | #define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_UNSUPPORTED 0x0
|
---|
83 | #define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_SUPPORTED BIT1
|
---|
84 |
|
---|
85 | #define EFI_ACPI_IORT_RMR_REMAP_NOT_PERMITTED 0x0
|
---|
86 | #define EFI_ACPI_IORT_RMR_REMAP_PERMITTED BIT0
|
---|
87 |
|
---|
88 | #define EFI_ACPI_IORT_RMR_ACCESS_REQ_NOT_PRIVILEGED 0x0
|
---|
89 | #define EFI_ACPI_IORT_RMR_ACCESS_REQ_PRIVILEGED BIT1
|
---|
90 |
|
---|
91 | #define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_DEV_NGNRNE 0x0
|
---|
92 | #define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_DEV_NGNRE 0x1
|
---|
93 | #define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_DEV_NGRE 0x2
|
---|
94 | #define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_DEV_GRE 0x3
|
---|
95 | #define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_NORM_IN_NC_OUT_NC 0x4
|
---|
96 | #define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_NORM_IN_WB_OUT_WB_ISH 0x5
|
---|
97 |
|
---|
98 | #define EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE BIT0
|
---|
99 |
|
---|
100 | #define EFI_ACPI_IORT_RMR_NODE_REVISION_02 0x2 // Deprecated
|
---|
101 |
|
---|
102 | #pragma pack(1)
|
---|
103 |
|
---|
104 | ///
|
---|
105 | /// Table header
|
---|
106 | ///
|
---|
107 | typedef struct {
|
---|
108 | EFI_ACPI_DESCRIPTION_HEADER Header;
|
---|
109 | UINT32 NumNodes;
|
---|
110 | UINT32 NodeOffset;
|
---|
111 | UINT32 Reserved;
|
---|
112 | } EFI_ACPI_6_0_IO_REMAPPING_TABLE;
|
---|
113 |
|
---|
114 | ///
|
---|
115 | /// Definition for ID mapping table shared by all node types
|
---|
116 | ///
|
---|
117 | typedef struct {
|
---|
118 | UINT32 InputBase;
|
---|
119 | UINT32 NumIds;
|
---|
120 | UINT32 OutputBase;
|
---|
121 | UINT32 OutputReference;
|
---|
122 | UINT32 Flags;
|
---|
123 | } EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE;
|
---|
124 |
|
---|
125 | ///
|
---|
126 | /// Node header definition shared by all node types
|
---|
127 | ///
|
---|
128 | typedef struct {
|
---|
129 | UINT8 Type;
|
---|
130 | UINT16 Length;
|
---|
131 | UINT8 Revision;
|
---|
132 | UINT32 Identifier;
|
---|
133 | UINT32 NumIdMappings;
|
---|
134 | UINT32 IdReference;
|
---|
135 | } EFI_ACPI_6_0_IO_REMAPPING_NODE;
|
---|
136 |
|
---|
137 | ///
|
---|
138 | /// Node type 0: ITS node
|
---|
139 | ///
|
---|
140 | typedef struct {
|
---|
141 | EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
|
---|
142 |
|
---|
143 | UINT32 NumItsIdentifiers;
|
---|
144 | // UINT32 ItsIdentifiers[NumItsIdentifiers];
|
---|
145 | } EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE;
|
---|
146 |
|
---|
147 | ///
|
---|
148 | /// Node type 1: root complex node
|
---|
149 | ///
|
---|
150 | typedef struct {
|
---|
151 | EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
|
---|
152 |
|
---|
153 | UINT32 CacheCoherent;
|
---|
154 | UINT8 AllocationHints;
|
---|
155 | UINT16 Reserved;
|
---|
156 | UINT8 MemoryAccessFlags;
|
---|
157 |
|
---|
158 | UINT32 AtsAttribute;
|
---|
159 | UINT32 PciSegmentNumber;
|
---|
160 | UINT8 MemoryAddressSize;
|
---|
161 | UINT16 PasidCapabilities;
|
---|
162 | UINT8 Reserved1[1];
|
---|
163 | UINT32 Flags;
|
---|
164 | } EFI_ACPI_6_0_IO_REMAPPING_RC_NODE;
|
---|
165 |
|
---|
166 | ///
|
---|
167 | /// Node type 2: named component node
|
---|
168 | ///
|
---|
169 | typedef struct {
|
---|
170 | EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
|
---|
171 |
|
---|
172 | UINT32 Flags;
|
---|
173 | UINT32 CacheCoherent;
|
---|
174 | UINT8 AllocationHints;
|
---|
175 | UINT16 Reserved;
|
---|
176 | UINT8 MemoryAccessFlags;
|
---|
177 | UINT8 AddressSizeLimit;
|
---|
178 | // UINT8 ObjectName[];
|
---|
179 | } EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE;
|
---|
180 |
|
---|
181 | ///
|
---|
182 | /// Node type 3: SMMUv1 or SMMUv2 node
|
---|
183 | ///
|
---|
184 | typedef struct {
|
---|
185 | UINT32 Interrupt;
|
---|
186 | UINT32 InterruptFlags;
|
---|
187 | } EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT;
|
---|
188 |
|
---|
189 | typedef struct {
|
---|
190 | EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
|
---|
191 |
|
---|
192 | UINT64 Base;
|
---|
193 | UINT64 Span;
|
---|
194 | UINT32 Model;
|
---|
195 | UINT32 Flags;
|
---|
196 | UINT32 GlobalInterruptArrayRef;
|
---|
197 | UINT32 NumContextInterrupts;
|
---|
198 | UINT32 ContextInterruptArrayRef;
|
---|
199 | UINT32 NumPmuInterrupts;
|
---|
200 | UINT32 PmuInterruptArrayRef;
|
---|
201 |
|
---|
202 | UINT32 SMMU_NSgIrpt;
|
---|
203 | UINT32 SMMU_NSgIrptFlags;
|
---|
204 | UINT32 SMMU_NSgCfgIrpt;
|
---|
205 | UINT32 SMMU_NSgCfgIrptFlags;
|
---|
206 |
|
---|
207 | // EFI_ACPI_6_0_IO_REMAPPING_SMMU_CTX_INT ContextInterrupt[NumContextInterrupts];
|
---|
208 | // EFI_ACPI_6_0_IO_REMAPPING_SMMU_CTX_INT PmuInterrupt[NumPmuInterrupts];
|
---|
209 | } EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE;
|
---|
210 |
|
---|
211 | ///
|
---|
212 | /// Node type 4: SMMUv3 node
|
---|
213 | ///
|
---|
214 | typedef struct {
|
---|
215 | EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
|
---|
216 |
|
---|
217 | UINT64 Base;
|
---|
218 | UINT32 Flags;
|
---|
219 | UINT32 Reserved;
|
---|
220 | UINT64 VatosAddress;
|
---|
221 | UINT32 Model;
|
---|
222 | UINT32 Event;
|
---|
223 | UINT32 Pri;
|
---|
224 | UINT32 Gerr;
|
---|
225 | UINT32 Sync;
|
---|
226 | UINT32 ProximityDomain;
|
---|
227 | UINT32 DeviceIdMappingIndex;
|
---|
228 | } EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE;
|
---|
229 |
|
---|
230 | ///
|
---|
231 | /// Node type 5: PMCG node
|
---|
232 | ///
|
---|
233 | typedef struct {
|
---|
234 | EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
|
---|
235 |
|
---|
236 | UINT64 Base;
|
---|
237 | UINT32 OverflowInterruptGsiv;
|
---|
238 | UINT32 NodeReference;
|
---|
239 | UINT64 Page1Base;
|
---|
240 | // EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE OverflowInterruptMsiMapping[1];
|
---|
241 | } EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE;
|
---|
242 |
|
---|
243 | ///
|
---|
244 | /// Memory Range Descriptor.
|
---|
245 | ///
|
---|
246 | typedef struct {
|
---|
247 | /// Base address of Reserved Memory Range,
|
---|
248 | /// aligned to a page size of 64K.
|
---|
249 | UINT64 Base;
|
---|
250 |
|
---|
251 | /// Length of the Reserved Memory range.
|
---|
252 | /// Must be a multiple of the page size of 64K.
|
---|
253 | UINT64 Length;
|
---|
254 |
|
---|
255 | /// Reserved, must be zero.
|
---|
256 | UINT32 Reserved;
|
---|
257 | } EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC;
|
---|
258 |
|
---|
259 | ///
|
---|
260 | /// Node type 6: Reserved Memory Range (RMR) node
|
---|
261 | ///
|
---|
262 | typedef struct {
|
---|
263 | EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
|
---|
264 |
|
---|
265 | /// RMR flags
|
---|
266 | UINT32 Flags;
|
---|
267 |
|
---|
268 | /// Memory range descriptor count.
|
---|
269 | UINT32 NumMemRangeDesc;
|
---|
270 |
|
---|
271 | /// Offset of the memory range descriptor array.
|
---|
272 | UINT32 MemRangeDescRef;
|
---|
273 | // EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE IdMapping[1];
|
---|
274 | // EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC MemRangeDesc[1];
|
---|
275 | } EFI_ACPI_6_0_IO_REMAPPING_RMR_NODE;
|
---|
276 |
|
---|
277 | #pragma pack()
|
---|
278 |
|
---|
279 | #endif
|
---|