]>
Commit | Line | Data |
---|---|---|
846ea5f5 GM |
1 | /** @file\r |
2 | DMA Remapping Reporting (DMAR) ACPI table definition from Intel(R)\r | |
3 | Virtualization Technology for Directed I/O (VT-D) Architecture Specification.\r | |
4 | \r | |
8ab0bd23 | 5 | Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r |
846ea5f5 GM |
6 | This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | @par Revision Reference:\r | |
15 | - Intel(R) Virtualization Technology for Directed I/O (VT-D) Architecture\r | |
8ab0bd23 | 16 | Specification v2.5, Dated November 2017.\r |
846ea5f5 GM |
17 | http://www.intel.com/content/dam/www/public/us/en/documents/product-specifications/vt-directed-io-spec.pdf\r |
18 | \r | |
19 | @par Glossary:\r | |
20 | - HPET - High Precision Event Timer\r | |
21 | - NUMA - Non-uniform Memory Access\r | |
22 | **/\r | |
23 | #ifndef _DMA_REMAPPING_REPORTING_TABLE_H_\r | |
24 | #define _DMA_REMAPPING_REPORTING_TABLE_H_\r | |
25 | \r | |
83a45784 JY |
26 | #include <IndustryStandard/Acpi.h>\r |
27 | \r | |
846ea5f5 GM |
28 | #pragma pack(1)\r |
29 | \r | |
30 | ///\r | |
31 | /// DMA-Remapping Reporting Structure definitions from section 8.1\r | |
32 | ///@{\r | |
8ab0bd23 | 33 | #define EFI_ACPI_DMAR_REVISION 0x01\r |
846ea5f5 | 34 | \r |
8ab0bd23 HW |
35 | #define EFI_ACPI_DMAR_FLAGS_INTR_REMAP BIT0\r |
36 | #define EFI_ACPI_DMAR_FLAGS_X2APIC_OPT_OUT BIT1\r | |
37 | #define EFI_ACPI_DMAR_FLAGS_DMA_CTRL_PLATFORM_OPT_IN_FLAG BIT2\r | |
846ea5f5 GM |
38 | ///@}\r |
39 | \r | |
40 | ///\r | |
41 | /// Remapping Structure Types definitions from section 8.2\r | |
42 | ///@{\r | |
43 | #define EFI_ACPI_DMAR_TYPE_DRHD 0x00\r | |
44 | #define EFI_ACPI_DMAR_TYPE_RMRR 0x01\r | |
45 | #define EFI_ACPI_DMAR_TYPE_ATSR 0x02\r | |
46 | #define EFI_ACPI_DMAR_TYPE_RHSA 0x03\r | |
47 | #define EFI_ACPI_DMAR_TYPE_ANDD 0x04\r | |
48 | ///@}\r | |
49 | \r | |
50 | ///\r | |
51 | /// DMA-Remapping Hardware Unit definitions from section 8.3\r | |
52 | ///\r | |
53 | #define EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL BIT0\r | |
54 | \r | |
55 | ///\r | |
56 | /// DMA-Remapping Device Scope Entry Structure definitions from section 8.3.1\r | |
57 | ///@{\r | |
58 | #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_PCI_ENDPOINT 0x01\r | |
59 | #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_PCI_BRIDGE 0x02\r | |
60 | #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_IOAPIC 0x03\r | |
61 | #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_MSI_CAPABLE_HPET 0x04\r | |
62 | #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_ACPI_NAMESPACE_DEVICE 0x05\r | |
63 | ///@}\r | |
64 | \r | |
65 | ///\r | |
66 | /// Root Port ATS Capability Reporting Structure definitions from section 8.5\r | |
67 | ///\r | |
68 | #define EFI_ACPI_DMAR_ATSR_FLAGS_ALL_PORTS BIT0\r | |
69 | \r | |
70 | ///\r | |
71 | /// Definition for DMA Remapping Structure Header\r | |
72 | ///\r | |
73 | typedef struct {\r | |
74 | UINT16 Type;\r | |
75 | UINT16 Length;\r | |
76 | } EFI_ACPI_DMAR_STRUCTURE_HEADER;\r | |
77 | \r | |
78 | ///\r | |
79 | /// Definition for DMA-Remapping PCI Path\r | |
80 | ///\r | |
81 | typedef struct {\r | |
82 | UINT8 Device;\r | |
83 | UINT8 Function;\r | |
84 | } EFI_ACPI_DMAR_PCI_PATH;\r | |
85 | \r | |
86 | ///\r | |
87 | /// Device Scope Structure is defined in section 8.3.1\r | |
88 | ///\r | |
89 | typedef struct {\r | |
90 | UINT8 Type;\r | |
91 | UINT8 Length;\r | |
92 | UINT16 Reserved2;\r | |
93 | UINT8 EnumerationId;\r | |
94 | UINT8 StartBusNumber;\r | |
95 | } EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER;\r | |
96 | \r | |
97 | /**\r | |
98 | DMA-remapping hardware unit definition (DRHD) structure is defined in\r | |
99 | section 8.3. This uniquely represents a remapping hardware unit present\r | |
100 | in the platform. There must be at least one instance of this structure\r | |
101 | for each PCI segment in the platform.\r | |
102 | **/\r | |
103 | typedef struct {\r | |
104 | EFI_ACPI_DMAR_STRUCTURE_HEADER Header;\r | |
105 | /**\r | |
106 | - Bit[0]: INCLUDE_PCI_ALL\r | |
107 | - If Set, this remapping hardware unit has under its scope all\r | |
108 | PCI compatible devices in the specified Segment, except devices\r | |
109 | reported under the scope of other remapping hardware units for\r | |
110 | the same Segment.\r | |
111 | - If Clear, this remapping hardware unit has under its scope only\r | |
112 | devices in the specified Segment that are explicitly identified\r | |
113 | through the DeviceScope field.\r | |
114 | - Bits[7:1] Reserved.\r | |
115 | **/\r | |
116 | UINT8 Flags;\r | |
117 | UINT8 Reserved;\r | |
118 | ///\r | |
119 | /// The PCI Segment associated with this unit.\r | |
120 | ///\r | |
121 | UINT16 SegmentNumber;\r | |
122 | ///\r | |
123 | /// Base address of remapping hardware register-set for this unit.\r | |
124 | ///\r | |
125 | UINT64 RegisterBaseAddress;\r | |
126 | } EFI_ACPI_DMAR_DRHD_HEADER;\r | |
127 | \r | |
128 | /**\r | |
129 | Reserved Memory Region Reporting Structure (RMRR) is described in section 8.4\r | |
130 | Reserved memory ranges that may be DMA targets may be reported through the\r | |
131 | RMRR structures, along with the devices that requires access to the specified\r | |
132 | reserved memory region.\r | |
133 | **/\r | |
134 | typedef struct {\r | |
135 | EFI_ACPI_DMAR_STRUCTURE_HEADER Header;\r | |
136 | UINT8 Reserved[2];\r | |
137 | ///\r | |
138 | /// PCI Segment Number associated with devices identified through\r | |
139 | /// the Device Scope field.\r | |
140 | ///\r | |
141 | UINT16 SegmentNumber;\r | |
142 | ///\r | |
143 | /// Base address of 4KB-aligned reserved memory region\r | |
144 | ///\r | |
145 | UINT64 ReservedMemoryRegionBaseAddress;\r | |
146 | /**\r | |
147 | Last address of the reserved memory region. Value in this field must be\r | |
148 | greater than the value in Reserved Memory Region Base Address field.\r | |
149 | The reserved memory region size (Limit - Base + 1) must be an integer\r | |
150 | multiple of 4KB.\r | |
151 | **/\r | |
152 | UINT64 ReservedMemoryRegionLimitAddress;\r | |
153 | } EFI_ACPI_DMAR_RMRR_HEADER;\r | |
154 | \r | |
155 | /**\r | |
156 | Root Port ATS Capability Reporting (ATSR) structure is defined in section 8.5.\r | |
157 | This structure is applicable only for platforms supporting Device-TLBs as\r | |
158 | reported through the Extended Capability Register. For each PCI Segment in\r | |
159 | the platform that supports Device-TLBs, BIOS provides an ATSR structure. The\r | |
160 | ATSR structures identifies PCI-Express Root-Ports supporting Address\r | |
161 | Translation Services (ATS) transactions. Software must enable ATS on endpoint\r | |
162 | devices behind a Root Port only if the Root Port is reported as supporting\r | |
163 | ATS transactions.\r | |
164 | **/\r | |
165 | typedef struct {\r | |
166 | EFI_ACPI_DMAR_STRUCTURE_HEADER Header;\r | |
167 | /**\r | |
168 | - Bit[0]: ALL_PORTS:\r | |
169 | - If Set, indicates all PCI Express Root Ports in the specified\r | |
170 | PCI Segment supports ATS transactions.\r | |
171 | - If Clear, indicates ATS transactions are supported only on\r | |
172 | Root Ports identified through the Device Scope field.\r | |
173 | - Bits[7:1] Reserved.\r | |
174 | **/\r | |
175 | UINT8 Flags;\r | |
176 | UINT8 Reserved;\r | |
177 | ///\r | |
178 | /// The PCI Segment associated with this ATSR structure\r | |
179 | ///\r | |
180 | UINT16 SegmentNumber;\r | |
181 | } EFI_ACPI_DMAR_ATSR_HEADER;\r | |
182 | \r | |
183 | /**\r | |
184 | Remapping Hardware Static Affinity (RHSA) is an optional structure defined\r | |
185 | in section 8.6. This is intended to be used only on NUMA platforms with\r | |
186 | Remapping hardware units and memory spanned across multiple nodes.\r | |
187 | When used, there must be a RHSA structure for each Remapping hardware unit\r | |
188 | reported through DRHD structure.\r | |
189 | **/\r | |
190 | typedef struct {\r | |
191 | EFI_ACPI_DMAR_STRUCTURE_HEADER Header;\r | |
192 | UINT8 Reserved[4];\r | |
193 | ///\r | |
194 | /// Register Base Address of this Remap hardware unit reported in the\r | |
195 | /// corresponding DRHD structure.\r | |
196 | ///\r | |
197 | UINT64 RegisterBaseAddress;\r | |
198 | ///\r | |
199 | /// Proximity Domain to which the Remap hardware unit identified by the\r | |
200 | /// Register Base Address field belongs.\r | |
201 | ///\r | |
202 | UINT32 ProximityDomain;\r | |
203 | } EFI_ACPI_DMAR_RHSA_HEADER;\r | |
204 | \r | |
205 | /**\r | |
206 | An ACPI Name-space Device Declaration (ANDD) structure is defined in section\r | |
207 | 8.7 and uniquely represents an ACPI name-space enumerated device capable of\r | |
208 | issuing DMA requests in the platform. ANDD structures are used in conjunction\r | |
209 | with Device-Scope entries of type ACPI_NAMESPACE_DEVICE.\r | |
210 | **/\r | |
211 | typedef struct {\r | |
212 | EFI_ACPI_DMAR_STRUCTURE_HEADER Header;\r | |
213 | UINT8 Reserved[3];\r | |
214 | /**\r | |
215 | Each ACPI device enumerated through an ANDD structure must have a unique\r | |
216 | value for this field. To report an ACPI device with ACPI Device Number\r | |
217 | value of X, under the scope of a DRHD unit, a Device-Scope entry of type\r | |
218 | ACPI_NAMESPACE_DEVICE is used with value of X in the Enumeration ID field.\r | |
219 | The Start Bus Number and Path fields in the Device-Scope together\r | |
220 | provides the 16-bit source-id allocated by platform for the ACPI device.\r | |
221 | **/\r | |
222 | UINT8 AcpiDeviceNumber;\r | |
223 | } EFI_ACPI_DMAR_ANDD_HEADER;\r | |
224 | \r | |
225 | /**\r | |
226 | DMA Remapping Reporting Structure Header as defined in section 8.1\r | |
227 | This header will be followed by list of Remapping Structures listed below\r | |
228 | - DMA Remapping Hardware Unit Definition (DRHD)\r | |
229 | - Reserved Memory Region Reporting (RMRR)\r | |
230 | - Root Port ATS Capability Reporting (ATSR)\r | |
231 | - Remapping Hardware Static Affinity (RHSA)\r | |
232 | - ACPI Name-space Device Declaration (ANDD)\r | |
233 | These structure types must by reported in numerical order.\r | |
234 | i.e., All remapping structures of type 0 (DRHD) enumerated before remapping\r | |
235 | structures of type 1 (RMRR), and so forth.\r | |
236 | **/\r | |
237 | typedef struct {\r | |
238 | EFI_ACPI_DESCRIPTION_HEADER Header;\r | |
239 | /**\r | |
240 | This field indicates the maximum DMA physical addressability supported by\r | |
241 | this platform. The system address map reported by the BIOS indicates what\r | |
242 | portions of this addresses are populated. The Host Address Width (HAW) of\r | |
243 | the platform is computed as (N+1), where N is the value reported in this\r | |
244 | field.\r | |
245 | For example, for a platform supporting 40 bits of physical addressability,\r | |
246 | the value of 100111b is reported in this field.\r | |
247 | **/\r | |
248 | UINT8 HostAddressWidth;\r | |
249 | /**\r | |
250 | - Bit[0]: INTR_REMAP - If Clear, the platform does not support interrupt\r | |
251 | remapping. If Set, the platform supports interrupt remapping.\r | |
252 | - Bit[1]: X2APIC_OPT_OUT - For firmware compatibility reasons, platform\r | |
253 | firmware may Set this field to request system software to opt\r | |
254 | out of enabling Extended xAPIC (X2APIC) mode. This field is\r | |
255 | valid only when the INTR_REMAP field (bit 0) is Set.\r | |
8ab0bd23 HW |
256 | - Bit[2]: DMA_CTRL_PLATFORM_OPT_IN_FLAG - Platform firmware is\r |
257 | recommended to Set this field to report any platform initiated\r | |
258 | DMA is restricted to only reserved memory regions (reported in\r | |
259 | RMRR structures) when transferring control to system software\r | |
260 | such as on ExitBootServices().\r | |
261 | - Bits[7:3] Reserved.\r | |
846ea5f5 GM |
262 | **/\r |
263 | UINT8 Flags;\r | |
264 | UINT8 Reserved[10];\r | |
265 | } EFI_ACPI_DMAR_HEADER;\r | |
266 | \r | |
267 | #pragma pack()\r | |
268 | \r | |
269 | #endif\r |