actbl2.h revision 1.1.1.27 1 1.1 jruoho /******************************************************************************
2 1.1 jruoho *
3 1.1.1.27 christos * Name: actbl2.h - ACPI Table Definitions
4 1.1 jruoho *
5 1.1 jruoho *****************************************************************************/
6 1.1 jruoho
7 1.1.1.26 christos /******************************************************************************
8 1.1.1.26 christos *
9 1.1.1.26 christos * 1. Copyright Notice
10 1.1.1.26 christos *
11 1.1.1.27 christos * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
12 1.1 jruoho * All rights reserved.
13 1.1 jruoho *
14 1.1.1.26 christos * 2. License
15 1.1.1.26 christos *
16 1.1.1.26 christos * 2.1. This is your license from Intel Corp. under its intellectual property
17 1.1.1.26 christos * rights. You may have additional license terms from the party that provided
18 1.1.1.26 christos * you this software, covering your right to use that party's intellectual
19 1.1.1.26 christos * property rights.
20 1.1.1.26 christos *
21 1.1.1.26 christos * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 1.1.1.26 christos * copy of the source code appearing in this file ("Covered Code") an
23 1.1.1.26 christos * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 1.1.1.26 christos * base code distributed originally by Intel ("Original Intel Code") to copy,
25 1.1.1.26 christos * make derivatives, distribute, use and display any portion of the Covered
26 1.1.1.26 christos * Code in any form, with the right to sublicense such rights; and
27 1.1.1.26 christos *
28 1.1.1.26 christos * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 1.1.1.26 christos * license (with the right to sublicense), under only those claims of Intel
30 1.1.1.26 christos * patents that are infringed by the Original Intel Code, to make, use, sell,
31 1.1.1.26 christos * offer to sell, and import the Covered Code and derivative works thereof
32 1.1.1.26 christos * solely to the minimum extent necessary to exercise the above copyright
33 1.1.1.26 christos * license, and in no event shall the patent license extend to any additions
34 1.1.1.26 christos * to or modifications of the Original Intel Code. No other license or right
35 1.1.1.26 christos * is granted directly or by implication, estoppel or otherwise;
36 1.1.1.26 christos *
37 1.1.1.26 christos * The above copyright and patent license is granted only if the following
38 1.1.1.26 christos * conditions are met:
39 1.1.1.26 christos *
40 1.1.1.26 christos * 3. Conditions
41 1.1.1.26 christos *
42 1.1.1.26 christos * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 1.1.1.26 christos * Redistribution of source code of any substantial portion of the Covered
44 1.1.1.26 christos * Code or modification with rights to further distribute source must include
45 1.1.1.26 christos * the above Copyright Notice, the above License, this list of Conditions,
46 1.1.1.26 christos * and the following Disclaimer and Export Compliance provision. In addition,
47 1.1.1.26 christos * Licensee must cause all Covered Code to which Licensee contributes to
48 1.1.1.26 christos * contain a file documenting the changes Licensee made to create that Covered
49 1.1.1.26 christos * Code and the date of any change. Licensee must include in that file the
50 1.1.1.26 christos * documentation of any changes made by any predecessor Licensee. Licensee
51 1.1.1.26 christos * must include a prominent statement that the modification is derived,
52 1.1.1.26 christos * directly or indirectly, from Original Intel Code.
53 1.1.1.26 christos *
54 1.1.1.26 christos * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 1.1.1.26 christos * Redistribution of source code of any substantial portion of the Covered
56 1.1.1.26 christos * Code or modification without rights to further distribute source must
57 1.1.1.26 christos * include the following Disclaimer and Export Compliance provision in the
58 1.1.1.26 christos * documentation and/or other materials provided with distribution. In
59 1.1.1.26 christos * addition, Licensee may not authorize further sublicense of source of any
60 1.1.1.26 christos * portion of the Covered Code, and must include terms to the effect that the
61 1.1.1.26 christos * license from Licensee to its licensee is limited to the intellectual
62 1.1.1.26 christos * property embodied in the software Licensee provides to its licensee, and
63 1.1.1.26 christos * not to intellectual property embodied in modifications its licensee may
64 1.1.1.26 christos * make.
65 1.1.1.26 christos *
66 1.1.1.26 christos * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 1.1.1.26 christos * substantial portion of the Covered Code or modification must reproduce the
68 1.1.1.26 christos * above Copyright Notice, and the following Disclaimer and Export Compliance
69 1.1.1.26 christos * provision in the documentation and/or other materials provided with the
70 1.1.1.26 christos * distribution.
71 1.1.1.26 christos *
72 1.1.1.26 christos * 3.4. Intel retains all right, title, and interest in and to the Original
73 1.1.1.26 christos * Intel Code.
74 1.1.1.26 christos *
75 1.1.1.26 christos * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 1.1.1.26 christos * Intel shall be used in advertising or otherwise to promote the sale, use or
77 1.1.1.26 christos * other dealings in products derived from or relating to the Covered Code
78 1.1.1.26 christos * without prior written authorization from Intel.
79 1.1.1.26 christos *
80 1.1.1.26 christos * 4. Disclaimer and Export Compliance
81 1.1.1.26 christos *
82 1.1.1.26 christos * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 1.1.1.26 christos * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 1.1.1.26 christos * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 1.1.1.26 christos * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 1.1.1.26 christos * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 1.1.1.26 christos * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88 1.1.1.26 christos * PARTICULAR PURPOSE.
89 1.1.1.26 christos *
90 1.1.1.26 christos * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 1.1.1.26 christos * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 1.1.1.26 christos * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 1.1.1.26 christos * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 1.1.1.26 christos * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 1.1.1.26 christos * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 1.1.1.26 christos * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97 1.1.1.26 christos * LIMITED REMEDY.
98 1.1.1.26 christos *
99 1.1.1.26 christos * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 1.1.1.26 christos * software or system incorporating such software without first obtaining any
101 1.1.1.26 christos * required license or other approval from the U. S. Department of Commerce or
102 1.1.1.26 christos * any other agency or department of the United States Government. In the
103 1.1.1.26 christos * event Licensee exports any such software from the United States or
104 1.1.1.26 christos * re-exports any such software from a foreign destination, Licensee shall
105 1.1.1.26 christos * ensure that the distribution and export/re-export of the software is in
106 1.1.1.26 christos * compliance with all laws, regulations, orders, or other restrictions of the
107 1.1.1.26 christos * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 1.1.1.26 christos * any of its subsidiaries will export/re-export any technical data, process,
109 1.1.1.26 christos * software, or service, directly or indirectly, to any country for which the
110 1.1.1.26 christos * United States government or any agency thereof requires an export license,
111 1.1.1.26 christos * other governmental approval, or letter of assurance, without first obtaining
112 1.1.1.26 christos * such license, approval or letter.
113 1.1.1.26 christos *
114 1.1.1.26 christos *****************************************************************************
115 1.1.1.26 christos *
116 1.1.1.26 christos * Alternatively, you may choose to be licensed under the terms of the
117 1.1.1.26 christos * following license:
118 1.1.1.26 christos *
119 1.1.1.2 jruoho * Redistribution and use in source and binary forms, with or without
120 1.1.1.2 jruoho * modification, are permitted provided that the following conditions
121 1.1.1.2 jruoho * are met:
122 1.1.1.2 jruoho * 1. Redistributions of source code must retain the above copyright
123 1.1.1.2 jruoho * notice, this list of conditions, and the following disclaimer,
124 1.1.1.2 jruoho * without modification.
125 1.1.1.2 jruoho * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 1.1.1.2 jruoho * substantially similar to the "NO WARRANTY" disclaimer below
127 1.1.1.2 jruoho * ("Disclaimer") and any redistribution must be conditioned upon
128 1.1.1.2 jruoho * including a substantially similar Disclaimer requirement for further
129 1.1.1.2 jruoho * binary redistribution.
130 1.1.1.2 jruoho * 3. Neither the names of the above-listed copyright holders nor the names
131 1.1.1.2 jruoho * of any contributors may be used to endorse or promote products derived
132 1.1.1.2 jruoho * from this software without specific prior written permission.
133 1.1.1.2 jruoho *
134 1.1.1.2 jruoho * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 1.1.1.2 jruoho * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 1.1.1.18 christos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 1.1.1.2 jruoho * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 1.1.1.26 christos * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 1.1.1.26 christos * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 1.1.1.26 christos * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 1.1.1.26 christos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 1.1.1.26 christos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 1.1.1.26 christos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 1.1.1.26 christos * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145 1.1.1.26 christos *
146 1.1.1.26 christos * Alternatively, you may choose to be licensed under the terms of the
147 1.1.1.26 christos * GNU General Public License ("GPL") version 2 as published by the Free
148 1.1.1.26 christos * Software Foundation.
149 1.1.1.26 christos *
150 1.1.1.26 christos *****************************************************************************/
151 1.1 jruoho
152 1.1 jruoho #ifndef __ACTBL2_H__
153 1.1 jruoho #define __ACTBL2_H__
154 1.1 jruoho
155 1.1 jruoho
156 1.1 jruoho /*******************************************************************************
157 1.1 jruoho *
158 1.1 jruoho * Additional ACPI Tables (2)
159 1.1 jruoho *
160 1.1 jruoho * These tables are not consumed directly by the ACPICA subsystem, but are
161 1.1 jruoho * included here to support device drivers and the AML disassembler.
162 1.1 jruoho *
163 1.1 jruoho ******************************************************************************/
164 1.1 jruoho
165 1.1 jruoho
166 1.1 jruoho /*
167 1.1 jruoho * Values for description table header signatures for tables defined in this
168 1.1 jruoho * file. Useful because they make it more difficult to inadvertently type in
169 1.1 jruoho * the wrong signature.
170 1.1 jruoho */
171 1.1.1.21 christos #define ACPI_SIG_AGDI "AGDI" /* Arm Generic Diagnostic Dump and Reset Device Interface */
172 1.1.1.22 christos #define ACPI_SIG_APMT "APMT" /* Arm Performance Monitoring Unit table */
173 1.1.1.19 christos #define ACPI_SIG_BDAT "BDAT" /* BIOS Data ACPI Table */
174 1.1.1.23 christos #define ACPI_SIG_CCEL "CCEL" /* CC Event Log Table */
175 1.1.1.23 christos #define ACPI_SIG_CDAT "CDAT" /* Coherent Device Attribute Table */
176 1.1.1.27 christos #define ACPI_SIG_ERDT "ERDT" /* Enhanced Resource Director Technology */
177 1.1.1.7 christos #define ACPI_SIG_IORT "IORT" /* IO Remapping Table */
178 1.1 jruoho #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
179 1.1.1.5 christos #define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
180 1.1.1.14 christos #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
181 1.1 jruoho #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
182 1.1 jruoho #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
183 1.1.1.24 christos #define ACPI_SIG_MPAM "MPAM" /* Memory System Resource Partitioning and Monitoring Table */
184 1.1.1.14 christos #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
185 1.1.1.27 christos #define ACPI_SIG_MRRM "MRRM" /* Memory Range and Region Mapping table */
186 1.1.1.6 christos #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
187 1.1.1.14 christos #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
188 1.1.1.20 christos #define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */
189 1.1.1.14 christos #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
190 1.1.1.14 christos #define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */
191 1.1.1.18 christos #define ACPI_SIG_PHAT "PHAT" /* Platform Health Assessment Table */
192 1.1.1.14 christos #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
193 1.1.1.14 christos #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */
194 1.1.1.19 christos #define ACPI_SIG_PRMT "PRMT" /* Platform Runtime Mechanism Table */
195 1.1.1.14 christos #define ACPI_SIG_RASF "RASF" /* RAS Feature table */
196 1.1.1.25 christos #define ACPI_SIG_RAS2 "RAS2" /* RAS2 Feature table */
197 1.1.1.19 christos #define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */
198 1.1.1.24 christos #define ACPI_SIG_RHCT "RHCT" /* RISC-V Hart Capabilities Table */
199 1.1.1.27 christos #define ACPI_SIG_RIMT "RIMT" /* RISC-V IO Mapping Table */
200 1.1.1.14 christos #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
201 1.1.1.12 christos #define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */
202 1.1.1.14 christos #define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
203 1.1.1.19 christos #define ACPI_SIG_SVKL "SVKL" /* Storage Volume Key Location Table */
204 1.1.1.27 christos #define ACPI_SIG_SWFT "SWFT" /* SoundWire File Table */
205 1.1.1.21 christos #define ACPI_SIG_TDEL "TDEL" /* TD Event Log Table */
206 1.1 jruoho
207 1.1 jruoho
208 1.1 jruoho /*
209 1.1 jruoho * All tables must be byte-packed to match the ACPI specification, since
210 1.1 jruoho * the tables are provided by the system BIOS.
211 1.1 jruoho */
212 1.1 jruoho #pragma pack(1)
213 1.1 jruoho
214 1.1 jruoho /*
215 1.1.1.4 christos * Note: C bitfields are not used for this reason:
216 1.1.1.4 christos *
217 1.1.1.4 christos * "Bitfields are great and easy to read, but unfortunately the C language
218 1.1.1.4 christos * does not specify the layout of bitfields in memory, which means they are
219 1.1.1.4 christos * essentially useless for dealing with packed data in on-disk formats or
220 1.1.1.4 christos * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
221 1.1.1.4 christos * this decision was a design error in C. Ritchie could have picked an order
222 1.1.1.4 christos * and stuck with it." Norman Ramsey.
223 1.1.1.4 christos * See http://stackoverflow.com/a/1053662/41661
224 1.1 jruoho */
225 1.1 jruoho
226 1.1 jruoho
227 1.1 jruoho /*******************************************************************************
228 1.1 jruoho *
229 1.1.1.20 christos * AEST - Arm Error Source Table
230 1.1.1.20 christos *
231 1.1.1.20 christos * Conforms to: ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document
232 1.1.1.20 christos * September 2020.
233 1.1.1.20 christos *
234 1.1.1.20 christos ******************************************************************************/
235 1.1.1.20 christos
236 1.1.1.20 christos typedef struct acpi_table_aest
237 1.1.1.20 christos {
238 1.1.1.20 christos ACPI_TABLE_HEADER Header;
239 1.1.1.20 christos
240 1.1.1.20 christos } ACPI_TABLE_AEST;
241 1.1.1.20 christos
242 1.1.1.20 christos /* Common Subtable header - one per Node Structure (Subtable) */
243 1.1.1.20 christos
244 1.1.1.24 christos typedef struct acpi_aest_hdr
245 1.1.1.20 christos {
246 1.1.1.20 christos UINT8 Type;
247 1.1.1.20 christos UINT16 Length;
248 1.1.1.20 christos UINT8 Reserved;
249 1.1.1.20 christos UINT32 NodeSpecificOffset;
250 1.1.1.20 christos UINT32 NodeInterfaceOffset;
251 1.1.1.20 christos UINT32 NodeInterruptOffset;
252 1.1.1.20 christos UINT32 NodeInterruptCount;
253 1.1.1.20 christos UINT64 TimestampRate;
254 1.1.1.20 christos UINT64 Reserved1;
255 1.1.1.20 christos UINT64 ErrorInjectionRate;
256 1.1.1.20 christos
257 1.1.1.20 christos } ACPI_AEST_HEADER;
258 1.1.1.20 christos
259 1.1.1.20 christos /* Values for Type above */
260 1.1.1.20 christos
261 1.1.1.20 christos #define ACPI_AEST_PROCESSOR_ERROR_NODE 0
262 1.1.1.20 christos #define ACPI_AEST_MEMORY_ERROR_NODE 1
263 1.1.1.20 christos #define ACPI_AEST_SMMU_ERROR_NODE 2
264 1.1.1.20 christos #define ACPI_AEST_VENDOR_ERROR_NODE 3
265 1.1.1.20 christos #define ACPI_AEST_GIC_ERROR_NODE 4
266 1.1.1.25 christos #define ACPI_AEST_PCIE_ERROR_NODE 5
267 1.1.1.25 christos #define ACPI_AEST_PROXY_ERROR_NODE 6
268 1.1.1.25 christos #define ACPI_AEST_NODE_TYPE_RESERVED 7 /* 7 and above are reserved */
269 1.1.1.20 christos
270 1.1.1.20 christos
271 1.1.1.20 christos /*
272 1.1.1.20 christos * AEST subtables (Error nodes)
273 1.1.1.20 christos */
274 1.1.1.20 christos
275 1.1.1.20 christos /* 0: Processor Error */
276 1.1.1.20 christos
277 1.1.1.24 christos typedef struct acpi_aest_processor
278 1.1.1.20 christos {
279 1.1.1.20 christos UINT32 ProcessorId;
280 1.1.1.20 christos UINT8 ResourceType;
281 1.1.1.20 christos UINT8 Reserved;
282 1.1.1.20 christos UINT8 Flags;
283 1.1.1.20 christos UINT8 Revision;
284 1.1.1.20 christos UINT64 ProcessorAffinity;
285 1.1.1.20 christos
286 1.1.1.20 christos } ACPI_AEST_PROCESSOR;
287 1.1.1.20 christos
288 1.1.1.20 christos /* Values for ResourceType above, related structs below */
289 1.1.1.20 christos
290 1.1.1.20 christos #define ACPI_AEST_CACHE_RESOURCE 0
291 1.1.1.20 christos #define ACPI_AEST_TLB_RESOURCE 1
292 1.1.1.20 christos #define ACPI_AEST_GENERIC_RESOURCE 2
293 1.1.1.20 christos #define ACPI_AEST_RESOURCE_RESERVED 3 /* 3 and above are reserved */
294 1.1.1.20 christos
295 1.1.1.20 christos /* 0R: Processor Cache Resource Substructure */
296 1.1.1.20 christos
297 1.1.1.24 christos typedef struct acpi_aest_processor_cache
298 1.1.1.20 christos {
299 1.1.1.20 christos UINT32 CacheReference;
300 1.1.1.20 christos UINT32 Reserved;
301 1.1.1.20 christos
302 1.1.1.20 christos } ACPI_AEST_PROCESSOR_CACHE;
303 1.1.1.20 christos
304 1.1.1.20 christos /* Values for CacheType above */
305 1.1.1.20 christos
306 1.1.1.20 christos #define ACPI_AEST_CACHE_DATA 0
307 1.1.1.20 christos #define ACPI_AEST_CACHE_INSTRUCTION 1
308 1.1.1.20 christos #define ACPI_AEST_CACHE_UNIFIED 2
309 1.1.1.20 christos #define ACPI_AEST_CACHE_RESERVED 3 /* 3 and above are reserved */
310 1.1.1.20 christos
311 1.1.1.20 christos /* 1R: Processor TLB Resource Substructure */
312 1.1.1.20 christos
313 1.1.1.24 christos typedef struct acpi_aest_processor_tlb
314 1.1.1.20 christos {
315 1.1.1.20 christos UINT32 TlbLevel;
316 1.1.1.20 christos UINT32 Reserved;
317 1.1.1.20 christos
318 1.1.1.20 christos } ACPI_AEST_PROCESSOR_TLB;
319 1.1.1.20 christos
320 1.1.1.20 christos /* 2R: Processor Generic Resource Substructure */
321 1.1.1.20 christos
322 1.1.1.24 christos typedef struct acpi_aest_processor_generic
323 1.1.1.20 christos {
324 1.1.1.21 christos UINT32 Resource;
325 1.1.1.20 christos
326 1.1.1.20 christos } ACPI_AEST_PROCESSOR_GENERIC;
327 1.1.1.20 christos
328 1.1.1.20 christos /* 1: Memory Error */
329 1.1.1.20 christos
330 1.1.1.24 christos typedef struct acpi_aest_memory
331 1.1.1.20 christos {
332 1.1.1.20 christos UINT32 SratProximityDomain;
333 1.1.1.20 christos
334 1.1.1.20 christos } ACPI_AEST_MEMORY;
335 1.1.1.20 christos
336 1.1.1.20 christos /* 2: Smmu Error */
337 1.1.1.20 christos
338 1.1.1.24 christos typedef struct acpi_aest_smmu
339 1.1.1.20 christos {
340 1.1.1.20 christos UINT32 IortNodeReference;
341 1.1.1.20 christos UINT32 SubcomponentReference;
342 1.1.1.20 christos
343 1.1.1.20 christos } ACPI_AEST_SMMU;
344 1.1.1.20 christos
345 1.1.1.20 christos /* 3: Vendor Defined */
346 1.1.1.20 christos
347 1.1.1.24 christos typedef struct acpi_aest_vendor
348 1.1.1.20 christos {
349 1.1.1.20 christos UINT32 AcpiHid;
350 1.1.1.20 christos UINT32 AcpiUid;
351 1.1.1.20 christos UINT8 VendorSpecificData[16];
352 1.1.1.20 christos
353 1.1.1.20 christos } ACPI_AEST_VENDOR;
354 1.1.1.20 christos
355 1.1.1.25 christos /* 3: Vendor Defined V2 */
356 1.1.1.25 christos
357 1.1.1.25 christos typedef struct acpi_aest_vendor_v2
358 1.1.1.25 christos {
359 1.1.1.25 christos UINT64 AcpiHid;
360 1.1.1.25 christos UINT32 AcpiUid;
361 1.1.1.25 christos UINT8 VendorSpecificData[16];
362 1.1.1.25 christos
363 1.1.1.25 christos } ACPI_AEST_VENDOR_V2;
364 1.1.1.25 christos
365 1.1.1.20 christos /* 4: Gic Error */
366 1.1.1.20 christos
367 1.1.1.24 christos typedef struct acpi_aest_gic
368 1.1.1.20 christos {
369 1.1.1.20 christos UINT32 InterfaceType;
370 1.1.1.20 christos UINT32 InstanceId;
371 1.1.1.20 christos
372 1.1.1.20 christos } ACPI_AEST_GIC;
373 1.1.1.20 christos
374 1.1.1.20 christos /* Values for InterfaceType above */
375 1.1.1.20 christos
376 1.1.1.20 christos #define ACPI_AEST_GIC_CPU 0
377 1.1.1.20 christos #define ACPI_AEST_GIC_DISTRIBUTOR 1
378 1.1.1.20 christos #define ACPI_AEST_GIC_REDISTRIBUTOR 2
379 1.1.1.20 christos #define ACPI_AEST_GIC_ITS 3
380 1.1.1.20 christos #define ACPI_AEST_GIC_RESERVED 4 /* 4 and above are reserved */
381 1.1.1.20 christos
382 1.1.1.25 christos /* 5: PCIe Error */
383 1.1.1.25 christos
384 1.1.1.25 christos typedef struct acpi_aest_pcie
385 1.1.1.25 christos {
386 1.1.1.25 christos UINT32 IortNodeReference;
387 1.1.1.25 christos
388 1.1.1.25 christos } ACPI_AEST_PCIE;
389 1.1.1.25 christos
390 1.1.1.25 christos
391 1.1.1.25 christos /* 6: Proxy Error */
392 1.1.1.25 christos
393 1.1.1.25 christos typedef struct acpi_aest_proxy
394 1.1.1.25 christos {
395 1.1.1.25 christos UINT64 NodeAddress;
396 1.1.1.25 christos
397 1.1.1.25 christos } ACPI_AEST_PROXY;
398 1.1.1.20 christos
399 1.1.1.20 christos /* Node Interface Structure */
400 1.1.1.20 christos
401 1.1.1.24 christos typedef struct acpi_aest_node_interface
402 1.1.1.20 christos {
403 1.1.1.20 christos UINT8 Type;
404 1.1.1.20 christos UINT8 Reserved[3];
405 1.1.1.20 christos UINT32 Flags;
406 1.1.1.20 christos UINT64 Address;
407 1.1.1.20 christos UINT32 ErrorRecordIndex;
408 1.1.1.20 christos UINT32 ErrorRecordCount;
409 1.1.1.20 christos UINT64 ErrorRecordImplemented;
410 1.1.1.20 christos UINT64 ErrorStatusReporting;
411 1.1.1.20 christos UINT64 AddressingMode;
412 1.1.1.20 christos
413 1.1.1.20 christos } ACPI_AEST_NODE_INTERFACE;
414 1.1.1.20 christos
415 1.1.1.25 christos /* Node Interface Structure V2*/
416 1.1.1.25 christos
417 1.1.1.25 christos typedef struct acpi_aest_node_interface_header
418 1.1.1.25 christos {
419 1.1.1.25 christos UINT8 Type;
420 1.1.1.25 christos UINT8 GroupFormat;
421 1.1.1.25 christos UINT8 Reserved[2];
422 1.1.1.25 christos UINT32 Flags;
423 1.1.1.25 christos UINT64 Address;
424 1.1.1.25 christos UINT32 ErrorRecordIndex;
425 1.1.1.25 christos UINT32 ErrorRecordCount;
426 1.1.1.25 christos
427 1.1.1.25 christos } ACPI_AEST_NODE_INTERFACE_HEADER;
428 1.1.1.25 christos
429 1.1.1.25 christos #define ACPI_AEST_NODE_GROUP_FORMAT_4K 0
430 1.1.1.25 christos #define ACPI_AEST_NODE_GROUP_FORMAT_16K 1
431 1.1.1.25 christos #define ACPI_AEST_NODE_GROUP_FORMAT_64K 2
432 1.1.1.25 christos
433 1.1.1.25 christos typedef struct acpi_aest_node_interface_common
434 1.1.1.25 christos {
435 1.1.1.25 christos UINT32 ErrorNodeDevice;
436 1.1.1.25 christos UINT32 ProcessorAffinity;
437 1.1.1.25 christos UINT64 ErrorGroupRegisterBase;
438 1.1.1.25 christos UINT64 FaultInjectRegisterBase;
439 1.1.1.25 christos UINT64 InterruptConfigRegisterBase;
440 1.1.1.25 christos
441 1.1.1.25 christos } ACPI_AEST_NODE_INTERFACE_COMMON;
442 1.1.1.25 christos
443 1.1.1.25 christos typedef struct acpi_aest_node_interface_4k
444 1.1.1.25 christos {
445 1.1.1.25 christos UINT64 ErrorRecordImplemented;
446 1.1.1.25 christos UINT64 ErrorStatusReporting;
447 1.1.1.25 christos UINT64 AddressingMode;
448 1.1.1.25 christos ACPI_AEST_NODE_INTERFACE_COMMON Common;
449 1.1.1.25 christos
450 1.1.1.25 christos } ACPI_AEST_NODE_INTERFACE_4K;
451 1.1.1.25 christos
452 1.1.1.25 christos typedef struct acpi_aest_node_interface_16k
453 1.1.1.25 christos {
454 1.1.1.25 christos UINT64 ErrorRecordImplemented[4];
455 1.1.1.25 christos UINT64 ErrorStatusReporting[4];
456 1.1.1.25 christos UINT64 AddressingMode[4];
457 1.1.1.25 christos ACPI_AEST_NODE_INTERFACE_COMMON Common;
458 1.1.1.25 christos
459 1.1.1.25 christos } ACPI_AEST_NODE_INTERFACE_16K;
460 1.1.1.25 christos
461 1.1.1.25 christos typedef struct acpi_aest_node_interface_64k
462 1.1.1.25 christos {
463 1.1.1.25 christos INT64 ErrorRecordImplemented[14];
464 1.1.1.25 christos UINT64 ErrorStatusReporting[14];
465 1.1.1.25 christos UINT64 AddressingMode[14];
466 1.1.1.25 christos ACPI_AEST_NODE_INTERFACE_COMMON Common;
467 1.1.1.25 christos
468 1.1.1.25 christos } ACPI_AEST_NODE_INTERFACE_64K;
469 1.1.1.25 christos
470 1.1.1.20 christos /* Values for Type field above */
471 1.1.1.20 christos
472 1.1.1.25 christos #define ACPI_AEST_NODE_SYSTEM_REGISTER 0
473 1.1.1.25 christos #define ACPI_AEST_NODE_MEMORY_MAPPED 1
474 1.1.1.25 christos #define ACPI_AEST_NODE_SINGLE_RECORD_MEMORY_MAPPED 2
475 1.1.1.25 christos #define ACPI_AEST_XFACE_RESERVED 3 /* 2 and above are reserved */
476 1.1.1.20 christos
477 1.1.1.20 christos /* Node Interrupt Structure */
478 1.1.1.20 christos
479 1.1.1.24 christos typedef struct acpi_aest_node_interrupt
480 1.1.1.20 christos {
481 1.1.1.20 christos UINT8 Type;
482 1.1.1.20 christos UINT8 Reserved[2];
483 1.1.1.20 christos UINT8 Flags;
484 1.1.1.20 christos UINT32 Gsiv;
485 1.1.1.20 christos UINT8 IortId;
486 1.1.1.20 christos UINT8 Reserved1[3];
487 1.1.1.20 christos
488 1.1.1.20 christos } ACPI_AEST_NODE_INTERRUPT;
489 1.1.1.20 christos
490 1.1.1.25 christos /* Node Interrupt Structure V2 */
491 1.1.1.25 christos
492 1.1.1.25 christos typedef struct acpi_aest_node_interrupt_v2
493 1.1.1.25 christos {
494 1.1.1.25 christos UINT8 Type;
495 1.1.1.25 christos UINT8 Reserved[2];
496 1.1.1.25 christos UINT8 Flags;
497 1.1.1.25 christos UINT32 Gsiv;
498 1.1.1.25 christos UINT8 Reserved1[4];
499 1.1.1.25 christos
500 1.1.1.25 christos } ACPI_AEST_NODE_INTERRUPT_V2;
501 1.1.1.25 christos
502 1.1.1.20 christos /* Values for Type field above */
503 1.1.1.20 christos
504 1.1.1.20 christos #define ACPI_AEST_NODE_FAULT_HANDLING 0
505 1.1.1.20 christos #define ACPI_AEST_NODE_ERROR_RECOVERY 1
506 1.1.1.20 christos #define ACPI_AEST_XRUPT_RESERVED 2 /* 2 and above are reserved */
507 1.1.1.20 christos
508 1.1.1.20 christos
509 1.1.1.20 christos /*******************************************************************************
510 1.1.1.21 christos * AGDI - Arm Generic Diagnostic Dump and Reset Device Interface
511 1.1.1.21 christos *
512 1.1.1.21 christos * Conforms to "ACPI for Arm Components 1.1, Platform Design Document"
513 1.1.1.21 christos * ARM DEN0093 v1.1
514 1.1.1.21 christos *
515 1.1.1.21 christos ******************************************************************************/
516 1.1.1.21 christos typedef struct acpi_table_agdi
517 1.1.1.21 christos {
518 1.1.1.21 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
519 1.1.1.21 christos UINT8 Flags;
520 1.1.1.21 christos UINT8 Reserved[3];
521 1.1.1.21 christos UINT32 SdeiEvent;
522 1.1.1.21 christos UINT32 Gsiv;
523 1.1.1.21 christos
524 1.1.1.21 christos } ACPI_TABLE_AGDI;
525 1.1.1.21 christos
526 1.1.1.21 christos /* Mask for Flags field above */
527 1.1.1.21 christos
528 1.1.1.21 christos #define ACPI_AGDI_SIGNALING_MODE (1)
529 1.1.1.21 christos
530 1.1.1.21 christos
531 1.1.1.21 christos /*******************************************************************************
532 1.1.1.20 christos *
533 1.1.1.22 christos * APMT - ARM Performance Monitoring Unit Table
534 1.1.1.22 christos *
535 1.1.1.22 christos * Conforms to:
536 1.1.1.22 christos * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document
537 1.1.1.22 christos * ARM DEN0117 v1.0 November 25, 2021
538 1.1.1.22 christos *
539 1.1.1.22 christos ******************************************************************************/
540 1.1.1.22 christos
541 1.1.1.22 christos typedef struct acpi_table_apmt {
542 1.1.1.22 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
543 1.1.1.22 christos } ACPI_TABLE_APMT;
544 1.1.1.22 christos
545 1.1.1.22 christos #define ACPI_APMT_NODE_ID_LENGTH 4
546 1.1.1.22 christos
547 1.1.1.22 christos /*
548 1.1.1.22 christos * APMT subtables
549 1.1.1.22 christos */
550 1.1.1.22 christos typedef struct acpi_apmt_node {
551 1.1.1.22 christos UINT16 Length;
552 1.1.1.22 christos UINT8 Flags;
553 1.1.1.22 christos UINT8 Type;
554 1.1.1.22 christos UINT32 Id;
555 1.1.1.22 christos UINT64 InstPrimary;
556 1.1.1.22 christos UINT32 InstSecondary;
557 1.1.1.22 christos UINT64 BaseAddress0;
558 1.1.1.22 christos UINT64 BaseAddress1;
559 1.1.1.22 christos UINT32 OvflwIrq;
560 1.1.1.22 christos UINT32 Reserved;
561 1.1.1.22 christos UINT32 OvflwIrqFlags;
562 1.1.1.22 christos UINT32 ProcAffinity;
563 1.1.1.22 christos UINT32 ImplId;
564 1.1.1.22 christos } ACPI_APMT_NODE;
565 1.1.1.22 christos
566 1.1.1.22 christos /* Masks for Flags field above */
567 1.1.1.22 christos
568 1.1.1.22 christos #define ACPI_APMT_FLAGS_DUAL_PAGE (1<<0)
569 1.1.1.22 christos #define ACPI_APMT_FLAGS_AFFINITY (1<<1)
570 1.1.1.22 christos #define ACPI_APMT_FLAGS_ATOMIC (1<<2)
571 1.1.1.22 christos
572 1.1.1.22 christos /* Values for Flags dual page field above */
573 1.1.1.22 christos
574 1.1.1.22 christos #define ACPI_APMT_FLAGS_DUAL_PAGE_NSUPP (0<<0)
575 1.1.1.22 christos #define ACPI_APMT_FLAGS_DUAL_PAGE_SUPP (1<<0)
576 1.1.1.22 christos
577 1.1.1.22 christos /* Values for Flags processor affinity field above */
578 1.1.1.22 christos #define ACPI_APMT_FLAGS_AFFINITY_PROC (0<<1)
579 1.1.1.22 christos #define ACPI_APMT_FLAGS_AFFINITY_PROC_CONTAINER (1<<1)
580 1.1.1.22 christos
581 1.1.1.22 christos /* Values for Flags 64-bit atomic field above */
582 1.1.1.22 christos #define ACPI_APMT_FLAGS_ATOMIC_NSUPP (0<<2)
583 1.1.1.22 christos #define ACPI_APMT_FLAGS_ATOMIC_SUPP (1<<2)
584 1.1.1.22 christos
585 1.1.1.22 christos /* Values for Type field above */
586 1.1.1.22 christos
587 1.1.1.22 christos enum acpi_apmt_node_type {
588 1.1.1.22 christos ACPI_APMT_NODE_TYPE_MC = 0x00,
589 1.1.1.22 christos ACPI_APMT_NODE_TYPE_SMMU = 0x01,
590 1.1.1.22 christos ACPI_APMT_NODE_TYPE_PCIE_ROOT = 0x02,
591 1.1.1.22 christos ACPI_APMT_NODE_TYPE_ACPI = 0x03,
592 1.1.1.22 christos ACPI_APMT_NODE_TYPE_CACHE = 0x04,
593 1.1.1.22 christos ACPI_APMT_NODE_TYPE_COUNT
594 1.1.1.22 christos };
595 1.1.1.22 christos
596 1.1.1.22 christos /* Masks for ovflw_irq_flags field above */
597 1.1.1.22 christos
598 1.1.1.22 christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE (1<<0)
599 1.1.1.22 christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE (1<<1)
600 1.1.1.22 christos
601 1.1.1.22 christos /* Values for ovflw_irq_flags mode field above */
602 1.1.1.22 christos
603 1.1.1.22 christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_LEVEL (0<<0)
604 1.1.1.22 christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_EDGE (1<<0)
605 1.1.1.22 christos
606 1.1.1.22 christos /* Values for ovflw_irq_flags type field above */
607 1.1.1.22 christos
608 1.1.1.22 christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE_WIRED (0<<1)
609 1.1.1.22 christos
610 1.1.1.22 christos
611 1.1.1.22 christos /*******************************************************************************
612 1.1.1.22 christos *
613 1.1.1.19 christos * BDAT - BIOS Data ACPI Table
614 1.1.1.19 christos *
615 1.1.1.19 christos * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5
616 1.1.1.19 christos * Nov 2020
617 1.1.1.19 christos *
618 1.1.1.19 christos ******************************************************************************/
619 1.1.1.19 christos
620 1.1.1.19 christos typedef struct acpi_table_bdat
621 1.1.1.19 christos {
622 1.1.1.19 christos ACPI_TABLE_HEADER Header;
623 1.1.1.19 christos ACPI_GENERIC_ADDRESS Gas;
624 1.1.1.19 christos
625 1.1.1.19 christos } ACPI_TABLE_BDAT;
626 1.1.1.19 christos
627 1.1.1.23 christos /*******************************************************************************
628 1.1.1.23 christos *
629 1.1.1.23 christos * CCEL - CC-Event Log
630 1.1.1.23 christos * From: "Guest-Host-Communication Interface (GHCI) for Intel
631 1.1.1.23 christos * Trust Domain Extensions (Intel TDX)". Feb 2022
632 1.1.1.23 christos *
633 1.1.1.23 christos ******************************************************************************/
634 1.1.1.23 christos
635 1.1.1.23 christos typedef struct acpi_table_ccel
636 1.1.1.23 christos {
637 1.1.1.23 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
638 1.1.1.23 christos UINT8 CCType;
639 1.1.1.23 christos UINT8 CCSubType;
640 1.1.1.23 christos UINT16 Reserved;
641 1.1.1.23 christos UINT64 LogAreaMinimumLength;
642 1.1.1.23 christos UINT64 LogAreaStartAddress;
643 1.1.1.23 christos
644 1.1.1.23 christos } ACPI_TABLE_CCEL;
645 1.1.1.19 christos
646 1.1.1.19 christos /*******************************************************************************
647 1.1.1.19 christos *
648 1.1.1.27 christos * ERDT - Enhanced Resource Director Technology (ERDT) table
649 1.1.1.27 christos *
650 1.1.1.27 christos * Conforms to "Intel Resource Director Technology Architecture Specification"
651 1.1.1.27 christos * Version 1.1, January 2025
652 1.1.1.27 christos *
653 1.1.1.27 christos ******************************************************************************/
654 1.1.1.27 christos
655 1.1.1.27 christos typedef struct acpi_table_erdt
656 1.1.1.27 christos {
657 1.1.1.27 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
658 1.1.1.27 christos UINT32 MaxClos; /* Maximum classes of service */
659 1.1.1.27 christos UINT8 Reserved[24];
660 1.1.1.27 christos UINT8 Erdt_Substructures[];
661 1.1.1.27 christos
662 1.1.1.27 christos } ACPI_TABLE_ERDT;
663 1.1.1.27 christos
664 1.1.1.27 christos
665 1.1.1.27 christos /* Values for subtable type in ACPI_SUBTBL_HDR_16 */
666 1.1.1.27 christos
667 1.1.1.27 christos enum AcpiErdtType
668 1.1.1.27 christos {
669 1.1.1.27 christos ACPI_ERDT_TYPE_RMDD = 0,
670 1.1.1.27 christos ACPI_ERDT_TYPE_CACD = 1,
671 1.1.1.27 christos ACPI_ERDT_TYPE_DACD = 2,
672 1.1.1.27 christos ACPI_ERDT_TYPE_CMRC = 3,
673 1.1.1.27 christos ACPI_ERDT_TYPE_MMRC = 4,
674 1.1.1.27 christos ACPI_ERDT_TYPE_MARC = 5,
675 1.1.1.27 christos ACPI_ERDT_TYPE_CARC = 6,
676 1.1.1.27 christos ACPI_ERDT_TYPE_CMRD = 7,
677 1.1.1.27 christos ACPI_ERDT_TYPE_IBRD = 8,
678 1.1.1.27 christos ACPI_ERDT_TYPE_IBAD = 9,
679 1.1.1.27 christos ACPI_ERDT_TYPE_CARD = 10,
680 1.1.1.27 christos ACPI_ERDT_TYPE_RESERVED = 11 /* 11 and above are reserved */
681 1.1.1.27 christos
682 1.1.1.27 christos };
683 1.1.1.27 christos
684 1.1.1.27 christos /*
685 1.1.1.27 christos * ERDT Subtables, correspond to Type in ACPI_SUBTBL_HDR_16
686 1.1.1.27 christos */
687 1.1.1.27 christos
688 1.1.1.27 christos /* 0: RMDD - Resource Management Domain Description */
689 1.1.1.27 christos
690 1.1.1.27 christos typedef struct acpi_erdt_rmdd
691 1.1.1.27 christos {
692 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
693 1.1.1.27 christos UINT16 Flags;
694 1.1.1.27 christos UINT16 IO_l3_Slices; /* Number of slices in IO cache */
695 1.1.1.27 christos UINT8 IO_l3_Sets; /* Number of sets in IO cache */
696 1.1.1.27 christos UINT8 IO_l3_Ways; /* Number of ways in IO cache */
697 1.1.1.27 christos UINT64 Reserved;
698 1.1.1.27 christos UINT16 DomainId; /* Unique domain ID */
699 1.1.1.27 christos UINT32 MaxRmid; /* Maximun RMID supported */
700 1.1.1.27 christos UINT64 CregBase; /* Control Register Base Address */
701 1.1.1.27 christos UINT16 CregSize; /* Control Register Size (4K pages) */
702 1.1.1.27 christos UINT8 RmddStructs[];
703 1.1.1.27 christos
704 1.1.1.27 christos } ACPI_ERDT_RMDD;
705 1.1.1.27 christos
706 1.1.1.27 christos
707 1.1.1.27 christos /* 1: CACD - CPU Agent Collection Description */
708 1.1.1.27 christos
709 1.1.1.27 christos typedef struct acpi_erdt_cacd
710 1.1.1.27 christos {
711 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
712 1.1.1.27 christos UINT16 Reserved;
713 1.1.1.27 christos UINT16 DomainId; /* Unique domain ID */
714 1.1.1.27 christos UINT32 X2APICIDS[];
715 1.1.1.27 christos
716 1.1.1.27 christos } ACPI_ERDT_CACD;
717 1.1.1.27 christos
718 1.1.1.27 christos
719 1.1.1.27 christos /* 2: DACD - Device Agent Collection Description */
720 1.1.1.27 christos
721 1.1.1.27 christos typedef struct acpi_erdt_dacd
722 1.1.1.27 christos {
723 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
724 1.1.1.27 christos UINT16 Reserved;
725 1.1.1.27 christos UINT16 DomainId; /* Unique domain ID */
726 1.1.1.27 christos UINT8 DevPaths[];
727 1.1.1.27 christos
728 1.1.1.27 christos } ACPI_ERDT_DACD;
729 1.1.1.27 christos
730 1.1.1.27 christos typedef struct acpi_erdt_dacd_dev_paths
731 1.1.1.27 christos {
732 1.1.1.27 christos ACPI_SUBTABLE_HEADER Header;
733 1.1.1.27 christos UINT16 Segment;
734 1.1.1.27 christos UINT8 Reserved;
735 1.1.1.27 christos UINT8 StartBus;
736 1.1.1.27 christos UINT8 Path[];
737 1.1.1.27 christos
738 1.1.1.27 christos } ACPI_ERDT_DACD_PATHS;
739 1.1.1.27 christos
740 1.1.1.27 christos
741 1.1.1.27 christos /* 3: CMRC - Cache Monitoring Registers for CPU Agents */
742 1.1.1.27 christos
743 1.1.1.27 christos typedef struct acpi_erdt_cmrc
744 1.1.1.27 christos {
745 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
746 1.1.1.27 christos UINT32 Reserved1;
747 1.1.1.27 christos UINT32 Flags;
748 1.1.1.27 christos UINT8 IndexFn;
749 1.1.1.27 christos UINT8 Reserved2[11];
750 1.1.1.27 christos UINT64 CmtRegBase;
751 1.1.1.27 christos UINT32 CmtRegSize;
752 1.1.1.27 christos UINT16 ClumpSize;
753 1.1.1.27 christos UINT16 ClumpStride;
754 1.1.1.27 christos UINT64 UpScale;
755 1.1.1.27 christos
756 1.1.1.27 christos } ACPI_ERDT_CMRC;
757 1.1.1.27 christos
758 1.1.1.27 christos
759 1.1.1.27 christos /* 4: MMRC - Memory-bandwidth Monitoring Registers for CPU Agents */
760 1.1.1.27 christos
761 1.1.1.27 christos typedef struct acpi_erdt_mmrc
762 1.1.1.27 christos {
763 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
764 1.1.1.27 christos UINT32 Reserved1;
765 1.1.1.27 christos UINT32 Flags;
766 1.1.1.27 christos UINT8 IndexFn;
767 1.1.1.27 christos UINT8 Reserved2[11];
768 1.1.1.27 christos UINT64 RegBase;
769 1.1.1.27 christos UINT32 RegSize;
770 1.1.1.27 christos UINT8 CounterWidth;
771 1.1.1.27 christos UINT64 UpScale;
772 1.1.1.27 christos UINT8 Reserved3[7];
773 1.1.1.27 christos UINT32 CorrFactorListLen;
774 1.1.1.27 christos UINT32 CorrFactorList[];
775 1.1.1.27 christos
776 1.1.1.27 christos } ACPI_ERDT_MMRC;
777 1.1.1.27 christos
778 1.1.1.27 christos
779 1.1.1.27 christos /* 5: MARC - Memory-bandwidth Allocation Registers for CPU Agents */
780 1.1.1.27 christos
781 1.1.1.27 christos typedef struct acpi_erdt_marc
782 1.1.1.27 christos {
783 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
784 1.1.1.27 christos UINT16 Reserved1;
785 1.1.1.27 christos UINT16 Flags;
786 1.1.1.27 christos UINT8 IndexFn;
787 1.1.1.27 christos UINT8 Reserved2[7];
788 1.1.1.27 christos UINT64 RegBaseOpt;
789 1.1.1.27 christos UINT64 RegBaseMin;
790 1.1.1.27 christos UINT64 RegBaseMax;
791 1.1.1.27 christos UINT32 MbaRegSize;
792 1.1.1.27 christos UINT32 MbaCtrlRange;
793 1.1.1.27 christos
794 1.1.1.27 christos } ACPI_ERDT_MARC;
795 1.1.1.27 christos
796 1.1.1.27 christos
797 1.1.1.27 christos /* 6: CARC - Cache Allocation Registers for CPU Agents */
798 1.1.1.27 christos
799 1.1.1.27 christos typedef struct acpi_erdt_carc
800 1.1.1.27 christos {
801 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
802 1.1.1.27 christos
803 1.1.1.27 christos } ACPI_ERDT_CARC;
804 1.1.1.27 christos
805 1.1.1.27 christos
806 1.1.1.27 christos /* 7: CMRD - Cache Monitoring Registers for Device Agents */
807 1.1.1.27 christos
808 1.1.1.27 christos typedef struct acpi_erdt_cmrd
809 1.1.1.27 christos {
810 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
811 1.1.1.27 christos UINT32 Reserved1;
812 1.1.1.27 christos UINT32 Flags;
813 1.1.1.27 christos UINT8 IndexFn;
814 1.1.1.27 christos UINT8 Reserved2[11];
815 1.1.1.27 christos UINT64 RegBase;
816 1.1.1.27 christos UINT32 RegSize;
817 1.1.1.27 christos UINT16 CmtRegOff;
818 1.1.1.27 christos UINT16 CmtClumpSize;
819 1.1.1.27 christos UINT64 UpScale;
820 1.1.1.27 christos
821 1.1.1.27 christos } ACPI_ERDT_CMRD;
822 1.1.1.27 christos
823 1.1.1.27 christos
824 1.1.1.27 christos /* 8: IBRD - Cache Monitoring Registers for Device Agents */
825 1.1.1.27 christos
826 1.1.1.27 christos typedef struct acpi_erdt_ibrd
827 1.1.1.27 christos {
828 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
829 1.1.1.27 christos UINT32 Reserved1;
830 1.1.1.27 christos UINT32 Flags;
831 1.1.1.27 christos UINT8 IndexFn;
832 1.1.1.27 christos UINT8 Reserved2[11];
833 1.1.1.27 christos UINT64 RegBase;
834 1.1.1.27 christos UINT32 RegSize;
835 1.1.1.27 christos UINT16 TotalBwOffset;
836 1.1.1.27 christos UINT16 IOMissBwOffset;
837 1.1.1.27 christos UINT16 TotalBwClump;
838 1.1.1.27 christos UINT16 IOMissBwClump;
839 1.1.1.27 christos UINT8 Reserved3[7];
840 1.1.1.27 christos UINT8 CounterWidth;
841 1.1.1.27 christos UINT64 UpScale;
842 1.1.1.27 christos UINT32 CorrFactorListLen;
843 1.1.1.27 christos UINT32 CorrFactorList[];
844 1.1.1.27 christos
845 1.1.1.27 christos } ACPI_ERDT_IBRD;
846 1.1.1.27 christos
847 1.1.1.27 christos
848 1.1.1.27 christos /* 9: IBAD - IO bandwidth Allocation Registers for device agents */
849 1.1.1.27 christos
850 1.1.1.27 christos typedef struct acpi_erdt_ibad
851 1.1.1.27 christos {
852 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
853 1.1.1.27 christos
854 1.1.1.27 christos } ACPI_ERDT_IBAD;
855 1.1.1.27 christos
856 1.1.1.27 christos
857 1.1.1.27 christos /* 10: CARD - IO bandwidth Allocation Registers for Device Agents */
858 1.1.1.27 christos
859 1.1.1.27 christos typedef struct acpi_erdt_card
860 1.1.1.27 christos {
861 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
862 1.1.1.27 christos UINT32 Reserved1;
863 1.1.1.27 christos UINT32 Flags;
864 1.1.1.27 christos UINT32 ContentionMask;
865 1.1.1.27 christos UINT8 IndexFn;
866 1.1.1.27 christos UINT8 Reserved2[7];
867 1.1.1.27 christos UINT64 RegBase;
868 1.1.1.27 christos UINT32 RegSize;
869 1.1.1.27 christos UINT16 CatRegOffset;
870 1.1.1.27 christos UINT16 CatRegBlockSize;
871 1.1.1.27 christos
872 1.1.1.27 christos } ACPI_ERDT_CARD;
873 1.1.1.27 christos
874 1.1.1.27 christos
875 1.1.1.27 christos /*******************************************************************************
876 1.1.1.27 christos *
877 1.1.1.14 christos * IORT - IO Remapping Table
878 1.1 jruoho *
879 1.1.1.14 christos * Conforms to "IO Remapping Table System Software on ARM Platforms",
880 1.1.1.25 christos * Document number: ARM DEN 0049E.f, Apr 2024
881 1.1 jruoho *
882 1.1 jruoho ******************************************************************************/
883 1.1 jruoho
884 1.1.1.14 christos typedef struct acpi_table_iort
885 1.1 jruoho {
886 1.1.1.14 christos ACPI_TABLE_HEADER Header;
887 1.1.1.14 christos UINT32 NodeCount;
888 1.1.1.14 christos UINT32 NodeOffset;
889 1.1.1.14 christos UINT32 Reserved;
890 1.1 jruoho
891 1.1.1.14 christos } ACPI_TABLE_IORT;
892 1.1 jruoho
893 1.1 jruoho
894 1.1.1.14 christos /*
895 1.1.1.14 christos * IORT subtables
896 1.1.1.14 christos */
897 1.1.1.14 christos typedef struct acpi_iort_node
898 1.1 jruoho {
899 1.1 jruoho UINT8 Type;
900 1.1 jruoho UINT16 Length;
901 1.1.1.14 christos UINT8 Revision;
902 1.1.1.18 christos UINT32 Identifier;
903 1.1.1.14 christos UINT32 MappingCount;
904 1.1.1.14 christos UINT32 MappingOffset;
905 1.1.1.24 christos char NodeData[];
906 1.1 jruoho
907 1.1.1.14 christos } ACPI_IORT_NODE;
908 1.1 jruoho
909 1.1.1.14 christos /* Values for subtable Type above */
910 1.1 jruoho
911 1.1.1.14 christos enum AcpiIortNodeType
912 1.1 jruoho {
913 1.1.1.14 christos ACPI_IORT_NODE_ITS_GROUP = 0x00,
914 1.1.1.14 christos ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
915 1.1.1.14 christos ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
916 1.1.1.14 christos ACPI_IORT_NODE_SMMU = 0x03,
917 1.1.1.15 christos ACPI_IORT_NODE_SMMU_V3 = 0x04,
918 1.1.1.18 christos ACPI_IORT_NODE_PMCG = 0x05,
919 1.1.1.18 christos ACPI_IORT_NODE_RMR = 0x06,
920 1.1 jruoho };
921 1.1 jruoho
922 1.1 jruoho
923 1.1.1.14 christos typedef struct acpi_iort_id_mapping
924 1.1 jruoho {
925 1.1.1.14 christos UINT32 InputBase; /* Lowest value in input range */
926 1.1.1.14 christos UINT32 IdCount; /* Number of IDs */
927 1.1.1.14 christos UINT32 OutputBase; /* Lowest value in output range */
928 1.1.1.14 christos UINT32 OutputReference; /* A reference to the output node */
929 1.1.1.14 christos UINT32 Flags;
930 1.1 jruoho
931 1.1.1.14 christos } ACPI_IORT_ID_MAPPING;
932 1.1 jruoho
933 1.1.1.14 christos /* Masks for Flags field above for IORT subtable */
934 1.1 jruoho
935 1.1.1.14 christos #define ACPI_IORT_ID_SINGLE_MAPPING (1)
936 1.1 jruoho
937 1.1 jruoho
938 1.1.1.14 christos typedef struct acpi_iort_memory_access
939 1.1 jruoho {
940 1.1.1.14 christos UINT32 CacheCoherency;
941 1.1.1.14 christos UINT8 Hints;
942 1.1.1.14 christos UINT16 Reserved;
943 1.1.1.14 christos UINT8 MemoryFlags;
944 1.1 jruoho
945 1.1.1.14 christos } ACPI_IORT_MEMORY_ACCESS;
946 1.1 jruoho
947 1.1.1.14 christos /* Values for CacheCoherency field above */
948 1.1 jruoho
949 1.1.1.14 christos #define ACPI_IORT_NODE_COHERENT 0x00000001 /* The device node is fully coherent */
950 1.1.1.14 christos #define ACPI_IORT_NODE_NOT_COHERENT 0x00000000 /* The device node is not coherent */
951 1.1 jruoho
952 1.1.1.14 christos /* Masks for Hints field above */
953 1.1 jruoho
954 1.1.1.14 christos #define ACPI_IORT_HT_TRANSIENT (1)
955 1.1.1.14 christos #define ACPI_IORT_HT_WRITE (1<<1)
956 1.1.1.14 christos #define ACPI_IORT_HT_READ (1<<2)
957 1.1.1.14 christos #define ACPI_IORT_HT_OVERRIDE (1<<3)
958 1.1 jruoho
959 1.1.1.14 christos /* Masks for MemoryFlags field above */
960 1.1 jruoho
961 1.1.1.14 christos #define ACPI_IORT_MF_COHERENCY (1)
962 1.1.1.14 christos #define ACPI_IORT_MF_ATTRIBUTES (1<<1)
963 1.1.1.25 christos #define ACPI_IORT_MF_CANWBS (1<<2)
964 1.1 jruoho
965 1.1 jruoho
966 1.1.1.14 christos /*
967 1.1.1.14 christos * IORT node specific subtables
968 1.1.1.14 christos */
969 1.1.1.14 christos typedef struct acpi_iort_its_group
970 1.1 jruoho {
971 1.1.1.14 christos UINT32 ItsCount;
972 1.1.1.24 christos UINT32 Identifiers[]; /* GIC ITS identifier array */
973 1.1 jruoho
974 1.1.1.14 christos } ACPI_IORT_ITS_GROUP;
975 1.1 jruoho
976 1.1 jruoho
977 1.1.1.14 christos typedef struct acpi_iort_named_component
978 1.1 jruoho {
979 1.1.1.14 christos UINT32 NodeFlags;
980 1.1.1.14 christos UINT64 MemoryProperties; /* Memory access properties */
981 1.1.1.14 christos UINT8 MemoryAddressLimit; /* Memory address size limit */
982 1.1.1.24 christos char DeviceName[]; /* Path of namespace object */
983 1.1 jruoho
984 1.1.1.14 christos } ACPI_IORT_NAMED_COMPONENT;
985 1.1 jruoho
986 1.1.1.15 christos /* Masks for Flags field above */
987 1.1.1.15 christos
988 1.1.1.15 christos #define ACPI_IORT_NC_STALL_SUPPORTED (1)
989 1.1.1.15 christos #define ACPI_IORT_NC_PASID_BITS (31<<1)
990 1.1 jruoho
991 1.1.1.14 christos typedef struct acpi_iort_root_complex
992 1.1 jruoho {
993 1.1.1.14 christos UINT64 MemoryProperties; /* Memory access properties */
994 1.1.1.14 christos UINT32 AtsAttribute;
995 1.1.1.14 christos UINT32 PciSegmentNumber;
996 1.1.1.15 christos UINT8 MemoryAddressLimit; /* Memory address size limit */
997 1.1.1.22 christos UINT16 PasidCapabilities; /* PASID Capabilities */
998 1.1.1.24 christos UINT8 Reserved[]; /* Reserved, must be zero */
999 1.1 jruoho
1000 1.1.1.14 christos } ACPI_IORT_ROOT_COMPLEX;
1001 1.1 jruoho
1002 1.1.1.18 christos /* Masks for AtsAttribute field above */
1003 1.1 jruoho
1004 1.1.1.18 christos #define ACPI_IORT_ATS_SUPPORTED (1) /* The root complex ATS support */
1005 1.1.1.18 christos #define ACPI_IORT_PRI_SUPPORTED (1<<1) /* The root complex PRI support */
1006 1.1.1.18 christos #define ACPI_IORT_PASID_FWD_SUPPORTED (1<<2) /* The root complex PASID forward support */
1007 1.1.1.4 christos
1008 1.1.1.22 christos /* Masks for PasidCapabilities field above */
1009 1.1.1.22 christos #define ACPI_IORT_PASID_MAX_WIDTH (0x1F) /* Bits 0-4 */
1010 1.1.1.4 christos
1011 1.1.1.14 christos typedef struct acpi_iort_smmu
1012 1.1.1.14 christos {
1013 1.1.1.14 christos UINT64 BaseAddress; /* SMMU base address */
1014 1.1.1.14 christos UINT64 Span; /* Length of memory range */
1015 1.1.1.14 christos UINT32 Model;
1016 1.1.1.14 christos UINT32 Flags;
1017 1.1.1.14 christos UINT32 GlobalInterruptOffset;
1018 1.1.1.14 christos UINT32 ContextInterruptCount;
1019 1.1.1.14 christos UINT32 ContextInterruptOffset;
1020 1.1.1.14 christos UINT32 PmuInterruptCount;
1021 1.1.1.14 christos UINT32 PmuInterruptOffset;
1022 1.1.1.24 christos UINT64 Interrupts[]; /* Interrupt array */
1023 1.1.1.4 christos
1024 1.1.1.14 christos } ACPI_IORT_SMMU;
1025 1.1.1.4 christos
1026 1.1.1.14 christos /* Values for Model field above */
1027 1.1.1.4 christos
1028 1.1.1.14 christos #define ACPI_IORT_SMMU_V1 0x00000000 /* Generic SMMUv1 */
1029 1.1.1.14 christos #define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */
1030 1.1.1.14 christos #define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */
1031 1.1.1.14 christos #define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */
1032 1.1.1.14 christos #define ACPI_IORT_SMMU_CORELINK_MMU401 0x00000004 /* ARM Corelink MMU-401 */
1033 1.1.1.14 christos #define ACPI_IORT_SMMU_CAVIUM_THUNDERX 0x00000005 /* Cavium ThunderX SMMUv2 */
1034 1.1.1.4 christos
1035 1.1.1.14 christos /* Masks for Flags field above */
1036 1.1.1.4 christos
1037 1.1.1.14 christos #define ACPI_IORT_SMMU_DVM_SUPPORTED (1)
1038 1.1.1.14 christos #define ACPI_IORT_SMMU_COHERENT_WALK (1<<1)
1039 1.1.1.4 christos
1040 1.1.1.14 christos /* Global interrupt format */
1041 1.1.1.4 christos
1042 1.1.1.14 christos typedef struct acpi_iort_smmu_gsi
1043 1.1.1.4 christos {
1044 1.1.1.14 christos UINT32 NSgIrpt;
1045 1.1.1.14 christos UINT32 NSgIrptFlags;
1046 1.1.1.14 christos UINT32 NSgCfgIrpt;
1047 1.1.1.14 christos UINT32 NSgCfgIrptFlags;
1048 1.1.1.4 christos
1049 1.1.1.14 christos } ACPI_IORT_SMMU_GSI;
1050 1.1.1.4 christos
1051 1.1.1.4 christos
1052 1.1.1.14 christos typedef struct acpi_iort_smmu_v3
1053 1.1.1.4 christos {
1054 1.1.1.14 christos UINT64 BaseAddress; /* SMMUv3 base address */
1055 1.1.1.14 christos UINT32 Flags;
1056 1.1.1.14 christos UINT32 Reserved;
1057 1.1.1.14 christos UINT64 VatosAddress;
1058 1.1.1.14 christos UINT32 Model;
1059 1.1.1.14 christos UINT32 EventGsiv;
1060 1.1.1.14 christos UINT32 PriGsiv;
1061 1.1.1.14 christos UINT32 GerrGsiv;
1062 1.1.1.14 christos UINT32 SyncGsiv;
1063 1.1.1.15 christos UINT32 Pxm;
1064 1.1.1.14 christos UINT32 IdMappingIndex;
1065 1.1.1.4 christos
1066 1.1.1.14 christos } ACPI_IORT_SMMU_V3;
1067 1.1.1.4 christos
1068 1.1.1.14 christos /* Values for Model field above */
1069 1.1.1.4 christos
1070 1.1.1.14 christos #define ACPI_IORT_SMMU_V3_GENERIC 0x00000000 /* Generic SMMUv3 */
1071 1.1.1.14 christos #define ACPI_IORT_SMMU_V3_HISILICON_HI161X 0x00000001 /* HiSilicon Hi161x SMMUv3 */
1072 1.1.1.14 christos #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x00000002 /* Cavium CN99xx SMMUv3 */
1073 1.1.1.4 christos
1074 1.1.1.14 christos /* Masks for Flags field above */
1075 1.1.1.4 christos
1076 1.1.1.14 christos #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1)
1077 1.1.1.15 christos #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1)
1078 1.1.1.14 christos #define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3)
1079 1.1.1.23 christos #define ACPI_IORT_SMMU_V3_DEVICEID_VALID (1<<4)
1080 1.1.1.4 christos
1081 1.1.1.15 christos typedef struct acpi_iort_pmcg
1082 1.1.1.15 christos {
1083 1.1.1.15 christos UINT64 Page0BaseAddress;
1084 1.1.1.15 christos UINT32 OverflowGsiv;
1085 1.1.1.15 christos UINT32 NodeReference;
1086 1.1.1.15 christos UINT64 Page1BaseAddress;
1087 1.1.1.15 christos
1088 1.1.1.15 christos } ACPI_IORT_PMCG;
1089 1.1.1.15 christos
1090 1.1.1.18 christos typedef struct acpi_iort_rmr {
1091 1.1.1.18 christos UINT32 Flags;
1092 1.1.1.18 christos UINT32 RmrCount;
1093 1.1.1.18 christos UINT32 RmrOffset;
1094 1.1.1.18 christos
1095 1.1.1.18 christos } ACPI_IORT_RMR;
1096 1.1.1.18 christos
1097 1.1.1.22 christos /* Masks for Flags field above */
1098 1.1.1.22 christos #define ACPI_IORT_RMR_REMAP_PERMITTED (1)
1099 1.1.1.22 christos #define ACPI_IORT_RMR_ACCESS_PRIVILEGE (1<<1)
1100 1.1.1.22 christos
1101 1.1.1.22 christos /*
1102 1.1.1.22 christos * Macro to access the Access Attributes in flags field above:
1103 1.1.1.22 christos * Access Attributes is encoded in bits 9:2
1104 1.1.1.22 christos */
1105 1.1.1.22 christos #define ACPI_IORT_RMR_ACCESS_ATTRIBUTES(flags) (((flags) >> 2) & 0xFF)
1106 1.1.1.22 christos
1107 1.1.1.22 christos /* Values for above Access Attributes */
1108 1.1.1.22 christos
1109 1.1.1.22 christos #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRNE 0x00
1110 1.1.1.22 christos #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRE 0x01
1111 1.1.1.22 christos #define ACPI_IORT_RMR_ATTR_DEVICE_NGRE 0x02
1112 1.1.1.22 christos #define ACPI_IORT_RMR_ATTR_DEVICE_GRE 0x03
1113 1.1.1.22 christos #define ACPI_IORT_RMR_ATTR_NORMAL_NC 0x04
1114 1.1.1.22 christos #define ACPI_IORT_RMR_ATTR_NORMAL_IWB_OWB 0x05
1115 1.1.1.22 christos
1116 1.1.1.18 christos typedef struct acpi_iort_rmr_desc {
1117 1.1.1.18 christos UINT64 BaseAddress;
1118 1.1.1.18 christos UINT64 Length;
1119 1.1.1.18 christos UINT32 Reserved;
1120 1.1.1.18 christos
1121 1.1.1.18 christos } ACPI_IORT_RMR_DESC;
1122 1.1.1.4 christos
1123 1.1.1.4 christos /*******************************************************************************
1124 1.1.1.4 christos *
1125 1.1.1.14 christos * IVRS - I/O Virtualization Reporting Structure
1126 1.1.1.14 christos * Version 1
1127 1.1.1.4 christos *
1128 1.1.1.14 christos * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
1129 1.1.1.14 christos * Revision 1.26, February 2009.
1130 1.1.1.4 christos *
1131 1.1.1.4 christos ******************************************************************************/
1132 1.1.1.4 christos
1133 1.1.1.14 christos typedef struct acpi_table_ivrs
1134 1.1.1.4 christos {
1135 1.1.1.4 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
1136 1.1.1.14 christos UINT32 Info; /* Common virtualization info */
1137 1.1.1.14 christos UINT64 Reserved;
1138 1.1.1.4 christos
1139 1.1.1.14 christos } ACPI_TABLE_IVRS;
1140 1.1.1.4 christos
1141 1.1.1.14 christos /* Values for Info field above */
1142 1.1.1.4 christos
1143 1.1.1.14 christos #define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */
1144 1.1.1.14 christos #define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */
1145 1.1.1.14 christos #define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */
1146 1.1.1.4 christos
1147 1.1.1.4 christos
1148 1.1.1.14 christos /* IVRS subtable header */
1149 1.1.1.4 christos
1150 1.1.1.14 christos typedef struct acpi_ivrs_header
1151 1.1.1.4 christos {
1152 1.1.1.14 christos UINT8 Type; /* Subtable type */
1153 1.1.1.14 christos UINT8 Flags;
1154 1.1.1.14 christos UINT16 Length; /* Subtable length */
1155 1.1.1.14 christos UINT16 DeviceId; /* ID of IOMMU */
1156 1.1.1.4 christos
1157 1.1.1.14 christos } ACPI_IVRS_HEADER;
1158 1.1.1.4 christos
1159 1.1.1.14 christos /* Values for subtable Type above */
1160 1.1 jruoho
1161 1.1.1.14 christos enum AcpiIvrsType
1162 1.1 jruoho {
1163 1.1.1.17 christos ACPI_IVRS_TYPE_HARDWARE1 = 0x10,
1164 1.1.1.17 christos ACPI_IVRS_TYPE_HARDWARE2 = 0x11,
1165 1.1.1.18 christos ACPI_IVRS_TYPE_HARDWARE3 = 0x40,
1166 1.1.1.14 christos ACPI_IVRS_TYPE_MEMORY1 = 0x20,
1167 1.1.1.14 christos ACPI_IVRS_TYPE_MEMORY2 = 0x21,
1168 1.1.1.14 christos ACPI_IVRS_TYPE_MEMORY3 = 0x22
1169 1.1.1.14 christos };
1170 1.1 jruoho
1171 1.1.1.14 christos /* Masks for Flags field above for IVHD subtable */
1172 1.1 jruoho
1173 1.1.1.14 christos #define ACPI_IVHD_TT_ENABLE (1)
1174 1.1.1.14 christos #define ACPI_IVHD_PASS_PW (1<<1)
1175 1.1.1.14 christos #define ACPI_IVHD_RES_PASS_PW (1<<2)
1176 1.1.1.14 christos #define ACPI_IVHD_ISOC (1<<3)
1177 1.1.1.14 christos #define ACPI_IVHD_IOTLB (1<<4)
1178 1.1 jruoho
1179 1.1.1.14 christos /* Masks for Flags field above for IVMD subtable */
1180 1.1 jruoho
1181 1.1.1.14 christos #define ACPI_IVMD_UNITY (1)
1182 1.1.1.14 christos #define ACPI_IVMD_READ (1<<1)
1183 1.1.1.14 christos #define ACPI_IVMD_WRITE (1<<2)
1184 1.1.1.14 christos #define ACPI_IVMD_EXCLUSION_RANGE (1<<3)
1185 1.1 jruoho
1186 1.1 jruoho
1187 1.1.1.14 christos /*
1188 1.1.1.14 christos * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
1189 1.1.1.14 christos */
1190 1.1 jruoho
1191 1.1.1.14 christos /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
1192 1.1 jruoho
1193 1.1.1.17 christos typedef struct acpi_ivrs_hardware_10
1194 1.1 jruoho {
1195 1.1.1.14 christos ACPI_IVRS_HEADER Header;
1196 1.1.1.14 christos UINT16 CapabilityOffset; /* Offset for IOMMU control fields */
1197 1.1.1.14 christos UINT64 BaseAddress; /* IOMMU control registers */
1198 1.1.1.14 christos UINT16 PciSegmentGroup;
1199 1.1.1.14 christos UINT16 Info; /* MSI number and unit ID */
1200 1.1.1.17 christos UINT32 FeatureReporting;
1201 1.1.1.17 christos
1202 1.1.1.17 christos } ACPI_IVRS_HARDWARE1;
1203 1.1.1.17 christos
1204 1.1.1.17 christos /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
1205 1.1 jruoho
1206 1.1.1.17 christos typedef struct acpi_ivrs_hardware_11
1207 1.1.1.17 christos {
1208 1.1.1.17 christos ACPI_IVRS_HEADER Header;
1209 1.1.1.17 christos UINT16 CapabilityOffset; /* Offset for IOMMU control fields */
1210 1.1.1.17 christos UINT64 BaseAddress; /* IOMMU control registers */
1211 1.1.1.17 christos UINT16 PciSegmentGroup;
1212 1.1.1.17 christos UINT16 Info; /* MSI number and unit ID */
1213 1.1.1.17 christos UINT32 Attributes;
1214 1.1.1.17 christos UINT64 EfrRegisterImage;
1215 1.1.1.17 christos UINT64 Reserved;
1216 1.1.1.17 christos } ACPI_IVRS_HARDWARE2;
1217 1.1 jruoho
1218 1.1.1.14 christos /* Masks for Info field above */
1219 1.1 jruoho
1220 1.1.1.14 christos #define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */
1221 1.1.1.14 christos #define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, UnitID */
1222 1.1 jruoho
1223 1.1 jruoho
1224 1.1.1.14 christos /*
1225 1.1.1.14 christos * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
1226 1.1.1.14 christos * Upper two bits of the Type field are the (encoded) length of the structure.
1227 1.1.1.14 christos * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
1228 1.1.1.14 christos * are reserved for future use but not defined.
1229 1.1.1.14 christos */
1230 1.1.1.14 christos typedef struct acpi_ivrs_de_header
1231 1.1 jruoho {
1232 1.1.1.14 christos UINT8 Type;
1233 1.1.1.14 christos UINT16 Id;
1234 1.1.1.14 christos UINT8 DataSetting;
1235 1.1 jruoho
1236 1.1.1.14 christos } ACPI_IVRS_DE_HEADER;
1237 1.1 jruoho
1238 1.1.1.14 christos /* Length of device entry is in the top two bits of Type field above */
1239 1.1 jruoho
1240 1.1.1.14 christos #define ACPI_IVHD_ENTRY_LENGTH 0xC0
1241 1.1 jruoho
1242 1.1.1.14 christos /* Values for device entry Type field above */
1243 1.1 jruoho
1244 1.1.1.14 christos enum AcpiIvrsDeviceEntryType
1245 1.1.1.14 christos {
1246 1.1.1.14 christos /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
1247 1.1 jruoho
1248 1.1.1.14 christos ACPI_IVRS_TYPE_PAD4 = 0,
1249 1.1.1.14 christos ACPI_IVRS_TYPE_ALL = 1,
1250 1.1.1.14 christos ACPI_IVRS_TYPE_SELECT = 2,
1251 1.1.1.14 christos ACPI_IVRS_TYPE_START = 3,
1252 1.1.1.14 christos ACPI_IVRS_TYPE_END = 4,
1253 1.1 jruoho
1254 1.1.1.14 christos /* 8-byte device entries */
1255 1.1 jruoho
1256 1.1.1.14 christos ACPI_IVRS_TYPE_PAD8 = 64,
1257 1.1.1.14 christos ACPI_IVRS_TYPE_NOT_USED = 65,
1258 1.1.1.14 christos ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses ACPI_IVRS_DEVICE8A */
1259 1.1.1.14 christos ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses ACPI_IVRS_DEVICE8A */
1260 1.1.1.14 christos ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses ACPI_IVRS_DEVICE8B */
1261 1.1.1.14 christos ACPI_IVRS_TYPE_EXT_START = 71, /* Uses ACPI_IVRS_DEVICE8B */
1262 1.1.1.18 christos ACPI_IVRS_TYPE_SPECIAL = 72, /* Uses ACPI_IVRS_DEVICE8C */
1263 1.1.1.18 christos
1264 1.1.1.18 christos /* Variable-length device entries */
1265 1.1.1.18 christos
1266 1.1.1.18 christos ACPI_IVRS_TYPE_HID = 240 /* Uses ACPI_IVRS_DEVICE_HID */
1267 1.1.1.14 christos };
1268 1.1 jruoho
1269 1.1.1.14 christos /* Values for Data field above */
1270 1.1 jruoho
1271 1.1.1.14 christos #define ACPI_IVHD_INIT_PASS (1)
1272 1.1.1.14 christos #define ACPI_IVHD_EINT_PASS (1<<1)
1273 1.1.1.14 christos #define ACPI_IVHD_NMI_PASS (1<<2)
1274 1.1.1.14 christos #define ACPI_IVHD_SYSTEM_MGMT (3<<4)
1275 1.1.1.14 christos #define ACPI_IVHD_LINT0_PASS (1<<6)
1276 1.1.1.14 christos #define ACPI_IVHD_LINT1_PASS (1<<7)
1277 1.1 jruoho
1278 1.1 jruoho
1279 1.1.1.14 christos /* Types 0-4: 4-byte device entry */
1280 1.1 jruoho
1281 1.1.1.14 christos typedef struct acpi_ivrs_device4
1282 1.1 jruoho {
1283 1.1.1.14 christos ACPI_IVRS_DE_HEADER Header;
1284 1.1 jruoho
1285 1.1.1.14 christos } ACPI_IVRS_DEVICE4;
1286 1.1 jruoho
1287 1.1.1.14 christos /* Types 66-67: 8-byte device entry */
1288 1.1 jruoho
1289 1.1.1.14 christos typedef struct acpi_ivrs_device8a
1290 1.1.1.14 christos {
1291 1.1.1.14 christos ACPI_IVRS_DE_HEADER Header;
1292 1.1.1.14 christos UINT8 Reserved1;
1293 1.1.1.14 christos UINT16 UsedId;
1294 1.1.1.14 christos UINT8 Reserved2;
1295 1.1 jruoho
1296 1.1.1.14 christos } ACPI_IVRS_DEVICE8A;
1297 1.1 jruoho
1298 1.1.1.14 christos /* Types 70-71: 8-byte device entry */
1299 1.1 jruoho
1300 1.1.1.14 christos typedef struct acpi_ivrs_device8b
1301 1.1 jruoho {
1302 1.1.1.14 christos ACPI_IVRS_DE_HEADER Header;
1303 1.1.1.14 christos UINT32 ExtendedData;
1304 1.1 jruoho
1305 1.1.1.14 christos } ACPI_IVRS_DEVICE8B;
1306 1.1 jruoho
1307 1.1.1.14 christos /* Values for ExtendedData above */
1308 1.1 jruoho
1309 1.1.1.14 christos #define ACPI_IVHD_ATS_DISABLED (1<<31)
1310 1.1 jruoho
1311 1.1.1.14 christos /* Type 72: 8-byte device entry */
1312 1.1 jruoho
1313 1.1.1.14 christos typedef struct acpi_ivrs_device8c
1314 1.1 jruoho {
1315 1.1.1.14 christos ACPI_IVRS_DE_HEADER Header;
1316 1.1.1.14 christos UINT8 Handle;
1317 1.1.1.14 christos UINT16 UsedId;
1318 1.1.1.14 christos UINT8 Variety;
1319 1.1.1.14 christos
1320 1.1.1.14 christos } ACPI_IVRS_DEVICE8C;
1321 1.1.1.14 christos
1322 1.1.1.14 christos /* Values for Variety field above */
1323 1.1 jruoho
1324 1.1.1.14 christos #define ACPI_IVHD_IOAPIC 1
1325 1.1.1.14 christos #define ACPI_IVHD_HPET 2
1326 1.1 jruoho
1327 1.1.1.18 christos /* Type 240: variable-length device entry */
1328 1.1.1.18 christos
1329 1.1.1.18 christos typedef struct acpi_ivrs_device_hid
1330 1.1.1.18 christos {
1331 1.1.1.18 christos ACPI_IVRS_DE_HEADER Header;
1332 1.1.1.18 christos UINT64 AcpiHid;
1333 1.1.1.18 christos UINT64 AcpiCid;
1334 1.1.1.18 christos UINT8 UidType;
1335 1.1.1.18 christos UINT8 UidLength;
1336 1.1.1.18 christos
1337 1.1.1.18 christos } ACPI_IVRS_DEVICE_HID;
1338 1.1.1.18 christos
1339 1.1.1.19 christos /* Values for UidType above */
1340 1.1.1.19 christos
1341 1.1.1.19 christos #define ACPI_IVRS_UID_NOT_PRESENT 0
1342 1.1.1.19 christos #define ACPI_IVRS_UID_IS_INTEGER 1
1343 1.1.1.19 christos #define ACPI_IVRS_UID_IS_STRING 2
1344 1.1 jruoho
1345 1.1.1.14 christos /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
1346 1.1.1.5 christos
1347 1.1.1.14 christos typedef struct acpi_ivrs_memory
1348 1.1.1.5 christos {
1349 1.1.1.14 christos ACPI_IVRS_HEADER Header;
1350 1.1.1.14 christos UINT16 AuxData;
1351 1.1.1.14 christos UINT64 Reserved;
1352 1.1.1.14 christos UINT64 StartAddress;
1353 1.1.1.14 christos UINT64 MemoryLength;
1354 1.1.1.5 christos
1355 1.1.1.14 christos } ACPI_IVRS_MEMORY;
1356 1.1.1.5 christos
1357 1.1.1.5 christos
1358 1.1 jruoho /*******************************************************************************
1359 1.1 jruoho *
1360 1.1.1.14 christos * LPIT - Low Power Idle Table
1361 1.1 jruoho *
1362 1.1.1.14 christos * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
1363 1.1 jruoho *
1364 1.1 jruoho ******************************************************************************/
1365 1.1 jruoho
1366 1.1.1.14 christos typedef struct acpi_table_lpit
1367 1.1 jruoho {
1368 1.1 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
1369 1.1 jruoho
1370 1.1.1.14 christos } ACPI_TABLE_LPIT;
1371 1.1.1.14 christos
1372 1.1 jruoho
1373 1.1.1.14 christos /* LPIT subtable header */
1374 1.1.1.14 christos
1375 1.1.1.14 christos typedef struct acpi_lpit_header
1376 1.1.1.14 christos {
1377 1.1.1.14 christos UINT32 Type; /* Subtable type */
1378 1.1.1.14 christos UINT32 Length; /* Subtable length */
1379 1.1.1.14 christos UINT16 UniqueId;
1380 1.1.1.14 christos UINT16 Reserved;
1381 1.1.1.14 christos UINT32 Flags;
1382 1.1 jruoho
1383 1.1.1.14 christos } ACPI_LPIT_HEADER;
1384 1.1 jruoho
1385 1.1.1.14 christos /* Values for subtable Type above */
1386 1.1 jruoho
1387 1.1.1.14 christos enum AcpiLpitType
1388 1.1 jruoho {
1389 1.1.1.14 christos ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
1390 1.1.1.14 christos ACPI_LPIT_TYPE_RESERVED = 0x01 /* 1 and above are reserved */
1391 1.1 jruoho };
1392 1.1 jruoho
1393 1.1.1.14 christos /* Masks for Flags field above */
1394 1.1.1.14 christos
1395 1.1.1.14 christos #define ACPI_LPIT_STATE_DISABLED (1)
1396 1.1.1.14 christos #define ACPI_LPIT_NO_COUNTER (1<<1)
1397 1.1.1.14 christos
1398 1.1.1.14 christos /*
1399 1.1.1.14 christos * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
1400 1.1.1.14 christos */
1401 1.1.1.14 christos
1402 1.1.1.14 christos /* 0x00: Native C-state instruction based LPI structure */
1403 1.1.1.14 christos
1404 1.1.1.14 christos typedef struct acpi_lpit_native
1405 1.1.1.14 christos {
1406 1.1.1.14 christos ACPI_LPIT_HEADER Header;
1407 1.1.1.14 christos ACPI_GENERIC_ADDRESS EntryTrigger;
1408 1.1.1.14 christos UINT32 Residency;
1409 1.1.1.14 christos UINT32 Latency;
1410 1.1.1.14 christos ACPI_GENERIC_ADDRESS ResidencyCounter;
1411 1.1.1.14 christos UINT64 CounterFrequency;
1412 1.1.1.14 christos
1413 1.1.1.14 christos } ACPI_LPIT_NATIVE;
1414 1.1.1.14 christos
1415 1.1 jruoho
1416 1.1 jruoho /*******************************************************************************
1417 1.1 jruoho *
1418 1.1.1.14 christos * MADT - Multiple APIC Description Table
1419 1.1.1.14 christos * Version 3
1420 1.1 jruoho *
1421 1.1 jruoho ******************************************************************************/
1422 1.1 jruoho
1423 1.1.1.14 christos typedef struct acpi_table_madt
1424 1.1 jruoho {
1425 1.1 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
1426 1.1.1.14 christos UINT32 Address; /* Physical address of local APIC */
1427 1.1.1.14 christos UINT32 Flags;
1428 1.1 jruoho
1429 1.1.1.14 christos } ACPI_TABLE_MADT;
1430 1.1 jruoho
1431 1.1.1.14 christos /* Masks for Flags field above */
1432 1.1 jruoho
1433 1.1.1.14 christos #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
1434 1.1 jruoho
1435 1.1.1.14 christos /* Values for PCATCompat flag */
1436 1.1 jruoho
1437 1.1.1.14 christos #define ACPI_MADT_DUAL_PIC 1
1438 1.1.1.14 christos #define ACPI_MADT_MULTIPLE_APIC 0
1439 1.1 jruoho
1440 1.1 jruoho
1441 1.1.1.14 christos /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
1442 1.1.1.14 christos
1443 1.1.1.14 christos enum AcpiMadtType
1444 1.1.1.14 christos {
1445 1.1.1.14 christos ACPI_MADT_TYPE_LOCAL_APIC = 0,
1446 1.1.1.14 christos ACPI_MADT_TYPE_IO_APIC = 1,
1447 1.1.1.14 christos ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
1448 1.1.1.14 christos ACPI_MADT_TYPE_NMI_SOURCE = 3,
1449 1.1.1.14 christos ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
1450 1.1.1.14 christos ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
1451 1.1.1.14 christos ACPI_MADT_TYPE_IO_SAPIC = 6,
1452 1.1.1.14 christos ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
1453 1.1.1.14 christos ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
1454 1.1.1.14 christos ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
1455 1.1.1.14 christos ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
1456 1.1.1.14 christos ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
1457 1.1.1.14 christos ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
1458 1.1.1.14 christos ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
1459 1.1.1.14 christos ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
1460 1.1.1.14 christos ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
1461 1.1.1.18 christos ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
1462 1.1.1.23 christos ACPI_MADT_TYPE_CORE_PIC = 17,
1463 1.1.1.23 christos ACPI_MADT_TYPE_LIO_PIC = 18,
1464 1.1.1.23 christos ACPI_MADT_TYPE_HT_PIC = 19,
1465 1.1.1.23 christos ACPI_MADT_TYPE_EIO_PIC = 20,
1466 1.1.1.23 christos ACPI_MADT_TYPE_MSI_PIC = 21,
1467 1.1.1.23 christos ACPI_MADT_TYPE_BIO_PIC = 22,
1468 1.1.1.23 christos ACPI_MADT_TYPE_LPC_PIC = 23,
1469 1.1.1.24 christos ACPI_MADT_TYPE_RINTC = 24,
1470 1.1.1.24 christos ACPI_MADT_TYPE_IMSIC = 25,
1471 1.1.1.24 christos ACPI_MADT_TYPE_APLIC = 26,
1472 1.1.1.24 christos ACPI_MADT_TYPE_PLIC = 27,
1473 1.1.1.24 christos ACPI_MADT_TYPE_RESERVED = 28, /* 28 to 0x7F are reserved */
1474 1.1.1.22 christos ACPI_MADT_TYPE_OEM_RESERVED = 0x80 /* 0x80 to 0xFF are reserved for OEM use */
1475 1.1 jruoho };
1476 1.1 jruoho
1477 1.1 jruoho
1478 1.1.1.14 christos /*
1479 1.1.1.14 christos * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
1480 1.1.1.14 christos */
1481 1.1 jruoho
1482 1.1.1.14 christos /* 0: Processor Local APIC */
1483 1.1.1.14 christos
1484 1.1.1.14 christos typedef struct acpi_madt_local_apic
1485 1.1 jruoho {
1486 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1487 1.1.1.14 christos UINT8 ProcessorId; /* ACPI processor id */
1488 1.1.1.14 christos UINT8 Id; /* Processor's local APIC id */
1489 1.1.1.14 christos UINT32 LapicFlags;
1490 1.1 jruoho
1491 1.1.1.14 christos } ACPI_MADT_LOCAL_APIC;
1492 1.1 jruoho
1493 1.1 jruoho
1494 1.1.1.14 christos /* 1: IO APIC */
1495 1.1.1.7 christos
1496 1.1.1.14 christos typedef struct acpi_madt_io_apic
1497 1.1.1.7 christos {
1498 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1499 1.1.1.14 christos UINT8 Id; /* I/O APIC ID */
1500 1.1.1.14 christos UINT8 Reserved; /* Reserved - must be zero */
1501 1.1.1.14 christos UINT32 Address; /* APIC physical address */
1502 1.1.1.14 christos UINT32 GlobalIrqBase; /* Global system interrupt where INTI lines start */
1503 1.1.1.7 christos
1504 1.1.1.14 christos } ACPI_MADT_IO_APIC;
1505 1.1.1.7 christos
1506 1.1.1.7 christos
1507 1.1.1.14 christos /* 2: Interrupt Override */
1508 1.1.1.7 christos
1509 1.1.1.14 christos typedef struct acpi_madt_interrupt_override
1510 1.1.1.14 christos {
1511 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1512 1.1.1.14 christos UINT8 Bus; /* 0 - ISA */
1513 1.1.1.14 christos UINT8 SourceIrq; /* Interrupt source (IRQ) */
1514 1.1.1.14 christos UINT32 GlobalIrq; /* Global system interrupt */
1515 1.1.1.14 christos UINT16 IntiFlags;
1516 1.1.1.7 christos
1517 1.1.1.14 christos } ACPI_MADT_INTERRUPT_OVERRIDE;
1518 1.1.1.7 christos
1519 1.1.1.7 christos
1520 1.1.1.14 christos /* 3: NMI Source */
1521 1.1.1.7 christos
1522 1.1.1.14 christos typedef struct acpi_madt_nmi_source
1523 1.1.1.7 christos {
1524 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1525 1.1.1.14 christos UINT16 IntiFlags;
1526 1.1.1.14 christos UINT32 GlobalIrq; /* Global system interrupt */
1527 1.1.1.7 christos
1528 1.1.1.14 christos } ACPI_MADT_NMI_SOURCE;
1529 1.1.1.7 christos
1530 1.1.1.7 christos
1531 1.1.1.14 christos /* 4: Local APIC NMI */
1532 1.1.1.7 christos
1533 1.1.1.14 christos typedef struct acpi_madt_local_apic_nmi
1534 1.1.1.7 christos {
1535 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1536 1.1.1.14 christos UINT8 ProcessorId; /* ACPI processor id */
1537 1.1.1.14 christos UINT16 IntiFlags;
1538 1.1.1.14 christos UINT8 Lint; /* LINTn to which NMI is connected */
1539 1.1.1.7 christos
1540 1.1.1.14 christos } ACPI_MADT_LOCAL_APIC_NMI;
1541 1.1.1.7 christos
1542 1.1.1.7 christos
1543 1.1.1.14 christos /* 5: Address Override */
1544 1.1.1.7 christos
1545 1.1.1.14 christos typedef struct acpi_madt_local_apic_override
1546 1.1.1.14 christos {
1547 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1548 1.1.1.14 christos UINT16 Reserved; /* Reserved, must be zero */
1549 1.1.1.14 christos UINT64 Address; /* APIC physical address */
1550 1.1.1.7 christos
1551 1.1.1.14 christos } ACPI_MADT_LOCAL_APIC_OVERRIDE;
1552 1.1.1.7 christos
1553 1.1.1.7 christos
1554 1.1.1.14 christos /* 6: I/O Sapic */
1555 1.1.1.7 christos
1556 1.1.1.14 christos typedef struct acpi_madt_io_sapic
1557 1.1.1.7 christos {
1558 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1559 1.1.1.14 christos UINT8 Id; /* I/O SAPIC ID */
1560 1.1.1.14 christos UINT8 Reserved; /* Reserved, must be zero */
1561 1.1.1.14 christos UINT32 GlobalIrqBase; /* Global interrupt for SAPIC start */
1562 1.1.1.14 christos UINT64 Address; /* SAPIC physical address */
1563 1.1.1.7 christos
1564 1.1.1.14 christos } ACPI_MADT_IO_SAPIC;
1565 1.1.1.7 christos
1566 1.1.1.7 christos
1567 1.1.1.14 christos /* 7: Local Sapic */
1568 1.1.1.14 christos
1569 1.1.1.14 christos typedef struct acpi_madt_local_sapic
1570 1.1.1.7 christos {
1571 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1572 1.1.1.14 christos UINT8 ProcessorId; /* ACPI processor id */
1573 1.1.1.14 christos UINT8 Id; /* SAPIC ID */
1574 1.1.1.14 christos UINT8 Eid; /* SAPIC EID */
1575 1.1.1.14 christos UINT8 Reserved[3]; /* Reserved, must be zero */
1576 1.1.1.14 christos UINT32 LapicFlags;
1577 1.1.1.14 christos UINT32 Uid; /* Numeric UID - ACPI 3.0 */
1578 1.1.1.24 christos char UidString[]; /* String UID - ACPI 3.0 */
1579 1.1.1.7 christos
1580 1.1.1.14 christos } ACPI_MADT_LOCAL_SAPIC;
1581 1.1.1.7 christos
1582 1.1.1.7 christos
1583 1.1.1.14 christos /* 8: Platform Interrupt Source */
1584 1.1.1.14 christos
1585 1.1.1.14 christos typedef struct acpi_madt_interrupt_source
1586 1.1.1.7 christos {
1587 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1588 1.1.1.14 christos UINT16 IntiFlags;
1589 1.1.1.14 christos UINT8 Type; /* 1=PMI, 2=INIT, 3=corrected */
1590 1.1.1.14 christos UINT8 Id; /* Processor ID */
1591 1.1.1.14 christos UINT8 Eid; /* Processor EID */
1592 1.1.1.14 christos UINT8 IoSapicVector; /* Vector value for PMI interrupts */
1593 1.1.1.14 christos UINT32 GlobalIrq; /* Global system interrupt */
1594 1.1.1.14 christos UINT32 Flags; /* Interrupt Source Flags */
1595 1.1.1.7 christos
1596 1.1.1.14 christos } ACPI_MADT_INTERRUPT_SOURCE;
1597 1.1.1.7 christos
1598 1.1.1.14 christos /* Masks for Flags field above */
1599 1.1.1.7 christos
1600 1.1.1.14 christos #define ACPI_MADT_CPEI_OVERRIDE (1)
1601 1.1.1.7 christos
1602 1.1.1.7 christos
1603 1.1.1.14 christos /* 9: Processor Local X2APIC (ACPI 4.0) */
1604 1.1.1.14 christos
1605 1.1.1.14 christos typedef struct acpi_madt_local_x2apic
1606 1.1.1.7 christos {
1607 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1608 1.1.1.14 christos UINT16 Reserved; /* Reserved - must be zero */
1609 1.1.1.14 christos UINT32 LocalApicId; /* Processor x2APIC ID */
1610 1.1.1.14 christos UINT32 LapicFlags;
1611 1.1.1.14 christos UINT32 Uid; /* ACPI processor UID */
1612 1.1.1.7 christos
1613 1.1.1.14 christos } ACPI_MADT_LOCAL_X2APIC;
1614 1.1.1.7 christos
1615 1.1.1.7 christos
1616 1.1.1.14 christos /* 10: Local X2APIC NMI (ACPI 4.0) */
1617 1.1.1.14 christos
1618 1.1.1.14 christos typedef struct acpi_madt_local_x2apic_nmi
1619 1.1.1.14 christos {
1620 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1621 1.1.1.14 christos UINT16 IntiFlags;
1622 1.1.1.14 christos UINT32 Uid; /* ACPI processor UID */
1623 1.1.1.14 christos UINT8 Lint; /* LINTn to which NMI is connected */
1624 1.1.1.14 christos UINT8 Reserved[3]; /* Reserved - must be zero */
1625 1.1.1.14 christos
1626 1.1.1.14 christos } ACPI_MADT_LOCAL_X2APIC_NMI;
1627 1.1.1.14 christos
1628 1.1.1.14 christos
1629 1.1.1.24 christos /* 11: Generic Interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 + ACPI 6.5 changes) */
1630 1.1.1.14 christos
1631 1.1.1.14 christos typedef struct acpi_madt_generic_interrupt
1632 1.1.1.14 christos {
1633 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1634 1.1.1.14 christos UINT16 Reserved; /* Reserved - must be zero */
1635 1.1.1.14 christos UINT32 CpuInterfaceNumber;
1636 1.1.1.14 christos UINT32 Uid;
1637 1.1.1.14 christos UINT32 Flags;
1638 1.1.1.14 christos UINT32 ParkingVersion;
1639 1.1.1.14 christos UINT32 PerformanceInterrupt;
1640 1.1.1.14 christos UINT64 ParkedAddress;
1641 1.1.1.14 christos UINT64 BaseAddress;
1642 1.1.1.14 christos UINT64 GicvBaseAddress;
1643 1.1.1.14 christos UINT64 GichBaseAddress;
1644 1.1.1.14 christos UINT32 VgicInterrupt;
1645 1.1.1.14 christos UINT64 GicrBaseAddress;
1646 1.1.1.14 christos UINT64 ArmMpidr;
1647 1.1.1.14 christos UINT8 EfficiencyClass;
1648 1.1.1.16 christos UINT8 Reserved2[1];
1649 1.1.1.16 christos UINT16 SpeInterrupt; /* ACPI 6.3 */
1650 1.1.1.24 christos UINT16 TrbeInterrupt; /* ACPI 6.5 */
1651 1.1.1.14 christos
1652 1.1.1.14 christos } ACPI_MADT_GENERIC_INTERRUPT;
1653 1.1.1.7 christos
1654 1.1.1.7 christos /* Masks for Flags field above */
1655 1.1.1.7 christos
1656 1.1.1.14 christos /* ACPI_MADT_ENABLED (1) Processor is usable if set */
1657 1.1.1.14 christos #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
1658 1.1.1.14 christos #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
1659 1.1.1.25 christos #define ACPI_MADT_GICC_ONLINE_CAPABLE (1<<3) /* 03: Processor is online capable */
1660 1.1.1.25 christos #define ACPI_MADT_GICC_NON_COHERENT (1<<4) /* 04: GIC redistributor is not coherent */
1661 1.1.1.11 christos
1662 1.1.1.14 christos /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
1663 1.1.1.14 christos
1664 1.1.1.14 christos typedef struct acpi_madt_generic_distributor
1665 1.1.1.11 christos {
1666 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1667 1.1.1.14 christos UINT16 Reserved; /* Reserved - must be zero */
1668 1.1.1.14 christos UINT32 GicId;
1669 1.1.1.14 christos UINT64 BaseAddress;
1670 1.1.1.14 christos UINT32 GlobalIrqBase;
1671 1.1.1.14 christos UINT8 Version;
1672 1.1.1.14 christos UINT8 Reserved2[3]; /* Reserved - must be zero */
1673 1.1.1.12 christos
1674 1.1.1.14 christos } ACPI_MADT_GENERIC_DISTRIBUTOR;
1675 1.1.1.11 christos
1676 1.1.1.14 christos /* Values for Version field above */
1677 1.1.1.7 christos
1678 1.1.1.14 christos enum AcpiMadtGicVersion
1679 1.1.1.9 christos {
1680 1.1.1.14 christos ACPI_MADT_GIC_VERSION_NONE = 0,
1681 1.1.1.14 christos ACPI_MADT_GIC_VERSION_V1 = 1,
1682 1.1.1.14 christos ACPI_MADT_GIC_VERSION_V2 = 2,
1683 1.1.1.14 christos ACPI_MADT_GIC_VERSION_V3 = 3,
1684 1.1.1.14 christos ACPI_MADT_GIC_VERSION_V4 = 4,
1685 1.1.1.14 christos ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
1686 1.1.1.14 christos };
1687 1.1.1.9 christos
1688 1.1.1.9 christos
1689 1.1.1.14 christos /* 13: Generic MSI Frame (ACPI 5.1) */
1690 1.1.1.12 christos
1691 1.1.1.14 christos typedef struct acpi_madt_generic_msi_frame
1692 1.1.1.14 christos {
1693 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1694 1.1.1.14 christos UINT16 Reserved; /* Reserved - must be zero */
1695 1.1.1.14 christos UINT32 MsiFrameId;
1696 1.1.1.14 christos UINT64 BaseAddress;
1697 1.1.1.14 christos UINT32 Flags;
1698 1.1.1.14 christos UINT16 SpiCount;
1699 1.1.1.14 christos UINT16 SpiBase;
1700 1.1.1.14 christos
1701 1.1.1.14 christos } ACPI_MADT_GENERIC_MSI_FRAME;
1702 1.1.1.12 christos
1703 1.1.1.9 christos /* Masks for Flags field above */
1704 1.1.1.9 christos
1705 1.1.1.14 christos #define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
1706 1.1.1.14 christos
1707 1.1.1.14 christos
1708 1.1.1.14 christos /* 14: Generic Redistributor (ACPI 5.1) */
1709 1.1.1.14 christos
1710 1.1.1.14 christos typedef struct acpi_madt_generic_redistributor
1711 1.1.1.14 christos {
1712 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1713 1.1.1.25 christos UINT8 Flags;
1714 1.1.1.25 christos UINT8 Reserved; /* reserved - must be zero */
1715 1.1.1.14 christos UINT64 BaseAddress;
1716 1.1.1.14 christos UINT32 Length;
1717 1.1.1.14 christos
1718 1.1.1.14 christos } ACPI_MADT_GENERIC_REDISTRIBUTOR;
1719 1.1.1.14 christos
1720 1.1.1.25 christos #define ACPI_MADT_GICR_NON_COHERENT (1)
1721 1.1.1.14 christos
1722 1.1.1.14 christos /* 15: Generic Translator (ACPI 6.0) */
1723 1.1.1.14 christos
1724 1.1.1.14 christos typedef struct acpi_madt_generic_translator
1725 1.1.1.14 christos {
1726 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
1727 1.1.1.25 christos UINT8 Flags;
1728 1.1.1.25 christos UINT8 Reserved; /* reserved - must be zero */
1729 1.1.1.14 christos UINT32 TranslationId;
1730 1.1.1.14 christos UINT64 BaseAddress;
1731 1.1.1.14 christos UINT32 Reserved2;
1732 1.1.1.14 christos
1733 1.1.1.14 christos } ACPI_MADT_GENERIC_TRANSLATOR;
1734 1.1.1.14 christos
1735 1.1.1.25 christos #define ACPI_MADT_ITS_NON_COHERENT (1)
1736 1.1.1.25 christos
1737 1.1.1.18 christos /* 16: Multiprocessor wakeup (ACPI 6.4) */
1738 1.1.1.18 christos
1739 1.1.1.18 christos typedef struct acpi_madt_multiproc_wakeup
1740 1.1.1.18 christos {
1741 1.1.1.18 christos ACPI_SUBTABLE_HEADER Header;
1742 1.1.1.18 christos UINT16 MailboxVersion;
1743 1.1.1.18 christos UINT32 Reserved; /* reserved - must be zero */
1744 1.1.1.18 christos UINT64 BaseAddress;
1745 1.1.1.18 christos
1746 1.1.1.18 christos } ACPI_MADT_MULTIPROC_WAKEUP;
1747 1.1.1.18 christos
1748 1.1.1.22 christos #define ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE 2032
1749 1.1.1.22 christos #define ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE 2048
1750 1.1.1.19 christos
1751 1.1.1.19 christos typedef struct acpi_madt_multiproc_wakeup_mailbox
1752 1.1.1.19 christos {
1753 1.1.1.19 christos UINT16 Command;
1754 1.1.1.19 christos UINT16 Reserved; /* reserved - must be zero */
1755 1.1.1.19 christos UINT32 ApicId;
1756 1.1.1.19 christos UINT64 WakeupVector;
1757 1.1.1.19 christos UINT8 ReservedOs[ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE]; /* reserved for OS use */
1758 1.1.1.19 christos UINT8 ReservedFirmware[ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE]; /* reserved for firmware use */
1759 1.1.1.19 christos
1760 1.1.1.19 christos } ACPI_MADT_MULTIPROC_WAKEUP_MAILBOX;
1761 1.1.1.19 christos
1762 1.1.1.19 christos #define ACPI_MP_WAKE_COMMAND_WAKEUP 1
1763 1.1.1.19 christos
1764 1.1.1.23 christos /* 17: CPU Core Interrupt Controller (ACPI 6.5) */
1765 1.1.1.23 christos
1766 1.1.1.23 christos typedef struct acpi_madt_core_pic {
1767 1.1.1.23 christos ACPI_SUBTABLE_HEADER Header;
1768 1.1.1.23 christos UINT8 Version;
1769 1.1.1.23 christos UINT32 ProcessorId;
1770 1.1.1.23 christos UINT32 CoreId;
1771 1.1.1.23 christos UINT32 Flags;
1772 1.1.1.23 christos } ACPI_MADT_CORE_PIC;
1773 1.1.1.23 christos
1774 1.1.1.23 christos /* Values for Version field above */
1775 1.1.1.23 christos
1776 1.1.1.23 christos enum AcpiMadtCorePicVersion {
1777 1.1.1.23 christos ACPI_MADT_CORE_PIC_VERSION_NONE = 0,
1778 1.1.1.23 christos ACPI_MADT_CORE_PIC_VERSION_V1 = 1,
1779 1.1.1.23 christos ACPI_MADT_CORE_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
1780 1.1.1.23 christos };
1781 1.1.1.23 christos
1782 1.1.1.23 christos /* 18: Legacy I/O Interrupt Controller (ACPI 6.5) */
1783 1.1.1.23 christos
1784 1.1.1.23 christos typedef struct acpi_madt_lio_pic {
1785 1.1.1.23 christos ACPI_SUBTABLE_HEADER Header;
1786 1.1.1.23 christos UINT8 Version;
1787 1.1.1.23 christos UINT64 Address;
1788 1.1.1.23 christos UINT16 Size;
1789 1.1.1.23 christos UINT8 Cascade[2];
1790 1.1.1.23 christos UINT32 CascadeMap[2];
1791 1.1.1.23 christos } ACPI_MADT_LIO_PIC;
1792 1.1.1.23 christos
1793 1.1.1.23 christos /* Values for Version field above */
1794 1.1.1.23 christos
1795 1.1.1.23 christos enum AcpiMadtLioPicVersion {
1796 1.1.1.23 christos ACPI_MADT_LIO_PIC_VERSION_NONE = 0,
1797 1.1.1.23 christos ACPI_MADT_LIO_PIC_VERSION_V1 = 1,
1798 1.1.1.23 christos ACPI_MADT_LIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
1799 1.1.1.23 christos };
1800 1.1.1.23 christos
1801 1.1.1.23 christos /* 19: HT Interrupt Controller (ACPI 6.5) */
1802 1.1.1.23 christos
1803 1.1.1.23 christos typedef struct acpi_madt_ht_pic {
1804 1.1.1.23 christos ACPI_SUBTABLE_HEADER Header;
1805 1.1.1.23 christos UINT8 Version;
1806 1.1.1.23 christos UINT64 Address;
1807 1.1.1.23 christos UINT16 Size;
1808 1.1.1.23 christos UINT8 Cascade[8];
1809 1.1.1.23 christos } ACPI_MADT_HT_PIC;
1810 1.1.1.23 christos
1811 1.1.1.23 christos /* Values for Version field above */
1812 1.1.1.23 christos
1813 1.1.1.23 christos enum AcpiMadtHtPicVersion {
1814 1.1.1.23 christos ACPI_MADT_HT_PIC_VERSION_NONE = 0,
1815 1.1.1.23 christos ACPI_MADT_HT_PIC_VERSION_V1 = 1,
1816 1.1.1.23 christos ACPI_MADT_HT_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
1817 1.1.1.23 christos };
1818 1.1.1.23 christos
1819 1.1.1.23 christos /* 20: Extend I/O Interrupt Controller (ACPI 6.5) */
1820 1.1.1.23 christos
1821 1.1.1.23 christos typedef struct acpi_madt_eio_pic {
1822 1.1.1.23 christos ACPI_SUBTABLE_HEADER Header;
1823 1.1.1.23 christos UINT8 Version;
1824 1.1.1.23 christos UINT8 Cascade;
1825 1.1.1.23 christos UINT8 Node;
1826 1.1.1.23 christos UINT64 NodeMap;
1827 1.1.1.23 christos } ACPI_MADT_EIO_PIC;
1828 1.1.1.23 christos
1829 1.1.1.23 christos /* Values for Version field above */
1830 1.1.1.23 christos
1831 1.1.1.23 christos enum AcpiMadtEioPicVersion {
1832 1.1.1.23 christos ACPI_MADT_EIO_PIC_VERSION_NONE = 0,
1833 1.1.1.23 christos ACPI_MADT_EIO_PIC_VERSION_V1 = 1,
1834 1.1.1.23 christos ACPI_MADT_EIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
1835 1.1.1.23 christos };
1836 1.1.1.23 christos
1837 1.1.1.23 christos /* 21: MSI Interrupt Controller (ACPI 6.5) */
1838 1.1.1.23 christos
1839 1.1.1.23 christos typedef struct acpi_madt_msi_pic {
1840 1.1.1.23 christos ACPI_SUBTABLE_HEADER Header;
1841 1.1.1.23 christos UINT8 Version;
1842 1.1.1.23 christos UINT64 MsgAddress;
1843 1.1.1.23 christos UINT32 Start;
1844 1.1.1.23 christos UINT32 Count;
1845 1.1.1.23 christos } ACPI_MADT_MSI_PIC;
1846 1.1.1.23 christos
1847 1.1.1.23 christos /* Values for Version field above */
1848 1.1.1.23 christos
1849 1.1.1.23 christos enum AcpiMadtMsiPicVersion {
1850 1.1.1.23 christos ACPI_MADT_MSI_PIC_VERSION_NONE = 0,
1851 1.1.1.23 christos ACPI_MADT_MSI_PIC_VERSION_V1 = 1,
1852 1.1.1.23 christos ACPI_MADT_MSI_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
1853 1.1.1.23 christos };
1854 1.1.1.23 christos
1855 1.1.1.23 christos /* 22: Bridge I/O Interrupt Controller (ACPI 6.5) */
1856 1.1.1.23 christos
1857 1.1.1.23 christos typedef struct acpi_madt_bio_pic {
1858 1.1.1.23 christos ACPI_SUBTABLE_HEADER Header;
1859 1.1.1.23 christos UINT8 Version;
1860 1.1.1.23 christos UINT64 Address;
1861 1.1.1.23 christos UINT16 Size;
1862 1.1.1.23 christos UINT16 Id;
1863 1.1.1.23 christos UINT16 GsiBase;
1864 1.1.1.23 christos } ACPI_MADT_BIO_PIC;
1865 1.1.1.23 christos
1866 1.1.1.23 christos /* Values for Version field above */
1867 1.1.1.23 christos
1868 1.1.1.23 christos enum AcpiMadtBioPicVersion {
1869 1.1.1.23 christos ACPI_MADT_BIO_PIC_VERSION_NONE = 0,
1870 1.1.1.23 christos ACPI_MADT_BIO_PIC_VERSION_V1 = 1,
1871 1.1.1.23 christos ACPI_MADT_BIO_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
1872 1.1.1.23 christos };
1873 1.1.1.23 christos
1874 1.1.1.23 christos /* 23: LPC Interrupt Controller (ACPI 6.5) */
1875 1.1.1.23 christos
1876 1.1.1.23 christos typedef struct acpi_madt_lpc_pic {
1877 1.1.1.23 christos ACPI_SUBTABLE_HEADER Header;
1878 1.1.1.23 christos UINT8 Version;
1879 1.1.1.23 christos UINT64 Address;
1880 1.1.1.23 christos UINT16 Size;
1881 1.1.1.23 christos UINT8 Cascade;
1882 1.1.1.23 christos } ACPI_MADT_LPC_PIC;
1883 1.1.1.23 christos
1884 1.1.1.23 christos /* Values for Version field above */
1885 1.1.1.23 christos
1886 1.1.1.23 christos enum AcpiMadtLpcPicVersion {
1887 1.1.1.23 christos ACPI_MADT_LPC_PIC_VERSION_NONE = 0,
1888 1.1.1.23 christos ACPI_MADT_LPC_PIC_VERSION_V1 = 1,
1889 1.1.1.23 christos ACPI_MADT_LPC_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
1890 1.1.1.23 christos };
1891 1.1.1.23 christos
1892 1.1.1.24 christos /* 24: RISC-V INTC */
1893 1.1.1.24 christos typedef struct acpi_madt_rintc {
1894 1.1.1.24 christos ACPI_SUBTABLE_HEADER Header;
1895 1.1.1.24 christos UINT8 Version;
1896 1.1.1.24 christos UINT8 Reserved;
1897 1.1.1.24 christos UINT32 Flags;
1898 1.1.1.24 christos UINT64 HartId;
1899 1.1.1.24 christos UINT32 Uid; /* ACPI processor UID */
1900 1.1.1.24 christos UINT32 ExtIntcId; /* External INTC Id */
1901 1.1.1.24 christos UINT64 ImsicAddr; /* IMSIC base address */
1902 1.1.1.24 christos UINT32 ImsicSize; /* IMSIC size */
1903 1.1.1.24 christos } ACPI_MADT_RINTC;
1904 1.1.1.24 christos
1905 1.1.1.24 christos /* Values for RISC-V INTC Version field above */
1906 1.1.1.24 christos
1907 1.1.1.24 christos enum AcpiMadtRintcVersion {
1908 1.1.1.24 christos ACPI_MADT_RINTC_VERSION_NONE = 0,
1909 1.1.1.24 christos ACPI_MADT_RINTC_VERSION_V1 = 1,
1910 1.1.1.24 christos ACPI_MADT_RINTC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
1911 1.1.1.24 christos };
1912 1.1.1.24 christos
1913 1.1.1.24 christos /* 25: RISC-V IMSIC */
1914 1.1.1.24 christos typedef struct acpi_madt_imsic {
1915 1.1.1.24 christos ACPI_SUBTABLE_HEADER Header;
1916 1.1.1.24 christos UINT8 Version;
1917 1.1.1.24 christos UINT8 Reserved;
1918 1.1.1.24 christos UINT32 Flags;
1919 1.1.1.24 christos UINT16 NumIds;
1920 1.1.1.24 christos UINT16 NumGuestIds;
1921 1.1.1.24 christos UINT8 GuestIndexBits;
1922 1.1.1.24 christos UINT8 HartIndexBits;
1923 1.1.1.24 christos UINT8 GroupIndexBits;
1924 1.1.1.24 christos UINT8 GroupIndexShift;
1925 1.1.1.24 christos } ACPI_MADT_IMSIC;
1926 1.1.1.24 christos
1927 1.1.1.24 christos /* 26: RISC-V APLIC */
1928 1.1.1.24 christos typedef struct acpi_madt_aplic {
1929 1.1.1.24 christos ACPI_SUBTABLE_HEADER Header;
1930 1.1.1.24 christos UINT8 Version;
1931 1.1.1.24 christos UINT8 Id;
1932 1.1.1.24 christos UINT32 Flags;
1933 1.1.1.24 christos UINT8 HwId[8];
1934 1.1.1.24 christos UINT16 NumIdcs;
1935 1.1.1.24 christos UINT16 NumSources;
1936 1.1.1.24 christos UINT32 GsiBase;
1937 1.1.1.24 christos UINT64 BaseAddr;
1938 1.1.1.24 christos UINT32 Size;
1939 1.1.1.24 christos } ACPI_MADT_APLIC;
1940 1.1.1.24 christos
1941 1.1.1.24 christos /* 27: RISC-V PLIC */
1942 1.1.1.24 christos typedef struct acpi_madt_plic {
1943 1.1.1.24 christos ACPI_SUBTABLE_HEADER Header;
1944 1.1.1.24 christos UINT8 Version;
1945 1.1.1.24 christos UINT8 Id;
1946 1.1.1.24 christos UINT8 HwId[8];
1947 1.1.1.24 christos UINT16 NumIrqs;
1948 1.1.1.24 christos UINT16 MaxPrio;
1949 1.1.1.24 christos UINT32 Flags;
1950 1.1.1.24 christos UINT32 Size;
1951 1.1.1.24 christos UINT64 BaseAddr;
1952 1.1.1.24 christos UINT32 GsiBase;
1953 1.1.1.24 christos } ACPI_MADT_PLIC;
1954 1.1.1.24 christos
1955 1.1.1.24 christos
1956 1.1.1.23 christos /* 80: OEM data */
1957 1.1.1.22 christos
1958 1.1.1.22 christos typedef struct acpi_madt_oem_data
1959 1.1.1.22 christos {
1960 1.1.1.24 christos ACPI_FLEX_ARRAY(UINT8, OemData);
1961 1.1.1.22 christos } ACPI_MADT_OEM_DATA;
1962 1.1.1.22 christos
1963 1.1.1.14 christos
1964 1.1.1.14 christos /*
1965 1.1.1.14 christos * Common flags fields for MADT subtables
1966 1.1.1.14 christos */
1967 1.1.1.14 christos
1968 1.1.1.14 christos /* MADT Local APIC flags */
1969 1.1.1.14 christos
1970 1.1.1.14 christos #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
1971 1.1.1.20 christos #define ACPI_MADT_ONLINE_CAPABLE (2) /* 01: System HW supports enabling processor at runtime */
1972 1.1.1.14 christos
1973 1.1.1.14 christos /* MADT MPS INTI flags (IntiFlags) */
1974 1.1.1.14 christos
1975 1.1.1.14 christos #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
1976 1.1.1.14 christos #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
1977 1.1.1.14 christos
1978 1.1.1.14 christos /* Values for MPS INTI flags */
1979 1.1.1.14 christos
1980 1.1.1.14 christos #define ACPI_MADT_POLARITY_CONFORMS 0
1981 1.1.1.14 christos #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
1982 1.1.1.14 christos #define ACPI_MADT_POLARITY_RESERVED 2
1983 1.1.1.14 christos #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
1984 1.1.1.14 christos
1985 1.1.1.14 christos #define ACPI_MADT_TRIGGER_CONFORMS (0)
1986 1.1.1.14 christos #define ACPI_MADT_TRIGGER_EDGE (1<<2)
1987 1.1.1.14 christos #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
1988 1.1.1.14 christos #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
1989 1.1.1.9 christos
1990 1.1.1.9 christos
1991 1.1.1.7 christos /*******************************************************************************
1992 1.1.1.7 christos *
1993 1.1.1.14 christos * MCFG - PCI Memory Mapped Configuration table and subtable
1994 1.1 jruoho * Version 1
1995 1.1 jruoho *
1996 1.1.1.14 christos * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
1997 1.1 jruoho *
1998 1.1 jruoho ******************************************************************************/
1999 1.1 jruoho
2000 1.1.1.14 christos typedef struct acpi_table_mcfg
2001 1.1 jruoho {
2002 1.1 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2003 1.1.1.14 christos UINT8 Reserved[8];
2004 1.1 jruoho
2005 1.1.1.14 christos } ACPI_TABLE_MCFG;
2006 1.1 jruoho
2007 1.1 jruoho
2008 1.1.1.14 christos /* Subtable */
2009 1.1 jruoho
2010 1.1.1.14 christos typedef struct acpi_mcfg_allocation
2011 1.1.1.14 christos {
2012 1.1.1.14 christos UINT64 Address; /* Base address, processor-relative */
2013 1.1.1.14 christos UINT16 PciSegment; /* PCI segment group number */
2014 1.1.1.14 christos UINT8 StartBusNumber; /* Starting PCI Bus number */
2015 1.1.1.14 christos UINT8 EndBusNumber; /* Final PCI Bus number */
2016 1.1.1.14 christos UINT32 Reserved;
2017 1.1 jruoho
2018 1.1.1.14 christos } ACPI_MCFG_ALLOCATION;
2019 1.1 jruoho
2020 1.1.1.14 christos
2021 1.1.1.14 christos /*******************************************************************************
2022 1.1.1.14 christos *
2023 1.1.1.14 christos * MCHI - Management Controller Host Interface Table
2024 1.1.1.14 christos * Version 1
2025 1.1.1.14 christos *
2026 1.1.1.14 christos * Conforms to "Management Component Transport Protocol (MCTP) Host
2027 1.1.1.14 christos * Interface Specification", Revision 1.0.0a, October 13, 2009
2028 1.1.1.14 christos *
2029 1.1.1.14 christos ******************************************************************************/
2030 1.1.1.14 christos
2031 1.1.1.14 christos typedef struct acpi_table_mchi
2032 1.1 jruoho {
2033 1.1.1.14 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2034 1.1.1.14 christos UINT8 InterfaceType;
2035 1.1.1.14 christos UINT8 Protocol;
2036 1.1.1.14 christos UINT64 ProtocolData;
2037 1.1.1.14 christos UINT8 InterruptType;
2038 1.1.1.14 christos UINT8 Gpe;
2039 1.1.1.14 christos UINT8 PciDeviceFlag;
2040 1.1.1.14 christos UINT32 GlobalInterrupt;
2041 1.1.1.14 christos ACPI_GENERIC_ADDRESS ControlRegister;
2042 1.1.1.14 christos UINT8 PciSegment;
2043 1.1.1.14 christos UINT8 PciBus;
2044 1.1.1.14 christos UINT8 PciDevice;
2045 1.1.1.14 christos UINT8 PciFunction;
2046 1.1 jruoho
2047 1.1.1.14 christos } ACPI_TABLE_MCHI;
2048 1.1 jruoho
2049 1.1.1.24 christos /*******************************************************************************
2050 1.1.1.24 christos *
2051 1.1.1.24 christos * MPAM - Memory System Resource Partitioning and Monitoring
2052 1.1.1.24 christos *
2053 1.1.1.24 christos * Conforms to "ACPI for Memory System Resource Partitioning and Monitoring 2.0"
2054 1.1.1.24 christos * Document number: ARM DEN 0065, December, 2022.
2055 1.1.1.24 christos *
2056 1.1.1.24 christos ******************************************************************************/
2057 1.1.1.24 christos
2058 1.1.1.24 christos /* MPAM RIS locator types. Table 11, Location types */
2059 1.1.1.24 christos enum AcpiMpamLocatorType {
2060 1.1.1.24 christos ACPI_MPAM_LOCATION_TYPE_PROCESSOR_CACHE = 0,
2061 1.1.1.24 christos ACPI_MPAM_LOCATION_TYPE_MEMORY = 1,
2062 1.1.1.24 christos ACPI_MPAM_LOCATION_TYPE_SMMU = 2,
2063 1.1.1.24 christos ACPI_MPAM_LOCATION_TYPE_MEMORY_CACHE = 3,
2064 1.1.1.24 christos ACPI_MPAM_LOCATION_TYPE_ACPI_DEVICE = 4,
2065 1.1.1.24 christos ACPI_MPAM_LOCATION_TYPE_INTERCONNECT = 5,
2066 1.1.1.24 christos ACPI_MPAM_LOCATION_TYPE_UNKNOWN = 0xFF
2067 1.1.1.24 christos };
2068 1.1.1.24 christos
2069 1.1.1.24 christos /* MPAM Functional dependency descriptor. Table 10 */
2070 1.1.1.24 christos typedef struct acpi_mpam_func_deps
2071 1.1.1.24 christos {
2072 1.1.1.24 christos UINT32 Producer;
2073 1.1.1.24 christos UINT32 Reserved;
2074 1.1.1.24 christos } ACPI_MPAM_FUNC_DEPS;
2075 1.1.1.24 christos
2076 1.1.1.24 christos /* MPAM Processor cache locator descriptor. Table 13 */
2077 1.1.1.24 christos typedef struct acpi_mpam_resource_cache_locator
2078 1.1.1.24 christos {
2079 1.1.1.24 christos UINT64 CacheReference;
2080 1.1.1.24 christos UINT32 Reserved;
2081 1.1.1.24 christos } ACPI_MPAM_RESOURCE_CACHE_LOCATOR;
2082 1.1.1.24 christos
2083 1.1.1.24 christos /* MPAM Memory locator descriptor. Table 14 */
2084 1.1.1.24 christos typedef struct acpi_mpam_resource_memory_locator
2085 1.1.1.24 christos {
2086 1.1.1.24 christos UINT64 ProximityDomain;
2087 1.1.1.24 christos UINT32 Reserved;
2088 1.1.1.24 christos } ACPI_MPAM_RESOURCE_MEMORY_LOCATOR;
2089 1.1.1.24 christos
2090 1.1.1.24 christos /* MPAM SMMU locator descriptor. Table 15 */
2091 1.1.1.24 christos typedef struct acpi_mpam_resource_smmu_locator
2092 1.1.1.24 christos {
2093 1.1.1.24 christos UINT64 SmmuInterface;
2094 1.1.1.24 christos UINT32 Reserved;
2095 1.1.1.24 christos } ACPI_MPAM_RESOURCE_SMMU_INTERFACE;
2096 1.1.1.24 christos
2097 1.1.1.24 christos /* MPAM Memory-side cache locator descriptor. Table 16 */
2098 1.1.1.24 christos typedef struct acpi_mpam_resource_memcache_locator
2099 1.1.1.24 christos {
2100 1.1.1.24 christos UINT8 Reserved[7];
2101 1.1.1.24 christos UINT8 Level;
2102 1.1.1.24 christos UINT32 Reference;
2103 1.1.1.24 christos } ACPI_MPAM_RESOURCE_MEMCACHE_INTERFACE;
2104 1.1.1.24 christos
2105 1.1.1.24 christos /* MPAM ACPI device locator descriptor. Table 17 */
2106 1.1.1.24 christos typedef struct acpi_mpam_resource_acpi_locator
2107 1.1.1.24 christos {
2108 1.1.1.24 christos UINT64 AcpiHwId;
2109 1.1.1.24 christos UINT32 AcpiUniqueId;
2110 1.1.1.24 christos } ACPI_MPAM_RESOURCE_ACPI_INTERFACE;
2111 1.1.1.24 christos
2112 1.1.1.24 christos /* MPAM Interconnect locator descriptor. Table 18 */
2113 1.1.1.24 christos typedef struct acpi_mpam_resource_interconnect_locator
2114 1.1.1.24 christos {
2115 1.1.1.24 christos UINT64 InterConnectDescTblOff;
2116 1.1.1.24 christos UINT32 Reserved;
2117 1.1.1.24 christos } ACPI_MPAM_RESOURCE_INTERCONNECT_INTERFACE;
2118 1.1.1.24 christos
2119 1.1.1.24 christos /* MPAM Locator structure. Table 12 */
2120 1.1.1.24 christos typedef struct acpi_mpam_resource_generic_locator
2121 1.1.1.24 christos {
2122 1.1.1.24 christos UINT64 Descriptor1;
2123 1.1.1.24 christos UINT32 Descriptor2;
2124 1.1.1.24 christos } ACPI_MPAM_RESOURCE_GENERIC_LOCATOR;
2125 1.1.1.24 christos
2126 1.1.1.24 christos typedef union acpi_mpam_resource_locator
2127 1.1.1.24 christos {
2128 1.1.1.24 christos ACPI_MPAM_RESOURCE_CACHE_LOCATOR CacheLocator;
2129 1.1.1.24 christos ACPI_MPAM_RESOURCE_MEMORY_LOCATOR MemoryLocator;
2130 1.1.1.24 christos ACPI_MPAM_RESOURCE_SMMU_INTERFACE SmmuLocator;
2131 1.1.1.24 christos ACPI_MPAM_RESOURCE_MEMCACHE_INTERFACE MemCacheLocator;
2132 1.1.1.24 christos ACPI_MPAM_RESOURCE_ACPI_INTERFACE AcpiLocator;
2133 1.1.1.24 christos ACPI_MPAM_RESOURCE_INTERCONNECT_INTERFACE InterconnectIfcLocator;
2134 1.1.1.24 christos ACPI_MPAM_RESOURCE_GENERIC_LOCATOR GenericLocator;
2135 1.1.1.24 christos } ACPI_MPAM_RESOURCE_LOCATOR;
2136 1.1.1.24 christos
2137 1.1.1.24 christos /* Memory System Component Resource Node Structure Table 9 */
2138 1.1.1.24 christos typedef struct acpi_mpam_resource_node
2139 1.1.1.24 christos {
2140 1.1.1.24 christos UINT32 Identifier;
2141 1.1.1.24 christos UINT8 RISIndex;
2142 1.1.1.24 christos UINT16 Reserved1;
2143 1.1.1.24 christos UINT8 LocatorType;
2144 1.1.1.24 christos ACPI_MPAM_RESOURCE_LOCATOR Locator;
2145 1.1.1.24 christos UINT32 NumFunctionalDeps;
2146 1.1.1.24 christos } ACPI_MPAM_RESOURCE_NODE;
2147 1.1.1.24 christos
2148 1.1.1.24 christos /* Memory System Component (MSC) Node Structure. Table 4 */
2149 1.1.1.24 christos typedef struct acpi_mpam_msc_node
2150 1.1.1.24 christos {
2151 1.1.1.24 christos UINT16 Length;
2152 1.1.1.24 christos UINT8 InterfaceType;
2153 1.1.1.24 christos UINT8 Reserved;
2154 1.1.1.24 christos UINT32 Identifier;
2155 1.1.1.24 christos UINT64 BaseAddress;
2156 1.1.1.24 christos UINT32 MMIOSize;
2157 1.1.1.24 christos UINT32 OverflowInterrupt;
2158 1.1.1.24 christos UINT32 OverflowInterruptFlags;
2159 1.1.1.24 christos UINT32 Reserved1;
2160 1.1.1.24 christos UINT32 OverflowInterruptAffinity;
2161 1.1.1.24 christos UINT32 ErrorInterrupt;
2162 1.1.1.24 christos UINT32 ErrorInterruptFlags;
2163 1.1.1.24 christos UINT32 Reserved2;
2164 1.1.1.24 christos UINT32 ErrorInterruptAffinity;
2165 1.1.1.24 christos UINT32 MaxNrdyUsec;
2166 1.1.1.24 christos UINT64 HardwareIdLinkedDevice;
2167 1.1.1.24 christos UINT32 InstanceIdLinkedDevice;
2168 1.1.1.25 christos UINT32 NumResourceNodes;
2169 1.1.1.24 christos } ACPI_MPAM_MSC_NODE;
2170 1.1.1.24 christos
2171 1.1.1.24 christos typedef struct acpi_table_mpam
2172 1.1.1.24 christos {
2173 1.1.1.24 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2174 1.1.1.24 christos } ACPI_TABLE_MPAM;
2175 1.1 jruoho
2176 1.1.1.14 christos /*******************************************************************************
2177 1.1.1.14 christos *
2178 1.1.1.14 christos * MPST - Memory Power State Table (ACPI 5.0)
2179 1.1.1.14 christos * Version 1
2180 1.1.1.14 christos *
2181 1.1.1.14 christos ******************************************************************************/
2182 1.1.1.14 christos
2183 1.1.1.14 christos #define ACPI_MPST_CHANNEL_INFO \
2184 1.1.1.14 christos UINT8 ChannelId; \
2185 1.1.1.14 christos UINT8 Reserved1[3]; \
2186 1.1.1.14 christos UINT16 PowerNodeCount; \
2187 1.1.1.14 christos UINT16 Reserved2;
2188 1.1.1.14 christos
2189 1.1.1.14 christos /* Main table */
2190 1.1.1.14 christos
2191 1.1.1.14 christos typedef struct acpi_table_mpst
2192 1.1 jruoho {
2193 1.1.1.14 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2194 1.1.1.14 christos ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
2195 1.1 jruoho
2196 1.1.1.14 christos } ACPI_TABLE_MPST;
2197 1.1 jruoho
2198 1.1 jruoho
2199 1.1.1.14 christos /* Memory Platform Communication Channel Info */
2200 1.1 jruoho
2201 1.1.1.14 christos typedef struct acpi_mpst_channel
2202 1.1.1.14 christos {
2203 1.1.1.14 christos ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
2204 1.1 jruoho
2205 1.1.1.14 christos } ACPI_MPST_CHANNEL;
2206 1.1 jruoho
2207 1.1 jruoho
2208 1.1.1.14 christos /* Memory Power Node Structure */
2209 1.1 jruoho
2210 1.1.1.14 christos typedef struct acpi_mpst_power_node
2211 1.1 jruoho {
2212 1.1.1.14 christos UINT8 Flags;
2213 1.1.1.14 christos UINT8 Reserved1;
2214 1.1.1.14 christos UINT16 NodeId;
2215 1.1.1.14 christos UINT32 Length;
2216 1.1.1.14 christos UINT64 RangeAddress;
2217 1.1.1.14 christos UINT64 RangeLength;
2218 1.1.1.14 christos UINT32 NumPowerStates;
2219 1.1.1.14 christos UINT32 NumPhysicalComponents;
2220 1.1 jruoho
2221 1.1.1.14 christos } ACPI_MPST_POWER_NODE;
2222 1.1 jruoho
2223 1.1.1.14 christos /* Values for Flags field above */
2224 1.1 jruoho
2225 1.1.1.14 christos #define ACPI_MPST_ENABLED 1
2226 1.1.1.14 christos #define ACPI_MPST_POWER_MANAGED 2
2227 1.1.1.14 christos #define ACPI_MPST_HOT_PLUG_CAPABLE 4
2228 1.1 jruoho
2229 1.1 jruoho
2230 1.1.1.14 christos /* Memory Power State Structure (follows POWER_NODE above) */
2231 1.1.1.14 christos
2232 1.1.1.14 christos typedef struct acpi_mpst_power_state
2233 1.1 jruoho {
2234 1.1.1.14 christos UINT8 PowerState;
2235 1.1.1.14 christos UINT8 InfoIndex;
2236 1.1 jruoho
2237 1.1.1.14 christos } ACPI_MPST_POWER_STATE;
2238 1.1 jruoho
2239 1.1 jruoho
2240 1.1.1.14 christos /* Physical Component ID Structure (follows POWER_STATE above) */
2241 1.1 jruoho
2242 1.1.1.14 christos typedef struct acpi_mpst_component
2243 1.1.1.14 christos {
2244 1.1.1.14 christos UINT16 ComponentId;
2245 1.1 jruoho
2246 1.1.1.14 christos } ACPI_MPST_COMPONENT;
2247 1.1.1.14 christos
2248 1.1.1.14 christos
2249 1.1.1.14 christos /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
2250 1.1.1.14 christos
2251 1.1.1.14 christos typedef struct acpi_mpst_data_hdr
2252 1.1 jruoho {
2253 1.1.1.14 christos UINT16 CharacteristicsCount;
2254 1.1.1.14 christos UINT16 Reserved;
2255 1.1 jruoho
2256 1.1.1.14 christos } ACPI_MPST_DATA_HDR;
2257 1.1 jruoho
2258 1.1.1.14 christos typedef struct acpi_mpst_power_data
2259 1.1.1.14 christos {
2260 1.1.1.14 christos UINT8 StructureId;
2261 1.1.1.14 christos UINT8 Flags;
2262 1.1.1.14 christos UINT16 Reserved1;
2263 1.1.1.14 christos UINT32 AveragePower;
2264 1.1.1.14 christos UINT32 PowerSaving;
2265 1.1.1.14 christos UINT64 ExitLatency;
2266 1.1.1.14 christos UINT64 Reserved2;
2267 1.1 jruoho
2268 1.1.1.14 christos } ACPI_MPST_POWER_DATA;
2269 1.1 jruoho
2270 1.1.1.14 christos /* Values for Flags field above */
2271 1.1 jruoho
2272 1.1.1.14 christos #define ACPI_MPST_PRESERVE 1
2273 1.1.1.14 christos #define ACPI_MPST_AUTOENTRY 2
2274 1.1.1.14 christos #define ACPI_MPST_AUTOEXIT 4
2275 1.1 jruoho
2276 1.1 jruoho
2277 1.1.1.14 christos /* Shared Memory Region (not part of an ACPI table) */
2278 1.1 jruoho
2279 1.1.1.14 christos typedef struct acpi_mpst_shared
2280 1.1 jruoho {
2281 1.1.1.14 christos UINT32 Signature;
2282 1.1.1.14 christos UINT16 PccCommand;
2283 1.1.1.14 christos UINT16 PccStatus;
2284 1.1.1.14 christos UINT32 CommandRegister;
2285 1.1.1.14 christos UINT32 StatusRegister;
2286 1.1.1.14 christos UINT32 PowerStateId;
2287 1.1.1.14 christos UINT32 PowerNodeId;
2288 1.1.1.14 christos UINT64 EnergyConsumed;
2289 1.1.1.14 christos UINT64 AveragePower;
2290 1.1 jruoho
2291 1.1.1.14 christos } ACPI_MPST_SHARED;
2292 1.1 jruoho
2293 1.1 jruoho
2294 1.1.1.14 christos /*******************************************************************************
2295 1.1.1.14 christos *
2296 1.1.1.14 christos * MSCT - Maximum System Characteristics Table (ACPI 4.0)
2297 1.1.1.14 christos * Version 1
2298 1.1.1.14 christos *
2299 1.1.1.14 christos ******************************************************************************/
2300 1.1.1.14 christos
2301 1.1.1.14 christos typedef struct acpi_table_msct
2302 1.1 jruoho {
2303 1.1.1.14 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2304 1.1.1.14 christos UINT32 ProximityOffset; /* Location of proximity info struct(s) */
2305 1.1.1.14 christos UINT32 MaxProximityDomains;/* Max number of proximity domains */
2306 1.1.1.14 christos UINT32 MaxClockDomains; /* Max number of clock domains */
2307 1.1.1.14 christos UINT64 MaxAddress; /* Max physical address in system */
2308 1.1 jruoho
2309 1.1.1.14 christos } ACPI_TABLE_MSCT;
2310 1.1 jruoho
2311 1.1 jruoho
2312 1.1.1.14 christos /* Subtable - Maximum Proximity Domain Information. Version 1 */
2313 1.1.1.14 christos
2314 1.1.1.14 christos typedef struct acpi_msct_proximity
2315 1.1 jruoho {
2316 1.1.1.14 christos UINT8 Revision;
2317 1.1.1.14 christos UINT8 Length;
2318 1.1.1.14 christos UINT32 RangeStart; /* Start of domain range */
2319 1.1.1.14 christos UINT32 RangeEnd; /* End of domain range */
2320 1.1.1.14 christos UINT32 ProcessorCapacity;
2321 1.1.1.14 christos UINT64 MemoryCapacity; /* In bytes */
2322 1.1 jruoho
2323 1.1.1.14 christos } ACPI_MSCT_PROXIMITY;
2324 1.1 jruoho
2325 1.1 jruoho
2326 1.1.1.14 christos /*******************************************************************************
2327 1.1.1.14 christos *
2328 1.1.1.27 christos * MRRM - Memory Range and Region Mapping (MRRM) table
2329 1.1.1.27 christos * Conforms to "Intel Resource Director Technology Architecture Specification"
2330 1.1.1.27 christos * Version 1.1, January 2025
2331 1.1.1.27 christos *
2332 1.1.1.27 christos ******************************************************************************/
2333 1.1.1.27 christos
2334 1.1.1.27 christos typedef struct acpi_table_mrrm
2335 1.1.1.27 christos {
2336 1.1.1.27 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2337 1.1.1.27 christos UINT8 MaxMemRegion; /* Max Memory Regions supported */
2338 1.1.1.27 christos UINT8 Flags; /* Region assignment type */
2339 1.1.1.27 christos UINT8 Reserved[26];
2340 1.1.1.27 christos UINT8 Memory_Range_Entry[];
2341 1.1.1.27 christos
2342 1.1.1.27 christos } ACPI_TABLE_MRRM;
2343 1.1.1.27 christos
2344 1.1.1.27 christos /* Flags */
2345 1.1.1.27 christos #define ACPI_MRRM_FLAGS_REGION_ASSIGNMENT_OS (1<<0)
2346 1.1.1.27 christos
2347 1.1.1.27 christos /*******************************************************************************
2348 1.1.1.27 christos *
2349 1.1.1.27 christos * Memory Range entry - Memory Range entry in MRRM table
2350 1.1.1.27 christos *
2351 1.1.1.27 christos ******************************************************************************/
2352 1.1.1.27 christos
2353 1.1.1.27 christos typedef struct acpi_mrrm_mem_range_entry
2354 1.1.1.27 christos {
2355 1.1.1.27 christos ACPI_SUBTBL_HDR_16 Header;
2356 1.1.1.27 christos UINT32 Reserved0; /* Reserved */
2357 1.1.1.27 christos UINT64 AddrBase; /* Base addr of the mem range */
2358 1.1.1.27 christos UINT64 AddrLen; /* Length of the mem range */
2359 1.1.1.27 christos UINT16 RegionIdFlags; /* Valid local or remote Region-ID */
2360 1.1.1.27 christos UINT8 LocalRegionId; /* Platform-assigned static local Region-ID */
2361 1.1.1.27 christos UINT8 RemoteRegionId; /* Platform-assigned static remote Region-ID */
2362 1.1.1.27 christos UINT32 Reserved1; /* Reserved */
2363 1.1.1.27 christos /* Region-ID Programming Registers[] */
2364 1.1.1.27 christos
2365 1.1.1.27 christos } ACPI_MRRM_MEM_RANGE_ENTRY;
2366 1.1.1.27 christos
2367 1.1.1.27 christos /* Values for RegionIdFlags above */
2368 1.1.1.27 christos #define ACPI_MRRM_VALID_REGION_ID_FLAGS_LOCAL (1<<0)
2369 1.1.1.27 christos #define ACPI_MRRM_VALID_REGION_ID_FLAGS_REMOTE (1<<1)
2370 1.1.1.27 christos
2371 1.1.1.27 christos
2372 1.1.1.27 christos /*******************************************************************************
2373 1.1.1.27 christos *
2374 1.1.1.14 christos * MSDM - Microsoft Data Management table
2375 1.1.1.14 christos *
2376 1.1.1.14 christos * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
2377 1.1.1.14 christos * November 29, 2011. Copyright 2011 Microsoft
2378 1.1.1.14 christos *
2379 1.1.1.14 christos ******************************************************************************/
2380 1.1 jruoho
2381 1.1.1.14 christos /* Basic MSDM table is only the common ACPI header */
2382 1.1 jruoho
2383 1.1.1.14 christos typedef struct acpi_table_msdm
2384 1.1 jruoho {
2385 1.1.1.14 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2386 1.1 jruoho
2387 1.1.1.14 christos } ACPI_TABLE_MSDM;
2388 1.1 jruoho
2389 1.1 jruoho
2390 1.1.1.14 christos /*******************************************************************************
2391 1.1.1.14 christos *
2392 1.1.1.14 christos * NFIT - NVDIMM Interface Table (ACPI 6.0+)
2393 1.1.1.14 christos * Version 1
2394 1.1.1.5 christos *
2395 1.1.1.5 christos ******************************************************************************/
2396 1.1.1.5 christos
2397 1.1.1.14 christos typedef struct acpi_table_nfit
2398 1.1.1.5 christos {
2399 1.1.1.5 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2400 1.1.1.14 christos UINT32 Reserved; /* Reserved, must be zero */
2401 1.1.1.5 christos
2402 1.1.1.14 christos } ACPI_TABLE_NFIT;
2403 1.1.1.5 christos
2404 1.1.1.14 christos /* Subtable header for NFIT */
2405 1.1.1.5 christos
2406 1.1.1.14 christos typedef struct acpi_nfit_header
2407 1.1.1.5 christos {
2408 1.1.1.14 christos UINT16 Type;
2409 1.1.1.14 christos UINT16 Length;
2410 1.1.1.5 christos
2411 1.1.1.14 christos } ACPI_NFIT_HEADER;
2412 1.1.1.5 christos
2413 1.1.1.5 christos
2414 1.1.1.14 christos /* Values for subtable type in ACPI_NFIT_HEADER */
2415 1.1.1.14 christos
2416 1.1.1.14 christos enum AcpiNfitType
2417 1.1.1.5 christos {
2418 1.1.1.14 christos ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
2419 1.1.1.14 christos ACPI_NFIT_TYPE_MEMORY_MAP = 1,
2420 1.1.1.14 christos ACPI_NFIT_TYPE_INTERLEAVE = 2,
2421 1.1.1.14 christos ACPI_NFIT_TYPE_SMBIOS = 3,
2422 1.1.1.14 christos ACPI_NFIT_TYPE_CONTROL_REGION = 4,
2423 1.1.1.14 christos ACPI_NFIT_TYPE_DATA_REGION = 5,
2424 1.1.1.14 christos ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
2425 1.1.1.14 christos ACPI_NFIT_TYPE_CAPABILITIES = 7,
2426 1.1.1.14 christos ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */
2427 1.1.1.5 christos };
2428 1.1.1.5 christos
2429 1.1.1.5 christos /*
2430 1.1.1.14 christos * NFIT Subtables
2431 1.1.1.5 christos */
2432 1.1.1.5 christos
2433 1.1.1.14 christos /* 0: System Physical Address Range Structure */
2434 1.1.1.5 christos
2435 1.1.1.14 christos typedef struct acpi_nfit_system_address
2436 1.1.1.5 christos {
2437 1.1.1.14 christos ACPI_NFIT_HEADER Header;
2438 1.1.1.14 christos UINT16 RangeIndex;
2439 1.1.1.14 christos UINT16 Flags;
2440 1.1.1.14 christos UINT32 Reserved; /* Reserved, must be zero */
2441 1.1.1.14 christos UINT32 ProximityDomain;
2442 1.1.1.14 christos UINT8 RangeGuid[16];
2443 1.1.1.14 christos UINT64 Address;
2444 1.1.1.14 christos UINT64 Length;
2445 1.1.1.14 christos UINT64 MemoryMapping;
2446 1.1.1.18 christos UINT64 LocationCookie; /* ACPI 6.4 */
2447 1.1.1.5 christos
2448 1.1.1.14 christos } ACPI_NFIT_SYSTEM_ADDRESS;
2449 1.1.1.5 christos
2450 1.1.1.14 christos /* Flags */
2451 1.1.1.5 christos
2452 1.1.1.14 christos #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
2453 1.1.1.14 christos #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
2454 1.1.1.18 christos #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2) /* 02: SPA location cookie valid (ACPI 6.4) */
2455 1.1 jruoho
2456 1.1.1.14 christos /* Range Type GUIDs appear in the include/acuuid.h file */
2457 1.1.1.14 christos
2458 1.1.1.14 christos
2459 1.1.1.14 christos /* 1: Memory Device to System Address Range Map Structure */
2460 1.1.1.14 christos
2461 1.1.1.14 christos typedef struct acpi_nfit_memory_map
2462 1.1 jruoho {
2463 1.1.1.14 christos ACPI_NFIT_HEADER Header;
2464 1.1.1.14 christos UINT32 DeviceHandle;
2465 1.1.1.14 christos UINT16 PhysicalId;
2466 1.1.1.14 christos UINT16 RegionId;
2467 1.1.1.14 christos UINT16 RangeIndex;
2468 1.1.1.14 christos UINT16 RegionIndex;
2469 1.1.1.14 christos UINT64 RegionSize;
2470 1.1.1.14 christos UINT64 RegionOffset;
2471 1.1.1.14 christos UINT64 Address;
2472 1.1.1.14 christos UINT16 InterleaveIndex;
2473 1.1.1.14 christos UINT16 InterleaveWays;
2474 1.1.1.14 christos UINT16 Flags;
2475 1.1.1.14 christos UINT16 Reserved; /* Reserved, must be zero */
2476 1.1 jruoho
2477 1.1.1.14 christos } ACPI_NFIT_MEMORY_MAP;
2478 1.1 jruoho
2479 1.1.1.14 christos /* Flags */
2480 1.1 jruoho
2481 1.1.1.14 christos #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
2482 1.1.1.14 christos #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
2483 1.1.1.14 christos #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
2484 1.1.1.14 christos #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
2485 1.1.1.14 christos #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
2486 1.1.1.14 christos #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
2487 1.1.1.14 christos #define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
2488 1.1 jruoho
2489 1.1.1.14 christos
2490 1.1.1.14 christos /* 2: Interleave Structure */
2491 1.1.1.14 christos
2492 1.1.1.14 christos typedef struct acpi_nfit_interleave
2493 1.1 jruoho {
2494 1.1.1.14 christos ACPI_NFIT_HEADER Header;
2495 1.1.1.14 christos UINT16 InterleaveIndex;
2496 1.1.1.14 christos UINT16 Reserved; /* Reserved, must be zero */
2497 1.1.1.14 christos UINT32 LineCount;
2498 1.1.1.14 christos UINT32 LineSize;
2499 1.1.1.24 christos UINT32 LineOffset[]; /* Variable length */
2500 1.1 jruoho
2501 1.1.1.14 christos } ACPI_NFIT_INTERLEAVE;
2502 1.1.1.14 christos
2503 1.1.1.14 christos
2504 1.1.1.14 christos /* 3: SMBIOS Management Information Structure */
2505 1.1.1.14 christos
2506 1.1.1.14 christos typedef struct acpi_nfit_smbios
2507 1.1.1.14 christos {
2508 1.1.1.14 christos ACPI_NFIT_HEADER Header;
2509 1.1.1.14 christos UINT32 Reserved; /* Reserved, must be zero */
2510 1.1.1.24 christos UINT8 Data[]; /* Variable length */
2511 1.1.1.14 christos
2512 1.1.1.14 christos } ACPI_NFIT_SMBIOS;
2513 1.1.1.14 christos
2514 1.1.1.14 christos
2515 1.1.1.14 christos /* 4: NVDIMM Control Region Structure */
2516 1.1.1.14 christos
2517 1.1.1.14 christos typedef struct acpi_nfit_control_region
2518 1.1.1.14 christos {
2519 1.1.1.14 christos ACPI_NFIT_HEADER Header;
2520 1.1.1.14 christos UINT16 RegionIndex;
2521 1.1.1.14 christos UINT16 VendorId;
2522 1.1.1.14 christos UINT16 DeviceId;
2523 1.1.1.14 christos UINT16 RevisionId;
2524 1.1.1.14 christos UINT16 SubsystemVendorId;
2525 1.1.1.14 christos UINT16 SubsystemDeviceId;
2526 1.1.1.14 christos UINT16 SubsystemRevisionId;
2527 1.1.1.14 christos UINT8 ValidFields;
2528 1.1.1.14 christos UINT8 ManufacturingLocation;
2529 1.1.1.14 christos UINT16 ManufacturingDate;
2530 1.1.1.14 christos UINT8 Reserved[2]; /* Reserved, must be zero */
2531 1.1.1.14 christos UINT32 SerialNumber;
2532 1.1.1.14 christos UINT16 Code;
2533 1.1.1.14 christos UINT16 Windows;
2534 1.1.1.14 christos UINT64 WindowSize;
2535 1.1.1.14 christos UINT64 CommandOffset;
2536 1.1.1.14 christos UINT64 CommandSize;
2537 1.1.1.14 christos UINT64 StatusOffset;
2538 1.1.1.14 christos UINT64 StatusSize;
2539 1.1.1.14 christos UINT16 Flags;
2540 1.1.1.14 christos UINT8 Reserved1[6]; /* Reserved, must be zero */
2541 1.1.1.14 christos
2542 1.1.1.14 christos } ACPI_NFIT_CONTROL_REGION;
2543 1.1.1.14 christos
2544 1.1.1.14 christos /* Flags */
2545 1.1.1.14 christos
2546 1.1.1.14 christos #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
2547 1.1.1.14 christos
2548 1.1.1.14 christos /* ValidFields bits */
2549 1.1.1.14 christos
2550 1.1.1.14 christos #define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
2551 1.1.1.14 christos
2552 1.1.1.14 christos
2553 1.1.1.14 christos /* 5: NVDIMM Block Data Window Region Structure */
2554 1.1.1.14 christos
2555 1.1.1.14 christos typedef struct acpi_nfit_data_region
2556 1.1.1.14 christos {
2557 1.1.1.14 christos ACPI_NFIT_HEADER Header;
2558 1.1.1.14 christos UINT16 RegionIndex;
2559 1.1.1.14 christos UINT16 Windows;
2560 1.1.1.14 christos UINT64 Offset;
2561 1.1.1.14 christos UINT64 Size;
2562 1.1.1.14 christos UINT64 Capacity;
2563 1.1.1.14 christos UINT64 StartAddress;
2564 1.1.1.14 christos
2565 1.1.1.14 christos } ACPI_NFIT_DATA_REGION;
2566 1.1.1.14 christos
2567 1.1.1.14 christos
2568 1.1.1.14 christos /* 6: Flush Hint Address Structure */
2569 1.1.1.14 christos
2570 1.1.1.14 christos typedef struct acpi_nfit_flush_address
2571 1.1.1.14 christos {
2572 1.1.1.14 christos ACPI_NFIT_HEADER Header;
2573 1.1.1.14 christos UINT32 DeviceHandle;
2574 1.1.1.14 christos UINT16 HintCount;
2575 1.1.1.14 christos UINT8 Reserved[6]; /* Reserved, must be zero */
2576 1.1.1.24 christos UINT64 HintAddress[]; /* Variable length */
2577 1.1.1.14 christos
2578 1.1.1.14 christos } ACPI_NFIT_FLUSH_ADDRESS;
2579 1.1.1.14 christos
2580 1.1.1.14 christos
2581 1.1.1.14 christos /* 7: Platform Capabilities Structure */
2582 1.1.1.14 christos
2583 1.1.1.14 christos typedef struct acpi_nfit_capabilities
2584 1.1.1.14 christos {
2585 1.1.1.14 christos ACPI_NFIT_HEADER Header;
2586 1.1.1.14 christos UINT8 HighestCapability;
2587 1.1.1.14 christos UINT8 Reserved[3]; /* Reserved, must be zero */
2588 1.1.1.14 christos UINT32 Capabilities;
2589 1.1.1.14 christos UINT32 Reserved2;
2590 1.1.1.14 christos
2591 1.1.1.14 christos } ACPI_NFIT_CAPABILITIES;
2592 1.1.1.14 christos
2593 1.1.1.14 christos /* Capabilities Flags */
2594 1.1.1.14 christos
2595 1.1.1.14 christos #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM capable */
2596 1.1.1.14 christos #define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to NVDIMM capable */
2597 1.1.1.14 christos #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring capable */
2598 1.1.1.14 christos
2599 1.1.1.14 christos
2600 1.1.1.14 christos /*
2601 1.1.1.14 christos * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
2602 1.1.1.14 christos */
2603 1.1.1.14 christos typedef struct nfit_device_handle
2604 1.1.1.14 christos {
2605 1.1.1.14 christos UINT32 Handle;
2606 1.1.1.14 christos
2607 1.1.1.14 christos } NFIT_DEVICE_HANDLE;
2608 1.1.1.14 christos
2609 1.1.1.14 christos /* Device handle construction and extraction macros */
2610 1.1.1.14 christos
2611 1.1.1.14 christos #define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F
2612 1.1.1.14 christos #define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0
2613 1.1.1.14 christos #define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00
2614 1.1.1.14 christos #define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000
2615 1.1.1.14 christos #define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000
2616 1.1.1.14 christos
2617 1.1.1.14 christos #define ACPI_NFIT_DIMM_NUMBER_OFFSET 0
2618 1.1.1.14 christos #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4
2619 1.1.1.14 christos #define ACPI_NFIT_MEMORY_ID_OFFSET 8
2620 1.1.1.14 christos #define ACPI_NFIT_SOCKET_ID_OFFSET 12
2621 1.1.1.14 christos #define ACPI_NFIT_NODE_ID_OFFSET 16
2622 1.1.1.14 christos
2623 1.1.1.14 christos /* Macro to construct a NFIT/NVDIMM device handle */
2624 1.1.1.14 christos
2625 1.1.1.14 christos #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
2626 1.1.1.14 christos ((dimm) | \
2627 1.1.1.14 christos ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \
2628 1.1.1.14 christos ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \
2629 1.1.1.14 christos ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \
2630 1.1.1.14 christos ((node) << ACPI_NFIT_NODE_ID_OFFSET))
2631 1.1.1.14 christos
2632 1.1.1.14 christos /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
2633 1.1.1.14 christos
2634 1.1.1.14 christos #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
2635 1.1.1.14 christos ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
2636 1.1.1.14 christos
2637 1.1.1.14 christos #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
2638 1.1.1.14 christos (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
2639 1.1.1.14 christos
2640 1.1.1.14 christos #define ACPI_NFIT_GET_MEMORY_ID(handle) \
2641 1.1.1.14 christos (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET)
2642 1.1.1.14 christos
2643 1.1.1.14 christos #define ACPI_NFIT_GET_SOCKET_ID(handle) \
2644 1.1.1.14 christos (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET)
2645 1.1.1.14 christos
2646 1.1.1.14 christos #define ACPI_NFIT_GET_NODE_ID(handle) \
2647 1.1.1.14 christos (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET)
2648 1.1 jruoho
2649 1.1 jruoho
2650 1.1 jruoho /*******************************************************************************
2651 1.1 jruoho *
2652 1.1.1.25 christos * NHLT - Non HDAudio Link Table
2653 1.1.1.25 christos * Version 1
2654 1.1.1.20 christos *
2655 1.1.1.20 christos ******************************************************************************/
2656 1.1.1.20 christos
2657 1.1.1.20 christos typedef struct acpi_table_nhlt
2658 1.1.1.20 christos {
2659 1.1.1.25 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2660 1.1.1.25 christos UINT8 EndpointsCount;
2661 1.1.1.25 christos /*
2662 1.1.1.25 christos * ACPI_NHLT_ENDPOINT Endpoints[];
2663 1.1.1.25 christos * ACPI_NHLT_CONFIG OEDConfig;
2664 1.1.1.25 christos */
2665 1.1.1.20 christos
2666 1.1.1.20 christos } ACPI_TABLE_NHLT;
2667 1.1.1.20 christos
2668 1.1.1.20 christos typedef struct acpi_nhlt_endpoint
2669 1.1.1.20 christos {
2670 1.1.1.25 christos UINT32 Length;
2671 1.1.1.25 christos UINT8 LinkType;
2672 1.1.1.25 christos UINT8 InstanceId;
2673 1.1.1.25 christos UINT16 VendorId;
2674 1.1.1.25 christos UINT16 DeviceId;
2675 1.1.1.25 christos UINT16 RevisionId;
2676 1.1.1.25 christos UINT32 SubsystemId;
2677 1.1.1.25 christos UINT8 DeviceType;
2678 1.1.1.25 christos UINT8 Direction;
2679 1.1.1.25 christos UINT8 VirtualBusId;
2680 1.1.1.25 christos /*
2681 1.1.1.25 christos * ACPI_NHLT_CONFIG DeviceConfig;
2682 1.1.1.25 christos * ACPI_NHLT_FORMATS_CONFIG FormatsConfig;
2683 1.1.1.25 christos * ACPI_NHLT_DEVICES_INFO DevicesInfo;
2684 1.1.1.25 christos */
2685 1.1.1.20 christos
2686 1.1.1.20 christos } ACPI_NHLT_ENDPOINT;
2687 1.1.1.20 christos
2688 1.1.1.25 christos /* Values for LinkType field above */
2689 1.1.1.20 christos
2690 1.1.1.25 christos #define ACPI_NHLT_LINKTYPE_HDA 0
2691 1.1.1.25 christos #define ACPI_NHLT_LINKTYPE_DSP 1
2692 1.1.1.25 christos #define ACPI_NHLT_LINKTYPE_PDM 2
2693 1.1.1.25 christos #define ACPI_NHLT_LINKTYPE_SSP 3
2694 1.1.1.25 christos #define ACPI_NHLT_LINKTYPE_SLIMBUS 4
2695 1.1.1.25 christos #define ACPI_NHLT_LINKTYPE_SDW 5
2696 1.1.1.25 christos #define ACPI_NHLT_LINKTYPE_UAOL 6
2697 1.1.1.20 christos
2698 1.1.1.20 christos /* Values for DeviceId field above */
2699 1.1.1.20 christos
2700 1.1.1.25 christos #define ACPI_NHLT_DEVICEID_DMIC 0xAE20
2701 1.1.1.25 christos #define ACPI_NHLT_DEVICEID_BT 0xAE30
2702 1.1.1.25 christos #define ACPI_NHLT_DEVICEID_I2S 0xAE34
2703 1.1.1.20 christos
2704 1.1.1.20 christos /* Values for DeviceType field above */
2705 1.1.1.20 christos
2706 1.1.1.25 christos /* Device types unique to endpoint of LinkType=PDM */
2707 1.1.1.25 christos #define ACPI_NHLT_DEVICETYPE_PDM 0
2708 1.1.1.25 christos #define ACPI_NHLT_DEVICETYPE_PDM_SKL 1
2709 1.1.1.25 christos /* Device types unique to endpoint of LinkType=SSP */
2710 1.1.1.25 christos #define ACPI_NHLT_DEVICETYPE_BT 0
2711 1.1.1.25 christos #define ACPI_NHLT_DEVICETYPE_FM 1
2712 1.1.1.25 christos #define ACPI_NHLT_DEVICETYPE_MODEM 2
2713 1.1.1.25 christos #define ACPI_NHLT_DEVICETYPE_CODEC 4
2714 1.1.1.20 christos
2715 1.1.1.20 christos /* Values for Direction field above */
2716 1.1.1.20 christos
2717 1.1.1.25 christos #define ACPI_NHLT_DIR_RENDER 0
2718 1.1.1.25 christos #define ACPI_NHLT_DIR_CAPTURE 1
2719 1.1.1.20 christos
2720 1.1.1.25 christos typedef struct acpi_nhlt_config
2721 1.1.1.20 christos {
2722 1.1.1.25 christos UINT32 CapabilitiesSize;
2723 1.1.1.25 christos UINT8 Capabilities[1];
2724 1.1.1.20 christos
2725 1.1.1.25 christos } ACPI_NHLT_CONFIG;
2726 1.1.1.20 christos
2727 1.1.1.25 christos typedef struct acpi_nhlt_gendevice_config
2728 1.1.1.20 christos {
2729 1.1.1.25 christos UINT8 VirtualSlot;
2730 1.1.1.25 christos UINT8 ConfigType;
2731 1.1.1.20 christos
2732 1.1.1.25 christos } ACPI_NHLT_GENDEVICE_CONFIG;
2733 1.1.1.20 christos
2734 1.1.1.25 christos /* Values for ConfigType field above */
2735 1.1.1.20 christos
2736 1.1.1.25 christos #define ACPI_NHLT_CONFIGTYPE_GENERIC 0
2737 1.1.1.25 christos #define ACPI_NHLT_CONFIGTYPE_MICARRAY 1
2738 1.1.1.20 christos
2739 1.1.1.25 christos typedef struct acpi_nhlt_micdevice_config
2740 1.1.1.20 christos {
2741 1.1.1.25 christos UINT8 VirtualSlot;
2742 1.1.1.25 christos UINT8 ConfigType;
2743 1.1.1.25 christos UINT8 ArrayType;
2744 1.1.1.20 christos
2745 1.1.1.25 christos } ACPI_NHLT_MICDEVICE_CONFIG;
2746 1.1.1.20 christos
2747 1.1.1.25 christos /* Values for ArrayType field above */
2748 1.1.1.21 christos
2749 1.1.1.25 christos #define ACPI_NHLT_ARRAYTYPE_LINEAR2_SMALL 0xA
2750 1.1.1.25 christos #define ACPI_NHLT_ARRAYTYPE_LINEAR2_BIG 0xB
2751 1.1.1.25 christos #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO1 0xC
2752 1.1.1.25 christos #define ACPI_NHLT_ARRAYTYPE_PLANAR4_LSHAPED 0xD
2753 1.1.1.25 christos #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO2 0xE
2754 1.1.1.25 christos #define ACPI_NHLT_ARRAYTYPE_VENDOR 0xF
2755 1.1.1.20 christos
2756 1.1.1.20 christos typedef struct acpi_nhlt_vendor_mic_config
2757 1.1.1.20 christos {
2758 1.1.1.25 christos UINT8 Type;
2759 1.1.1.25 christos UINT8 Panel;
2760 1.1.1.25 christos UINT16 SpeakerPositionDistance; /* mm */
2761 1.1.1.25 christos UINT16 HorizontalOffset; /* mm */
2762 1.1.1.25 christos UINT16 VerticalOffset; /* mm */
2763 1.1.1.25 christos UINT8 FrequencyLowBand; /* 5*Hz */
2764 1.1.1.25 christos UINT8 FrequencyHighBand; /* 500*Hz */
2765 1.1.1.25 christos UINT16 DirectionAngle; /* -180 - +180 */
2766 1.1.1.25 christos UINT16 ElevationAngle; /* -180 - +180 */
2767 1.1.1.25 christos UINT16 WorkVerticalAngleBegin; /* -180 - +180 with 2 deg step */
2768 1.1.1.25 christos UINT16 WorkVerticalAngleEnd; /* -180 - +180 with 2 deg step */
2769 1.1.1.25 christos UINT16 WorkHorizontalAngleBegin; /* -180 - +180 with 2 deg step */
2770 1.1.1.25 christos UINT16 WorkHorizontalAngleEnd; /* -180 - +180 with 2 deg step */
2771 1.1.1.20 christos
2772 1.1.1.20 christos } ACPI_NHLT_VENDOR_MIC_CONFIG;
2773 1.1.1.20 christos
2774 1.1.1.20 christos /* Values for Type field above */
2775 1.1.1.20 christos
2776 1.1.1.25 christos #define ACPI_NHLT_MICTYPE_OMNIDIRECTIONAL 0
2777 1.1.1.25 christos #define ACPI_NHLT_MICTYPE_SUBCARDIOID 1
2778 1.1.1.25 christos #define ACPI_NHLT_MICTYPE_CARDIOID 2
2779 1.1.1.25 christos #define ACPI_NHLT_MICTYPE_SUPERCARDIOID 3
2780 1.1.1.25 christos #define ACPI_NHLT_MICTYPE_HYPERCARDIOID 4
2781 1.1.1.25 christos #define ACPI_NHLT_MICTYPE_8SHAPED 5
2782 1.1.1.25 christos #define ACPI_NHLT_MICTYPE_RESERVED 6
2783 1.1.1.25 christos #define ACPI_NHLT_MICTYPE_VENDORDEFINED 7
2784 1.1.1.20 christos
2785 1.1.1.20 christos /* Values for Panel field above */
2786 1.1.1.20 christos
2787 1.1.1.25 christos #define ACPI_NHLT_MICLOCATION_TOP 0
2788 1.1.1.25 christos #define ACPI_NHLT_MICLOCATION_BOTTOM 1
2789 1.1.1.25 christos #define ACPI_NHLT_MICLOCATION_LEFT 2
2790 1.1.1.25 christos #define ACPI_NHLT_MICLOCATION_RIGHT 3
2791 1.1.1.25 christos #define ACPI_NHLT_MICLOCATION_FRONT 4
2792 1.1.1.25 christos #define ACPI_NHLT_MICLOCATION_REAR 5
2793 1.1.1.25 christos
2794 1.1.1.25 christos typedef struct acpi_nhlt_vendor_micdevice_config
2795 1.1.1.25 christos {
2796 1.1.1.25 christos UINT8 VirtualSlot;
2797 1.1.1.25 christos UINT8 ConfigType;
2798 1.1.1.25 christos UINT8 ArrayType;
2799 1.1.1.25 christos UINT8 MicsCount;
2800 1.1.1.25 christos ACPI_NHLT_VENDOR_MIC_CONFIG Mics[];
2801 1.1.1.25 christos
2802 1.1.1.25 christos } ACPI_NHLT_VENDOR_MICDEVICE_CONFIG;
2803 1.1.1.25 christos
2804 1.1.1.25 christos typedef union acpi_nhlt_device_config
2805 1.1.1.25 christos {
2806 1.1.1.25 christos UINT8 VirtualSlot;
2807 1.1.1.25 christos ACPI_NHLT_GENDEVICE_CONFIG Gen;
2808 1.1.1.25 christos ACPI_NHLT_MICDEVICE_CONFIG Mic;
2809 1.1.1.25 christos ACPI_NHLT_VENDOR_MICDEVICE_CONFIG VendorMic;
2810 1.1.1.25 christos
2811 1.1.1.25 christos } ACPI_NHLT_DEVICE_CONFIG;
2812 1.1.1.25 christos
2813 1.1.1.25 christos /* Inherited from Microsoft's WAVEFORMATEXTENSIBLE. */
2814 1.1.1.25 christos typedef struct acpi_nhlt_wave_formatext
2815 1.1.1.25 christos {
2816 1.1.1.25 christos UINT16 FormatTag;
2817 1.1.1.25 christos UINT16 ChannelCount;
2818 1.1.1.25 christos UINT32 SamplesPerSec;
2819 1.1.1.25 christos UINT32 AvgBytesPerSec;
2820 1.1.1.25 christos UINT16 BlockAlign;
2821 1.1.1.25 christos UINT16 BitsPerSample;
2822 1.1.1.25 christos UINT16 ExtraFormatSize;
2823 1.1.1.25 christos UINT16 ValidBitsPerSample;
2824 1.1.1.25 christos UINT32 ChannelMask;
2825 1.1.1.25 christos UINT8 Subformat[16];
2826 1.1.1.20 christos
2827 1.1.1.25 christos } ACPI_NHLT_WAVE_FORMATEXT;
2828 1.1.1.20 christos
2829 1.1.1.25 christos typedef struct acpi_nhlt_format_config
2830 1.1.1.20 christos {
2831 1.1.1.25 christos ACPI_NHLT_WAVE_FORMATEXT Format;
2832 1.1.1.25 christos ACPI_NHLT_CONFIG Config;
2833 1.1.1.20 christos
2834 1.1.1.25 christos } ACPI_NHLT_FORMAT_CONFIG;
2835 1.1.1.21 christos
2836 1.1.1.25 christos typedef struct acpi_nhlt_formats_config
2837 1.1.1.20 christos {
2838 1.1.1.25 christos UINT8 FormatsCount;
2839 1.1.1.25 christos ACPI_NHLT_FORMAT_CONFIG Formats[];
2840 1.1.1.20 christos
2841 1.1.1.25 christos } ACPI_NHLT_FORMATS_CONFIG;
2842 1.1.1.20 christos
2843 1.1.1.25 christos typedef struct acpi_nhlt_device_info
2844 1.1.1.20 christos {
2845 1.1.1.25 christos UINT8 Id[16];
2846 1.1.1.25 christos UINT8 InstanceId;
2847 1.1.1.25 christos UINT8 PortId;
2848 1.1.1.20 christos
2849 1.1.1.25 christos } ACPI_NHLT_DEVICE_INFO;
2850 1.1.1.20 christos
2851 1.1.1.25 christos typedef struct acpi_nhlt_devices_info
2852 1.1.1.20 christos {
2853 1.1.1.25 christos UINT8 DevicesCount;
2854 1.1.1.25 christos ACPI_NHLT_DEVICE_INFO Devices[];
2855 1.1.1.20 christos
2856 1.1.1.25 christos } ACPI_NHLT_DEVICES_INFO;
2857 1.1.1.20 christos
2858 1.1.1.20 christos
2859 1.1.1.20 christos /*******************************************************************************
2860 1.1.1.20 christos *
2861 1.1.1.14 christos * PCCT - Platform Communications Channel Table (ACPI 5.0)
2862 1.1.1.14 christos * Version 2 (ACPI 6.2)
2863 1.1 jruoho *
2864 1.1 jruoho ******************************************************************************/
2865 1.1 jruoho
2866 1.1.1.14 christos typedef struct acpi_table_pcct
2867 1.1 jruoho {
2868 1.1 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
2869 1.1.1.14 christos UINT32 Flags;
2870 1.1.1.14 christos UINT64 Reserved;
2871 1.1.1.14 christos
2872 1.1.1.14 christos } ACPI_TABLE_PCCT;
2873 1.1.1.14 christos
2874 1.1.1.14 christos /* Values for Flags field above */
2875 1.1.1.14 christos
2876 1.1.1.14 christos #define ACPI_PCCT_DOORBELL 1
2877 1.1.1.14 christos
2878 1.1.1.14 christos /* Values for subtable type in ACPI_SUBTABLE_HEADER */
2879 1.1.1.14 christos
2880 1.1.1.14 christos enum AcpiPcctType
2881 1.1.1.14 christos {
2882 1.1.1.14 christos ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
2883 1.1.1.14 christos ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
2884 1.1.1.14 christos ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */
2885 1.1.1.14 christos ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */
2886 1.1.1.14 christos ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */
2887 1.1.1.18 christos ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE = 5, /* ACPI 6.4 */
2888 1.1.1.18 christos ACPI_PCCT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
2889 1.1.1.14 christos };
2890 1.1 jruoho
2891 1.1.1.14 christos /*
2892 1.1.1.14 christos * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
2893 1.1.1.14 christos */
2894 1.1 jruoho
2895 1.1.1.14 christos /* 0: Generic Communications Subspace */
2896 1.1 jruoho
2897 1.1.1.14 christos typedef struct acpi_pcct_subspace
2898 1.1.1.14 christos {
2899 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
2900 1.1.1.14 christos UINT8 Reserved[6];
2901 1.1.1.14 christos UINT64 BaseAddress;
2902 1.1.1.14 christos UINT64 Length;
2903 1.1.1.14 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
2904 1.1.1.14 christos UINT64 PreserveMask;
2905 1.1.1.14 christos UINT64 WriteMask;
2906 1.1.1.14 christos UINT32 Latency;
2907 1.1.1.14 christos UINT32 MaxAccessRate;
2908 1.1.1.14 christos UINT16 MinTurnaroundTime;
2909 1.1.1.6 christos
2910 1.1.1.14 christos } ACPI_PCCT_SUBSPACE;
2911 1.1.1.6 christos
2912 1.1.1.14 christos
2913 1.1.1.14 christos /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
2914 1.1.1.14 christos
2915 1.1.1.14 christos typedef struct acpi_pcct_hw_reduced
2916 1.1.1.6 christos {
2917 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
2918 1.1.1.14 christos UINT32 PlatformInterrupt;
2919 1.1.1.14 christos UINT8 Flags;
2920 1.1.1.14 christos UINT8 Reserved;
2921 1.1.1.14 christos UINT64 BaseAddress;
2922 1.1.1.14 christos UINT64 Length;
2923 1.1.1.14 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
2924 1.1.1.14 christos UINT64 PreserveMask;
2925 1.1.1.14 christos UINT64 WriteMask;
2926 1.1.1.14 christos UINT32 Latency;
2927 1.1.1.14 christos UINT32 MaxAccessRate;
2928 1.1.1.14 christos UINT16 MinTurnaroundTime;
2929 1.1.1.6 christos
2930 1.1.1.14 christos } ACPI_PCCT_HW_REDUCED;
2931 1.1.1.6 christos
2932 1.1.1.6 christos
2933 1.1.1.14 christos /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
2934 1.1.1.4 christos
2935 1.1.1.14 christos typedef struct acpi_pcct_hw_reduced_type2
2936 1.1.1.4 christos {
2937 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
2938 1.1.1.14 christos UINT32 PlatformInterrupt;
2939 1.1.1.14 christos UINT8 Flags;
2940 1.1.1.14 christos UINT8 Reserved;
2941 1.1.1.14 christos UINT64 BaseAddress;
2942 1.1.1.14 christos UINT64 Length;
2943 1.1.1.14 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
2944 1.1.1.14 christos UINT64 PreserveMask;
2945 1.1.1.14 christos UINT64 WriteMask;
2946 1.1.1.14 christos UINT32 Latency;
2947 1.1.1.14 christos UINT32 MaxAccessRate;
2948 1.1.1.14 christos UINT16 MinTurnaroundTime;
2949 1.1.1.14 christos ACPI_GENERIC_ADDRESS PlatformAckRegister;
2950 1.1.1.14 christos UINT64 AckPreserveMask;
2951 1.1.1.14 christos UINT64 AckWriteMask;
2952 1.1.1.4 christos
2953 1.1.1.14 christos } ACPI_PCCT_HW_REDUCED_TYPE2;
2954 1.1.1.4 christos
2955 1.1.1.4 christos
2956 1.1.1.14 christos /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
2957 1.1.1.14 christos
2958 1.1.1.14 christos typedef struct acpi_pcct_ext_pcc_master
2959 1.1.1.4 christos {
2960 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
2961 1.1.1.14 christos UINT32 PlatformInterrupt;
2962 1.1.1.14 christos UINT8 Flags;
2963 1.1.1.14 christos UINT8 Reserved1;
2964 1.1.1.14 christos UINT64 BaseAddress;
2965 1.1.1.14 christos UINT32 Length;
2966 1.1.1.14 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
2967 1.1.1.14 christos UINT64 PreserveMask;
2968 1.1.1.14 christos UINT64 WriteMask;
2969 1.1.1.14 christos UINT32 Latency;
2970 1.1.1.14 christos UINT32 MaxAccessRate;
2971 1.1.1.14 christos UINT32 MinTurnaroundTime;
2972 1.1.1.14 christos ACPI_GENERIC_ADDRESS PlatformAckRegister;
2973 1.1.1.14 christos UINT64 AckPreserveMask;
2974 1.1.1.14 christos UINT64 AckSetMask;
2975 1.1.1.14 christos UINT64 Reserved2;
2976 1.1.1.14 christos ACPI_GENERIC_ADDRESS CmdCompleteRegister;
2977 1.1.1.14 christos UINT64 CmdCompleteMask;
2978 1.1.1.14 christos ACPI_GENERIC_ADDRESS CmdUpdateRegister;
2979 1.1.1.14 christos UINT64 CmdUpdatePreserveMask;
2980 1.1.1.14 christos UINT64 CmdUpdateSetMask;
2981 1.1.1.14 christos ACPI_GENERIC_ADDRESS ErrorStatusRegister;
2982 1.1.1.14 christos UINT64 ErrorStatusMask;
2983 1.1.1.14 christos
2984 1.1.1.14 christos } ACPI_PCCT_EXT_PCC_MASTER;
2985 1.1.1.4 christos
2986 1.1.1.4 christos
2987 1.1.1.14 christos /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
2988 1.1.1.12 christos
2989 1.1.1.14 christos typedef struct acpi_pcct_ext_pcc_slave
2990 1.1.1.12 christos {
2991 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
2992 1.1.1.14 christos UINT32 PlatformInterrupt;
2993 1.1.1.14 christos UINT8 Flags;
2994 1.1.1.14 christos UINT8 Reserved1;
2995 1.1.1.14 christos UINT64 BaseAddress;
2996 1.1.1.14 christos UINT32 Length;
2997 1.1.1.14 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
2998 1.1.1.14 christos UINT64 PreserveMask;
2999 1.1.1.14 christos UINT64 WriteMask;
3000 1.1.1.14 christos UINT32 Latency;
3001 1.1.1.14 christos UINT32 MaxAccessRate;
3002 1.1.1.14 christos UINT32 MinTurnaroundTime;
3003 1.1.1.14 christos ACPI_GENERIC_ADDRESS PlatformAckRegister;
3004 1.1.1.14 christos UINT64 AckPreserveMask;
3005 1.1.1.14 christos UINT64 AckSetMask;
3006 1.1.1.14 christos UINT64 Reserved2;
3007 1.1.1.14 christos ACPI_GENERIC_ADDRESS CmdCompleteRegister;
3008 1.1.1.14 christos UINT64 CmdCompleteMask;
3009 1.1.1.14 christos ACPI_GENERIC_ADDRESS CmdUpdateRegister;
3010 1.1.1.14 christos UINT64 CmdUpdatePreserveMask;
3011 1.1.1.14 christos UINT64 CmdUpdateSetMask;
3012 1.1.1.14 christos ACPI_GENERIC_ADDRESS ErrorStatusRegister;
3013 1.1.1.14 christos UINT64 ErrorStatusMask;
3014 1.1.1.12 christos
3015 1.1.1.14 christos } ACPI_PCCT_EXT_PCC_SLAVE;
3016 1.1.1.12 christos
3017 1.1.1.18 christos /* 5: HW Registers based Communications Subspace */
3018 1.1.1.18 christos
3019 1.1.1.18 christos typedef struct acpi_pcct_hw_reg
3020 1.1.1.18 christos {
3021 1.1.1.18 christos ACPI_SUBTABLE_HEADER Header;
3022 1.1.1.18 christos UINT16 Version;
3023 1.1.1.18 christos UINT64 BaseAddress;
3024 1.1.1.18 christos UINT64 Length;
3025 1.1.1.18 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
3026 1.1.1.18 christos UINT64 DoorbellPreserve;
3027 1.1.1.18 christos UINT64 DoorbellWrite;
3028 1.1.1.18 christos ACPI_GENERIC_ADDRESS CmdCompleteRegister;
3029 1.1.1.18 christos UINT64 CmdCompleteMask;
3030 1.1.1.18 christos ACPI_GENERIC_ADDRESS ErrorStatusRegister;
3031 1.1.1.18 christos UINT64 ErrorStatusMask;
3032 1.1.1.18 christos UINT32 NominalLatency;
3033 1.1.1.18 christos UINT32 MinTurnaroundTime;
3034 1.1.1.18 christos
3035 1.1.1.18 christos } ACPI_PCCT_HW_REG;
3036 1.1.1.18 christos
3037 1.1.1.4 christos
3038 1.1.1.14 christos /* Values for doorbell flags above */
3039 1.1.1.14 christos
3040 1.1.1.14 christos #define ACPI_PCCT_INTERRUPT_POLARITY (1)
3041 1.1.1.14 christos #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
3042 1.1.1.14 christos
3043 1.1.1.14 christos
3044 1.1.1.14 christos /*
3045 1.1.1.14 christos * PCC memory structures (not part of the ACPI table)
3046 1.1.1.14 christos */
3047 1.1.1.3 jruoho
3048 1.1.1.14 christos /* Shared Memory Region */
3049 1.1.1.3 jruoho
3050 1.1.1.14 christos typedef struct acpi_pcct_shared_memory
3051 1.1.1.3 jruoho {
3052 1.1.1.14 christos UINT32 Signature;
3053 1.1.1.14 christos UINT16 Command;
3054 1.1.1.14 christos UINT16 Status;
3055 1.1.1.14 christos
3056 1.1.1.14 christos } ACPI_PCCT_SHARED_MEMORY;
3057 1.1.1.14 christos
3058 1.1.1.14 christos
3059 1.1.1.14 christos /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
3060 1.1.1.14 christos
3061 1.1.1.14 christos typedef struct acpi_pcct_ext_pcc_shared_memory
3062 1.1.1.14 christos {
3063 1.1.1.14 christos UINT32 Signature;
3064 1.1.1.14 christos UINT32 Flags;
3065 1.1.1.14 christos UINT32 Length;
3066 1.1.1.14 christos UINT32 Command;
3067 1.1.1.3 jruoho
3068 1.1.1.14 christos } ACPI_PCCT_EXT_PCC_SHARED_MEMORY;
3069 1.1.1.3 jruoho
3070 1.1.1.3 jruoho
3071 1.1.1.3 jruoho /*******************************************************************************
3072 1.1.1.3 jruoho *
3073 1.1.1.14 christos * PDTT - Platform Debug Trigger Table (ACPI 6.2)
3074 1.1.1.14 christos * Version 0
3075 1.1 jruoho *
3076 1.1 jruoho ******************************************************************************/
3077 1.1 jruoho
3078 1.1.1.14 christos typedef struct acpi_table_pdtt
3079 1.1 jruoho {
3080 1.1 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3081 1.1.1.14 christos UINT8 TriggerCount;
3082 1.1 jruoho UINT8 Reserved[3];
3083 1.1.1.14 christos UINT32 ArrayOffset;
3084 1.1.1.14 christos
3085 1.1.1.14 christos } ACPI_TABLE_PDTT;
3086 1.1 jruoho
3087 1.1 jruoho
3088 1.1.1.14 christos /*
3089 1.1.1.14 christos * PDTT Communication Channel Identifier Structure.
3090 1.1.1.14 christos * The number of these structures is defined by TriggerCount above,
3091 1.1.1.14 christos * starting at ArrayOffset.
3092 1.1.1.14 christos */
3093 1.1.1.14 christos typedef struct acpi_pdtt_channel
3094 1.1.1.14 christos {
3095 1.1.1.14 christos UINT8 SubchannelId;
3096 1.1.1.14 christos UINT8 Flags;
3097 1.1.1.14 christos
3098 1.1.1.14 christos } ACPI_PDTT_CHANNEL;
3099 1.1 jruoho
3100 1.1.1.14 christos /* Flags for above */
3101 1.1 jruoho
3102 1.1.1.14 christos #define ACPI_PDTT_RUNTIME_TRIGGER (1)
3103 1.1.1.14 christos #define ACPI_PDTT_WAIT_COMPLETION (1<<1)
3104 1.1.1.16 christos #define ACPI_PDTT_TRIGGER_ORDER (1<<2)
3105 1.1.1.9 christos
3106 1.1 jruoho
3107 1.1 jruoho /*******************************************************************************
3108 1.1 jruoho *
3109 1.1.1.18 christos * PHAT - Platform Health Assessment Table (ACPI 6.4)
3110 1.1.1.18 christos * Version 1
3111 1.1.1.18 christos *
3112 1.1.1.18 christos ******************************************************************************/
3113 1.1.1.18 christos
3114 1.1.1.18 christos typedef struct acpi_table_phat
3115 1.1.1.18 christos {
3116 1.1.1.18 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3117 1.1.1.18 christos
3118 1.1.1.18 christos } ACPI_TABLE_PHAT;
3119 1.1.1.18 christos
3120 1.1.1.18 christos /* Common header for PHAT subtables that follow main table */
3121 1.1.1.18 christos
3122 1.1.1.18 christos typedef struct acpi_phat_header
3123 1.1.1.18 christos {
3124 1.1.1.18 christos UINT16 Type;
3125 1.1.1.18 christos UINT16 Length;
3126 1.1.1.18 christos UINT8 Revision;
3127 1.1.1.18 christos
3128 1.1.1.18 christos } ACPI_PHAT_HEADER;
3129 1.1.1.18 christos
3130 1.1.1.18 christos
3131 1.1.1.18 christos /* Values for Type field above */
3132 1.1.1.18 christos
3133 1.1.1.18 christos #define ACPI_PHAT_TYPE_FW_VERSION_DATA 0
3134 1.1.1.18 christos #define ACPI_PHAT_TYPE_FW_HEALTH_DATA 1
3135 1.1.1.18 christos #define ACPI_PHAT_TYPE_RESERVED 2 /* 0x02-0xFFFF are reserved */
3136 1.1.1.18 christos
3137 1.1.1.18 christos /*
3138 1.1.1.18 christos * PHAT subtables, correspond to Type in ACPI_PHAT_HEADER
3139 1.1.1.18 christos */
3140 1.1.1.18 christos
3141 1.1.1.18 christos /* 0: Firmware Version Data Record */
3142 1.1.1.18 christos
3143 1.1.1.18 christos typedef struct acpi_phat_version_data
3144 1.1.1.18 christos {
3145 1.1.1.18 christos ACPI_PHAT_HEADER Header;
3146 1.1.1.18 christos UINT8 Reserved[3];
3147 1.1.1.18 christos UINT32 ElementCount;
3148 1.1.1.18 christos
3149 1.1.1.18 christos } ACPI_PHAT_VERSION_DATA;
3150 1.1.1.18 christos
3151 1.1.1.18 christos typedef struct acpi_phat_version_element
3152 1.1.1.18 christos {
3153 1.1.1.18 christos UINT8 Guid[16];
3154 1.1.1.18 christos UINT64 VersionValue;
3155 1.1.1.18 christos UINT32 ProducerId;
3156 1.1.1.18 christos
3157 1.1.1.18 christos } ACPI_PHAT_VERSION_ELEMENT;
3158 1.1.1.18 christos
3159 1.1.1.18 christos
3160 1.1.1.18 christos /* 1: Firmware Health Data Record */
3161 1.1.1.18 christos
3162 1.1.1.18 christos typedef struct acpi_phat_health_data
3163 1.1.1.18 christos {
3164 1.1.1.18 christos ACPI_PHAT_HEADER Header;
3165 1.1.1.18 christos UINT8 Reserved[2];
3166 1.1.1.18 christos UINT8 Health;
3167 1.1.1.18 christos UINT8 DeviceGuid[16];
3168 1.1.1.18 christos UINT32 DeviceSpecificOffset; /* Zero if no Device-specific data */
3169 1.1.1.18 christos
3170 1.1.1.18 christos } ACPI_PHAT_HEALTH_DATA;
3171 1.1.1.18 christos
3172 1.1.1.18 christos /* Values for Health field above */
3173 1.1.1.18 christos
3174 1.1.1.18 christos #define ACPI_PHAT_ERRORS_FOUND 0
3175 1.1.1.18 christos #define ACPI_PHAT_NO_ERRORS 1
3176 1.1.1.18 christos #define ACPI_PHAT_UNKNOWN_ERRORS 2
3177 1.1.1.18 christos #define ACPI_PHAT_ADVISORY 3
3178 1.1.1.18 christos
3179 1.1.1.18 christos
3180 1.1.1.18 christos /*******************************************************************************
3181 1.1.1.18 christos *
3182 1.1.1.14 christos * PMTT - Platform Memory Topology Table (ACPI 5.0)
3183 1.1.1.14 christos * Version 1
3184 1.1 jruoho *
3185 1.1 jruoho ******************************************************************************/
3186 1.1 jruoho
3187 1.1.1.14 christos typedef struct acpi_table_pmtt
3188 1.1 jruoho {
3189 1.1 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3190 1.1.1.18 christos UINT32 MemoryDeviceCount;
3191 1.1.1.18 christos /*
3192 1.1.1.18 christos * Immediately followed by:
3193 1.1.1.18 christos * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
3194 1.1.1.18 christos */
3195 1.1.1.14 christos
3196 1.1.1.14 christos } ACPI_TABLE_PMTT;
3197 1.1 jruoho
3198 1.1 jruoho
3199 1.1.1.14 christos /* Common header for PMTT subtables that follow main table */
3200 1.1 jruoho
3201 1.1.1.14 christos typedef struct acpi_pmtt_header
3202 1.1 jruoho {
3203 1.1.1.14 christos UINT8 Type;
3204 1.1.1.14 christos UINT8 Reserved1;
3205 1.1.1.14 christos UINT16 Length;
3206 1.1.1.14 christos UINT16 Flags;
3207 1.1.1.14 christos UINT16 Reserved2;
3208 1.1.1.18 christos UINT32 MemoryDeviceCount; /* Zero means no memory device structs follow */
3209 1.1.1.18 christos /*
3210 1.1.1.18 christos * Immediately followed by:
3211 1.1.1.18 christos * UINT8 TypeSpecificData[]
3212 1.1.1.18 christos * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
3213 1.1.1.18 christos */
3214 1.1 jruoho
3215 1.1.1.14 christos } ACPI_PMTT_HEADER;
3216 1.1 jruoho
3217 1.1.1.14 christos /* Values for Type field above */
3218 1.1 jruoho
3219 1.1.1.14 christos #define ACPI_PMTT_TYPE_SOCKET 0
3220 1.1.1.14 christos #define ACPI_PMTT_TYPE_CONTROLLER 1
3221 1.1.1.14 christos #define ACPI_PMTT_TYPE_DIMM 2
3222 1.1.1.18 christos #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFE are reserved */
3223 1.1.1.18 christos #define ACPI_PMTT_TYPE_VENDOR 0xFF
3224 1.1.1.14 christos
3225 1.1.1.14 christos /* Values for Flags field above */
3226 1.1.1.14 christos
3227 1.1.1.14 christos #define ACPI_PMTT_TOP_LEVEL 0x0001
3228 1.1.1.14 christos #define ACPI_PMTT_PHYSICAL 0x0002
3229 1.1.1.14 christos #define ACPI_PMTT_MEMORY_TYPE 0x000C
3230 1.1.1.7 christos
3231 1.1.1.7 christos
3232 1.1.1.7 christos /*
3233 1.1.1.14 christos * PMTT subtables, correspond to Type in acpi_pmtt_header
3234 1.1.1.7 christos */
3235 1.1.1.7 christos
3236 1.1.1.7 christos
3237 1.1.1.14 christos /* 0: Socket Structure */
3238 1.1.1.14 christos
3239 1.1.1.14 christos typedef struct acpi_pmtt_socket
3240 1.1.1.7 christos {
3241 1.1.1.14 christos ACPI_PMTT_HEADER Header;
3242 1.1.1.14 christos UINT16 SocketId;
3243 1.1.1.14 christos UINT16 Reserved;
3244 1.1.1.14 christos
3245 1.1.1.14 christos } ACPI_PMTT_SOCKET;
3246 1.1.1.18 christos /*
3247 1.1.1.18 christos * Immediately followed by:
3248 1.1.1.18 christos * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
3249 1.1.1.18 christos */
3250 1.1.1.14 christos
3251 1.1.1.7 christos
3252 1.1.1.14 christos /* 1: Memory Controller subtable */
3253 1.1.1.7 christos
3254 1.1.1.14 christos typedef struct acpi_pmtt_controller
3255 1.1.1.7 christos {
3256 1.1.1.14 christos ACPI_PMTT_HEADER Header;
3257 1.1.1.18 christos UINT16 ControllerId;
3258 1.1 jruoho UINT16 Reserved;
3259 1.1.1.14 christos
3260 1.1.1.14 christos } ACPI_PMTT_CONTROLLER;
3261 1.1.1.18 christos /*
3262 1.1.1.18 christos * Immediately followed by:
3263 1.1.1.18 christos * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
3264 1.1.1.18 christos */
3265 1.1.1.7 christos
3266 1.1.1.7 christos
3267 1.1.1.14 christos /* 2: Physical Component Identifier (DIMM) */
3268 1.1.1.7 christos
3269 1.1.1.14 christos typedef struct acpi_pmtt_physical_component
3270 1.1.1.14 christos {
3271 1.1.1.14 christos ACPI_PMTT_HEADER Header;
3272 1.1.1.14 christos UINT32 BiosHandle;
3273 1.1.1.7 christos
3274 1.1.1.14 christos } ACPI_PMTT_PHYSICAL_COMPONENT;
3275 1.1.1.7 christos
3276 1.1.1.7 christos
3277 1.1.1.18 christos /* 0xFF: Vendor Specific Data */
3278 1.1.1.18 christos
3279 1.1.1.18 christos typedef struct acpi_pmtt_vendor_specific
3280 1.1.1.18 christos {
3281 1.1.1.18 christos ACPI_PMTT_HEADER Header;
3282 1.1.1.18 christos UINT8 TypeUuid[16];
3283 1.1.1.18 christos UINT8 Specific[];
3284 1.1.1.18 christos /*
3285 1.1.1.18 christos * Immediately followed by:
3286 1.1.1.18 christos * UINT8 VendorSpecificData[];
3287 1.1.1.18 christos * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
3288 1.1.1.18 christos */
3289 1.1.1.18 christos
3290 1.1.1.18 christos } ACPI_PMTT_VENDOR_SPECIFIC;
3291 1.1.1.18 christos
3292 1.1.1.18 christos
3293 1.1.1.7 christos /*******************************************************************************
3294 1.1.1.7 christos *
3295 1.1.1.14 christos * PPTT - Processor Properties Topology Table (ACPI 6.2)
3296 1.1.1.14 christos * Version 1
3297 1.1.1.7 christos *
3298 1.1.1.7 christos ******************************************************************************/
3299 1.1.1.7 christos
3300 1.1.1.14 christos typedef struct acpi_table_pptt
3301 1.1.1.7 christos {
3302 1.1.1.7 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3303 1.1.1.7 christos
3304 1.1.1.14 christos } ACPI_TABLE_PPTT;
3305 1.1.1.7 christos
3306 1.1.1.14 christos /* Values for Type field above */
3307 1.1 jruoho
3308 1.1.1.14 christos enum AcpiPpttType
3309 1.1.1.14 christos {
3310 1.1.1.14 christos ACPI_PPTT_TYPE_PROCESSOR = 0,
3311 1.1.1.14 christos ACPI_PPTT_TYPE_CACHE = 1,
3312 1.1.1.14 christos ACPI_PPTT_TYPE_ID = 2,
3313 1.1.1.14 christos ACPI_PPTT_TYPE_RESERVED = 3
3314 1.1.1.14 christos };
3315 1.1.1.12 christos
3316 1.1.1.12 christos
3317 1.1.1.14 christos /* 0: Processor Hierarchy Node Structure */
3318 1.1.1.12 christos
3319 1.1.1.14 christos typedef struct acpi_pptt_processor
3320 1.1.1.12 christos {
3321 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
3322 1.1.1.14 christos UINT16 Reserved;
3323 1.1.1.14 christos UINT32 Flags;
3324 1.1.1.14 christos UINT32 Parent;
3325 1.1.1.14 christos UINT32 AcpiProcessorId;
3326 1.1.1.14 christos UINT32 NumberOfPrivResources;
3327 1.1.1.12 christos
3328 1.1.1.14 christos } ACPI_PPTT_PROCESSOR;
3329 1.1.1.12 christos
3330 1.1.1.14 christos /* Flags */
3331 1.1.1.14 christos
3332 1.1.1.16 christos #define ACPI_PPTT_PHYSICAL_PACKAGE (1)
3333 1.1.1.16 christos #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (1<<1)
3334 1.1.1.16 christos #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD (1<<2) /* ACPI 6.3 */
3335 1.1.1.16 christos #define ACPI_PPTT_ACPI_LEAF_NODE (1<<3) /* ACPI 6.3 */
3336 1.1.1.16 christos #define ACPI_PPTT_ACPI_IDENTICAL (1<<4) /* ACPI 6.3 */
3337 1.1.1.12 christos
3338 1.1.1.12 christos
3339 1.1.1.14 christos /* 1: Cache Type Structure */
3340 1.1.1.12 christos
3341 1.1.1.14 christos typedef struct acpi_pptt_cache
3342 1.1.1.12 christos {
3343 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
3344 1.1.1.12 christos UINT16 Reserved;
3345 1.1.1.14 christos UINT32 Flags;
3346 1.1.1.14 christos UINT32 NextLevelOfCache;
3347 1.1.1.14 christos UINT32 Size;
3348 1.1.1.14 christos UINT32 NumberOfSets;
3349 1.1.1.14 christos UINT8 Associativity;
3350 1.1.1.14 christos UINT8 Attributes;
3351 1.1.1.14 christos UINT16 LineSize;
3352 1.1.1.14 christos
3353 1.1.1.14 christos } ACPI_PPTT_CACHE;
3354 1.1.1.14 christos
3355 1.1.1.18 christos /* 1: Cache Type Structure for PPTT version 3 */
3356 1.1.1.18 christos
3357 1.1.1.18 christos typedef struct acpi_pptt_cache_v1
3358 1.1.1.18 christos {
3359 1.1.1.18 christos UINT32 CacheId;
3360 1.1.1.18 christos
3361 1.1.1.18 christos } ACPI_PPTT_CACHE_V1;
3362 1.1.1.18 christos
3363 1.1.1.18 christos
3364 1.1.1.14 christos /* Flags */
3365 1.1.1.14 christos
3366 1.1.1.14 christos #define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
3367 1.1.1.14 christos #define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
3368 1.1.1.14 christos #define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
3369 1.1.1.14 christos #define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
3370 1.1.1.14 christos #define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
3371 1.1.1.14 christos #define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
3372 1.1.1.14 christos #define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
3373 1.1.1.18 christos #define ACPI_PPTT_CACHE_ID_VALID (1<<7) /* Cache ID valid */
3374 1.1.1.14 christos
3375 1.1.1.14 christos /* Masks for Attributes */
3376 1.1.1.14 christos
3377 1.1.1.14 christos #define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
3378 1.1.1.14 christos #define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
3379 1.1.1.14 christos #define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
3380 1.1.1.14 christos
3381 1.1.1.14 christos /* Attributes describing cache */
3382 1.1.1.14 christos #define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read */
3383 1.1.1.14 christos #define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write */
3384 1.1.1.14 christos #define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read and write */
3385 1.1.1.14 christos #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above */
3386 1.1.1.14 christos
3387 1.1.1.14 christos #define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */
3388 1.1.1.14 christos #define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */
3389 1.1.1.14 christos #define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */
3390 1.1.1.14 christos #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of above */
3391 1.1.1.12 christos
3392 1.1.1.14 christos #define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */
3393 1.1.1.14 christos #define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */
3394 1.1.1.12 christos
3395 1.1.1.14 christos /* 2: ID Structure */
3396 1.1.1.12 christos
3397 1.1.1.14 christos typedef struct acpi_pptt_id
3398 1.1.1.14 christos {
3399 1.1.1.14 christos ACPI_SUBTABLE_HEADER Header;
3400 1.1.1.14 christos UINT16 Reserved;
3401 1.1.1.14 christos UINT32 VendorId;
3402 1.1.1.14 christos UINT64 Level1Id;
3403 1.1.1.14 christos UINT64 Level2Id;
3404 1.1.1.14 christos UINT16 MajorRev;
3405 1.1.1.14 christos UINT16 MinorRev;
3406 1.1.1.14 christos UINT16 SpinRev;
3407 1.1.1.12 christos
3408 1.1.1.14 christos } ACPI_PPTT_ID;
3409 1.1 jruoho
3410 1.1 jruoho
3411 1.1 jruoho /*******************************************************************************
3412 1.1 jruoho *
3413 1.1.1.19 christos * PRMT - Platform Runtime Mechanism Table
3414 1.1.1.19 christos * Version 1
3415 1.1.1.19 christos *
3416 1.1.1.19 christos ******************************************************************************/
3417 1.1.1.19 christos
3418 1.1.1.19 christos typedef struct acpi_table_prmt
3419 1.1.1.19 christos {
3420 1.1.1.19 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3421 1.1.1.19 christos
3422 1.1.1.19 christos } ACPI_TABLE_PRMT;
3423 1.1.1.19 christos
3424 1.1.1.19 christos typedef struct acpi_table_prmt_header
3425 1.1.1.19 christos {
3426 1.1.1.19 christos UINT8 PlatformGuid[16];
3427 1.1.1.19 christos UINT32 ModuleInfoOffset;
3428 1.1.1.19 christos UINT32 ModuleInfoCount;
3429 1.1.1.19 christos
3430 1.1.1.19 christos } ACPI_TABLE_PRMT_HEADER;
3431 1.1.1.19 christos
3432 1.1.1.20 christos typedef struct acpi_prmt_module_header
3433 1.1.1.20 christos {
3434 1.1.1.22 christos UINT16 Revision;
3435 1.1.1.22 christos UINT16 Length;
3436 1.1.1.20 christos
3437 1.1.1.20 christos } ACPI_PRMT_MODULE_HEADER;
3438 1.1.1.20 christos
3439 1.1.1.19 christos typedef struct acpi_prmt_module_info
3440 1.1.1.19 christos {
3441 1.1.1.19 christos UINT16 Revision;
3442 1.1.1.19 christos UINT16 Length;
3443 1.1.1.19 christos UINT8 ModuleGuid[16];
3444 1.1.1.19 christos UINT16 MajorRev;
3445 1.1.1.19 christos UINT16 MinorRev;
3446 1.1.1.19 christos UINT16 HandlerInfoCount;
3447 1.1.1.19 christos UINT32 HandlerInfoOffset;
3448 1.1.1.19 christos UINT64 MmioListPointer;
3449 1.1.1.19 christos
3450 1.1.1.19 christos } ACPI_PRMT_MODULE_INFO;
3451 1.1.1.19 christos
3452 1.1.1.19 christos typedef struct acpi_prmt_handler_info
3453 1.1.1.19 christos {
3454 1.1.1.19 christos UINT16 Revision;
3455 1.1.1.19 christos UINT16 Length;
3456 1.1.1.19 christos UINT8 HandlerGuid[16];
3457 1.1.1.19 christos UINT64 HandlerAddress;
3458 1.1.1.19 christos UINT64 StaticDataBufferAddress;
3459 1.1.1.19 christos UINT64 AcpiParamBufferAddress;
3460 1.1.1.19 christos
3461 1.1.1.19 christos } ACPI_PRMT_HANDLER_INFO;
3462 1.1.1.19 christos
3463 1.1.1.19 christos
3464 1.1.1.19 christos /*******************************************************************************
3465 1.1.1.19 christos *
3466 1.1.1.14 christos * RASF - RAS Feature Table (ACPI 5.0)
3467 1.1 jruoho * Version 1
3468 1.1 jruoho *
3469 1.1 jruoho ******************************************************************************/
3470 1.1 jruoho
3471 1.1.1.14 christos typedef struct acpi_table_rasf
3472 1.1 jruoho {
3473 1.1 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3474 1.1.1.14 christos UINT8 ChannelId[12];
3475 1.1 jruoho
3476 1.1.1.14 christos } ACPI_TABLE_RASF;
3477 1.1 jruoho
3478 1.1.1.14 christos /* RASF Platform Communication Channel Shared Memory Region */
3479 1.1.1.4 christos
3480 1.1.1.14 christos typedef struct acpi_rasf_shared_memory
3481 1.1.1.4 christos {
3482 1.1.1.14 christos UINT32 Signature;
3483 1.1.1.14 christos UINT16 Command;
3484 1.1.1.14 christos UINT16 Status;
3485 1.1.1.14 christos UINT16 Version;
3486 1.1.1.14 christos UINT8 Capabilities[16];
3487 1.1.1.14 christos UINT8 SetCapabilities[16];
3488 1.1.1.14 christos UINT16 NumParameterBlocks;
3489 1.1.1.14 christos UINT32 SetCapabilitiesStatus;
3490 1.1.1.4 christos
3491 1.1.1.14 christos } ACPI_RASF_SHARED_MEMORY;
3492 1.1.1.4 christos
3493 1.1.1.14 christos /* RASF Parameter Block Structure Header */
3494 1.1.1.4 christos
3495 1.1.1.14 christos typedef struct acpi_rasf_parameter_block
3496 1.1.1.4 christos {
3497 1.1.1.14 christos UINT16 Type;
3498 1.1.1.14 christos UINT16 Version;
3499 1.1.1.14 christos UINT16 Length;
3500 1.1.1.4 christos
3501 1.1.1.14 christos } ACPI_RASF_PARAMETER_BLOCK;
3502 1.1.1.4 christos
3503 1.1.1.14 christos /* RASF Parameter Block Structure for PATROL_SCRUB */
3504 1.1 jruoho
3505 1.1.1.14 christos typedef struct acpi_rasf_patrol_scrub_parameter
3506 1.1 jruoho {
3507 1.1.1.14 christos ACPI_RASF_PARAMETER_BLOCK Header;
3508 1.1.1.14 christos UINT16 PatrolScrubCommand;
3509 1.1.1.14 christos UINT64 RequestedAddressRange[2];
3510 1.1.1.14 christos UINT64 ActualAddressRange[2];
3511 1.1.1.14 christos UINT16 Flags;
3512 1.1.1.14 christos UINT8 RequestedSpeed;
3513 1.1 jruoho
3514 1.1.1.14 christos } ACPI_RASF_PATROL_SCRUB_PARAMETER;
3515 1.1 jruoho
3516 1.1.1.14 christos /* Masks for Flags and Speed fields above */
3517 1.1 jruoho
3518 1.1.1.14 christos #define ACPI_RASF_SCRUBBER_RUNNING 1
3519 1.1.1.14 christos #define ACPI_RASF_SPEED (7<<1)
3520 1.1.1.14 christos #define ACPI_RASF_SPEED_SLOW (0<<1)
3521 1.1.1.14 christos #define ACPI_RASF_SPEED_MEDIUM (4<<1)
3522 1.1.1.14 christos #define ACPI_RASF_SPEED_FAST (7<<1)
3523 1.1 jruoho
3524 1.1.1.14 christos /* Channel Commands */
3525 1.1 jruoho
3526 1.1.1.14 christos enum AcpiRasfCommands
3527 1.1.1.14 christos {
3528 1.1.1.14 christos ACPI_RASF_EXECUTE_RASF_COMMAND = 1
3529 1.1.1.14 christos };
3530 1.1 jruoho
3531 1.1.1.14 christos /* Platform RAS Capabilities */
3532 1.1.1.14 christos
3533 1.1.1.14 christos enum AcpiRasfCapabiliities
3534 1.1 jruoho {
3535 1.1.1.14 christos ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
3536 1.1.1.14 christos ACPI_SW_PATROL_SCRUB_EXPOSED = 1
3537 1.1.1.14 christos };
3538 1.1 jruoho
3539 1.1.1.14 christos /* Patrol Scrub Commands */
3540 1.1 jruoho
3541 1.1.1.14 christos enum AcpiRasfPatrolScrubCommands
3542 1.1.1.14 christos {
3543 1.1.1.14 christos ACPI_RASF_GET_PATROL_PARAMETERS = 1,
3544 1.1.1.14 christos ACPI_RASF_START_PATROL_SCRUBBER = 2,
3545 1.1.1.14 christos ACPI_RASF_STOP_PATROL_SCRUBBER = 3
3546 1.1.1.14 christos };
3547 1.1 jruoho
3548 1.1.1.14 christos /* Channel Command flags */
3549 1.1 jruoho
3550 1.1.1.14 christos #define ACPI_RASF_GENERATE_SCI (1<<15)
3551 1.1 jruoho
3552 1.1.1.14 christos /* Status values */
3553 1.1 jruoho
3554 1.1.1.14 christos enum AcpiRasfStatus
3555 1.1 jruoho {
3556 1.1.1.14 christos ACPI_RASF_SUCCESS = 0,
3557 1.1.1.14 christos ACPI_RASF_NOT_VALID = 1,
3558 1.1.1.14 christos ACPI_RASF_NOT_SUPPORTED = 2,
3559 1.1.1.14 christos ACPI_RASF_BUSY = 3,
3560 1.1.1.14 christos ACPI_RASF_FAILED = 4,
3561 1.1.1.14 christos ACPI_RASF_ABORTED = 5,
3562 1.1.1.14 christos ACPI_RASF_INVALID_DATA = 6
3563 1.1 jruoho };
3564 1.1 jruoho
3565 1.1.1.14 christos /* Status flags */
3566 1.1 jruoho
3567 1.1.1.14 christos #define ACPI_RASF_COMMAND_COMPLETE (1)
3568 1.1.1.14 christos #define ACPI_RASF_SCI_DOORBELL (1<<1)
3569 1.1.1.14 christos #define ACPI_RASF_ERROR (1<<2)
3570 1.1.1.14 christos #define ACPI_RASF_STATUS (0x1F<<3)
3571 1.1 jruoho
3572 1.1 jruoho
3573 1.1 jruoho /*******************************************************************************
3574 1.1 jruoho *
3575 1.1.1.25 christos * RAS2 - RAS2 Feature Table (ACPI 6.5)
3576 1.1.1.25 christos * Version 1
3577 1.1.1.25 christos *
3578 1.1.1.25 christos *
3579 1.1.1.25 christos ******************************************************************************/
3580 1.1.1.25 christos
3581 1.1.1.25 christos typedef struct acpi_table_ras2 {
3582 1.1.1.25 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3583 1.1.1.25 christos UINT16 Reserved;
3584 1.1.1.25 christos UINT16 NumPccDescs;
3585 1.1.1.25 christos
3586 1.1.1.25 christos } ACPI_TABLE_RAS2;
3587 1.1.1.25 christos
3588 1.1.1.25 christos /* RAS2 Platform Communication Channel Descriptor */
3589 1.1.1.25 christos
3590 1.1.1.25 christos typedef struct acpi_ras2_pcc_desc {
3591 1.1.1.25 christos UINT8 ChannelId;
3592 1.1.1.25 christos UINT16 Reserved;
3593 1.1.1.25 christos UINT8 FeatureType;
3594 1.1.1.25 christos UINT32 Instance;
3595 1.1.1.25 christos
3596 1.1.1.25 christos } ACPI_RAS2_PCC_DESC;
3597 1.1.1.25 christos
3598 1.1.1.25 christos /* RAS2 Platform Communication Channel Shared Memory Region */
3599 1.1.1.25 christos
3600 1.1.1.27 christos typedef struct acpi_ras2_shmem {
3601 1.1.1.25 christos UINT32 Signature;
3602 1.1.1.25 christos UINT16 Command;
3603 1.1.1.25 christos UINT16 Status;
3604 1.1.1.25 christos UINT16 Version;
3605 1.1.1.25 christos UINT8 Features[16];
3606 1.1.1.27 christos UINT8 SetCaps[16];
3607 1.1.1.27 christos UINT16 NumParamBlks;
3608 1.1.1.27 christos UINT32 SetCapsStatus;
3609 1.1.1.25 christos
3610 1.1.1.27 christos } ACPI_RAS2_SHMEM;
3611 1.1.1.25 christos
3612 1.1.1.25 christos /* RAS2 Parameter Block Structure for PATROL_SCRUB */
3613 1.1.1.25 christos
3614 1.1.1.25 christos typedef struct acpi_ras2_parameter_block
3615 1.1.1.25 christos {
3616 1.1.1.25 christos UINT16 Type;
3617 1.1.1.25 christos UINT16 Version;
3618 1.1.1.25 christos UINT16 Length;
3619 1.1.1.25 christos
3620 1.1.1.25 christos } ACPI_RAS2_PARAMETER_BLOCK;
3621 1.1.1.25 christos
3622 1.1.1.25 christos /* RAS2 Parameter Block Structure for PATROL_SCRUB */
3623 1.1.1.25 christos
3624 1.1.1.27 christos typedef struct acpi_ras2_patrol_scrub_param {
3625 1.1.1.25 christos ACPI_RAS2_PARAMETER_BLOCK Header;
3626 1.1.1.27 christos UINT16 Command;
3627 1.1.1.27 christos UINT64 ReqAddrRange[2];
3628 1.1.1.27 christos UINT64 ActlAddrRange[2];
3629 1.1.1.25 christos UINT32 Flags;
3630 1.1.1.25 christos UINT32 ScrubParamsOut;
3631 1.1.1.25 christos UINT32 ScrubParamsIn;
3632 1.1.1.25 christos
3633 1.1.1.27 christos } ACPI_RAS2_PATROL_SCRUB_PARAM;
3634 1.1.1.25 christos
3635 1.1.1.25 christos /* Masks for Flags field above */
3636 1.1.1.25 christos
3637 1.1.1.25 christos #define ACPI_RAS2_SCRUBBER_RUNNING 1
3638 1.1.1.25 christos
3639 1.1.1.25 christos /* RAS2 Parameter Block Structure for LA2PA_TRANSLATION */
3640 1.1.1.25 christos
3641 1.1.1.25 christos typedef struct acpi_ras2_la2pa_translation_parameter {
3642 1.1.1.25 christos ACPI_RAS2_PARAMETER_BLOCK Header;
3643 1.1.1.25 christos UINT16 AddrTranslationCommand;
3644 1.1.1.25 christos UINT64 SubInstId;
3645 1.1.1.25 christos UINT64 LogicalAddress;
3646 1.1.1.25 christos UINT64 PhysicalAddress;
3647 1.1.1.25 christos UINT32 Status;
3648 1.1.1.25 christos
3649 1.1.1.25 christos } ACPI_RAS2_LA2PA_TRANSLATION_PARAM;
3650 1.1.1.25 christos
3651 1.1.1.25 christos /* Channel Commands */
3652 1.1.1.25 christos
3653 1.1.1.25 christos enum AcpiRas2Commands
3654 1.1.1.25 christos {
3655 1.1.1.25 christos ACPI_RAS2_EXECUTE_RAS2_COMMAND = 1
3656 1.1.1.25 christos };
3657 1.1.1.25 christos
3658 1.1.1.25 christos /* Platform RAS2 Features */
3659 1.1.1.25 christos
3660 1.1.1.25 christos enum AcpiRas2Features
3661 1.1.1.25 christos {
3662 1.1.1.25 christos ACPI_RAS2_PATROL_SCRUB_SUPPORTED = 0,
3663 1.1.1.25 christos ACPI_RAS2_LA2PA_TRANSLATION = 1
3664 1.1.1.25 christos };
3665 1.1.1.25 christos
3666 1.1.1.25 christos /* RAS2 Patrol Scrub Commands */
3667 1.1.1.25 christos
3668 1.1.1.25 christos enum AcpiRas2PatrolScrubCommands
3669 1.1.1.25 christos {
3670 1.1.1.25 christos ACPI_RAS2_GET_PATROL_PARAMETERS = 1,
3671 1.1.1.25 christos ACPI_RAS2_START_PATROL_SCRUBBER = 2,
3672 1.1.1.25 christos ACPI_RAS2_STOP_PATROL_SCRUBBER = 3
3673 1.1.1.25 christos };
3674 1.1.1.25 christos
3675 1.1.1.25 christos /* RAS2 LA2PA Translation Commands */
3676 1.1.1.25 christos
3677 1.1.1.25 christos enum AcpiRas2La2PaTranslationCommands
3678 1.1.1.25 christos {
3679 1.1.1.25 christos ACPI_RAS2_GET_LA2PA_TRANSLATION = 1,
3680 1.1.1.25 christos };
3681 1.1.1.25 christos
3682 1.1.1.25 christos /* RAS2 LA2PA Translation Status values */
3683 1.1.1.25 christos
3684 1.1.1.25 christos enum AcpiRas2La2PaTranslationStatus
3685 1.1.1.25 christos {
3686 1.1.1.25 christos ACPI_RAS2_LA2PA_TRANSLATION_SUCCESS = 0,
3687 1.1.1.25 christos ACPI_RAS2_LA2PA_TRANSLATION_FAIL = 1,
3688 1.1.1.25 christos };
3689 1.1.1.25 christos
3690 1.1.1.25 christos /* Channel Command flags */
3691 1.1.1.25 christos
3692 1.1.1.25 christos #define ACPI_RAS2_GENERATE_SCI (1<<15)
3693 1.1.1.25 christos
3694 1.1.1.25 christos /* Status values */
3695 1.1.1.25 christos
3696 1.1.1.25 christos enum AcpiRas2Status
3697 1.1.1.25 christos {
3698 1.1.1.25 christos ACPI_RAS2_SUCCESS = 0,
3699 1.1.1.25 christos ACPI_RAS2_NOT_VALID = 1,
3700 1.1.1.25 christos ACPI_RAS2_NOT_SUPPORTED = 2,
3701 1.1.1.25 christos ACPI_RAS2_BUSY = 3,
3702 1.1.1.25 christos ACPI_RAS2_FAILED = 4,
3703 1.1.1.25 christos ACPI_RAS2_ABORTED = 5,
3704 1.1.1.25 christos ACPI_RAS2_INVALID_DATA = 6
3705 1.1.1.25 christos };
3706 1.1.1.25 christos
3707 1.1.1.25 christos /* Status flags */
3708 1.1.1.25 christos
3709 1.1.1.25 christos #define ACPI_RAS2_COMMAND_COMPLETE (1)
3710 1.1.1.25 christos #define ACPI_RAS2_SCI_DOORBELL (1<<1)
3711 1.1.1.25 christos #define ACPI_RAS2_ERROR (1<<2)
3712 1.1.1.25 christos #define ACPI_RAS2_STATUS (0x1F<<3)
3713 1.1.1.25 christos
3714 1.1.1.25 christos
3715 1.1.1.25 christos /*******************************************************************************
3716 1.1.1.25 christos *
3717 1.1.1.19 christos * RGRT - Regulatory Graphics Resource Table
3718 1.1.1.19 christos * Version 1
3719 1.1.1.19 christos *
3720 1.1.1.19 christos * Conforms to "ACPI RGRT" available at:
3721 1.1.1.19 christos * https://microsoft.github.io/mu/dyn/mu_plus/MsCorePkg/AcpiRGRT/feature_acpi_rgrt/
3722 1.1.1.19 christos *
3723 1.1.1.19 christos ******************************************************************************/
3724 1.1.1.19 christos
3725 1.1.1.19 christos typedef struct acpi_table_rgrt
3726 1.1.1.19 christos {
3727 1.1.1.19 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3728 1.1.1.19 christos UINT16 Version;
3729 1.1.1.19 christos UINT8 ImageType;
3730 1.1.1.19 christos UINT8 Reserved;
3731 1.1.1.22 christos UINT8 Image[];
3732 1.1.1.19 christos
3733 1.1.1.19 christos } ACPI_TABLE_RGRT;
3734 1.1.1.19 christos
3735 1.1.1.19 christos /* ImageType values */
3736 1.1.1.19 christos
3737 1.1.1.19 christos enum AcpiRgrtImageType
3738 1.1.1.19 christos {
3739 1.1.1.19 christos ACPI_RGRT_TYPE_RESERVED0 = 0,
3740 1.1.1.19 christos ACPI_RGRT_IMAGE_TYPE_PNG = 1,
3741 1.1.1.19 christos ACPI_RGRT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
3742 1.1.1.19 christos };
3743 1.1.1.19 christos
3744 1.1.1.19 christos
3745 1.1.1.19 christos /*******************************************************************************
3746 1.1.1.19 christos *
3747 1.1.1.24 christos * RHCT - RISC-V Hart Capabilities Table
3748 1.1.1.24 christos * Version 1
3749 1.1.1.24 christos *
3750 1.1.1.24 christos ******************************************************************************/
3751 1.1.1.24 christos
3752 1.1.1.24 christos typedef struct acpi_table_rhct {
3753 1.1.1.24 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3754 1.1.1.24 christos UINT32 Flags; /* RHCT flags */
3755 1.1.1.24 christos UINT64 TimeBaseFreq;
3756 1.1.1.24 christos UINT32 NodeCount;
3757 1.1.1.24 christos UINT32 NodeOffset;
3758 1.1.1.24 christos } ACPI_TABLE_RHCT;
3759 1.1.1.24 christos
3760 1.1.1.24 christos /* RHCT Flags */
3761 1.1.1.24 christos
3762 1.1.1.24 christos #define ACPI_RHCT_TIMER_CANNOT_WAKEUP_CPU (1)
3763 1.1.1.24 christos /*
3764 1.1.1.24 christos * RHCT subtables
3765 1.1.1.24 christos */
3766 1.1.1.24 christos typedef struct acpi_rhct_node_header {
3767 1.1.1.24 christos UINT16 Type;
3768 1.1.1.24 christos UINT16 Length;
3769 1.1.1.24 christos UINT16 Revision;
3770 1.1.1.24 christos } ACPI_RHCT_NODE_HEADER;
3771 1.1.1.24 christos
3772 1.1.1.24 christos /* Values for RHCT subtable Type above */
3773 1.1.1.24 christos
3774 1.1.1.24 christos enum acpi_rhct_node_type {
3775 1.1.1.24 christos ACPI_RHCT_NODE_TYPE_ISA_STRING = 0x0000,
3776 1.1.1.24 christos ACPI_RHCT_NODE_TYPE_CMO = 0x0001,
3777 1.1.1.24 christos ACPI_RHCT_NODE_TYPE_MMU = 0x0002,
3778 1.1.1.24 christos ACPI_RHCT_NODE_TYPE_RESERVED = 0x0003,
3779 1.1.1.24 christos ACPI_RHCT_NODE_TYPE_HART_INFO = 0xFFFF,
3780 1.1.1.24 christos };
3781 1.1.1.24 christos
3782 1.1.1.24 christos /*
3783 1.1.1.24 christos * RHCT node specific subtables
3784 1.1.1.24 christos */
3785 1.1.1.24 christos
3786 1.1.1.24 christos /* ISA string node structure */
3787 1.1.1.24 christos typedef struct acpi_rhct_isa_string {
3788 1.1.1.24 christos UINT16 IsaLength;
3789 1.1.1.24 christos char Isa[];
3790 1.1.1.24 christos } ACPI_RHCT_ISA_STRING;
3791 1.1.1.24 christos
3792 1.1.1.24 christos typedef struct acpi_rhct_cmo_node {
3793 1.1.1.24 christos UINT8 Reserved; /* Must be zero */
3794 1.1.1.24 christos UINT8 CbomSize; /* CBOM size in powerof 2 */
3795 1.1.1.24 christos UINT8 CbopSize; /* CBOP size in powerof 2 */
3796 1.1.1.24 christos UINT8 CbozSize; /* CBOZ size in powerof 2 */
3797 1.1.1.24 christos } ACPI_RHCT_CMO_NODE;
3798 1.1.1.24 christos
3799 1.1.1.24 christos typedef struct acpi_rhct_mmu_node {
3800 1.1.1.24 christos UINT8 Reserved; /* Must be zero */
3801 1.1.1.24 christos UINT8 MmuType; /* Virtual Address Scheme */
3802 1.1.1.24 christos } ACPI_RHCT_MMU_NODE;
3803 1.1.1.24 christos
3804 1.1.1.24 christos enum acpi_rhct_mmu_type {
3805 1.1.1.24 christos ACPI_RHCT_MMU_TYPE_SV39 = 0,
3806 1.1.1.24 christos ACPI_RHCT_MMU_TYPE_SV48 = 1,
3807 1.1.1.24 christos ACPI_RHCT_MMU_TYPE_SV57 = 2
3808 1.1.1.24 christos };
3809 1.1.1.24 christos
3810 1.1.1.24 christos /* Hart Info node structure */
3811 1.1.1.24 christos typedef struct acpi_rhct_hart_info {
3812 1.1.1.24 christos UINT16 NumOffsets;
3813 1.1.1.24 christos UINT32 Uid; /* ACPI processor UID */
3814 1.1.1.24 christos } ACPI_RHCT_HART_INFO;
3815 1.1.1.24 christos
3816 1.1.1.24 christos /*******************************************************************************
3817 1.1.1.24 christos *
3818 1.1.1.27 christos * RIMT - RISC-V IO Remapping Table
3819 1.1.1.27 christos *
3820 1.1.1.27 christos * https://github.com/riscv-non-isa/riscv-acpi-rimt
3821 1.1.1.27 christos *
3822 1.1.1.27 christos ******************************************************************************/
3823 1.1.1.27 christos
3824 1.1.1.27 christos typedef struct acpi_table_rimt {
3825 1.1.1.27 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3826 1.1.1.27 christos UINT32 NumNodes; /* Number of RIMT Nodes */
3827 1.1.1.27 christos UINT32 NodeOffset; /* Offset to RIMT Node Array */
3828 1.1.1.27 christos UINT32 Reserved;
3829 1.1.1.27 christos } ACPI_TABLE_RIMT;
3830 1.1.1.27 christos
3831 1.1.1.27 christos typedef struct acpi_rimt_node {
3832 1.1.1.27 christos UINT8 Type;
3833 1.1.1.27 christos UINT8 Revision;
3834 1.1.1.27 christos UINT16 Length;
3835 1.1.1.27 christos UINT16 Reserved;
3836 1.1.1.27 christos UINT16 Id;
3837 1.1.1.27 christos char NodeData[];
3838 1.1.1.27 christos } ACPI_RIMT_NODE;
3839 1.1.1.27 christos
3840 1.1.1.27 christos enum acpi_rimt_node_type {
3841 1.1.1.27 christos ACPI_RIMT_NODE_TYPE_IOMMU = 0x0,
3842 1.1.1.27 christos ACPI_RIMT_NODE_TYPE_PCIE_ROOT_COMPLEX = 0x1,
3843 1.1.1.27 christos ACPI_RIMT_NODE_TYPE_PLAT_DEVICE = 0x2,
3844 1.1.1.27 christos };
3845 1.1.1.27 christos
3846 1.1.1.27 christos typedef struct acpi_rimt_iommu {
3847 1.1.1.27 christos UINT8 HardwareId[8]; /* Hardware ID */
3848 1.1.1.27 christos UINT64 BaseAddress; /* Base Address */
3849 1.1.1.27 christos UINT32 Flags; /* Flags */
3850 1.1.1.27 christos UINT32 ProximityDomain; /* Proximity Domain */
3851 1.1.1.27 christos UINT16 PcieSegmentNumber; /* PCIe Segment number */
3852 1.1.1.27 christos UINT16 PcieBdf; /* PCIe B/D/F */
3853 1.1.1.27 christos UINT16 NumInterruptWires; /* Number of interrupt wires */
3854 1.1.1.27 christos UINT16 InterruptWireOffset; /* Interrupt wire array offset */
3855 1.1.1.27 christos UINT64 InterruptWire[]; /* Interrupt wire array */
3856 1.1.1.27 christos } ACPI_RIMT_IOMMU;
3857 1.1.1.27 christos
3858 1.1.1.27 christos /* IOMMU Node Flags */
3859 1.1.1.27 christos #define ACPI_RIMT_IOMMU_FLAGS_PCIE (1)
3860 1.1.1.27 christos #define ACPI_RIMT_IOMMU_FLAGS_PXM_VALID (1 << 1)
3861 1.1.1.27 christos
3862 1.1.1.27 christos /* Interrupt Wire Structure */
3863 1.1.1.27 christos typedef struct acpi_rimt_iommu_wire_gsi {
3864 1.1.1.27 christos UINT32 IrqNum; /* Interrupt Number */
3865 1.1.1.27 christos UINT32 Flags; /* Flags */
3866 1.1.1.27 christos } ACPI_RIMT_IOMMU_WIRE_GSI;
3867 1.1.1.27 christos
3868 1.1.1.27 christos /* Interrupt Wire Flags */
3869 1.1.1.27 christos #define ACPI_RIMT_GSI_LEVEL_TRIGGERRED (1)
3870 1.1.1.27 christos #define ACPI_RIMT_GSI_ACTIVE_HIGH (1 << 1)
3871 1.1.1.27 christos
3872 1.1.1.27 christos typedef struct acpi_rimt_id_mapping {
3873 1.1.1.27 christos UINT32 SourceIdBase; /* Source ID Base */
3874 1.1.1.27 christos UINT32 NumIds; /* Number of IDs */
3875 1.1.1.27 christos UINT32 DestIdBase; /* Destination Device ID Base */
3876 1.1.1.27 christos UINT32 DestOffset; /* Destination IOMMU Offset */
3877 1.1.1.27 christos UINT32 Flags; /* Flags */
3878 1.1.1.27 christos } ACPI_RIMT_ID_MAPPING;
3879 1.1.1.27 christos
3880 1.1.1.27 christos typedef struct acpi_rimt_pcie_rc {
3881 1.1.1.27 christos UINT32 Flags; /* Flags */
3882 1.1.1.27 christos UINT16 Reserved; /* Reserved */
3883 1.1.1.27 christos UINT16 PcieSegmentNumber; /* PCIe Segment number */
3884 1.1.1.27 christos UINT16 IdMappingOffset; /* ID mapping array offset */
3885 1.1.1.27 christos UINT16 NumIdMappings; /* Number of ID mappings */
3886 1.1.1.27 christos } ACPI_RIMT_PCIE_RC;
3887 1.1.1.27 christos
3888 1.1.1.27 christos /* PCIe Root Complex Node Flags */
3889 1.1.1.27 christos #define ACPI_RIMT_PCIE_ATS_SUPPORTED (1)
3890 1.1.1.27 christos #define ACPI_RIMT_PCIE_PRI_SUPPORTED (1 << 1)
3891 1.1.1.27 christos
3892 1.1.1.27 christos typedef struct acpi_rimt_platform_device {
3893 1.1.1.27 christos UINT16 IdMappingOffset; /* ID Mapping array offset */
3894 1.1.1.27 christos UINT16 NumIdMappings; /* Number of ID mappings */
3895 1.1.1.27 christos char DeviceName[]; /* Device Object Name */
3896 1.1.1.27 christos } ACPI_RIMT_PLATFORM_DEVICE;
3897 1.1.1.27 christos
3898 1.1.1.27 christos
3899 1.1.1.27 christos /*******************************************************************************
3900 1.1.1.27 christos *
3901 1.1.1.14 christos * SBST - Smart Battery Specification Table
3902 1.1.1.2 jruoho * Version 1
3903 1.1.1.2 jruoho *
3904 1.1.1.2 jruoho ******************************************************************************/
3905 1.1.1.2 jruoho
3906 1.1.1.14 christos typedef struct acpi_table_sbst
3907 1.1.1.2 jruoho {
3908 1.1.1.2 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3909 1.1.1.14 christos UINT32 WarningLevel;
3910 1.1.1.14 christos UINT32 LowLevel;
3911 1.1.1.14 christos UINT32 CriticalLevel;
3912 1.1.1.2 jruoho
3913 1.1.1.14 christos } ACPI_TABLE_SBST;
3914 1.1.1.2 jruoho
3915 1.1.1.2 jruoho
3916 1.1.1.2 jruoho /*******************************************************************************
3917 1.1.1.2 jruoho *
3918 1.1.1.14 christos * SDEI - Software Delegated Exception Interface Descriptor Table
3919 1.1 jruoho *
3920 1.1.1.14 christos * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
3921 1.1.1.14 christos * May 8th, 2017. Copyright 2017 ARM Ltd.
3922 1.1 jruoho *
3923 1.1 jruoho ******************************************************************************/
3924 1.1 jruoho
3925 1.1.1.14 christos typedef struct acpi_table_sdei
3926 1.1 jruoho {
3927 1.1 jruoho ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3928 1.1 jruoho
3929 1.1.1.14 christos } ACPI_TABLE_SDEI;
3930 1.1 jruoho
3931 1.1 jruoho
3932 1.1.1.12 christos /*******************************************************************************
3933 1.1.1.12 christos *
3934 1.1.1.14 christos * SDEV - Secure Devices Table (ACPI 6.2)
3935 1.1.1.12 christos * Version 1
3936 1.1.1.12 christos *
3937 1.1.1.12 christos ******************************************************************************/
3938 1.1.1.12 christos
3939 1.1.1.14 christos typedef struct acpi_table_sdev
3940 1.1.1.12 christos {
3941 1.1.1.12 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
3942 1.1.1.12 christos
3943 1.1.1.14 christos } ACPI_TABLE_SDEV;
3944 1.1.1.14 christos
3945 1.1.1.14 christos
3946 1.1.1.14 christos typedef struct acpi_sdev_header
3947 1.1.1.14 christos {
3948 1.1.1.14 christos UINT8 Type;
3949 1.1.1.14 christos UINT8 Flags;
3950 1.1.1.14 christos UINT16 Length;
3951 1.1.1.14 christos
3952 1.1.1.14 christos } ACPI_SDEV_HEADER;
3953 1.1.1.14 christos
3954 1.1.1.14 christos
3955 1.1.1.14 christos /* Values for subtable type above */
3956 1.1.1.14 christos
3957 1.1.1.14 christos enum AcpiSdevType
3958 1.1.1.14 christos {
3959 1.1.1.14 christos ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
3960 1.1.1.14 christos ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
3961 1.1.1.14 christos ACPI_SDEV_TYPE_RESERVED = 2 /* 2 and greater are reserved */
3962 1.1.1.14 christos };
3963 1.1.1.14 christos
3964 1.1.1.14 christos /* Values for flags above */
3965 1.1.1.14 christos
3966 1.1.1.14 christos #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1)
3967 1.1.1.18 christos #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1)
3968 1.1.1.12 christos
3969 1.1.1.14 christos /*
3970 1.1.1.14 christos * SDEV subtables
3971 1.1.1.14 christos */
3972 1.1.1.14 christos
3973 1.1.1.14 christos /* 0: Namespace Device Based Secure Device Structure */
3974 1.1.1.14 christos
3975 1.1.1.14 christos typedef struct acpi_sdev_namespace
3976 1.1.1.14 christos {
3977 1.1.1.14 christos ACPI_SDEV_HEADER Header;
3978 1.1.1.14 christos UINT16 DeviceIdOffset;
3979 1.1.1.14 christos UINT16 DeviceIdLength;
3980 1.1.1.14 christos UINT16 VendorDataOffset;
3981 1.1.1.14 christos UINT16 VendorDataLength;
3982 1.1.1.14 christos
3983 1.1.1.14 christos } ACPI_SDEV_NAMESPACE;
3984 1.1.1.14 christos
3985 1.1.1.18 christos typedef struct acpi_sdev_secure_component
3986 1.1.1.18 christos {
3987 1.1.1.18 christos UINT16 SecureComponentOffset;
3988 1.1.1.18 christos UINT16 SecureComponentLength;
3989 1.1.1.18 christos
3990 1.1.1.18 christos } ACPI_SDEV_SECURE_COMPONENT;
3991 1.1.1.18 christos
3992 1.1.1.18 christos
3993 1.1.1.18 christos /*
3994 1.1.1.18 christos * SDEV sub-subtables ("Components") for above
3995 1.1.1.18 christos */
3996 1.1.1.18 christos typedef struct acpi_sdev_component
3997 1.1.1.18 christos {
3998 1.1.1.18 christos ACPI_SDEV_HEADER Header;
3999 1.1.1.18 christos
4000 1.1.1.18 christos } ACPI_SDEV_COMPONENT;
4001 1.1.1.18 christos
4002 1.1.1.18 christos
4003 1.1.1.18 christos /* Values for sub-subtable type above */
4004 1.1.1.18 christos
4005 1.1.1.18 christos enum AcpiSacType
4006 1.1.1.18 christos {
4007 1.1.1.18 christos ACPI_SDEV_TYPE_ID_COMPONENT = 0,
4008 1.1.1.18 christos ACPI_SDEV_TYPE_MEM_COMPONENT = 1
4009 1.1.1.18 christos };
4010 1.1.1.18 christos
4011 1.1.1.18 christos typedef struct acpi_sdev_id_component
4012 1.1.1.18 christos {
4013 1.1.1.18 christos ACPI_SDEV_HEADER Header;
4014 1.1.1.18 christos UINT16 HardwareIdOffset;
4015 1.1.1.18 christos UINT16 HardwareIdLength;
4016 1.1.1.18 christos UINT16 SubsystemIdOffset;
4017 1.1.1.18 christos UINT16 SubsystemIdLength;
4018 1.1.1.18 christos UINT16 HardwareRevision;
4019 1.1.1.18 christos UINT8 HardwareRevPresent;
4020 1.1.1.18 christos UINT8 ClassCodePresent;
4021 1.1.1.18 christos UINT8 PciBaseClass;
4022 1.1.1.18 christos UINT8 PciSubClass;
4023 1.1.1.18 christos UINT8 PciProgrammingXface;
4024 1.1.1.18 christos
4025 1.1.1.18 christos } ACPI_SDEV_ID_COMPONENT;
4026 1.1.1.18 christos
4027 1.1.1.18 christos typedef struct acpi_sdev_mem_component
4028 1.1.1.18 christos {
4029 1.1.1.18 christos ACPI_SDEV_HEADER Header;
4030 1.1.1.18 christos UINT32 Reserved;
4031 1.1.1.18 christos UINT64 MemoryBaseAddress;
4032 1.1.1.18 christos UINT64 MemoryLength;
4033 1.1.1.18 christos
4034 1.1.1.18 christos } ACPI_SDEV_MEM_COMPONENT;
4035 1.1.1.18 christos
4036 1.1.1.18 christos
4037 1.1.1.14 christos /* 1: PCIe Endpoint Device Based Device Structure */
4038 1.1.1.14 christos
4039 1.1.1.14 christos typedef struct acpi_sdev_pcie
4040 1.1.1.14 christos {
4041 1.1.1.14 christos ACPI_SDEV_HEADER Header;
4042 1.1.1.14 christos UINT16 Segment;
4043 1.1.1.14 christos UINT16 StartBus;
4044 1.1.1.14 christos UINT16 PathOffset;
4045 1.1.1.14 christos UINT16 PathLength;
4046 1.1.1.14 christos UINT16 VendorDataOffset;
4047 1.1.1.14 christos UINT16 VendorDataLength;
4048 1.1.1.14 christos
4049 1.1.1.14 christos } ACPI_SDEV_PCIE;
4050 1.1.1.14 christos
4051 1.1.1.14 christos /* 1a: PCIe Endpoint path entry */
4052 1.1.1.14 christos
4053 1.1.1.14 christos typedef struct acpi_sdev_pcie_path
4054 1.1.1.14 christos {
4055 1.1.1.14 christos UINT8 Device;
4056 1.1.1.14 christos UINT8 Function;
4057 1.1.1.12 christos
4058 1.1.1.14 christos } ACPI_SDEV_PCIE_PATH;
4059 1.1.1.12 christos
4060 1.1.1.12 christos
4061 1.1.1.19 christos /*******************************************************************************
4062 1.1.1.19 christos *
4063 1.1.1.19 christos * SVKL - Storage Volume Key Location Table (ACPI 6.4)
4064 1.1.1.19 christos * From: "Guest-Host-Communication Interface (GHCI) for Intel
4065 1.1.1.19 christos * Trust Domain Extensions (Intel TDX)".
4066 1.1.1.19 christos * Version 1
4067 1.1.1.19 christos *
4068 1.1.1.19 christos ******************************************************************************/
4069 1.1.1.19 christos
4070 1.1.1.19 christos typedef struct acpi_table_svkl
4071 1.1.1.19 christos {
4072 1.1.1.19 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
4073 1.1.1.19 christos UINT32 Count;
4074 1.1.1.19 christos
4075 1.1.1.19 christos } ACPI_TABLE_SVKL;
4076 1.1.1.19 christos
4077 1.1.1.19 christos typedef struct acpi_svkl_key
4078 1.1.1.19 christos {
4079 1.1.1.19 christos UINT16 Type;
4080 1.1.1.19 christos UINT16 Format;
4081 1.1.1.19 christos UINT32 Size;
4082 1.1.1.19 christos UINT64 Address;
4083 1.1.1.19 christos
4084 1.1.1.19 christos } ACPI_SVKL_KEY;
4085 1.1.1.19 christos
4086 1.1.1.19 christos enum acpi_svkl_type
4087 1.1.1.19 christos {
4088 1.1.1.19 christos ACPI_SVKL_TYPE_MAIN_STORAGE = 0,
4089 1.1.1.19 christos ACPI_SVKL_TYPE_RESERVED = 1 /* 1 and greater are reserved */
4090 1.1.1.19 christos };
4091 1.1.1.19 christos
4092 1.1.1.19 christos enum acpi_svkl_format
4093 1.1.1.19 christos {
4094 1.1.1.19 christos ACPI_SVKL_FORMAT_RAW_BINARY = 0,
4095 1.1.1.19 christos ACPI_SVKL_FORMAT_RESERVED = 1 /* 1 and greater are reserved */
4096 1.1.1.19 christos };
4097 1.1.1.19 christos
4098 1.1.1.27 christos /*******************************************************************************
4099 1.1.1.27 christos *
4100 1.1.1.27 christos * SWFT - SoundWire File Table
4101 1.1.1.27 christos * as described in Discovery and Configuration (DisCo) Specification
4102 1.1.1.27 christos * for SoundWire
4103 1.1.1.27 christos * Version 1
4104 1.1.1.27 christos *
4105 1.1.1.27 christos ******************************************************************************/
4106 1.1.1.27 christos
4107 1.1.1.27 christos typedef struct acpi_table_swft
4108 1.1.1.27 christos {
4109 1.1.1.27 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
4110 1.1.1.27 christos
4111 1.1.1.27 christos } ACPI_TABLE_SWFT;
4112 1.1.1.27 christos
4113 1.1.1.27 christos typedef struct acpi_swft_file
4114 1.1.1.27 christos {
4115 1.1.1.27 christos UINT16 VendorID;
4116 1.1.1.27 christos UINT32 FileID;
4117 1.1.1.27 christos UINT16 FileVersion;
4118 1.1.1.27 christos UINT16 FileLength;
4119 1.1.1.27 christos UINT8 FileData[];
4120 1.1.1.27 christos
4121 1.1.1.27 christos } ACPI_SWFT_FILE;
4122 1.1.1.19 christos
4123 1.1.1.21 christos /*******************************************************************************
4124 1.1.1.21 christos *
4125 1.1.1.21 christos * TDEL - TD-Event Log
4126 1.1.1.21 christos * From: "Guest-Host-Communication Interface (GHCI) for Intel
4127 1.1.1.21 christos * Trust Domain Extensions (Intel TDX)".
4128 1.1.1.21 christos * September 2020
4129 1.1.1.21 christos *
4130 1.1.1.21 christos ******************************************************************************/
4131 1.1.1.21 christos
4132 1.1.1.21 christos typedef struct acpi_table_tdel
4133 1.1.1.21 christos {
4134 1.1.1.21 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
4135 1.1.1.21 christos UINT32 Reserved;
4136 1.1.1.21 christos UINT64 LogAreaMinimumLength;
4137 1.1.1.21 christos UINT64 LogAreaStartAddress;
4138 1.1.1.21 christos
4139 1.1.1.21 christos } ACPI_TABLE_TDEL;
4140 1.1.1.21 christos
4141 1.1 jruoho /* Reset to default packing */
4142 1.1 jruoho
4143 1.1 jruoho #pragma pack()
4144 1.1 jruoho
4145 1.1 jruoho #endif /* __ACTBL2_H__ */
4146