xref: /linux/include/acpi/actbl2.h (revision 11b3125073d16929403d3aa7b2ae6a482060a937)
195857638SErik Schmauss /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2a8357b0cSBob Moore /******************************************************************************
3a8357b0cSBob Moore  *
45cf4d733SBob Moore  * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
5a8357b0cSBob Moore  *
6612c2932SBob Moore  * Copyright (C) 2000 - 2023, Intel Corp.
7a8357b0cSBob Moore  *
895857638SErik Schmauss  *****************************************************************************/
9a8357b0cSBob Moore 
10b24aad44SBob Moore #ifndef __ACTBL2_H__
11b24aad44SBob Moore #define __ACTBL2_H__
12b24aad44SBob Moore 
13b24aad44SBob Moore /*******************************************************************************
14b24aad44SBob Moore  *
15b24aad44SBob Moore  * Additional ACPI Tables (2)
16b24aad44SBob Moore  *
17b24aad44SBob Moore  * These tables are not consumed directly by the ACPICA subsystem, but are
18b24aad44SBob Moore  * included here to support device drivers and the AML disassembler.
19b24aad44SBob Moore  *
20b24aad44SBob Moore  ******************************************************************************/
21b24aad44SBob Moore 
22b24aad44SBob Moore /*
236e2d5ebdSBob Moore  * Values for description table header signatures for tables defined in this
246e2d5ebdSBob Moore  * file. Useful because they make it more difficult to inadvertently type in
256e2d5ebdSBob Moore  * the wrong signature.
26b24aad44SBob Moore  */
275579649eSIlkka Koskinen #define ACPI_SIG_AGDI           "AGDI"	/* Arm Generic Diagnostic Dump and Reset Device Interface */
281c5d62f5SBesar Wicaksono #define ACPI_SIG_APMT           "APMT"	/* Arm Performance Monitoring Unit table */
299401eafaSBob Moore #define ACPI_SIG_BDAT           "BDAT"	/* BIOS Data ACPI Table */
30407144ebSKuppuswamy Sathyanarayanan #define ACPI_SIG_CCEL           "CCEL"	/* CC Event Log Table */
3151aad1a6SBob Moore #define ACPI_SIG_CDAT           "CDAT"	/* Coherent Device Attribute Table */
32874f6a72SLv Zheng #define ACPI_SIG_IORT           "IORT"	/* IO Remapping Table */
336e2d5ebdSBob Moore #define ACPI_SIG_IVRS           "IVRS"	/* I/O Virtualization Reporting Structure */
34d36d4e30SBob Moore #define ACPI_SIG_LPIT           "LPIT"	/* Low Power Idle Table */
35e62f8227SErik Schmauss #define ACPI_SIG_MADT           "APIC"	/* Multiple APIC Description Table */
36b24aad44SBob Moore #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
370e264f0bSBob Moore #define ACPI_SIG_MCHI           "MCHI"	/* Management Controller Host Interface table */
3847920aaeSHesham Almatary #define ACPI_SIG_MPAM           "MPAM"	/* Memory System Resource Partitioning and Monitoring Table */
39e62f8227SErik Schmauss #define ACPI_SIG_MPST           "MPST"	/* Memory Power State Table */
405132f2faSBob Moore #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
41e62f8227SErik Schmauss #define ACPI_SIG_NFIT           "NFIT"	/* NVDIMM Firmware Interface Table */
42a805aab8SBob Moore #define ACPI_SIG_NHLT           "NHLT"	/* Non HD Audio Link Table */
43e62f8227SErik Schmauss #define ACPI_SIG_PCCT           "PCCT"	/* Platform Communications Channel Table */
44e62f8227SErik Schmauss #define ACPI_SIG_PDTT           "PDTT"	/* Platform Debug Trigger Table */
459f400337SErik Kaneda #define ACPI_SIG_PHAT           "PHAT"	/* Platform Health Assessment Table */
46e62f8227SErik Schmauss #define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table */
47e62f8227SErik Schmauss #define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
48d71df85aSErik Kaneda #define ACPI_SIG_PRMT           "PRMT"	/* Platform Runtime Mechanism Table */
49e62f8227SErik Schmauss #define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
502e94dc11SShiju Jose #define ACPI_SIG_RAS2           "RAS2"	/* RAS2 Feature table */
51536e35c9SBob Moore #define ACPI_SIG_RGRT           "RGRT"	/* Regulatory Graphics Resource Table */
52003567a3SSunil V L #define ACPI_SIG_RHCT           "RHCT"	/* RISC-V Hart Capabilities Table */
53e62f8227SErik Schmauss #define ACPI_SIG_SBST           "SBST"	/* Smart Battery Specification Table */
543bd38469SJames Morse #define ACPI_SIG_SDEI           "SDEI"	/* Software Delegated Exception Interface Table */
55e62f8227SErik Schmauss #define ACPI_SIG_SDEV           "SDEV"	/* Secure Devices table */
568288f69eSKuppuswamy Sathyanarayanan #define ACPI_SIG_SVKL           "SVKL"	/* Storage Volume Key Location Table */
572de6bb92SBob Moore #define ACPI_SIG_TDEL           "TDEL"	/* TD Event Log Table */
584461cf54SBob Moore 
59b24aad44SBob Moore /*
60b24aad44SBob Moore  * All tables must be byte-packed to match the ACPI specification, since
61b24aad44SBob Moore  * the tables are provided by the system BIOS.
62b24aad44SBob Moore  */
63b24aad44SBob Moore #pragma pack(1)
64b24aad44SBob Moore 
65b24aad44SBob Moore /*
66be030a57SBob Moore  * Note: C bitfields are not used for this reason:
67be030a57SBob Moore  *
68be030a57SBob Moore  * "Bitfields are great and easy to read, but unfortunately the C language
69be030a57SBob Moore  * does not specify the layout of bitfields in memory, which means they are
70be030a57SBob Moore  * essentially useless for dealing with packed data in on-disk formats or
71be030a57SBob Moore  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
72be030a57SBob Moore  * this decision was a design error in C. Ritchie could have picked an order
73be030a57SBob Moore  * and stuck with it." Norman Ramsey.
74be030a57SBob Moore  * See http://stackoverflow.com/a/1053662/41661
75b24aad44SBob Moore  */
76b24aad44SBob Moore 
77b24aad44SBob Moore /*******************************************************************************
78b24aad44SBob Moore  *
79e692fa13SBob Moore  * AEST - Arm Error Source Table
80e692fa13SBob Moore  *
81e0492490SRuidong Tian  * Conforms to: ACPI for the Armv8 RAS Extensions 1.1(Sep 2020) and
82e0492490SRuidong Tian  * 2.0(May 2023) Platform Design Document.
83e692fa13SBob Moore  *
84e692fa13SBob Moore  ******************************************************************************/
85e692fa13SBob Moore 
86e692fa13SBob Moore struct acpi_table_aest {
87e692fa13SBob Moore 	struct acpi_table_header header;
88e692fa13SBob Moore };
89e692fa13SBob Moore 
90e692fa13SBob Moore /* Common Subtable header - one per Node Structure (Subtable) */
91e692fa13SBob Moore 
92e692fa13SBob Moore struct acpi_aest_hdr {
93e692fa13SBob Moore 	u8 type;
94e692fa13SBob Moore 	u16 length;
95e692fa13SBob Moore 	u8 reserved;
96e692fa13SBob Moore 	u32 node_specific_offset;
97e692fa13SBob Moore 	u32 node_interface_offset;
98e692fa13SBob Moore 	u32 node_interrupt_offset;
99e692fa13SBob Moore 	u32 node_interrupt_count;
100e692fa13SBob Moore 	u64 timestamp_rate;
101e692fa13SBob Moore 	u64 reserved1;
102e692fa13SBob Moore 	u64 error_injection_rate;
103e692fa13SBob Moore };
104e692fa13SBob Moore 
105e692fa13SBob Moore /* Values for Type above */
106e692fa13SBob Moore 
107e692fa13SBob Moore #define ACPI_AEST_PROCESSOR_ERROR_NODE      0
108e692fa13SBob Moore #define ACPI_AEST_MEMORY_ERROR_NODE         1
109e692fa13SBob Moore #define ACPI_AEST_SMMU_ERROR_NODE           2
110e692fa13SBob Moore #define ACPI_AEST_VENDOR_ERROR_NODE         3
111e692fa13SBob Moore #define ACPI_AEST_GIC_ERROR_NODE            4
112e0492490SRuidong Tian #define ACPI_AEST_PCIE_ERROR_NODE           5
113e0492490SRuidong Tian #define ACPI_AEST_PROXY_ERROR_NODE          6
114e0492490SRuidong Tian #define ACPI_AEST_NODE_TYPE_RESERVED        7 /* 7 and above are reserved */
115e692fa13SBob Moore 
116e692fa13SBob Moore /*
117e692fa13SBob Moore  * AEST subtables (Error nodes)
118e692fa13SBob Moore  */
119e692fa13SBob Moore 
120e692fa13SBob Moore /* 0: Processor Error */
121e692fa13SBob Moore 
122e692fa13SBob Moore typedef struct acpi_aest_processor {
123e692fa13SBob Moore 	u32 processor_id;
124e692fa13SBob Moore 	u8 resource_type;
125e692fa13SBob Moore 	u8 reserved;
126e692fa13SBob Moore 	u8 flags;
127e692fa13SBob Moore 	u8 revision;
128e692fa13SBob Moore 	u64 processor_affinity;
129e692fa13SBob Moore 
130e692fa13SBob Moore } acpi_aest_processor;
131e692fa13SBob Moore 
132e692fa13SBob Moore /* Values for resource_type above, related structs below */
133e692fa13SBob Moore 
134e692fa13SBob Moore #define ACPI_AEST_CACHE_RESOURCE            0
135e692fa13SBob Moore #define ACPI_AEST_TLB_RESOURCE              1
136e692fa13SBob Moore #define ACPI_AEST_GENERIC_RESOURCE          2
137e692fa13SBob Moore #define ACPI_AEST_RESOURCE_RESERVED         3	/* 3 and above are reserved */
138e692fa13SBob Moore 
139e692fa13SBob Moore /* 0R: Processor Cache Resource Substructure */
140e692fa13SBob Moore 
141e692fa13SBob Moore typedef struct acpi_aest_processor_cache {
142e692fa13SBob Moore 	u32 cache_reference;
143e692fa13SBob Moore 	u32 reserved;
144e692fa13SBob Moore 
145e692fa13SBob Moore } acpi_aest_processor_cache;
146e692fa13SBob Moore 
147e692fa13SBob Moore /* Values for cache_type above */
148e692fa13SBob Moore 
149e692fa13SBob Moore #define ACPI_AEST_CACHE_DATA                0
150e692fa13SBob Moore #define ACPI_AEST_CACHE_INSTRUCTION         1
151e692fa13SBob Moore #define ACPI_AEST_CACHE_UNIFIED             2
152e692fa13SBob Moore #define ACPI_AEST_CACHE_RESERVED            3	/* 3 and above are reserved */
153e692fa13SBob Moore 
154e692fa13SBob Moore /* 1R: Processor TLB Resource Substructure */
155e692fa13SBob Moore 
156e692fa13SBob Moore typedef struct acpi_aest_processor_tlb {
157e692fa13SBob Moore 	u32 tlb_level;
158e692fa13SBob Moore 	u32 reserved;
159e692fa13SBob Moore 
160e692fa13SBob Moore } acpi_aest_processor_tlb;
161e692fa13SBob Moore 
162e692fa13SBob Moore /* 2R: Processor Generic Resource Substructure */
163e692fa13SBob Moore 
164e692fa13SBob Moore typedef struct acpi_aest_processor_generic {
16500395b74SShuuichirou Ishii 	u32 resource;
166e692fa13SBob Moore 
167e692fa13SBob Moore } acpi_aest_processor_generic;
168e692fa13SBob Moore 
169e692fa13SBob Moore /* 1: Memory Error */
170e692fa13SBob Moore 
171e692fa13SBob Moore typedef struct acpi_aest_memory {
172e692fa13SBob Moore 	u32 srat_proximity_domain;
173e692fa13SBob Moore 
174e692fa13SBob Moore } acpi_aest_memory;
175e692fa13SBob Moore 
176e692fa13SBob Moore /* 2: Smmu Error */
177e692fa13SBob Moore 
178e692fa13SBob Moore typedef struct acpi_aest_smmu {
179e692fa13SBob Moore 	u32 iort_node_reference;
180e692fa13SBob Moore 	u32 subcomponent_reference;
181e692fa13SBob Moore 
182e692fa13SBob Moore } acpi_aest_smmu;
183e692fa13SBob Moore 
184e692fa13SBob Moore /* 3: Vendor Defined */
185e692fa13SBob Moore 
186e692fa13SBob Moore typedef struct acpi_aest_vendor {
187e692fa13SBob Moore 	u32 acpi_hid;
188e692fa13SBob Moore 	u32 acpi_uid;
189e692fa13SBob Moore 	u8 vendor_specific_data[16];
190e692fa13SBob Moore 
191e692fa13SBob Moore } acpi_aest_vendor;
192e692fa13SBob Moore 
193e0492490SRuidong Tian struct acpi_aest_vendor_v2 {
194e0492490SRuidong Tian 	char acpi_hid[8];
195e0492490SRuidong Tian 	u32 acpi_uid;
196e0492490SRuidong Tian 	u8 vendor_specific_data[16];
197e0492490SRuidong Tian };
198e0492490SRuidong Tian 
199e692fa13SBob Moore /* 4: Gic Error */
200e692fa13SBob Moore 
201e692fa13SBob Moore typedef struct acpi_aest_gic {
202e692fa13SBob Moore 	u32 interface_type;
203e692fa13SBob Moore 	u32 instance_id;
204e692fa13SBob Moore 
205e692fa13SBob Moore } acpi_aest_gic;
206e692fa13SBob Moore 
207e692fa13SBob Moore /* Values for interface_type above */
208e692fa13SBob Moore 
209e692fa13SBob Moore #define ACPI_AEST_GIC_CPU                   0
210e692fa13SBob Moore #define ACPI_AEST_GIC_DISTRIBUTOR           1
211e692fa13SBob Moore #define ACPI_AEST_GIC_REDISTRIBUTOR         2
212e692fa13SBob Moore #define ACPI_AEST_GIC_ITS                   3
213e692fa13SBob Moore #define ACPI_AEST_GIC_RESERVED              4	/* 4 and above are reserved */
214e692fa13SBob Moore 
215e0492490SRuidong Tian /* 5: PCIe Error */
216e0492490SRuidong Tian 
217e0492490SRuidong Tian struct acpi_aest_pcie {
218e0492490SRuidong Tian 	u32 iort_node_reference;
219e0492490SRuidong Tian };
220e0492490SRuidong Tian 
221e0492490SRuidong Tian /* 6: Proxy Error */
222e0492490SRuidong Tian 
223e0492490SRuidong Tian struct acpi_aest_proxy {
224e0492490SRuidong Tian 	u64 node_address;
225e0492490SRuidong Tian };
226e0492490SRuidong Tian 
227e692fa13SBob Moore /* Node Interface Structure */
228e692fa13SBob Moore 
229e692fa13SBob Moore typedef struct acpi_aest_node_interface {
230e692fa13SBob Moore 	u8 type;
231e692fa13SBob Moore 	u8 reserved[3];
232e692fa13SBob Moore 	u32 flags;
233e692fa13SBob Moore 	u64 address;
234e692fa13SBob Moore 	u32 error_record_index;
235e692fa13SBob Moore 	u32 error_record_count;
236e692fa13SBob Moore 	u64 error_record_implemented;
237e692fa13SBob Moore 	u64 error_status_reporting;
238e692fa13SBob Moore 	u64 addressing_mode;
239e692fa13SBob Moore 
240e692fa13SBob Moore } acpi_aest_node_interface;
241e692fa13SBob Moore 
242e0492490SRuidong Tian /* Node Interface Structure V2 */
243e0492490SRuidong Tian 
244e0492490SRuidong Tian struct acpi_aest_node_interface_header {
245e0492490SRuidong Tian 	u8 type;
246e0492490SRuidong Tian 	u8 group_format;
247e0492490SRuidong Tian 	u8 reserved[2];
248e0492490SRuidong Tian 	u32 flags;
249e0492490SRuidong Tian 	u64 address;
250e0492490SRuidong Tian 	u32 error_record_index;
251e0492490SRuidong Tian 	u32 error_record_count;
252e0492490SRuidong Tian };
253e0492490SRuidong Tian 
254e0492490SRuidong Tian #define ACPI_AEST_NODE_GROUP_FORMAT_4K          0
255e0492490SRuidong Tian #define ACPI_AEST_NODE_GROUP_FORMAT_16K         1
256e0492490SRuidong Tian #define ACPI_AEST_NODE_GROUP_FORMAT_64K         2
257e0492490SRuidong Tian 
258e0492490SRuidong Tian struct acpi_aest_node_interface_common {
259e0492490SRuidong Tian 	u32 error_node_device;
260e0492490SRuidong Tian 	u32 processor_affinity;
261e0492490SRuidong Tian 	u64 error_group_register_base;
262e0492490SRuidong Tian 	u64 fault_inject_register_base;
263e0492490SRuidong Tian 	u64 interrupt_config_register_base;
264e0492490SRuidong Tian };
265e0492490SRuidong Tian 
266e0492490SRuidong Tian struct acpi_aest_node_interface_4k {
267e0492490SRuidong Tian 	u64 error_record_implemented;
268e0492490SRuidong Tian 	u64 error_status_reporting;
269e0492490SRuidong Tian 	u64 addressing_mode;
270e0492490SRuidong Tian 	struct acpi_aest_node_interface_common common;
271e0492490SRuidong Tian };
272e0492490SRuidong Tian 
273e0492490SRuidong Tian struct acpi_aest_node_interface_16k {
274e0492490SRuidong Tian 	u64 error_record_implemented[4];
275e0492490SRuidong Tian 	u64 error_status_reporting[4];
276e0492490SRuidong Tian 	u64 addressing_mode[4];
277e0492490SRuidong Tian 	struct acpi_aest_node_interface_common common;
278e0492490SRuidong Tian };
279e0492490SRuidong Tian 
280e0492490SRuidong Tian struct acpi_aest_node_interface_64k {
281e0492490SRuidong Tian 	u64 error_record_implemented[14];
282e0492490SRuidong Tian 	u64 error_status_reporting[14];
283e0492490SRuidong Tian 	u64 addressing_mode[14];
284e0492490SRuidong Tian 	struct acpi_aest_node_interface_common common;
285e0492490SRuidong Tian };
286e0492490SRuidong Tian 
287e692fa13SBob Moore /* Values for Type field above */
288e692fa13SBob Moore 
289e692fa13SBob Moore #define ACPI_AEST_NODE_SYSTEM_REGISTER			0
290e692fa13SBob Moore #define ACPI_AEST_NODE_MEMORY_MAPPED			1
291e0492490SRuidong Tian #define ACPI_AEST_NODE_SINGLE_RECORD_MEMORY_MAPPED	2
292e0492490SRuidong Tian #define ACPI_AEST_XFACE_RESERVED			3   /* 2 and above are reserved */
293e692fa13SBob Moore 
294e692fa13SBob Moore /* Node Interrupt Structure */
295e692fa13SBob Moore 
296e692fa13SBob Moore typedef struct acpi_aest_node_interrupt {
297e692fa13SBob Moore 	u8 type;
298e692fa13SBob Moore 	u8 reserved[2];
299e692fa13SBob Moore 	u8 flags;
300e692fa13SBob Moore 	u32 gsiv;
301e692fa13SBob Moore 	u8 iort_id;
302e692fa13SBob Moore 	u8 reserved1[3];
303e692fa13SBob Moore 
304e692fa13SBob Moore } acpi_aest_node_interrupt;
305e692fa13SBob Moore 
306e0492490SRuidong Tian /* Node Interrupt Structure V2 */
307e0492490SRuidong Tian 
308e0492490SRuidong Tian struct acpi_aest_node_interrupt_v2 {
309e0492490SRuidong Tian 	u8 type;
310e0492490SRuidong Tian 	u8 reserved[2];
311e0492490SRuidong Tian 	u8 flags;
312e0492490SRuidong Tian 	u32 gsiv;
313e0492490SRuidong Tian 	u8 reserved1[4];
314e0492490SRuidong Tian };
315e0492490SRuidong Tian 
316e692fa13SBob Moore /* Values for Type field above */
317e692fa13SBob Moore 
318e692fa13SBob Moore #define ACPI_AEST_NODE_FAULT_HANDLING       0
319e692fa13SBob Moore #define ACPI_AEST_NODE_ERROR_RECOVERY       1
320e692fa13SBob Moore #define ACPI_AEST_XRUPT_RESERVED            2	/* 2 and above are reserved */
321e692fa13SBob Moore 
322e692fa13SBob Moore /*******************************************************************************
3235579649eSIlkka Koskinen  * AGDI - Arm Generic Diagnostic Dump and Reset Device Interface
3245579649eSIlkka Koskinen  *
3255579649eSIlkka Koskinen  * Conforms to "ACPI for Arm Components 1.1, Platform Design Document"
3265579649eSIlkka Koskinen  * ARM DEN0093 v1.1
3275579649eSIlkka Koskinen  *
3285579649eSIlkka Koskinen  ******************************************************************************/
3295579649eSIlkka Koskinen struct acpi_table_agdi {
3305579649eSIlkka Koskinen 	struct acpi_table_header header;	/* Common ACPI table header */
3315579649eSIlkka Koskinen 	u8 flags;
3325579649eSIlkka Koskinen 	u8 reserved[3];
3335579649eSIlkka Koskinen 	u32 sdei_event;
3345579649eSIlkka Koskinen 	u32 gsiv;
3355579649eSIlkka Koskinen };
3365579649eSIlkka Koskinen 
3375579649eSIlkka Koskinen /* Mask for Flags field above */
3385579649eSIlkka Koskinen 
3395579649eSIlkka Koskinen #define ACPI_AGDI_SIGNALING_MODE (1)
3405579649eSIlkka Koskinen 
3415579649eSIlkka Koskinen /*******************************************************************************
342e692fa13SBob Moore  *
3431c5d62f5SBesar Wicaksono  * APMT - ARM Performance Monitoring Unit Table
3441c5d62f5SBesar Wicaksono  *
3451c5d62f5SBesar Wicaksono  * Conforms to:
3461c5d62f5SBesar Wicaksono  * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document
3471c5d62f5SBesar Wicaksono  * ARM DEN0117 v1.0 November 25, 2021
3481c5d62f5SBesar Wicaksono  *
3491c5d62f5SBesar Wicaksono  ******************************************************************************/
3501c5d62f5SBesar Wicaksono 
3511c5d62f5SBesar Wicaksono struct acpi_table_apmt {
3521c5d62f5SBesar Wicaksono 	struct acpi_table_header header;	/* Common ACPI table header */
3531c5d62f5SBesar Wicaksono };
3541c5d62f5SBesar Wicaksono 
3551c5d62f5SBesar Wicaksono #define ACPI_APMT_NODE_ID_LENGTH                4
3561c5d62f5SBesar Wicaksono 
3571c5d62f5SBesar Wicaksono /*
3581c5d62f5SBesar Wicaksono  * APMT subtables
3591c5d62f5SBesar Wicaksono  */
3601c5d62f5SBesar Wicaksono struct acpi_apmt_node {
3611c5d62f5SBesar Wicaksono 	u16 length;
3621c5d62f5SBesar Wicaksono 	u8 flags;
3631c5d62f5SBesar Wicaksono 	u8 type;
3641c5d62f5SBesar Wicaksono 	u32 id;
3651c5d62f5SBesar Wicaksono 	u64 inst_primary;
3661c5d62f5SBesar Wicaksono 	u32 inst_secondary;
3671c5d62f5SBesar Wicaksono 	u64 base_address0;
3681c5d62f5SBesar Wicaksono 	u64 base_address1;
3691c5d62f5SBesar Wicaksono 	u32 ovflw_irq;
3701c5d62f5SBesar Wicaksono 	u32 reserved;
3711c5d62f5SBesar Wicaksono 	u32 ovflw_irq_flags;
3721c5d62f5SBesar Wicaksono 	u32 proc_affinity;
3731c5d62f5SBesar Wicaksono 	u32 impl_id;
3741c5d62f5SBesar Wicaksono };
3751c5d62f5SBesar Wicaksono 
3761c5d62f5SBesar Wicaksono /* Masks for Flags field above */
3771c5d62f5SBesar Wicaksono 
3781c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_DUAL_PAGE               (1<<0)
3791c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_AFFINITY                (1<<1)
3801c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_ATOMIC                  (1<<2)
3811c5d62f5SBesar Wicaksono 
3821c5d62f5SBesar Wicaksono /* Values for Flags dual page field above */
3831c5d62f5SBesar Wicaksono 
3841c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_DUAL_PAGE_NSUPP         (0<<0)
3851c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_DUAL_PAGE_SUPP          (1<<0)
3861c5d62f5SBesar Wicaksono 
3871c5d62f5SBesar Wicaksono /* Values for Flags processor affinity field above */
3881c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_AFFINITY_PROC           (0<<1)
3891c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_AFFINITY_PROC_CONTAINER (1<<1)
3901c5d62f5SBesar Wicaksono 
3911c5d62f5SBesar Wicaksono /* Values for Flags 64-bit atomic field above */
3921c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_ATOMIC_NSUPP            (0<<2)
3931c5d62f5SBesar Wicaksono #define ACPI_APMT_FLAGS_ATOMIC_SUPP             (1<<2)
3941c5d62f5SBesar Wicaksono 
3951c5d62f5SBesar Wicaksono /* Values for Type field above */
3961c5d62f5SBesar Wicaksono 
3971c5d62f5SBesar Wicaksono enum acpi_apmt_node_type {
3981c5d62f5SBesar Wicaksono 	ACPI_APMT_NODE_TYPE_MC = 0x00,
3991c5d62f5SBesar Wicaksono 	ACPI_APMT_NODE_TYPE_SMMU = 0x01,
4001c5d62f5SBesar Wicaksono 	ACPI_APMT_NODE_TYPE_PCIE_ROOT = 0x02,
4011c5d62f5SBesar Wicaksono 	ACPI_APMT_NODE_TYPE_ACPI = 0x03,
4021c5d62f5SBesar Wicaksono 	ACPI_APMT_NODE_TYPE_CACHE = 0x04,
4031c5d62f5SBesar Wicaksono 	ACPI_APMT_NODE_TYPE_COUNT
4041c5d62f5SBesar Wicaksono };
4051c5d62f5SBesar Wicaksono 
4061c5d62f5SBesar Wicaksono /* Masks for ovflw_irq_flags field above */
4071c5d62f5SBesar Wicaksono 
4081c5d62f5SBesar Wicaksono #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE          (1<<0)
4091c5d62f5SBesar Wicaksono #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE          (1<<1)
4101c5d62f5SBesar Wicaksono 
4111c5d62f5SBesar Wicaksono /* Values for ovflw_irq_flags mode field above */
4121c5d62f5SBesar Wicaksono 
4131c5d62f5SBesar Wicaksono #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_LEVEL    (0<<0)
4141c5d62f5SBesar Wicaksono #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_EDGE     (1<<0)
4151c5d62f5SBesar Wicaksono 
4161c5d62f5SBesar Wicaksono /* Values for ovflw_irq_flags type field above */
4171c5d62f5SBesar Wicaksono 
4181c5d62f5SBesar Wicaksono #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE_WIRED    (0<<1)
4191c5d62f5SBesar Wicaksono 
4201c5d62f5SBesar Wicaksono /*******************************************************************************
4211c5d62f5SBesar Wicaksono  *
4229401eafaSBob Moore  * BDAT - BIOS Data ACPI Table
4239401eafaSBob Moore  *
4249401eafaSBob Moore  * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5
4259401eafaSBob Moore  * Nov 2020
4269401eafaSBob Moore  *
4279401eafaSBob Moore  ******************************************************************************/
4289401eafaSBob Moore 
4299401eafaSBob Moore struct acpi_table_bdat {
4309401eafaSBob Moore 	struct acpi_table_header header;
4319401eafaSBob Moore 	struct acpi_generic_address gas;
4329401eafaSBob Moore };
4339401eafaSBob Moore 
4349401eafaSBob Moore /*******************************************************************************
4359401eafaSBob Moore  *
436407144ebSKuppuswamy Sathyanarayanan  * CCEL - CC-Event Log
437407144ebSKuppuswamy Sathyanarayanan  *        From: "Guest-Host-Communication Interface (GHCI) for Intel
438407144ebSKuppuswamy Sathyanarayanan  *        Trust Domain Extensions (Intel TDX)". Feb 2022
439407144ebSKuppuswamy Sathyanarayanan  *
440407144ebSKuppuswamy Sathyanarayanan  ******************************************************************************/
441407144ebSKuppuswamy Sathyanarayanan 
442407144ebSKuppuswamy Sathyanarayanan struct acpi_table_ccel {
443407144ebSKuppuswamy Sathyanarayanan 	struct acpi_table_header header;	/* Common ACPI table header */
444407144ebSKuppuswamy Sathyanarayanan 	u8 CCtype;
445407144ebSKuppuswamy Sathyanarayanan 	u8 Ccsub_type;
446407144ebSKuppuswamy Sathyanarayanan 	u16 reserved;
447407144ebSKuppuswamy Sathyanarayanan 	u64 log_area_minimum_length;
448407144ebSKuppuswamy Sathyanarayanan 	u64 log_area_start_address;
449407144ebSKuppuswamy Sathyanarayanan };
450407144ebSKuppuswamy Sathyanarayanan 
451407144ebSKuppuswamy Sathyanarayanan /*******************************************************************************
452407144ebSKuppuswamy Sathyanarayanan  *
453874f6a72SLv Zheng  * IORT - IO Remapping Table
454874f6a72SLv Zheng  *
455874f6a72SLv Zheng  * Conforms to "IO Remapping Table System Software on ARM Platforms",
4563f062a51SRobin Murphy  * Document number: ARM DEN 0049E.e, Sep 2022
457874f6a72SLv Zheng  *
458874f6a72SLv Zheng  ******************************************************************************/
459874f6a72SLv Zheng 
460874f6a72SLv Zheng struct acpi_table_iort {
461874f6a72SLv Zheng 	struct acpi_table_header header;
462874f6a72SLv Zheng 	u32 node_count;
463874f6a72SLv Zheng 	u32 node_offset;
464874f6a72SLv Zheng 	u32 reserved;
465874f6a72SLv Zheng };
466874f6a72SLv Zheng 
467874f6a72SLv Zheng /*
468874f6a72SLv Zheng  * IORT subtables
469874f6a72SLv Zheng  */
470874f6a72SLv Zheng struct acpi_iort_node {
471874f6a72SLv Zheng 	u8 type;
472874f6a72SLv Zheng 	u16 length;
473874f6a72SLv Zheng 	u8 revision;
4748e1fdd7fSShameer Kolothum 	u32 identifier;
475874f6a72SLv Zheng 	u32 mapping_count;
476874f6a72SLv Zheng 	u32 mapping_offset;
47774522feaSKees Cook 	char node_data[];
478874f6a72SLv Zheng };
479874f6a72SLv Zheng 
480874f6a72SLv Zheng /* Values for subtable Type above */
481874f6a72SLv Zheng 
482874f6a72SLv Zheng enum acpi_iort_node_type {
483874f6a72SLv Zheng 	ACPI_IORT_NODE_ITS_GROUP = 0x00,
484874f6a72SLv Zheng 	ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
485874f6a72SLv Zheng 	ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
4864ac78bafSAl Stone 	ACPI_IORT_NODE_SMMU = 0x03,
487a53eaef6SRobin Murphy 	ACPI_IORT_NODE_SMMU_V3 = 0x04,
4888e1fdd7fSShameer Kolothum 	ACPI_IORT_NODE_PMCG = 0x05,
4898e1fdd7fSShameer Kolothum 	ACPI_IORT_NODE_RMR = 0x06,
490874f6a72SLv Zheng };
491874f6a72SLv Zheng 
492874f6a72SLv Zheng struct acpi_iort_id_mapping {
493874f6a72SLv Zheng 	u32 input_base;		/* Lowest value in input range */
494874f6a72SLv Zheng 	u32 id_count;		/* Number of IDs */
495874f6a72SLv Zheng 	u32 output_base;	/* Lowest value in output range */
496874f6a72SLv Zheng 	u32 output_reference;	/* A reference to the output node */
497874f6a72SLv Zheng 	u32 flags;
498874f6a72SLv Zheng };
499874f6a72SLv Zheng 
500874f6a72SLv Zheng /* Masks for Flags field above for IORT subtable */
501874f6a72SLv Zheng 
502874f6a72SLv Zheng #define ACPI_IORT_ID_SINGLE_MAPPING (1)
503874f6a72SLv Zheng 
504874f6a72SLv Zheng struct acpi_iort_memory_access {
505874f6a72SLv Zheng 	u32 cache_coherency;
506874f6a72SLv Zheng 	u8 hints;
507874f6a72SLv Zheng 	u16 reserved;
508874f6a72SLv Zheng 	u8 memory_flags;
509874f6a72SLv Zheng };
510874f6a72SLv Zheng 
511874f6a72SLv Zheng /* Values for cache_coherency field above */
512874f6a72SLv Zheng 
513874f6a72SLv Zheng #define ACPI_IORT_NODE_COHERENT         0x00000001	/* The device node is fully coherent */
514874f6a72SLv Zheng #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000	/* The device node is not coherent */
515874f6a72SLv Zheng 
516874f6a72SLv Zheng /* Masks for Hints field above */
517874f6a72SLv Zheng 
518874f6a72SLv Zheng #define ACPI_IORT_HT_TRANSIENT          (1)
519874f6a72SLv Zheng #define ACPI_IORT_HT_WRITE              (1<<1)
520874f6a72SLv Zheng #define ACPI_IORT_HT_READ               (1<<2)
521874f6a72SLv Zheng #define ACPI_IORT_HT_OVERRIDE           (1<<3)
522874f6a72SLv Zheng 
523874f6a72SLv Zheng /* Masks for memory_flags field above */
524874f6a72SLv Zheng 
525874f6a72SLv Zheng #define ACPI_IORT_MF_COHERENCY          (1)
526874f6a72SLv Zheng #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
527874f6a72SLv Zheng 
528874f6a72SLv Zheng /*
529874f6a72SLv Zheng  * IORT node specific subtables
530874f6a72SLv Zheng  */
531874f6a72SLv Zheng struct acpi_iort_its_group {
532874f6a72SLv Zheng 	u32 its_count;
53374522feaSKees Cook 	u32 identifiers[];	/* GIC ITS identifier array */
534874f6a72SLv Zheng };
535874f6a72SLv Zheng 
536874f6a72SLv Zheng struct acpi_iort_named_component {
537874f6a72SLv Zheng 	u32 node_flags;
538874f6a72SLv Zheng 	u64 memory_properties;	/* Memory access properties */
539874f6a72SLv Zheng 	u8 memory_address_limit;	/* Memory address size limit */
54074522feaSKees Cook 	char device_name[];	/* Path of namespace object */
541874f6a72SLv Zheng };
542874f6a72SLv Zheng 
543d87be043SRobin Murphy /* Masks for Flags field above */
544d87be043SRobin Murphy 
545d87be043SRobin Murphy #define ACPI_IORT_NC_STALL_SUPPORTED    (1)
546d87be043SRobin Murphy #define ACPI_IORT_NC_PASID_BITS         (31<<1)
547d87be043SRobin Murphy 
548874f6a72SLv Zheng struct acpi_iort_root_complex {
549874f6a72SLv Zheng 	u64 memory_properties;	/* Memory access properties */
550874f6a72SLv Zheng 	u32 ats_attribute;
551874f6a72SLv Zheng 	u32 pci_segment_number;
552d87be043SRobin Murphy 	u8 memory_address_limit;	/* Memory address size limit */
5534fd14753SShameer Kolothum 	u16 pasid_capabilities;	/* PASID Capabilities */
55474522feaSKees Cook 	u8 reserved[];		/* Reserved, must be zero */
555874f6a72SLv Zheng };
556874f6a72SLv Zheng 
5578e1fdd7fSShameer Kolothum /* Masks for ats_attribute field above */
558874f6a72SLv Zheng 
5598e1fdd7fSShameer Kolothum #define ACPI_IORT_ATS_SUPPORTED         (1)	/* The root complex ATS support */
5608e1fdd7fSShameer Kolothum #define ACPI_IORT_PRI_SUPPORTED         (1<<1)	/* The root complex PRI support */
5618e1fdd7fSShameer Kolothum #define ACPI_IORT_PASID_FWD_SUPPORTED   (1<<2)	/* The root complex PASID forward support */
562874f6a72SLv Zheng 
5634fd14753SShameer Kolothum /* Masks for pasid_capabilities field above */
5644fd14753SShameer Kolothum #define ACPI_IORT_PASID_MAX_WIDTH       (0x1F)	/* Bits 0-4 */
5654fd14753SShameer Kolothum 
566874f6a72SLv Zheng struct acpi_iort_smmu {
567874f6a72SLv Zheng 	u64 base_address;	/* SMMU base address */
568874f6a72SLv Zheng 	u64 span;		/* Length of memory range */
569874f6a72SLv Zheng 	u32 model;
570874f6a72SLv Zheng 	u32 flags;
571874f6a72SLv Zheng 	u32 global_interrupt_offset;
572874f6a72SLv Zheng 	u32 context_interrupt_count;
573874f6a72SLv Zheng 	u32 context_interrupt_offset;
574874f6a72SLv Zheng 	u32 pmu_interrupt_count;
575874f6a72SLv Zheng 	u32 pmu_interrupt_offset;
57674522feaSKees Cook 	u64 interrupts[];	/* Interrupt array */
577874f6a72SLv Zheng };
578874f6a72SLv Zheng 
579874f6a72SLv Zheng /* Values for Model field above */
580874f6a72SLv Zheng 
581874f6a72SLv Zheng #define ACPI_IORT_SMMU_V1               0x00000000	/* Generic SMMUv1 */
582874f6a72SLv Zheng #define ACPI_IORT_SMMU_V2               0x00000001	/* Generic SMMUv2 */
583874f6a72SLv Zheng #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002	/* ARM Corelink MMU-400 */
584874f6a72SLv Zheng #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003	/* ARM Corelink MMU-500 */
5850c2021c0SRobin Murphy #define ACPI_IORT_SMMU_CORELINK_MMU401  0x00000004	/* ARM Corelink MMU-401 */
5860c2021c0SRobin Murphy #define ACPI_IORT_SMMU_CAVIUM_THUNDERX  0x00000005	/* Cavium thunder_x SMMUv2 */
587874f6a72SLv Zheng 
588874f6a72SLv Zheng /* Masks for Flags field above */
589874f6a72SLv Zheng 
590874f6a72SLv Zheng #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
591874f6a72SLv Zheng #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
592874f6a72SLv Zheng 
593bb1e23e6SLv Zheng /* Global interrupt format */
594bb1e23e6SLv Zheng 
595bb1e23e6SLv Zheng struct acpi_iort_smmu_gsi {
596bb1e23e6SLv Zheng 	u32 nsg_irpt;
597bb1e23e6SLv Zheng 	u32 nsg_irpt_flags;
598bb1e23e6SLv Zheng 	u32 nsg_cfg_irpt;
599bb1e23e6SLv Zheng 	u32 nsg_cfg_irpt_flags;
600bb1e23e6SLv Zheng };
601bb1e23e6SLv Zheng 
6024ac78bafSAl Stone struct acpi_iort_smmu_v3 {
6034ac78bafSAl Stone 	u64 base_address;	/* SMMUv3 base address */
6044ac78bafSAl Stone 	u32 flags;
6054ac78bafSAl Stone 	u32 reserved;
6064ac78bafSAl Stone 	u64 vatos_address;
6070c2021c0SRobin Murphy 	u32 model;
6084ac78bafSAl Stone 	u32 event_gsiv;
6094ac78bafSAl Stone 	u32 pri_gsiv;
6104ac78bafSAl Stone 	u32 gerr_gsiv;
6114ac78bafSAl Stone 	u32 sync_gsiv;
612d87be043SRobin Murphy 	u32 pxm;
6134c106aa4SHanjun Guo 	u32 id_mapping_index;
6144ac78bafSAl Stone };
6154ac78bafSAl Stone 
6160c2021c0SRobin Murphy /* Values for Model field above */
6170c2021c0SRobin Murphy 
6180c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_GENERIC           0x00000000	/* Generic SMMUv3 */
6190c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_HISILICON_HI161X  0x00000001	/* hi_silicon Hi161x SMMUv3 */
6200c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX     0x00000002	/* Cavium CN99xx SMMUv3 */
6210c2021c0SRobin Murphy 
6224ac78bafSAl Stone /* Masks for Flags field above */
6234ac78bafSAl Stone 
6244ac78bafSAl Stone #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
625d87be043SRobin Murphy #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (3<<1)
626c9442300SGanapatrao Kulkarni #define ACPI_IORT_SMMU_V3_PXM_VALID         (1<<3)
6273f062a51SRobin Murphy #define ACPI_IORT_SMMU_V3_DEVICEID_VALID    (1<<4)
6284ac78bafSAl Stone 
629a53eaef6SRobin Murphy struct acpi_iort_pmcg {
630a53eaef6SRobin Murphy 	u64 page0_base_address;
631a53eaef6SRobin Murphy 	u32 overflow_gsiv;
632a53eaef6SRobin Murphy 	u32 node_reference;
633a53eaef6SRobin Murphy 	u64 page1_base_address;
634a53eaef6SRobin Murphy };
635a53eaef6SRobin Murphy 
6368e1fdd7fSShameer Kolothum struct acpi_iort_rmr {
6378e1fdd7fSShameer Kolothum 	u32 flags;
6388e1fdd7fSShameer Kolothum 	u32 rmr_count;
6398e1fdd7fSShameer Kolothum 	u32 rmr_offset;
6408e1fdd7fSShameer Kolothum };
6418e1fdd7fSShameer Kolothum 
6424fd14753SShameer Kolothum /* Masks for Flags field above */
6434fd14753SShameer Kolothum #define ACPI_IORT_RMR_REMAP_PERMITTED      (1)
6444fd14753SShameer Kolothum #define ACPI_IORT_RMR_ACCESS_PRIVILEGE     (1<<1)
6454fd14753SShameer Kolothum 
6464fd14753SShameer Kolothum /*
6474fd14753SShameer Kolothum  * Macro to access the Access Attributes in flags field above:
6484fd14753SShameer Kolothum  *  Access Attributes is encoded in bits 9:2
6494fd14753SShameer Kolothum  */
6504fd14753SShameer Kolothum #define ACPI_IORT_RMR_ACCESS_ATTRIBUTES(flags)          (((flags) >> 2) & 0xFF)
6514fd14753SShameer Kolothum 
6524fd14753SShameer Kolothum /* Values for above Access Attributes */
6534fd14753SShameer Kolothum 
6544fd14753SShameer Kolothum #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRNE   0x00
6554fd14753SShameer Kolothum #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRE    0x01
6564fd14753SShameer Kolothum #define ACPI_IORT_RMR_ATTR_DEVICE_NGRE     0x02
6574fd14753SShameer Kolothum #define ACPI_IORT_RMR_ATTR_DEVICE_GRE      0x03
6584fd14753SShameer Kolothum #define ACPI_IORT_RMR_ATTR_NORMAL_NC       0x04
6594fd14753SShameer Kolothum #define ACPI_IORT_RMR_ATTR_NORMAL_IWB_OWB  0x05
6604fd14753SShameer Kolothum 
6618e1fdd7fSShameer Kolothum struct acpi_iort_rmr_desc {
6628e1fdd7fSShameer Kolothum 	u64 base_address;
6638e1fdd7fSShameer Kolothum 	u64 length;
6648e1fdd7fSShameer Kolothum 	u32 reserved;
6658e1fdd7fSShameer Kolothum };
6668e1fdd7fSShameer Kolothum 
667874f6a72SLv Zheng /*******************************************************************************
668874f6a72SLv Zheng  *
6696e2d5ebdSBob Moore  * IVRS - I/O Virtualization Reporting Structure
6706e2d5ebdSBob Moore  *        Version 1
6716e2d5ebdSBob Moore  *
6726e2d5ebdSBob Moore  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
6736e2d5ebdSBob Moore  * Revision 1.26, February 2009.
6746e2d5ebdSBob Moore  *
6756e2d5ebdSBob Moore  ******************************************************************************/
6766e2d5ebdSBob Moore 
6776e2d5ebdSBob Moore struct acpi_table_ivrs {
6786e2d5ebdSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
6796e2d5ebdSBob Moore 	u32 info;		/* Common virtualization info */
6806e2d5ebdSBob Moore 	u64 reserved;
6816e2d5ebdSBob Moore };
6826e2d5ebdSBob Moore 
6836e2d5ebdSBob Moore /* Values for Info field above */
6846e2d5ebdSBob Moore 
6856e2d5ebdSBob Moore #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00	/* 7 bits, physical address size */
6866e2d5ebdSBob Moore #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000	/* 7 bits, virtual address size */
6876e2d5ebdSBob Moore #define ACPI_IVRS_ATS_RESERVED      0x00400000	/* ATS address translation range reserved */
6886e2d5ebdSBob Moore 
6896e2d5ebdSBob Moore /* IVRS subtable header */
6906e2d5ebdSBob Moore 
6916e2d5ebdSBob Moore struct acpi_ivrs_header {
6926e2d5ebdSBob Moore 	u8 type;		/* Subtable type */
6936e2d5ebdSBob Moore 	u8 flags;
6946e2d5ebdSBob Moore 	u16 length;		/* Subtable length */
6956e2d5ebdSBob Moore 	u16 device_id;		/* ID of IOMMU */
6966e2d5ebdSBob Moore };
6976e2d5ebdSBob Moore 
6986e2d5ebdSBob Moore /* Values for subtable Type above */
6996e2d5ebdSBob Moore 
7006e2d5ebdSBob Moore enum acpi_ivrs_type {
7011f6239caSMichał Żygowski 	ACPI_IVRS_TYPE_HARDWARE1 = 0x10,
7021f6239caSMichał Żygowski 	ACPI_IVRS_TYPE_HARDWARE2 = 0x11,
7037ce7a445SAlexander Monakov 	ACPI_IVRS_TYPE_HARDWARE3 = 0x40,
7046e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY1 = 0x20,
7056e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY2 = 0x21,
7066e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY3 = 0x22
7076e2d5ebdSBob Moore };
7086e2d5ebdSBob Moore 
7096e2d5ebdSBob Moore /* Masks for Flags field above for IVHD subtable */
7106e2d5ebdSBob Moore 
7116e2d5ebdSBob Moore #define ACPI_IVHD_TT_ENABLE         (1)
7126e2d5ebdSBob Moore #define ACPI_IVHD_PASS_PW           (1<<1)
7136e2d5ebdSBob Moore #define ACPI_IVHD_RES_PASS_PW       (1<<2)
7146e2d5ebdSBob Moore #define ACPI_IVHD_ISOC              (1<<3)
7156e2d5ebdSBob Moore #define ACPI_IVHD_IOTLB             (1<<4)
7166e2d5ebdSBob Moore 
7176e2d5ebdSBob Moore /* Masks for Flags field above for IVMD subtable */
7186e2d5ebdSBob Moore 
7196e2d5ebdSBob Moore #define ACPI_IVMD_UNITY             (1)
7206e2d5ebdSBob Moore #define ACPI_IVMD_READ              (1<<1)
7216e2d5ebdSBob Moore #define ACPI_IVMD_WRITE             (1<<2)
7226e2d5ebdSBob Moore #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
7236e2d5ebdSBob Moore 
7246e2d5ebdSBob Moore /*
7256e2d5ebdSBob Moore  * IVRS subtables, correspond to Type in struct acpi_ivrs_header
7266e2d5ebdSBob Moore  */
7276e2d5ebdSBob Moore 
7286e2d5ebdSBob Moore /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
7296e2d5ebdSBob Moore 
7301f6239caSMichał Żygowski struct acpi_ivrs_hardware_10 {
7316e2d5ebdSBob Moore 	struct acpi_ivrs_header header;
7326e2d5ebdSBob Moore 	u16 capability_offset;	/* Offset for IOMMU control fields */
7336e2d5ebdSBob Moore 	u64 base_address;	/* IOMMU control registers */
7346e2d5ebdSBob Moore 	u16 pci_segment_group;
7356e2d5ebdSBob Moore 	u16 info;		/* MSI number and unit ID */
7360dc7e795SMichał Żygowski 	u32 feature_reporting;
7376e2d5ebdSBob Moore };
7386e2d5ebdSBob Moore 
7391f6239caSMichał Żygowski /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
7401f6239caSMichał Żygowski 
7411f6239caSMichał Żygowski struct acpi_ivrs_hardware_11 {
7421f6239caSMichał Żygowski 	struct acpi_ivrs_header header;
7431f6239caSMichał Żygowski 	u16 capability_offset;	/* Offset for IOMMU control fields */
7441f6239caSMichał Żygowski 	u64 base_address;	/* IOMMU control registers */
7451f6239caSMichał Żygowski 	u16 pci_segment_group;
7461f6239caSMichał Żygowski 	u16 info;		/* MSI number and unit ID */
7471f6239caSMichał Żygowski 	u32 attributes;
7481f6239caSMichał Żygowski 	u64 efr_register_image;
7491f6239caSMichał Żygowski 	u64 reserved;
7501f6239caSMichał Żygowski };
7511f6239caSMichał Żygowski 
7526e2d5ebdSBob Moore /* Masks for Info field above */
7536e2d5ebdSBob Moore 
7546e2d5ebdSBob Moore #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F	/* 5 bits, MSI message number */
755ba494beeSBob Moore #define ACPI_IVHD_UNIT_ID_MASK      0x1F00	/* 5 bits, unit_ID */
7566e2d5ebdSBob Moore 
7576e2d5ebdSBob Moore /*
7586e2d5ebdSBob Moore  * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
7596e2d5ebdSBob Moore  * Upper two bits of the Type field are the (encoded) length of the structure.
7606e2d5ebdSBob Moore  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
7616e2d5ebdSBob Moore  * are reserved for future use but not defined.
7626e2d5ebdSBob Moore  */
7636e2d5ebdSBob Moore struct acpi_ivrs_de_header {
7646e2d5ebdSBob Moore 	u8 type;
7656e2d5ebdSBob Moore 	u16 id;
7666e2d5ebdSBob Moore 	u8 data_setting;
7676e2d5ebdSBob Moore };
7686e2d5ebdSBob Moore 
7696e2d5ebdSBob Moore /* Length of device entry is in the top two bits of Type field above */
7706e2d5ebdSBob Moore 
7716e2d5ebdSBob Moore #define ACPI_IVHD_ENTRY_LENGTH      0xC0
7726e2d5ebdSBob Moore 
7736e2d5ebdSBob Moore /* Values for device entry Type field above */
7746e2d5ebdSBob Moore 
7756e2d5ebdSBob Moore enum acpi_ivrs_device_entry_type {
7766e2d5ebdSBob Moore 	/* 4-byte device entries, all use struct acpi_ivrs_device4 */
7776e2d5ebdSBob Moore 
7786e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_PAD4 = 0,
7796e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALL = 1,
7806e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_SELECT = 2,
7816e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_START = 3,
7826e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_END = 4,
7836e2d5ebdSBob Moore 
7846e2d5ebdSBob Moore 	/* 8-byte device entries */
7856e2d5ebdSBob Moore 
7866e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_PAD8 = 64,
7876e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_NOT_USED = 65,
7886e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALIAS_SELECT = 66,	/* Uses struct acpi_ivrs_device8a */
7896e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALIAS_START = 67,	/* Uses struct acpi_ivrs_device8a */
7906e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_EXT_SELECT = 70,	/* Uses struct acpi_ivrs_device8b */
7916e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_EXT_START = 71,	/* Uses struct acpi_ivrs_device8b */
7927ce7a445SAlexander Monakov 	ACPI_IVRS_TYPE_SPECIAL = 72,	/* Uses struct acpi_ivrs_device8c */
7937ce7a445SAlexander Monakov 
7947ce7a445SAlexander Monakov 	/* Variable-length device entries */
7957ce7a445SAlexander Monakov 
7967ce7a445SAlexander Monakov 	ACPI_IVRS_TYPE_HID = 240	/* Uses ACPI_IVRS_DEVICE_HID */
7976e2d5ebdSBob Moore };
7986e2d5ebdSBob Moore 
7996e2d5ebdSBob Moore /* Values for Data field above */
8006e2d5ebdSBob Moore 
8016e2d5ebdSBob Moore #define ACPI_IVHD_INIT_PASS         (1)
8026e2d5ebdSBob Moore #define ACPI_IVHD_EINT_PASS         (1<<1)
8036e2d5ebdSBob Moore #define ACPI_IVHD_NMI_PASS          (1<<2)
8046e2d5ebdSBob Moore #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
8056e2d5ebdSBob Moore #define ACPI_IVHD_LINT0_PASS        (1<<6)
8066e2d5ebdSBob Moore #define ACPI_IVHD_LINT1_PASS        (1<<7)
8076e2d5ebdSBob Moore 
8086e2d5ebdSBob Moore /* Types 0-4: 4-byte device entry */
8096e2d5ebdSBob Moore 
8106e2d5ebdSBob Moore struct acpi_ivrs_device4 {
8116e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
8126e2d5ebdSBob Moore };
8136e2d5ebdSBob Moore 
8146e2d5ebdSBob Moore /* Types 66-67: 8-byte device entry */
8156e2d5ebdSBob Moore 
8166e2d5ebdSBob Moore struct acpi_ivrs_device8a {
8176e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
8186e2d5ebdSBob Moore 	u8 reserved1;
8196e2d5ebdSBob Moore 	u16 used_id;
8206e2d5ebdSBob Moore 	u8 reserved2;
8216e2d5ebdSBob Moore };
8226e2d5ebdSBob Moore 
8236e2d5ebdSBob Moore /* Types 70-71: 8-byte device entry */
8246e2d5ebdSBob Moore 
8256e2d5ebdSBob Moore struct acpi_ivrs_device8b {
8266e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
8276e2d5ebdSBob Moore 	u32 extended_data;
8286e2d5ebdSBob Moore };
8296e2d5ebdSBob Moore 
8306e2d5ebdSBob Moore /* Values for extended_data above */
8316e2d5ebdSBob Moore 
8326e2d5ebdSBob Moore #define ACPI_IVHD_ATS_DISABLED      (1<<31)
8336e2d5ebdSBob Moore 
8346e2d5ebdSBob Moore /* Type 72: 8-byte device entry */
8356e2d5ebdSBob Moore 
8366e2d5ebdSBob Moore struct acpi_ivrs_device8c {
8376e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
8386e2d5ebdSBob Moore 	u8 handle;
8396e2d5ebdSBob Moore 	u16 used_id;
8406e2d5ebdSBob Moore 	u8 variety;
8416e2d5ebdSBob Moore };
8426e2d5ebdSBob Moore 
8436e2d5ebdSBob Moore /* Values for Variety field above */
8446e2d5ebdSBob Moore 
8456e2d5ebdSBob Moore #define ACPI_IVHD_IOAPIC            1
8466e2d5ebdSBob Moore #define ACPI_IVHD_HPET              2
8476e2d5ebdSBob Moore 
8487ce7a445SAlexander Monakov /* Type 240: variable-length device entry */
8497ce7a445SAlexander Monakov 
8507ce7a445SAlexander Monakov struct acpi_ivrs_device_hid {
8517ce7a445SAlexander Monakov 	struct acpi_ivrs_de_header header;
8527ce7a445SAlexander Monakov 	u64 acpi_hid;
8537ce7a445SAlexander Monakov 	u64 acpi_cid;
8547ce7a445SAlexander Monakov 	u8 uid_type;
8557ce7a445SAlexander Monakov 	u8 uid_length;
8567ce7a445SAlexander Monakov };
8577ce7a445SAlexander Monakov 
858c160b7d2SBob Moore /* Values for uid_type above */
859c160b7d2SBob Moore 
860c160b7d2SBob Moore #define ACPI_IVRS_UID_NOT_PRESENT   0
861c160b7d2SBob Moore #define ACPI_IVRS_UID_IS_INTEGER    1
862c160b7d2SBob Moore #define ACPI_IVRS_UID_IS_STRING     2
863c160b7d2SBob Moore 
8646e2d5ebdSBob Moore /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
8656e2d5ebdSBob Moore 
8666e2d5ebdSBob Moore struct acpi_ivrs_memory {
8676e2d5ebdSBob Moore 	struct acpi_ivrs_header header;
8686e2d5ebdSBob Moore 	u16 aux_data;
8696e2d5ebdSBob Moore 	u64 reserved;
8706e2d5ebdSBob Moore 	u64 start_address;
8716e2d5ebdSBob Moore 	u64 memory_length;
8726e2d5ebdSBob Moore };
8736e2d5ebdSBob Moore 
8746e2d5ebdSBob Moore /*******************************************************************************
8756e2d5ebdSBob Moore  *
876d36d4e30SBob Moore  * LPIT - Low Power Idle Table
877d36d4e30SBob Moore  *
8789ab8cf1bSBob Moore  * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
879d36d4e30SBob Moore  *
880d36d4e30SBob Moore  ******************************************************************************/
881d36d4e30SBob Moore 
882d36d4e30SBob Moore struct acpi_table_lpit {
883d36d4e30SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
884d36d4e30SBob Moore };
885d36d4e30SBob Moore 
886d36d4e30SBob Moore /* LPIT subtable header */
887d36d4e30SBob Moore 
888d36d4e30SBob Moore struct acpi_lpit_header {
889d36d4e30SBob Moore 	u32 type;		/* Subtable type */
890d36d4e30SBob Moore 	u32 length;		/* Subtable length */
891d36d4e30SBob Moore 	u16 unique_id;
892d36d4e30SBob Moore 	u16 reserved;
893d36d4e30SBob Moore 	u32 flags;
894d36d4e30SBob Moore };
895d36d4e30SBob Moore 
896d36d4e30SBob Moore /* Values for subtable Type above */
897d36d4e30SBob Moore 
898d36d4e30SBob Moore enum acpi_lpit_type {
899d36d4e30SBob Moore 	ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
9009ab8cf1bSBob Moore 	ACPI_LPIT_TYPE_RESERVED = 0x01	/* 1 and above are reserved */
901d36d4e30SBob Moore };
902d36d4e30SBob Moore 
903d36d4e30SBob Moore /* Masks for Flags field above  */
904d36d4e30SBob Moore 
905d36d4e30SBob Moore #define ACPI_LPIT_STATE_DISABLED    (1)
906d36d4e30SBob Moore #define ACPI_LPIT_NO_COUNTER        (1<<1)
907d36d4e30SBob Moore 
908d36d4e30SBob Moore /*
909d36d4e30SBob Moore  * LPIT subtables, correspond to Type in struct acpi_lpit_header
910d36d4e30SBob Moore  */
911d36d4e30SBob Moore 
912d36d4e30SBob Moore /* 0x00: Native C-state instruction based LPI structure */
913d36d4e30SBob Moore 
914d36d4e30SBob Moore struct acpi_lpit_native {
915d36d4e30SBob Moore 	struct acpi_lpit_header header;
916d36d4e30SBob Moore 	struct acpi_generic_address entry_trigger;
917d36d4e30SBob Moore 	u32 residency;
918d36d4e30SBob Moore 	u32 latency;
919d36d4e30SBob Moore 	struct acpi_generic_address residency_counter;
920d36d4e30SBob Moore 	u64 counter_frequency;
921d36d4e30SBob Moore };
922d36d4e30SBob Moore 
923d36d4e30SBob Moore /*******************************************************************************
924d36d4e30SBob Moore  *
925e62f8227SErik Schmauss  * MADT - Multiple APIC Description Table
926e62f8227SErik Schmauss  *        Version 3
927e62f8227SErik Schmauss  *
928e62f8227SErik Schmauss  ******************************************************************************/
929e62f8227SErik Schmauss 
930e62f8227SErik Schmauss struct acpi_table_madt {
931e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
932e62f8227SErik Schmauss 	u32 address;		/* Physical address of local APIC */
933e62f8227SErik Schmauss 	u32 flags;
934e62f8227SErik Schmauss };
935e62f8227SErik Schmauss 
936e62f8227SErik Schmauss /* Masks for Flags field above */
937e62f8227SErik Schmauss 
938e62f8227SErik Schmauss #define ACPI_MADT_PCAT_COMPAT       (1)	/* 00: System also has dual 8259s */
939e62f8227SErik Schmauss 
940e62f8227SErik Schmauss /* Values for PCATCompat flag */
941e62f8227SErik Schmauss 
942e62f8227SErik Schmauss #define ACPI_MADT_DUAL_PIC          1
943e62f8227SErik Schmauss #define ACPI_MADT_MULTIPLE_APIC     0
944e62f8227SErik Schmauss 
945e62f8227SErik Schmauss /* Values for MADT subtable type in struct acpi_subtable_header */
946e62f8227SErik Schmauss 
947e62f8227SErik Schmauss enum acpi_madt_type {
948e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC = 0,
949e62f8227SErik Schmauss 	ACPI_MADT_TYPE_IO_APIC = 1,
950e62f8227SErik Schmauss 	ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
951e62f8227SErik Schmauss 	ACPI_MADT_TYPE_NMI_SOURCE = 3,
952e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
953e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
954e62f8227SErik Schmauss 	ACPI_MADT_TYPE_IO_SAPIC = 6,
955e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
956e62f8227SErik Schmauss 	ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
957e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
958e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
959e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
960e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
961e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
962e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
963e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
9649557cb8cSErik Kaneda 	ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
96560f2096bSHuacai Chen 	ACPI_MADT_TYPE_CORE_PIC = 17,
96660f2096bSHuacai Chen 	ACPI_MADT_TYPE_LIO_PIC = 18,
96760f2096bSHuacai Chen 	ACPI_MADT_TYPE_HT_PIC = 19,
96860f2096bSHuacai Chen 	ACPI_MADT_TYPE_EIO_PIC = 20,
96960f2096bSHuacai Chen 	ACPI_MADT_TYPE_MSI_PIC = 21,
97060f2096bSHuacai Chen 	ACPI_MADT_TYPE_BIO_PIC = 22,
97160f2096bSHuacai Chen 	ACPI_MADT_TYPE_LPC_PIC = 23,
972f2ca92d0SSunil V L 	ACPI_MADT_TYPE_RINTC = 24,
973f3b19adeSSunil V L 	ACPI_MADT_TYPE_IMSIC = 25,
974f3b19adeSSunil V L 	ACPI_MADT_TYPE_APLIC = 26,
975f3b19adeSSunil V L 	ACPI_MADT_TYPE_PLIC = 27,
976f3b19adeSSunil V L 	ACPI_MADT_TYPE_RESERVED = 28,	/* 28 to 0x7F are reserved */
977da6a9bbeSBob Moore 	ACPI_MADT_TYPE_OEM_RESERVED = 0x80	/* 0x80 to 0xFF are reserved for OEM use */
978e62f8227SErik Schmauss };
979e62f8227SErik Schmauss 
980e62f8227SErik Schmauss /*
981e62f8227SErik Schmauss  * MADT Subtables, correspond to Type in struct acpi_subtable_header
982e62f8227SErik Schmauss  */
983e62f8227SErik Schmauss 
984e62f8227SErik Schmauss /* 0: Processor Local APIC */
985e62f8227SErik Schmauss 
986e62f8227SErik Schmauss struct acpi_madt_local_apic {
987e62f8227SErik Schmauss 	struct acpi_subtable_header header;
988e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
989e62f8227SErik Schmauss 	u8 id;			/* Processor's local APIC id */
990e62f8227SErik Schmauss 	u32 lapic_flags;
991e62f8227SErik Schmauss };
992e62f8227SErik Schmauss 
993e62f8227SErik Schmauss /* 1: IO APIC */
994e62f8227SErik Schmauss 
995e62f8227SErik Schmauss struct acpi_madt_io_apic {
996e62f8227SErik Schmauss 	struct acpi_subtable_header header;
997e62f8227SErik Schmauss 	u8 id;			/* I/O APIC ID */
998e62f8227SErik Schmauss 	u8 reserved;		/* reserved - must be zero */
999e62f8227SErik Schmauss 	u32 address;		/* APIC physical address */
1000e62f8227SErik Schmauss 	u32 global_irq_base;	/* Global system interrupt where INTI lines start */
1001e62f8227SErik Schmauss };
1002e62f8227SErik Schmauss 
1003e62f8227SErik Schmauss /* 2: Interrupt Override */
1004e62f8227SErik Schmauss 
1005e62f8227SErik Schmauss struct acpi_madt_interrupt_override {
1006e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1007e62f8227SErik Schmauss 	u8 bus;			/* 0 - ISA */
1008e62f8227SErik Schmauss 	u8 source_irq;		/* Interrupt source (IRQ) */
1009e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
1010e62f8227SErik Schmauss 	u16 inti_flags;
1011e62f8227SErik Schmauss };
1012e62f8227SErik Schmauss 
1013e62f8227SErik Schmauss /* 3: NMI Source */
1014e62f8227SErik Schmauss 
1015e62f8227SErik Schmauss struct acpi_madt_nmi_source {
1016e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1017e62f8227SErik Schmauss 	u16 inti_flags;
1018e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
1019e62f8227SErik Schmauss };
1020e62f8227SErik Schmauss 
1021e62f8227SErik Schmauss /* 4: Local APIC NMI */
1022e62f8227SErik Schmauss 
1023e62f8227SErik Schmauss struct acpi_madt_local_apic_nmi {
1024e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1025e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
1026e62f8227SErik Schmauss 	u16 inti_flags;
1027e62f8227SErik Schmauss 	u8 lint;		/* LINTn to which NMI is connected */
1028e62f8227SErik Schmauss };
1029e62f8227SErik Schmauss 
1030e62f8227SErik Schmauss /* 5: Address Override */
1031e62f8227SErik Schmauss 
1032e62f8227SErik Schmauss struct acpi_madt_local_apic_override {
1033e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1034e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
1035e62f8227SErik Schmauss 	u64 address;		/* APIC physical address */
1036e62f8227SErik Schmauss };
1037e62f8227SErik Schmauss 
1038e62f8227SErik Schmauss /* 6: I/O Sapic */
1039e62f8227SErik Schmauss 
1040e62f8227SErik Schmauss struct acpi_madt_io_sapic {
1041e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1042e62f8227SErik Schmauss 	u8 id;			/* I/O SAPIC ID */
1043e62f8227SErik Schmauss 	u8 reserved;		/* Reserved, must be zero */
1044e62f8227SErik Schmauss 	u32 global_irq_base;	/* Global interrupt for SAPIC start */
1045e62f8227SErik Schmauss 	u64 address;		/* SAPIC physical address */
1046e62f8227SErik Schmauss };
1047e62f8227SErik Schmauss 
1048e62f8227SErik Schmauss /* 7: Local Sapic */
1049e62f8227SErik Schmauss 
1050e62f8227SErik Schmauss struct acpi_madt_local_sapic {
1051e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1052e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
1053e62f8227SErik Schmauss 	u8 id;			/* SAPIC ID */
1054e62f8227SErik Schmauss 	u8 eid;			/* SAPIC EID */
1055e62f8227SErik Schmauss 	u8 reserved[3];		/* Reserved, must be zero */
1056e62f8227SErik Schmauss 	u32 lapic_flags;
1057e62f8227SErik Schmauss 	u32 uid;		/* Numeric UID - ACPI 3.0 */
105874522feaSKees Cook 	char uid_string[];	/* String UID  - ACPI 3.0 */
1059e62f8227SErik Schmauss };
1060e62f8227SErik Schmauss 
1061e62f8227SErik Schmauss /* 8: Platform Interrupt Source */
1062e62f8227SErik Schmauss 
1063e62f8227SErik Schmauss struct acpi_madt_interrupt_source {
1064e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1065e62f8227SErik Schmauss 	u16 inti_flags;
1066e62f8227SErik Schmauss 	u8 type;		/* 1=PMI, 2=INIT, 3=corrected */
1067e62f8227SErik Schmauss 	u8 id;			/* Processor ID */
1068e62f8227SErik Schmauss 	u8 eid;			/* Processor EID */
1069e62f8227SErik Schmauss 	u8 io_sapic_vector;	/* Vector value for PMI interrupts */
1070e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
1071e62f8227SErik Schmauss 	u32 flags;		/* Interrupt Source Flags */
1072e62f8227SErik Schmauss };
1073e62f8227SErik Schmauss 
1074e62f8227SErik Schmauss /* Masks for Flags field above */
1075e62f8227SErik Schmauss 
1076e62f8227SErik Schmauss #define ACPI_MADT_CPEI_OVERRIDE     (1)
1077e62f8227SErik Schmauss 
1078e62f8227SErik Schmauss /* 9: Processor Local X2APIC (ACPI 4.0) */
1079e62f8227SErik Schmauss 
1080e62f8227SErik Schmauss struct acpi_madt_local_x2apic {
1081e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1082e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
1083e62f8227SErik Schmauss 	u32 local_apic_id;	/* Processor x2APIC ID  */
1084e62f8227SErik Schmauss 	u32 lapic_flags;
1085e62f8227SErik Schmauss 	u32 uid;		/* ACPI processor UID */
1086e62f8227SErik Schmauss };
1087e62f8227SErik Schmauss 
1088e62f8227SErik Schmauss /* 10: Local X2APIC NMI (ACPI 4.0) */
1089e62f8227SErik Schmauss 
1090e62f8227SErik Schmauss struct acpi_madt_local_x2apic_nmi {
1091e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1092e62f8227SErik Schmauss 	u16 inti_flags;
1093e62f8227SErik Schmauss 	u32 uid;		/* ACPI processor UID */
1094e62f8227SErik Schmauss 	u8 lint;		/* LINTn to which NMI is connected */
1095e62f8227SErik Schmauss 	u8 reserved[3];		/* reserved - must be zero */
1096e62f8227SErik Schmauss };
1097e62f8227SErik Schmauss 
1098377421fcSXiongfeng Wang /* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 + ACPI 6.5 changes) */
1099e62f8227SErik Schmauss 
1100e62f8227SErik Schmauss struct acpi_madt_generic_interrupt {
1101e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1102e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
1103e62f8227SErik Schmauss 	u32 cpu_interface_number;
1104e62f8227SErik Schmauss 	u32 uid;
1105e62f8227SErik Schmauss 	u32 flags;
1106e62f8227SErik Schmauss 	u32 parking_version;
1107e62f8227SErik Schmauss 	u32 performance_interrupt;
1108e62f8227SErik Schmauss 	u64 parked_address;
1109e62f8227SErik Schmauss 	u64 base_address;
1110e62f8227SErik Schmauss 	u64 gicv_base_address;
1111e62f8227SErik Schmauss 	u64 gich_base_address;
1112e62f8227SErik Schmauss 	u32 vgic_interrupt;
1113e62f8227SErik Schmauss 	u64 gicr_base_address;
1114e62f8227SErik Schmauss 	u64 arm_mpidr;
1115e62f8227SErik Schmauss 	u8 efficiency_class;
1116e646e0a5SErik Schmauss 	u8 reserved2[1];
1117e646e0a5SErik Schmauss 	u16 spe_interrupt;	/* ACPI 6.3 */
1118377421fcSXiongfeng Wang 	u16 trbe_interrupt;	/* ACPI 6.5 */
1119e62f8227SErik Schmauss };
1120e62f8227SErik Schmauss 
1121e62f8227SErik Schmauss /* Masks for Flags field above */
1122e62f8227SErik Schmauss 
1123e62f8227SErik Schmauss /* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
1124e62f8227SErik Schmauss #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)	/* 01: Performance Interrupt Mode */
1125e62f8227SErik Schmauss #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)	/* 02: VGIC Maintenance Interrupt mode */
1126cb1210a7SLorenzo Pieralisi #define ACPI_MADT_GICC_ONLINE_CAPABLE   (1<<3)	/* 03: Processor is online capable  */
11273be8fb1bSLorenzo Pieralisi #define ACPI_MADT_GICC_NON_COHERENT     (1<<4)	/* 04: GIC redistributor is not coherent */
1128e62f8227SErik Schmauss 
1129e62f8227SErik Schmauss /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
1130e62f8227SErik Schmauss 
1131e62f8227SErik Schmauss struct acpi_madt_generic_distributor {
1132e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1133e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
1134e62f8227SErik Schmauss 	u32 gic_id;
1135e62f8227SErik Schmauss 	u64 base_address;
1136e62f8227SErik Schmauss 	u32 global_irq_base;
1137e62f8227SErik Schmauss 	u8 version;
1138e62f8227SErik Schmauss 	u8 reserved2[3];	/* reserved - must be zero */
1139e62f8227SErik Schmauss };
1140e62f8227SErik Schmauss 
1141e62f8227SErik Schmauss /* Values for Version field above */
1142e62f8227SErik Schmauss 
1143e62f8227SErik Schmauss enum acpi_madt_gic_version {
1144e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_NONE = 0,
1145e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V1 = 1,
1146e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V2 = 2,
1147e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V3 = 3,
1148e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V4 = 4,
1149e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_RESERVED = 5	/* 5 and greater are reserved */
1150e62f8227SErik Schmauss };
1151e62f8227SErik Schmauss 
1152e62f8227SErik Schmauss /* 13: Generic MSI Frame (ACPI 5.1) */
1153e62f8227SErik Schmauss 
1154e62f8227SErik Schmauss struct acpi_madt_generic_msi_frame {
1155e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1156e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
1157e62f8227SErik Schmauss 	u32 msi_frame_id;
1158e62f8227SErik Schmauss 	u64 base_address;
1159e62f8227SErik Schmauss 	u32 flags;
1160e62f8227SErik Schmauss 	u16 spi_count;
1161e62f8227SErik Schmauss 	u16 spi_base;
1162e62f8227SErik Schmauss };
1163e62f8227SErik Schmauss 
1164e62f8227SErik Schmauss /* Masks for Flags field above */
1165e62f8227SErik Schmauss 
1166e62f8227SErik Schmauss #define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
1167e62f8227SErik Schmauss 
1168e62f8227SErik Schmauss /* 14: Generic Redistributor (ACPI 5.1) */
1169e62f8227SErik Schmauss 
1170e62f8227SErik Schmauss struct acpi_madt_generic_redistributor {
1171e62f8227SErik Schmauss 	struct acpi_subtable_header header;
11723be8fb1bSLorenzo Pieralisi 	u8 flags;
11733be8fb1bSLorenzo Pieralisi 	u8 reserved;		/* reserved - must be zero */
1174e62f8227SErik Schmauss 	u64 base_address;
1175e62f8227SErik Schmauss 	u32 length;
1176e62f8227SErik Schmauss };
1177e62f8227SErik Schmauss 
11783be8fb1bSLorenzo Pieralisi #define ACPI_MADT_GICR_NON_COHERENT     (1)
11793be8fb1bSLorenzo Pieralisi 
1180e62f8227SErik Schmauss /* 15: Generic Translator (ACPI 6.0) */
1181e62f8227SErik Schmauss 
1182e62f8227SErik Schmauss struct acpi_madt_generic_translator {
1183e62f8227SErik Schmauss 	struct acpi_subtable_header header;
11843be8fb1bSLorenzo Pieralisi 	u8 flags;
11853be8fb1bSLorenzo Pieralisi 	u8 reserved;		/* reserved - must be zero */
1186e62f8227SErik Schmauss 	u32 translation_id;
1187e62f8227SErik Schmauss 	u64 base_address;
1188e62f8227SErik Schmauss 	u32 reserved2;
1189e62f8227SErik Schmauss };
1190e62f8227SErik Schmauss 
11913be8fb1bSLorenzo Pieralisi #define ACPI_MADT_ITS_NON_COHERENT      (1)
11923be8fb1bSLorenzo Pieralisi 
11939557cb8cSErik Kaneda /* 16: Multiprocessor wakeup (ACPI 6.4) */
11949557cb8cSErik Kaneda 
11959557cb8cSErik Kaneda struct acpi_madt_multiproc_wakeup {
11969557cb8cSErik Kaneda 	struct acpi_subtable_header header;
11976630cbceSKirill A. Shutemov 	u16 version;
11989557cb8cSErik Kaneda 	u32 reserved;		/* reserved - must be zero */
11996630cbceSKirill A. Shutemov 	u64 mailbox_address;
12001ceebe2eSKirill A. Shutemov 	u64 reset_vector;
12019557cb8cSErik Kaneda };
12029557cb8cSErik Kaneda 
12031ceebe2eSKirill A. Shutemov /* Values for Version field above */
12041ceebe2eSKirill A. Shutemov 
12051ceebe2eSKirill A. Shutemov enum acpi_madt_multiproc_wakeup_version {
12061ceebe2eSKirill A. Shutemov 	ACPI_MADT_MP_WAKEUP_VERSION_NONE = 0,
12071ceebe2eSKirill A. Shutemov 	ACPI_MADT_MP_WAKEUP_VERSION_V1 = 1,
12081ceebe2eSKirill A. Shutemov 	ACPI_MADT_MP_WAKEUP_VERSION_RESERVED = 2, /* 2 and greater are reserved */
12091ceebe2eSKirill A. Shutemov };
12101ceebe2eSKirill A. Shutemov 
12111ceebe2eSKirill A. Shutemov #define ACPI_MADT_MP_WAKEUP_SIZE_V0	16
12121ceebe2eSKirill A. Shutemov #define ACPI_MADT_MP_WAKEUP_SIZE_V1	24
12131ceebe2eSKirill A. Shutemov 
121442d96e16SKuppuswamy Sathyanarayanan #define ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE        2032
121542d96e16SKuppuswamy Sathyanarayanan #define ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE  2048
121642d96e16SKuppuswamy Sathyanarayanan 
121742d96e16SKuppuswamy Sathyanarayanan struct acpi_madt_multiproc_wakeup_mailbox {
121842d96e16SKuppuswamy Sathyanarayanan 	u16 command;
121942d96e16SKuppuswamy Sathyanarayanan 	u16 reserved;		/* reserved - must be zero */
122042d96e16SKuppuswamy Sathyanarayanan 	u32 apic_id;
122142d96e16SKuppuswamy Sathyanarayanan 	u64 wakeup_vector;
122242d96e16SKuppuswamy Sathyanarayanan 	u8 reserved_os[ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE];	/* reserved for OS use */
122342d96e16SKuppuswamy Sathyanarayanan 	u8 reserved_firmware[ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE];	/* reserved for firmware use */
122442d96e16SKuppuswamy Sathyanarayanan };
122542d96e16SKuppuswamy Sathyanarayanan 
122642d96e16SKuppuswamy Sathyanarayanan #define ACPI_MP_WAKE_COMMAND_WAKEUP	1
12271ceebe2eSKirill A. Shutemov #define ACPI_MP_WAKE_COMMAND_TEST	2
122842d96e16SKuppuswamy Sathyanarayanan 
122960f2096bSHuacai Chen /* 17: CPU Core Interrupt Controller (ACPI 6.5) */
123060f2096bSHuacai Chen 
123160f2096bSHuacai Chen struct acpi_madt_core_pic {
123260f2096bSHuacai Chen 	struct acpi_subtable_header header;
123360f2096bSHuacai Chen 	u8 version;
123460f2096bSHuacai Chen 	u32 processor_id;
123560f2096bSHuacai Chen 	u32 core_id;
123660f2096bSHuacai Chen 	u32 flags;
123760f2096bSHuacai Chen };
123860f2096bSHuacai Chen 
123960f2096bSHuacai Chen /* Values for Version field above */
124060f2096bSHuacai Chen 
124160f2096bSHuacai Chen enum acpi_madt_core_pic_version {
124260f2096bSHuacai Chen 	ACPI_MADT_CORE_PIC_VERSION_NONE = 0,
124360f2096bSHuacai Chen 	ACPI_MADT_CORE_PIC_VERSION_V1 = 1,
124460f2096bSHuacai Chen 	ACPI_MADT_CORE_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
124560f2096bSHuacai Chen };
124660f2096bSHuacai Chen 
124760f2096bSHuacai Chen /* 18: Legacy I/O Interrupt Controller (ACPI 6.5) */
124860f2096bSHuacai Chen 
124960f2096bSHuacai Chen struct acpi_madt_lio_pic {
125060f2096bSHuacai Chen 	struct acpi_subtable_header header;
125160f2096bSHuacai Chen 	u8 version;
125260f2096bSHuacai Chen 	u64 address;
125360f2096bSHuacai Chen 	u16 size;
125460f2096bSHuacai Chen 	u8 cascade[2];
125560f2096bSHuacai Chen 	u32 cascade_map[2];
125660f2096bSHuacai Chen };
125760f2096bSHuacai Chen 
125860f2096bSHuacai Chen /* Values for Version field above */
125960f2096bSHuacai Chen 
126060f2096bSHuacai Chen enum acpi_madt_lio_pic_version {
126160f2096bSHuacai Chen 	ACPI_MADT_LIO_PIC_VERSION_NONE = 0,
126260f2096bSHuacai Chen 	ACPI_MADT_LIO_PIC_VERSION_V1 = 1,
126360f2096bSHuacai Chen 	ACPI_MADT_LIO_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
126460f2096bSHuacai Chen };
126560f2096bSHuacai Chen 
126660f2096bSHuacai Chen /* 19: HT Interrupt Controller (ACPI 6.5) */
126760f2096bSHuacai Chen 
126860f2096bSHuacai Chen struct acpi_madt_ht_pic {
126960f2096bSHuacai Chen 	struct acpi_subtable_header header;
127060f2096bSHuacai Chen 	u8 version;
127160f2096bSHuacai Chen 	u64 address;
127260f2096bSHuacai Chen 	u16 size;
127360f2096bSHuacai Chen 	u8 cascade[8];
127460f2096bSHuacai Chen };
127560f2096bSHuacai Chen 
127660f2096bSHuacai Chen /* Values for Version field above */
127760f2096bSHuacai Chen 
127860f2096bSHuacai Chen enum acpi_madt_ht_pic_version {
127960f2096bSHuacai Chen 	ACPI_MADT_HT_PIC_VERSION_NONE = 0,
128060f2096bSHuacai Chen 	ACPI_MADT_HT_PIC_VERSION_V1 = 1,
128160f2096bSHuacai Chen 	ACPI_MADT_HT_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
128260f2096bSHuacai Chen };
128360f2096bSHuacai Chen 
128460f2096bSHuacai Chen /* 20: Extend I/O Interrupt Controller (ACPI 6.5) */
128560f2096bSHuacai Chen 
128660f2096bSHuacai Chen struct acpi_madt_eio_pic {
128760f2096bSHuacai Chen 	struct acpi_subtable_header header;
128860f2096bSHuacai Chen 	u8 version;
128960f2096bSHuacai Chen 	u8 cascade;
129060f2096bSHuacai Chen 	u8 node;
129160f2096bSHuacai Chen 	u64 node_map;
129260f2096bSHuacai Chen };
129360f2096bSHuacai Chen 
129460f2096bSHuacai Chen /* Values for Version field above */
129560f2096bSHuacai Chen 
129660f2096bSHuacai Chen enum acpi_madt_eio_pic_version {
129760f2096bSHuacai Chen 	ACPI_MADT_EIO_PIC_VERSION_NONE = 0,
129860f2096bSHuacai Chen 	ACPI_MADT_EIO_PIC_VERSION_V1 = 1,
129960f2096bSHuacai Chen 	ACPI_MADT_EIO_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
130060f2096bSHuacai Chen };
130160f2096bSHuacai Chen 
130260f2096bSHuacai Chen /* 21: MSI Interrupt Controller (ACPI 6.5) */
130360f2096bSHuacai Chen 
130460f2096bSHuacai Chen struct acpi_madt_msi_pic {
130560f2096bSHuacai Chen 	struct acpi_subtable_header header;
130660f2096bSHuacai Chen 	u8 version;
130760f2096bSHuacai Chen 	u64 msg_address;
130860f2096bSHuacai Chen 	u32 start;
130960f2096bSHuacai Chen 	u32 count;
131060f2096bSHuacai Chen };
131160f2096bSHuacai Chen 
131260f2096bSHuacai Chen /* Values for Version field above */
131360f2096bSHuacai Chen 
131460f2096bSHuacai Chen enum acpi_madt_msi_pic_version {
131560f2096bSHuacai Chen 	ACPI_MADT_MSI_PIC_VERSION_NONE = 0,
131660f2096bSHuacai Chen 	ACPI_MADT_MSI_PIC_VERSION_V1 = 1,
131760f2096bSHuacai Chen 	ACPI_MADT_MSI_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
131860f2096bSHuacai Chen };
131960f2096bSHuacai Chen 
132060f2096bSHuacai Chen /* 22: Bridge I/O Interrupt Controller (ACPI 6.5) */
132160f2096bSHuacai Chen 
132260f2096bSHuacai Chen struct acpi_madt_bio_pic {
132360f2096bSHuacai Chen 	struct acpi_subtable_header header;
132460f2096bSHuacai Chen 	u8 version;
132560f2096bSHuacai Chen 	u64 address;
132660f2096bSHuacai Chen 	u16 size;
132760f2096bSHuacai Chen 	u16 id;
132860f2096bSHuacai Chen 	u16 gsi_base;
132960f2096bSHuacai Chen };
133060f2096bSHuacai Chen 
133160f2096bSHuacai Chen /* Values for Version field above */
133260f2096bSHuacai Chen 
133360f2096bSHuacai Chen enum acpi_madt_bio_pic_version {
133460f2096bSHuacai Chen 	ACPI_MADT_BIO_PIC_VERSION_NONE = 0,
133560f2096bSHuacai Chen 	ACPI_MADT_BIO_PIC_VERSION_V1 = 1,
133660f2096bSHuacai Chen 	ACPI_MADT_BIO_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
133760f2096bSHuacai Chen };
133860f2096bSHuacai Chen 
133960f2096bSHuacai Chen /* 23: LPC Interrupt Controller (ACPI 6.5) */
134060f2096bSHuacai Chen 
134160f2096bSHuacai Chen struct acpi_madt_lpc_pic {
134260f2096bSHuacai Chen 	struct acpi_subtable_header header;
134360f2096bSHuacai Chen 	u8 version;
134460f2096bSHuacai Chen 	u64 address;
134560f2096bSHuacai Chen 	u16 size;
134660f2096bSHuacai Chen 	u8 cascade;
134760f2096bSHuacai Chen };
134860f2096bSHuacai Chen 
134960f2096bSHuacai Chen /* Values for Version field above */
135060f2096bSHuacai Chen 
135160f2096bSHuacai Chen enum acpi_madt_lpc_pic_version {
135260f2096bSHuacai Chen 	ACPI_MADT_LPC_PIC_VERSION_NONE = 0,
135360f2096bSHuacai Chen 	ACPI_MADT_LPC_PIC_VERSION_V1 = 1,
135460f2096bSHuacai Chen 	ACPI_MADT_LPC_PIC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
135560f2096bSHuacai Chen };
135660f2096bSHuacai Chen 
1357f2ca92d0SSunil V L /* 24: RISC-V INTC */
1358f2ca92d0SSunil V L struct acpi_madt_rintc {
1359f2ca92d0SSunil V L 	struct acpi_subtable_header header;
1360f2ca92d0SSunil V L 	u8 version;
1361f2ca92d0SSunil V L 	u8 reserved;
1362f2ca92d0SSunil V L 	u32 flags;
1363f2ca92d0SSunil V L 	u64 hart_id;
1364f2ca92d0SSunil V L 	u32 uid;		/* ACPI processor UID */
1365f3b19adeSSunil V L 	u32 ext_intc_id;	/* External INTC Id */
1366f3b19adeSSunil V L 	u64 imsic_addr;		/* IMSIC base address */
1367f3b19adeSSunil V L 	u32 imsic_size;		/* IMSIC size */
1368f2ca92d0SSunil V L };
1369f2ca92d0SSunil V L 
1370f2ca92d0SSunil V L /* Values for RISC-V INTC Version field above */
1371f2ca92d0SSunil V L 
1372f2ca92d0SSunil V L enum acpi_madt_rintc_version {
1373f2ca92d0SSunil V L 	ACPI_MADT_RINTC_VERSION_NONE = 0,
1374f2ca92d0SSunil V L 	ACPI_MADT_RINTC_VERSION_V1 = 1,
1375f2ca92d0SSunil V L 	ACPI_MADT_RINTC_VERSION_RESERVED = 2	/* 2 and greater are reserved */
1376f2ca92d0SSunil V L };
1377f2ca92d0SSunil V L 
1378f3b19adeSSunil V L /* 25: RISC-V IMSIC */
1379f3b19adeSSunil V L struct acpi_madt_imsic {
1380f3b19adeSSunil V L 	struct acpi_subtable_header header;
1381f3b19adeSSunil V L 	u8 version;
1382f3b19adeSSunil V L 	u8 reserved;
1383f3b19adeSSunil V L 	u32 flags;
1384f3b19adeSSunil V L 	u16 num_ids;
1385f3b19adeSSunil V L 	u16 num_guest_ids;
1386f3b19adeSSunil V L 	u8 guest_index_bits;
1387f3b19adeSSunil V L 	u8 hart_index_bits;
1388f3b19adeSSunil V L 	u8 group_index_bits;
1389f3b19adeSSunil V L 	u8 group_index_shift;
1390f3b19adeSSunil V L };
1391f3b19adeSSunil V L 
1392f3b19adeSSunil V L /* 26: RISC-V APLIC */
1393f3b19adeSSunil V L struct acpi_madt_aplic {
1394f3b19adeSSunil V L 	struct acpi_subtable_header header;
1395f3b19adeSSunil V L 	u8 version;
1396f3b19adeSSunil V L 	u8 id;
1397f3b19adeSSunil V L 	u32 flags;
1398f3b19adeSSunil V L 	u8 hw_id[8];
1399f3b19adeSSunil V L 	u16 num_idcs;
1400f3b19adeSSunil V L 	u16 num_sources;
1401f3b19adeSSunil V L 	u32 gsi_base;
1402f3b19adeSSunil V L 	u64 base_addr;
1403f3b19adeSSunil V L 	u32 size;
1404f3b19adeSSunil V L };
1405f3b19adeSSunil V L 
1406f3b19adeSSunil V L /* 27: RISC-V PLIC */
1407f3b19adeSSunil V L struct acpi_madt_plic {
1408f3b19adeSSunil V L 	struct acpi_subtable_header header;
1409f3b19adeSSunil V L 	u8 version;
1410f3b19adeSSunil V L 	u8 id;
1411f3b19adeSSunil V L 	u8 hw_id[8];
1412f3b19adeSSunil V L 	u16 num_irqs;
1413f3b19adeSSunil V L 	u16 max_prio;
1414f3b19adeSSunil V L 	u32 flags;
1415f3b19adeSSunil V L 	u32 size;
1416f3b19adeSSunil V L 	u64 base_addr;
1417f3b19adeSSunil V L 	u32 gsi_base;
1418f3b19adeSSunil V L };
1419f3b19adeSSunil V L 
142060f2096bSHuacai Chen /* 80: OEM data */
1421da6a9bbeSBob Moore 
1422da6a9bbeSBob Moore struct acpi_madt_oem_data {
14232a85fc56SKees Cook 	ACPI_FLEX_ARRAY(u8, oem_data);
1424da6a9bbeSBob Moore };
1425da6a9bbeSBob Moore 
1426e62f8227SErik Schmauss /*
1427e62f8227SErik Schmauss  * Common flags fields for MADT subtables
1428e62f8227SErik Schmauss  */
1429e62f8227SErik Schmauss 
1430e62f8227SErik Schmauss /* MADT Local APIC flags */
1431e62f8227SErik Schmauss 
1432e62f8227SErik Schmauss #define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if set */
1433435a8dc8SMario Limonciello #define ACPI_MADT_ONLINE_CAPABLE    (2)	/* 01: System HW supports enabling processor at runtime */
1434e62f8227SErik Schmauss 
1435e62f8227SErik Schmauss /* MADT MPS INTI flags (inti_flags) */
1436e62f8227SErik Schmauss 
1437e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_MASK     (3)	/* 00-01: Polarity of APIC I/O input signals */
1438e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_MASK      (3<<2)	/* 02-03: Trigger mode of APIC input signals */
1439e62f8227SErik Schmauss 
1440e62f8227SErik Schmauss /* Values for MPS INTI flags */
1441e62f8227SErik Schmauss 
1442e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_CONFORMS       0
1443e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
1444e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_RESERVED       2
1445e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
1446e62f8227SErik Schmauss 
1447e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_CONFORMS        (0)
1448e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
1449e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
1450e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
1451e62f8227SErik Schmauss 
1452e62f8227SErik Schmauss /*******************************************************************************
1453e62f8227SErik Schmauss  *
14541a49b72cSBob Moore  * MCFG - PCI Memory Mapped Configuration table and subtable
14556e2d5ebdSBob Moore  *        Version 1
14566e2d5ebdSBob Moore  *
14576e2d5ebdSBob Moore  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
1458b24aad44SBob Moore  *
1459b24aad44SBob Moore  ******************************************************************************/
1460b24aad44SBob Moore 
1461b24aad44SBob Moore struct acpi_table_mcfg {
1462b24aad44SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1463b24aad44SBob Moore 	u8 reserved[8];
1464b24aad44SBob Moore };
1465b24aad44SBob Moore 
1466b24aad44SBob Moore /* Subtable */
1467b24aad44SBob Moore 
1468b24aad44SBob Moore struct acpi_mcfg_allocation {
1469b24aad44SBob Moore 	u64 address;		/* Base address, processor-relative */
1470b24aad44SBob Moore 	u16 pci_segment;	/* PCI segment group number */
1471b24aad44SBob Moore 	u8 start_bus_number;	/* Starting PCI Bus number */
1472b24aad44SBob Moore 	u8 end_bus_number;	/* Final PCI Bus number */
1473b24aad44SBob Moore 	u32 reserved;
1474b24aad44SBob Moore };
1475b24aad44SBob Moore 
1476b24aad44SBob Moore /*******************************************************************************
1477b24aad44SBob Moore  *
14780e264f0bSBob Moore  * MCHI - Management Controller Host Interface Table
14790e264f0bSBob Moore  *        Version 1
14800e264f0bSBob Moore  *
14810e264f0bSBob Moore  * Conforms to "Management Component Transport Protocol (MCTP) Host
14820e264f0bSBob Moore  * Interface Specification", Revision 1.0.0a, October 13, 2009
14830e264f0bSBob Moore  *
14840e264f0bSBob Moore  ******************************************************************************/
14850e264f0bSBob Moore 
14860e264f0bSBob Moore struct acpi_table_mchi {
14870e264f0bSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
14880e264f0bSBob Moore 	u8 interface_type;
14890e264f0bSBob Moore 	u8 protocol;
14900e264f0bSBob Moore 	u64 protocol_data;
14910e264f0bSBob Moore 	u8 interrupt_type;
14920e264f0bSBob Moore 	u8 gpe;
14930e264f0bSBob Moore 	u8 pci_device_flag;
14940e264f0bSBob Moore 	u32 global_interrupt;
14950e264f0bSBob Moore 	struct acpi_generic_address control_register;
14960e264f0bSBob Moore 	u8 pci_segment;
14970e264f0bSBob Moore 	u8 pci_bus;
14980e264f0bSBob Moore 	u8 pci_device;
14990e264f0bSBob Moore 	u8 pci_function;
15000e264f0bSBob Moore };
15010e264f0bSBob Moore 
15020e264f0bSBob Moore /*******************************************************************************
15030e264f0bSBob Moore  *
150447920aaeSHesham Almatary  * MPAM - Memory System Resource Partitioning and Monitoring
150547920aaeSHesham Almatary  *
150647920aaeSHesham Almatary  * Conforms to "ACPI for Memory System Resource Partitioning and Monitoring 2.0"
150747920aaeSHesham Almatary  * Document number: ARM DEN 0065, December, 2022.
150847920aaeSHesham Almatary  *
150947920aaeSHesham Almatary  ******************************************************************************/
151047920aaeSHesham Almatary 
151147920aaeSHesham Almatary /* MPAM RIS locator types. Table 11, Location types */
151247920aaeSHesham Almatary enum acpi_mpam_locator_type {
151347920aaeSHesham Almatary 	ACPI_MPAM_LOCATION_TYPE_PROCESSOR_CACHE = 0,
151447920aaeSHesham Almatary 	ACPI_MPAM_LOCATION_TYPE_MEMORY = 1,
151547920aaeSHesham Almatary 	ACPI_MPAM_LOCATION_TYPE_SMMU = 2,
151647920aaeSHesham Almatary 	ACPI_MPAM_LOCATION_TYPE_MEMORY_CACHE = 3,
151747920aaeSHesham Almatary 	ACPI_MPAM_LOCATION_TYPE_ACPI_DEVICE = 4,
151847920aaeSHesham Almatary 	ACPI_MPAM_LOCATION_TYPE_INTERCONNECT = 5,
151947920aaeSHesham Almatary 	ACPI_MPAM_LOCATION_TYPE_UNKNOWN = 0xFF
152047920aaeSHesham Almatary };
152147920aaeSHesham Almatary 
152247920aaeSHesham Almatary /* MPAM Functional dependency descriptor. Table 10 */
152347920aaeSHesham Almatary struct acpi_mpam_func_deps {
152447920aaeSHesham Almatary 	u32 producer;
152547920aaeSHesham Almatary 	u32 reserved;
152647920aaeSHesham Almatary };
152747920aaeSHesham Almatary 
152847920aaeSHesham Almatary /* MPAM Processor cache locator descriptor. Table 13 */
152947920aaeSHesham Almatary struct acpi_mpam_resource_cache_locator {
153047920aaeSHesham Almatary 	u64 cache_reference;
153147920aaeSHesham Almatary 	u32 reserved;
153247920aaeSHesham Almatary };
153347920aaeSHesham Almatary 
153447920aaeSHesham Almatary /* MPAM Memory locator descriptor. Table 14 */
153547920aaeSHesham Almatary struct acpi_mpam_resource_memory_locator {
153647920aaeSHesham Almatary 	u64 proximity_domain;
153747920aaeSHesham Almatary 	u32 reserved;
153847920aaeSHesham Almatary };
153947920aaeSHesham Almatary 
154047920aaeSHesham Almatary /* MPAM SMMU locator descriptor. Table 15 */
154147920aaeSHesham Almatary struct acpi_mpam_resource_smmu_locator {
154247920aaeSHesham Almatary 	u64 smmu_interface;
154347920aaeSHesham Almatary 	u32 reserved;
154447920aaeSHesham Almatary };
154547920aaeSHesham Almatary 
154647920aaeSHesham Almatary /* MPAM Memory-side cache locator descriptor. Table 16 */
154747920aaeSHesham Almatary struct acpi_mpam_resource_memcache_locator {
154847920aaeSHesham Almatary 	u8 reserved[7];
154947920aaeSHesham Almatary 	u8 level;
155047920aaeSHesham Almatary 	u32 reference;
155147920aaeSHesham Almatary };
155247920aaeSHesham Almatary 
155347920aaeSHesham Almatary /* MPAM ACPI device locator descriptor. Table 17 */
155447920aaeSHesham Almatary struct acpi_mpam_resource_acpi_locator {
155547920aaeSHesham Almatary 	u64 acpi_hw_id;
155647920aaeSHesham Almatary 	u32 acpi_unique_id;
155747920aaeSHesham Almatary };
155847920aaeSHesham Almatary 
155947920aaeSHesham Almatary /* MPAM Interconnect locator descriptor. Table 18 */
156047920aaeSHesham Almatary struct acpi_mpam_resource_interconnect_locator {
156147920aaeSHesham Almatary 	u64 inter_connect_desc_tbl_off;
156247920aaeSHesham Almatary 	u32 reserved;
156347920aaeSHesham Almatary };
156447920aaeSHesham Almatary 
156547920aaeSHesham Almatary /* MPAM Locator structure. Table 12 */
156647920aaeSHesham Almatary struct acpi_mpam_resource_generic_locator {
156747920aaeSHesham Almatary 	u64 descriptor1;
156847920aaeSHesham Almatary 	u32 descriptor2;
156947920aaeSHesham Almatary };
157047920aaeSHesham Almatary 
157147920aaeSHesham Almatary union acpi_mpam_resource_locator {
157247920aaeSHesham Almatary 	struct acpi_mpam_resource_cache_locator cache_locator;
157347920aaeSHesham Almatary 	struct acpi_mpam_resource_memory_locator memory_locator;
157447920aaeSHesham Almatary 	struct acpi_mpam_resource_smmu_locator smmu_locator;
157547920aaeSHesham Almatary 	struct acpi_mpam_resource_memcache_locator mem_cache_locator;
157647920aaeSHesham Almatary 	struct acpi_mpam_resource_acpi_locator acpi_locator;
157747920aaeSHesham Almatary 	struct acpi_mpam_resource_interconnect_locator interconnect_ifc_locator;
157847920aaeSHesham Almatary 	struct acpi_mpam_resource_generic_locator generic_locator;
157947920aaeSHesham Almatary };
158047920aaeSHesham Almatary 
158147920aaeSHesham Almatary /* Memory System Component Resource Node Structure Table 9 */
158247920aaeSHesham Almatary struct acpi_mpam_resource_node {
158347920aaeSHesham Almatary 	u32 identifier;
158447920aaeSHesham Almatary 	u8 ris_index;
158547920aaeSHesham Almatary 	u16 reserved1;
158647920aaeSHesham Almatary 	u8 locator_type;
158747920aaeSHesham Almatary 	union acpi_mpam_resource_locator locator;
158847920aaeSHesham Almatary 	u32 num_functional_deps;
158947920aaeSHesham Almatary };
159047920aaeSHesham Almatary 
159147920aaeSHesham Almatary /* Memory System Component (MSC) Node Structure. Table 4 */
159247920aaeSHesham Almatary struct acpi_mpam_msc_node {
159347920aaeSHesham Almatary 	u16 length;
159447920aaeSHesham Almatary 	u8 interface_type;
159547920aaeSHesham Almatary 	u8 reserved;
159647920aaeSHesham Almatary 	u32 identifier;
159747920aaeSHesham Almatary 	u64 base_address;
159847920aaeSHesham Almatary 	u32 mmio_size;
159947920aaeSHesham Almatary 	u32 overflow_interrupt;
160047920aaeSHesham Almatary 	u32 overflow_interrupt_flags;
160147920aaeSHesham Almatary 	u32 reserved1;
160247920aaeSHesham Almatary 	u32 overflow_interrupt_affinity;
160347920aaeSHesham Almatary 	u32 error_interrupt;
160447920aaeSHesham Almatary 	u32 error_interrupt_flags;
160547920aaeSHesham Almatary 	u32 reserved2;
160647920aaeSHesham Almatary 	u32 error_interrupt_affinity;
160747920aaeSHesham Almatary 	u32 max_nrdy_usec;
160847920aaeSHesham Almatary 	u64 hardware_id_linked_device;
160947920aaeSHesham Almatary 	u32 instance_id_linked_device;
1610*cf94e10aSPunit Agrawal 	u32 num_resource_nodes;
161147920aaeSHesham Almatary };
161247920aaeSHesham Almatary 
161347920aaeSHesham Almatary struct acpi_table_mpam {
161447920aaeSHesham Almatary 	struct acpi_table_header header;	/* Common ACPI table header */
161547920aaeSHesham Almatary };
161647920aaeSHesham Almatary 
161747920aaeSHesham Almatary /*******************************************************************************
161847920aaeSHesham Almatary  *
1619e62f8227SErik Schmauss  * MPST - Memory Power State Table (ACPI 5.0)
1620e62f8227SErik Schmauss  *        Version 1
1621e62f8227SErik Schmauss  *
1622e62f8227SErik Schmauss  ******************************************************************************/
1623e62f8227SErik Schmauss 
1624e62f8227SErik Schmauss #define ACPI_MPST_CHANNEL_INFO \
1625e62f8227SErik Schmauss 	u8                              channel_id; \
1626e62f8227SErik Schmauss 	u8                              reserved1[3]; \
1627e62f8227SErik Schmauss 	u16                             power_node_count; \
1628e62f8227SErik Schmauss 	u16                             reserved2;
1629e62f8227SErik Schmauss 
1630e62f8227SErik Schmauss /* Main table */
1631e62f8227SErik Schmauss 
1632e62f8227SErik Schmauss struct acpi_table_mpst {
1633e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1634e62f8227SErik Schmauss 	 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
1635e62f8227SErik Schmauss };
1636e62f8227SErik Schmauss 
1637e62f8227SErik Schmauss /* Memory Platform Communication Channel Info */
1638e62f8227SErik Schmauss 
1639e62f8227SErik Schmauss struct acpi_mpst_channel {
1640e62f8227SErik Schmauss 	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
1641e62f8227SErik Schmauss };
1642e62f8227SErik Schmauss 
1643e62f8227SErik Schmauss /* Memory Power Node Structure */
1644e62f8227SErik Schmauss 
1645e62f8227SErik Schmauss struct acpi_mpst_power_node {
1646e62f8227SErik Schmauss 	u8 flags;
1647e62f8227SErik Schmauss 	u8 reserved1;
1648e62f8227SErik Schmauss 	u16 node_id;
1649e62f8227SErik Schmauss 	u32 length;
1650e62f8227SErik Schmauss 	u64 range_address;
1651e62f8227SErik Schmauss 	u64 range_length;
1652e62f8227SErik Schmauss 	u32 num_power_states;
1653e62f8227SErik Schmauss 	u32 num_physical_components;
1654e62f8227SErik Schmauss };
1655e62f8227SErik Schmauss 
1656e62f8227SErik Schmauss /* Values for Flags field above */
1657e62f8227SErik Schmauss 
1658e62f8227SErik Schmauss #define ACPI_MPST_ENABLED               1
1659e62f8227SErik Schmauss #define ACPI_MPST_POWER_MANAGED         2
1660e62f8227SErik Schmauss #define ACPI_MPST_HOT_PLUG_CAPABLE      4
1661e62f8227SErik Schmauss 
1662e62f8227SErik Schmauss /* Memory Power State Structure (follows POWER_NODE above) */
1663e62f8227SErik Schmauss 
1664e62f8227SErik Schmauss struct acpi_mpst_power_state {
1665e62f8227SErik Schmauss 	u8 power_state;
1666e62f8227SErik Schmauss 	u8 info_index;
1667e62f8227SErik Schmauss };
1668e62f8227SErik Schmauss 
1669e62f8227SErik Schmauss /* Physical Component ID Structure (follows POWER_STATE above) */
1670e62f8227SErik Schmauss 
1671e62f8227SErik Schmauss struct acpi_mpst_component {
1672e62f8227SErik Schmauss 	u16 component_id;
1673e62f8227SErik Schmauss };
1674e62f8227SErik Schmauss 
1675e62f8227SErik Schmauss /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
1676e62f8227SErik Schmauss 
1677e62f8227SErik Schmauss struct acpi_mpst_data_hdr {
1678e62f8227SErik Schmauss 	u16 characteristics_count;
1679e62f8227SErik Schmauss 	u16 reserved;
1680e62f8227SErik Schmauss };
1681e62f8227SErik Schmauss 
1682e62f8227SErik Schmauss struct acpi_mpst_power_data {
1683e62f8227SErik Schmauss 	u8 structure_id;
1684e62f8227SErik Schmauss 	u8 flags;
1685e62f8227SErik Schmauss 	u16 reserved1;
1686e62f8227SErik Schmauss 	u32 average_power;
1687e62f8227SErik Schmauss 	u32 power_saving;
1688e62f8227SErik Schmauss 	u64 exit_latency;
1689e62f8227SErik Schmauss 	u64 reserved2;
1690e62f8227SErik Schmauss };
1691e62f8227SErik Schmauss 
1692e62f8227SErik Schmauss /* Values for Flags field above */
1693e62f8227SErik Schmauss 
1694e62f8227SErik Schmauss #define ACPI_MPST_PRESERVE              1
1695e62f8227SErik Schmauss #define ACPI_MPST_AUTOENTRY             2
1696e62f8227SErik Schmauss #define ACPI_MPST_AUTOEXIT              4
1697e62f8227SErik Schmauss 
1698e62f8227SErik Schmauss /* Shared Memory Region (not part of an ACPI table) */
1699e62f8227SErik Schmauss 
1700e62f8227SErik Schmauss struct acpi_mpst_shared {
1701e62f8227SErik Schmauss 	u32 signature;
1702e62f8227SErik Schmauss 	u16 pcc_command;
1703e62f8227SErik Schmauss 	u16 pcc_status;
1704e62f8227SErik Schmauss 	u32 command_register;
1705e62f8227SErik Schmauss 	u32 status_register;
1706e62f8227SErik Schmauss 	u32 power_state_id;
1707e62f8227SErik Schmauss 	u32 power_node_id;
1708e62f8227SErik Schmauss 	u64 energy_consumed;
1709e62f8227SErik Schmauss 	u64 average_power;
1710e62f8227SErik Schmauss };
1711e62f8227SErik Schmauss 
1712e62f8227SErik Schmauss /*******************************************************************************
1713e62f8227SErik Schmauss  *
1714e62f8227SErik Schmauss  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
1715e62f8227SErik Schmauss  *        Version 1
1716e62f8227SErik Schmauss  *
1717e62f8227SErik Schmauss  ******************************************************************************/
1718e62f8227SErik Schmauss 
1719e62f8227SErik Schmauss struct acpi_table_msct {
1720e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1721e62f8227SErik Schmauss 	u32 proximity_offset;	/* Location of proximity info struct(s) */
1722e62f8227SErik Schmauss 	u32 max_proximity_domains;	/* Max number of proximity domains */
1723e62f8227SErik Schmauss 	u32 max_clock_domains;	/* Max number of clock domains */
1724e62f8227SErik Schmauss 	u64 max_address;	/* Max physical address in system */
1725e62f8227SErik Schmauss };
1726e62f8227SErik Schmauss 
1727e62f8227SErik Schmauss /* subtable - Maximum Proximity Domain Information. Version 1 */
1728e62f8227SErik Schmauss 
1729e62f8227SErik Schmauss struct acpi_msct_proximity {
1730e62f8227SErik Schmauss 	u8 revision;
1731e62f8227SErik Schmauss 	u8 length;
1732e62f8227SErik Schmauss 	u32 range_start;	/* Start of domain range */
1733e62f8227SErik Schmauss 	u32 range_end;		/* End of domain range */
1734e62f8227SErik Schmauss 	u32 processor_capacity;
1735e62f8227SErik Schmauss 	u64 memory_capacity;	/* In bytes */
1736e62f8227SErik Schmauss };
1737e62f8227SErik Schmauss 
1738e62f8227SErik Schmauss /*******************************************************************************
1739e62f8227SErik Schmauss  *
17405132f2faSBob Moore  * MSDM - Microsoft Data Management table
17415132f2faSBob Moore  *
17425132f2faSBob Moore  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
17435132f2faSBob Moore  * November 29, 2011. Copyright 2011 Microsoft
17445132f2faSBob Moore  *
17455132f2faSBob Moore  ******************************************************************************/
17465132f2faSBob Moore 
17475132f2faSBob Moore /* Basic MSDM table is only the common ACPI header */
17485132f2faSBob Moore 
17495132f2faSBob Moore struct acpi_table_msdm {
17505132f2faSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
17515132f2faSBob Moore };
17525132f2faSBob Moore 
17535132f2faSBob Moore /*******************************************************************************
17545132f2faSBob Moore  *
1755e62f8227SErik Schmauss  * NFIT - NVDIMM Interface Table (ACPI 6.0+)
1756e62f8227SErik Schmauss  *        Version 1
1757e62f8227SErik Schmauss  *
1758e62f8227SErik Schmauss  ******************************************************************************/
1759e62f8227SErik Schmauss 
1760e62f8227SErik Schmauss struct acpi_table_nfit {
1761e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1762e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
1763e62f8227SErik Schmauss };
1764e62f8227SErik Schmauss 
1765e62f8227SErik Schmauss /* Subtable header for NFIT */
1766e62f8227SErik Schmauss 
1767e62f8227SErik Schmauss struct acpi_nfit_header {
1768e62f8227SErik Schmauss 	u16 type;
1769e62f8227SErik Schmauss 	u16 length;
1770e62f8227SErik Schmauss };
1771e62f8227SErik Schmauss 
1772e62f8227SErik Schmauss /* Values for subtable type in struct acpi_nfit_header */
1773e62f8227SErik Schmauss 
1774e62f8227SErik Schmauss enum acpi_nfit_type {
1775e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
1776e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_MEMORY_MAP = 1,
1777e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_INTERLEAVE = 2,
1778e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_SMBIOS = 3,
1779e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_CONTROL_REGION = 4,
1780e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_DATA_REGION = 5,
1781e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
1782e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_CAPABILITIES = 7,
1783e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_RESERVED = 8	/* 8 and greater are reserved */
1784e62f8227SErik Schmauss };
1785e62f8227SErik Schmauss 
1786e62f8227SErik Schmauss /*
1787e62f8227SErik Schmauss  * NFIT Subtables
1788e62f8227SErik Schmauss  */
1789e62f8227SErik Schmauss 
1790e62f8227SErik Schmauss /* 0: System Physical Address Range Structure */
1791e62f8227SErik Schmauss 
1792e62f8227SErik Schmauss struct acpi_nfit_system_address {
1793e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1794e62f8227SErik Schmauss 	u16 range_index;
1795e62f8227SErik Schmauss 	u16 flags;
1796e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
1797e62f8227SErik Schmauss 	u32 proximity_domain;
1798e62f8227SErik Schmauss 	u8 range_guid[16];
1799e62f8227SErik Schmauss 	u64 address;
1800e62f8227SErik Schmauss 	u64 length;
1801e62f8227SErik Schmauss 	u64 memory_mapping;
1802cf16b05cSBob Moore 	u64 location_cookie;	/* ACPI 6.4 */
1803e62f8227SErik Schmauss };
1804e62f8227SErik Schmauss 
1805e62f8227SErik Schmauss /* Flags */
1806e62f8227SErik Schmauss 
1807e62f8227SErik Schmauss #define ACPI_NFIT_ADD_ONLINE_ONLY       (1)	/* 00: Add/Online Operation Only */
1808e62f8227SErik Schmauss #define ACPI_NFIT_PROXIMITY_VALID       (1<<1)	/* 01: Proximity Domain Valid */
1809cf16b05cSBob Moore #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2)	/* 02: SPA location cookie valid (ACPI 6.4) */
1810e62f8227SErik Schmauss 
1811e62f8227SErik Schmauss /* Range Type GUIDs appear in the include/acuuid.h file */
1812e62f8227SErik Schmauss 
1813e62f8227SErik Schmauss /* 1: Memory Device to System Address Range Map Structure */
1814e62f8227SErik Schmauss 
1815e62f8227SErik Schmauss struct acpi_nfit_memory_map {
1816e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1817e62f8227SErik Schmauss 	u32 device_handle;
1818e62f8227SErik Schmauss 	u16 physical_id;
1819e62f8227SErik Schmauss 	u16 region_id;
1820e62f8227SErik Schmauss 	u16 range_index;
1821e62f8227SErik Schmauss 	u16 region_index;
1822e62f8227SErik Schmauss 	u64 region_size;
1823e62f8227SErik Schmauss 	u64 region_offset;
1824e62f8227SErik Schmauss 	u64 address;
1825e62f8227SErik Schmauss 	u16 interleave_index;
1826e62f8227SErik Schmauss 	u16 interleave_ways;
1827e62f8227SErik Schmauss 	u16 flags;
1828e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
1829e62f8227SErik Schmauss };
1830e62f8227SErik Schmauss 
1831e62f8227SErik Schmauss /* Flags */
1832e62f8227SErik Schmauss 
1833e62f8227SErik Schmauss #define ACPI_NFIT_MEM_SAVE_FAILED       (1)	/* 00: Last SAVE to Memory Device failed */
1834e62f8227SErik Schmauss #define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)	/* 01: Last RESTORE from Memory Device failed */
1835e62f8227SErik Schmauss #define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)	/* 02: Platform flush failed */
1836e62f8227SErik Schmauss #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device is not armed */
1837e62f8227SErik Schmauss #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device observed SMART/health events */
1838e62f8227SErik Schmauss #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health events enabled */
1839e62f8227SErik Schmauss #define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to SPA failed */
1840e62f8227SErik Schmauss 
1841e62f8227SErik Schmauss /* 2: Interleave Structure */
1842e62f8227SErik Schmauss 
1843e62f8227SErik Schmauss struct acpi_nfit_interleave {
1844e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1845e62f8227SErik Schmauss 	u16 interleave_index;
1846e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
1847e62f8227SErik Schmauss 	u32 line_count;
1848e62f8227SErik Schmauss 	u32 line_size;
18492a5ab998SKees Cook 	u32 line_offset[];	/* Variable length */
1850e62f8227SErik Schmauss };
1851e62f8227SErik Schmauss 
1852e62f8227SErik Schmauss /* 3: SMBIOS Management Information Structure */
1853e62f8227SErik Schmauss 
1854e62f8227SErik Schmauss struct acpi_nfit_smbios {
1855e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1856e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
185774522feaSKees Cook 	u8 data[];		/* Variable length */
1858e62f8227SErik Schmauss };
1859e62f8227SErik Schmauss 
1860e62f8227SErik Schmauss /* 4: NVDIMM Control Region Structure */
1861e62f8227SErik Schmauss 
1862e62f8227SErik Schmauss struct acpi_nfit_control_region {
1863e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1864e62f8227SErik Schmauss 	u16 region_index;
1865e62f8227SErik Schmauss 	u16 vendor_id;
1866e62f8227SErik Schmauss 	u16 device_id;
1867e62f8227SErik Schmauss 	u16 revision_id;
1868e62f8227SErik Schmauss 	u16 subsystem_vendor_id;
1869e62f8227SErik Schmauss 	u16 subsystem_device_id;
1870e62f8227SErik Schmauss 	u16 subsystem_revision_id;
1871e62f8227SErik Schmauss 	u8 valid_fields;
1872e62f8227SErik Schmauss 	u8 manufacturing_location;
1873e62f8227SErik Schmauss 	u16 manufacturing_date;
1874e62f8227SErik Schmauss 	u8 reserved[2];		/* Reserved, must be zero */
1875e62f8227SErik Schmauss 	u32 serial_number;
1876e62f8227SErik Schmauss 	u16 code;
1877e62f8227SErik Schmauss 	u16 windows;
1878e62f8227SErik Schmauss 	u64 window_size;
1879e62f8227SErik Schmauss 	u64 command_offset;
1880e62f8227SErik Schmauss 	u64 command_size;
1881e62f8227SErik Schmauss 	u64 status_offset;
1882e62f8227SErik Schmauss 	u64 status_size;
1883e62f8227SErik Schmauss 	u16 flags;
1884e62f8227SErik Schmauss 	u8 reserved1[6];	/* Reserved, must be zero */
1885e62f8227SErik Schmauss };
1886e62f8227SErik Schmauss 
1887e62f8227SErik Schmauss /* Flags */
1888e62f8227SErik Schmauss 
1889e62f8227SErik Schmauss #define ACPI_NFIT_CONTROL_BUFFERED          (1)	/* Block Data Windows implementation is buffered */
1890e62f8227SErik Schmauss 
1891e62f8227SErik Schmauss /* valid_fields bits */
1892e62f8227SErik Schmauss 
1893e62f8227SErik Schmauss #define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)	/* Manufacturing fields are valid */
1894e62f8227SErik Schmauss 
1895e62f8227SErik Schmauss /* 5: NVDIMM Block Data Window Region Structure */
1896e62f8227SErik Schmauss 
1897e62f8227SErik Schmauss struct acpi_nfit_data_region {
1898e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1899e62f8227SErik Schmauss 	u16 region_index;
1900e62f8227SErik Schmauss 	u16 windows;
1901e62f8227SErik Schmauss 	u64 offset;
1902e62f8227SErik Schmauss 	u64 size;
1903e62f8227SErik Schmauss 	u64 capacity;
1904e62f8227SErik Schmauss 	u64 start_address;
1905e62f8227SErik Schmauss };
1906e62f8227SErik Schmauss 
1907e62f8227SErik Schmauss /* 6: Flush Hint Address Structure */
1908e62f8227SErik Schmauss 
1909e62f8227SErik Schmauss struct acpi_nfit_flush_address {
1910e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1911e62f8227SErik Schmauss 	u32 device_handle;
1912e62f8227SErik Schmauss 	u16 hint_count;
1913e62f8227SErik Schmauss 	u8 reserved[6];		/* Reserved, must be zero */
191474522feaSKees Cook 	u64 hint_address[];	/* Variable length */
1915e62f8227SErik Schmauss };
1916e62f8227SErik Schmauss 
1917e62f8227SErik Schmauss /* 7: Platform Capabilities Structure */
1918e62f8227SErik Schmauss 
1919e62f8227SErik Schmauss struct acpi_nfit_capabilities {
1920e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1921e62f8227SErik Schmauss 	u8 highest_capability;
1922e62f8227SErik Schmauss 	u8 reserved[3];		/* Reserved, must be zero */
1923e62f8227SErik Schmauss 	u32 capabilities;
1924e62f8227SErik Schmauss 	u32 reserved2;
1925e62f8227SErik Schmauss };
1926e62f8227SErik Schmauss 
1927e62f8227SErik Schmauss /* Capabilities Flags */
1928e62f8227SErik Schmauss 
1929e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH       (1)	/* 00: Cache Flush to NVDIMM capable */
1930e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_MEM_FLUSH         (1<<1)	/* 01: Memory Flush to NVDIMM capable */
1931e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING     (1<<2)	/* 02: Memory Mirroring capable */
1932e62f8227SErik Schmauss 
1933e62f8227SErik Schmauss /*
1934e62f8227SErik Schmauss  * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
1935e62f8227SErik Schmauss  */
1936e62f8227SErik Schmauss struct nfit_device_handle {
1937e62f8227SErik Schmauss 	u32 handle;
1938e62f8227SErik Schmauss };
1939e62f8227SErik Schmauss 
1940e62f8227SErik Schmauss /* Device handle construction and extraction macros */
1941e62f8227SErik Schmauss 
1942e62f8227SErik Schmauss #define ACPI_NFIT_DIMM_NUMBER_MASK              0x0000000F
1943e62f8227SErik Schmauss #define ACPI_NFIT_CHANNEL_NUMBER_MASK           0x000000F0
1944e62f8227SErik Schmauss #define ACPI_NFIT_MEMORY_ID_MASK                0x00000F00
1945e62f8227SErik Schmauss #define ACPI_NFIT_SOCKET_ID_MASK                0x0000F000
1946e62f8227SErik Schmauss #define ACPI_NFIT_NODE_ID_MASK                  0x0FFF0000
1947e62f8227SErik Schmauss 
1948e62f8227SErik Schmauss #define ACPI_NFIT_DIMM_NUMBER_OFFSET            0
1949e62f8227SErik Schmauss #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET         4
1950e62f8227SErik Schmauss #define ACPI_NFIT_MEMORY_ID_OFFSET              8
1951e62f8227SErik Schmauss #define ACPI_NFIT_SOCKET_ID_OFFSET              12
1952e62f8227SErik Schmauss #define ACPI_NFIT_NODE_ID_OFFSET                16
1953e62f8227SErik Schmauss 
1954e62f8227SErik Schmauss /* Macro to construct a NFIT/NVDIMM device handle */
1955e62f8227SErik Schmauss 
1956e62f8227SErik Schmauss #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
1957e62f8227SErik Schmauss 	((dimm)                                         | \
1958e62f8227SErik Schmauss 	((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET)  | \
1959e62f8227SErik Schmauss 	((memory)  << ACPI_NFIT_MEMORY_ID_OFFSET)       | \
1960e62f8227SErik Schmauss 	((socket)  << ACPI_NFIT_SOCKET_ID_OFFSET)       | \
1961e62f8227SErik Schmauss 	((node)    << ACPI_NFIT_NODE_ID_OFFSET))
1962e62f8227SErik Schmauss 
1963e62f8227SErik Schmauss /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
1964e62f8227SErik Schmauss 
1965e62f8227SErik Schmauss #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
1966e62f8227SErik Schmauss 	((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
1967e62f8227SErik Schmauss 
1968e62f8227SErik Schmauss #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
1969e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
1970e62f8227SErik Schmauss 
1971e62f8227SErik Schmauss #define ACPI_NFIT_GET_MEMORY_ID(handle) \
1972e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_MEMORY_ID_MASK)      >> ACPI_NFIT_MEMORY_ID_OFFSET)
1973e62f8227SErik Schmauss 
1974e62f8227SErik Schmauss #define ACPI_NFIT_GET_SOCKET_ID(handle) \
1975e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_SOCKET_ID_MASK)      >> ACPI_NFIT_SOCKET_ID_OFFSET)
1976e62f8227SErik Schmauss 
1977e62f8227SErik Schmauss #define ACPI_NFIT_GET_NODE_ID(handle) \
1978e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_NODE_ID_MASK)        >> ACPI_NFIT_NODE_ID_OFFSET)
1979e62f8227SErik Schmauss 
1980e62f8227SErik Schmauss /*******************************************************************************
1981e62f8227SErik Schmauss  *
1982a805aab8SBob Moore  * NHLT - Non HDAudio Link Table
19832f7d7ea4SCezary Rojewski  *        Version 1
1984a805aab8SBob Moore  *
1985a805aab8SBob Moore  ******************************************************************************/
1986a805aab8SBob Moore 
1987a805aab8SBob Moore struct acpi_table_nhlt {
1988a805aab8SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
19892f7d7ea4SCezary Rojewski 	u8 endpoints_count;
19902f7d7ea4SCezary Rojewski 	/*
19912f7d7ea4SCezary Rojewski 	 * struct acpi_nhlt_endpoint endpoints[];
19922f7d7ea4SCezary Rojewski 	 * struct acpi_nhlt_config oed_config;
19932f7d7ea4SCezary Rojewski 	 */
1994a805aab8SBob Moore };
1995a805aab8SBob Moore 
1996a805aab8SBob Moore struct acpi_nhlt_endpoint {
19972f7d7ea4SCezary Rojewski 	u32 length;
1998a805aab8SBob Moore 	u8 link_type;
1999a805aab8SBob Moore 	u8 instance_id;
2000a805aab8SBob Moore 	u16 vendor_id;
2001a805aab8SBob Moore 	u16 device_id;
2002a805aab8SBob Moore 	u16 revision_id;
2003a805aab8SBob Moore 	u32 subsystem_id;
2004a805aab8SBob Moore 	u8 device_type;
2005a805aab8SBob Moore 	u8 direction;
2006a805aab8SBob Moore 	u8 virtual_bus_id;
20072f7d7ea4SCezary Rojewski 	/*
20082f7d7ea4SCezary Rojewski 	 * struct acpi_nhlt_config device_config;
20092f7d7ea4SCezary Rojewski 	 * struct acpi_nhlt_formats_config formats_config;
20102f7d7ea4SCezary Rojewski 	 * struct acpi_nhlt_devices_info devices_info;
20112f7d7ea4SCezary Rojewski 	 */
2012a805aab8SBob Moore };
2013a805aab8SBob Moore 
20142f7d7ea4SCezary Rojewski /*
20152f7d7ea4SCezary Rojewski  * Values for link_type field above
20162f7d7ea4SCezary Rojewski  *
20172f7d7ea4SCezary Rojewski  * Only types PDM and SSP are used
20182f7d7ea4SCezary Rojewski  */
20192f7d7ea4SCezary Rojewski #define ACPI_NHLT_LINKTYPE_HDA			0
20202f7d7ea4SCezary Rojewski #define ACPI_NHLT_LINKTYPE_DSP			1
20212f7d7ea4SCezary Rojewski #define ACPI_NHLT_LINKTYPE_PDM			2
20222f7d7ea4SCezary Rojewski #define ACPI_NHLT_LINKTYPE_SSP			3
20232f7d7ea4SCezary Rojewski #define ACPI_NHLT_LINKTYPE_SLIMBUS		4
20242f7d7ea4SCezary Rojewski #define ACPI_NHLT_LINKTYPE_SDW			5
20252f7d7ea4SCezary Rojewski #define ACPI_NHLT_LINKTYPE_UAOL			6
2026a805aab8SBob Moore 
2027a805aab8SBob Moore /* Values for device_id field above */
2028a805aab8SBob Moore 
20292f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICEID_DMIC			0xAE20
20302f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICEID_BT			0xAE30
20312f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICEID_I2S			0xAE34
2032a805aab8SBob Moore 
2033a805aab8SBob Moore /* Values for device_type field above */
2034a805aab8SBob Moore 
20352f7d7ea4SCezary Rojewski /*
20362f7d7ea4SCezary Rojewski  * Device types unique to endpoint of link_type=PDM
20372f7d7ea4SCezary Rojewski  *
20382f7d7ea4SCezary Rojewski  * Type PDM used for all SKL+ platforms
20392f7d7ea4SCezary Rojewski  */
20402f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICETYPE_PDM		0
20412f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICETYPE_PDM_SKL		1
20422f7d7ea4SCezary Rojewski /* Device types unique to endpoint of link_type=SSP */
20432f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICETYPE_BT			0
20442f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICETYPE_FM			1
20452f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICETYPE_MODEM		2
20462f7d7ea4SCezary Rojewski #define ACPI_NHLT_DEVICETYPE_CODEC		4
2047a805aab8SBob Moore 
2048a805aab8SBob Moore /* Values for Direction field above */
2049a805aab8SBob Moore 
2050a805aab8SBob Moore #define ACPI_NHLT_DIR_RENDER			0
2051a805aab8SBob Moore #define ACPI_NHLT_DIR_CAPTURE			1
2052a805aab8SBob Moore 
20532f7d7ea4SCezary Rojewski struct acpi_nhlt_config {
2054a805aab8SBob Moore 	u32 capabilities_size;
20552f7d7ea4SCezary Rojewski 	u8 capabilities[];
20562f7d7ea4SCezary Rojewski };
20572f7d7ea4SCezary Rojewski 
20582f7d7ea4SCezary Rojewski struct acpi_nhlt_gendevice_config {
2059a805aab8SBob Moore 	u8 virtual_slot;
2060a805aab8SBob Moore 	u8 config_type;
2061a805aab8SBob Moore };
2062a805aab8SBob Moore 
20632f7d7ea4SCezary Rojewski /* Values for config_type field above */
20642f7d7ea4SCezary Rojewski 
20652f7d7ea4SCezary Rojewski #define ACPI_NHLT_CONFIGTYPE_GENERIC		0
20662f7d7ea4SCezary Rojewski #define ACPI_NHLT_CONFIGTYPE_MICARRAY		1
20672f7d7ea4SCezary Rojewski 
20682f7d7ea4SCezary Rojewski struct acpi_nhlt_micdevice_config {
2069a805aab8SBob Moore 	u8 virtual_slot;
2070a805aab8SBob Moore 	u8 config_type;
2071a805aab8SBob Moore 	u8 array_type;
2072a805aab8SBob Moore };
2073a805aab8SBob Moore 
20742f7d7ea4SCezary Rojewski /* Values for array_type field above */
2075a805aab8SBob Moore 
20762f7d7ea4SCezary Rojewski #define ACPI_NHLT_ARRAYTYPE_LINEAR2_SMALL	0xA
20772f7d7ea4SCezary Rojewski #define ACPI_NHLT_ARRAYTYPE_LINEAR2_BIG		0xB
20782f7d7ea4SCezary Rojewski #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO1	0xC
20792f7d7ea4SCezary Rojewski #define ACPI_NHLT_ARRAYTYPE_PLANAR4_LSHAPED	0xD
20802f7d7ea4SCezary Rojewski #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO2	0xE
20812f7d7ea4SCezary Rojewski #define ACPI_NHLT_ARRAYTYPE_VENDOR		0xF
2082a805aab8SBob Moore 
2083a805aab8SBob Moore struct acpi_nhlt_vendor_mic_config {
2084a805aab8SBob Moore 	u8 type;
2085a805aab8SBob Moore 	u8 panel;
208645882a81SBob Moore 	u16 speaker_position_distance;		/* mm */
208745882a81SBob Moore 	u16 horizontal_offset;			/* mm */
208845882a81SBob Moore 	u16 vertical_offset;			/* mm */
208945882a81SBob Moore 	u8 frequency_low_band;			/* 5*Hz */
209045882a81SBob Moore 	u8 frequency_high_band;			/* 500*Hz */
209145882a81SBob Moore 	u16 direction_angle;			/* -180 - +180 */
209245882a81SBob Moore 	u16 elevation_angle;			/* -180 - +180 */
209345882a81SBob Moore 	u16 work_vertical_angle_begin;		/* -180 - +180 with 2 deg step */
209445882a81SBob Moore 	u16 work_vertical_angle_end;		/* -180 - +180 with 2 deg step */
209545882a81SBob Moore 	u16 work_horizontal_angle_begin;	/* -180 - +180 with 2 deg step */
209645882a81SBob Moore 	u16 work_horizontal_angle_end;		/* -180 - +180 with 2 deg step */
2097a805aab8SBob Moore };
2098a805aab8SBob Moore 
2099a805aab8SBob Moore /* Values for Type field above */
2100a805aab8SBob Moore 
21012f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICTYPE_OMNIDIRECTIONAL	0
21022f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICTYPE_SUBCARDIOID		1
21032f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICTYPE_CARDIOID		2
21042f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICTYPE_SUPERCARDIOID		3
21052f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICTYPE_HYPERCARDIOID		4
21062f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICTYPE_8SHAPED		5
21072f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICTYPE_RESERVED		6
21082f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICTYPE_VENDORDEFINED		7
2109a805aab8SBob Moore 
2110a805aab8SBob Moore /* Values for Panel field above */
2111a805aab8SBob Moore 
21122f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICLOCATION_TOP		0
21132f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICLOCATION_BOTTOM		1
21142f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICLOCATION_LEFT		2
21152f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICLOCATION_RIGHT		3
21162f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICLOCATION_FRONT		4
21172f7d7ea4SCezary Rojewski #define ACPI_NHLT_MICLOCATION_REAR		5
2118a805aab8SBob Moore 
21192f7d7ea4SCezary Rojewski struct acpi_nhlt_vendor_micdevice_config {
21202f7d7ea4SCezary Rojewski 	u8 virtual_slot;
21212f7d7ea4SCezary Rojewski 	u8 config_type;
21222f7d7ea4SCezary Rojewski 	u8 array_type;
21232f7d7ea4SCezary Rojewski 	u8 mics_count;
2124a640acabSCezary Rojewski 	struct acpi_nhlt_vendor_mic_config mics[];
2125a805aab8SBob Moore };
2126a805aab8SBob Moore 
21272f7d7ea4SCezary Rojewski union acpi_nhlt_device_config {
21282f7d7ea4SCezary Rojewski 	u8 virtual_slot;
21292f7d7ea4SCezary Rojewski 	struct acpi_nhlt_gendevice_config gen;
21302f7d7ea4SCezary Rojewski 	struct acpi_nhlt_micdevice_config mic;
21312f7d7ea4SCezary Rojewski 	struct acpi_nhlt_vendor_micdevice_config vendor_mic;
2132a805aab8SBob Moore };
2133a805aab8SBob Moore 
21342f7d7ea4SCezary Rojewski /* Inherited from Microsoft's WAVEFORMATEXTENSIBLE. */
2135a640acabSCezary Rojewski struct acpi_nhlt_wave_formatext {
21362f7d7ea4SCezary Rojewski 	u16 format_tag;
21372f7d7ea4SCezary Rojewski 	u16 channel_count;
21382f7d7ea4SCezary Rojewski 	u32 samples_per_sec;
21392f7d7ea4SCezary Rojewski 	u32 avg_bytes_per_sec;
21402f7d7ea4SCezary Rojewski 	u16 block_align;
21412f7d7ea4SCezary Rojewski 	u16 bits_per_sample;
21422f7d7ea4SCezary Rojewski 	u16 extra_format_size;
21432f7d7ea4SCezary Rojewski 	u16 valid_bits_per_sample;
21442f7d7ea4SCezary Rojewski 	u32 channel_mask;
21452f7d7ea4SCezary Rojewski 	u8 subformat[16];
2146a805aab8SBob Moore };
2147a805aab8SBob Moore 
2148a640acabSCezary Rojewski struct acpi_nhlt_format_config {
2149a640acabSCezary Rojewski 	struct acpi_nhlt_wave_formatext format;
21502f7d7ea4SCezary Rojewski 	struct acpi_nhlt_config config;
21512f7d7ea4SCezary Rojewski };
2152a805aab8SBob Moore 
2153a640acabSCezary Rojewski struct acpi_nhlt_formats_config {
21542f7d7ea4SCezary Rojewski 	u8 formats_count;
2155a640acabSCezary Rojewski 	struct acpi_nhlt_format_config formats[];
2156a805aab8SBob Moore };
2157a805aab8SBob Moore 
21588bd24835SPiotr Maziarz struct acpi_nhlt_device_info {
21592f7d7ea4SCezary Rojewski 	u8 id[16];
21602f7d7ea4SCezary Rojewski 	u8 instance_id;
21612f7d7ea4SCezary Rojewski 	u8 port_id;
21622f7d7ea4SCezary Rojewski };
21632f7d7ea4SCezary Rojewski 
21642f7d7ea4SCezary Rojewski struct acpi_nhlt_devices_info {
21652f7d7ea4SCezary Rojewski 	u8 devices_count;
2166a640acabSCezary Rojewski 	struct acpi_nhlt_device_info devices[];
21670c9a6727SBob Moore };
21680c9a6727SBob Moore 
2169a805aab8SBob Moore /*******************************************************************************
2170a805aab8SBob Moore  *
2171e62f8227SErik Schmauss  * PCCT - Platform Communications Channel Table (ACPI 5.0)
2172e62f8227SErik Schmauss  *        Version 2 (ACPI 6.2)
2173e62f8227SErik Schmauss  *
2174e62f8227SErik Schmauss  ******************************************************************************/
2175e62f8227SErik Schmauss 
2176e62f8227SErik Schmauss struct acpi_table_pcct {
2177e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
2178e62f8227SErik Schmauss 	u32 flags;
2179e62f8227SErik Schmauss 	u64 reserved;
2180e62f8227SErik Schmauss };
2181e62f8227SErik Schmauss 
2182e62f8227SErik Schmauss /* Values for Flags field above */
2183e62f8227SErik Schmauss 
2184e62f8227SErik Schmauss #define ACPI_PCCT_DOORBELL              1
2185e62f8227SErik Schmauss 
2186e62f8227SErik Schmauss /* Values for subtable type in struct acpi_subtable_header */
2187e62f8227SErik Schmauss 
2188e62f8227SErik Schmauss enum acpi_pcct_type {
2189e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
2190e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
2191e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2,	/* ACPI 6.1 */
2192e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3,	/* ACPI 6.2 */
2193e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4,	/* ACPI 6.2 */
219471f79a3fSErik Kaneda 	ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE = 5,	/* ACPI 6.4 */
219571f79a3fSErik Kaneda 	ACPI_PCCT_TYPE_RESERVED = 6	/* 6 and greater are reserved */
2196e62f8227SErik Schmauss };
2197e62f8227SErik Schmauss 
2198e62f8227SErik Schmauss /*
2199e62f8227SErik Schmauss  * PCCT Subtables, correspond to Type in struct acpi_subtable_header
2200e62f8227SErik Schmauss  */
2201e62f8227SErik Schmauss 
2202e62f8227SErik Schmauss /* 0: Generic Communications Subspace */
2203e62f8227SErik Schmauss 
2204e62f8227SErik Schmauss struct acpi_pcct_subspace {
2205e62f8227SErik Schmauss 	struct acpi_subtable_header header;
2206e62f8227SErik Schmauss 	u8 reserved[6];
2207e62f8227SErik Schmauss 	u64 base_address;
2208e62f8227SErik Schmauss 	u64 length;
2209e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
2210e62f8227SErik Schmauss 	u64 preserve_mask;
2211e62f8227SErik Schmauss 	u64 write_mask;
2212e62f8227SErik Schmauss 	u32 latency;
2213e62f8227SErik Schmauss 	u32 max_access_rate;
2214e62f8227SErik Schmauss 	u16 min_turnaround_time;
2215e62f8227SErik Schmauss };
2216e62f8227SErik Schmauss 
2217e62f8227SErik Schmauss /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
2218e62f8227SErik Schmauss 
2219e62f8227SErik Schmauss struct acpi_pcct_hw_reduced {
2220e62f8227SErik Schmauss 	struct acpi_subtable_header header;
2221e62f8227SErik Schmauss 	u32 platform_interrupt;
2222e62f8227SErik Schmauss 	u8 flags;
2223e62f8227SErik Schmauss 	u8 reserved;
2224e62f8227SErik Schmauss 	u64 base_address;
2225e62f8227SErik Schmauss 	u64 length;
2226e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
2227e62f8227SErik Schmauss 	u64 preserve_mask;
2228e62f8227SErik Schmauss 	u64 write_mask;
2229e62f8227SErik Schmauss 	u32 latency;
2230e62f8227SErik Schmauss 	u32 max_access_rate;
2231e62f8227SErik Schmauss 	u16 min_turnaround_time;
2232e62f8227SErik Schmauss };
2233e62f8227SErik Schmauss 
2234e62f8227SErik Schmauss /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
2235e62f8227SErik Schmauss 
2236e62f8227SErik Schmauss struct acpi_pcct_hw_reduced_type2 {
2237e62f8227SErik Schmauss 	struct acpi_subtable_header header;
2238e62f8227SErik Schmauss 	u32 platform_interrupt;
2239e62f8227SErik Schmauss 	u8 flags;
2240e62f8227SErik Schmauss 	u8 reserved;
2241e62f8227SErik Schmauss 	u64 base_address;
2242e62f8227SErik Schmauss 	u64 length;
2243e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
2244e62f8227SErik Schmauss 	u64 preserve_mask;
2245e62f8227SErik Schmauss 	u64 write_mask;
2246e62f8227SErik Schmauss 	u32 latency;
2247e62f8227SErik Schmauss 	u32 max_access_rate;
2248e62f8227SErik Schmauss 	u16 min_turnaround_time;
2249e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
2250e62f8227SErik Schmauss 	u64 ack_preserve_mask;
2251e62f8227SErik Schmauss 	u64 ack_write_mask;
2252e62f8227SErik Schmauss };
2253e62f8227SErik Schmauss 
2254e62f8227SErik Schmauss /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
2255e62f8227SErik Schmauss 
2256e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_master {
2257e62f8227SErik Schmauss 	struct acpi_subtable_header header;
2258e62f8227SErik Schmauss 	u32 platform_interrupt;
2259e62f8227SErik Schmauss 	u8 flags;
2260e62f8227SErik Schmauss 	u8 reserved1;
2261e62f8227SErik Schmauss 	u64 base_address;
2262e62f8227SErik Schmauss 	u32 length;
2263e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
2264e62f8227SErik Schmauss 	u64 preserve_mask;
2265e62f8227SErik Schmauss 	u64 write_mask;
2266e62f8227SErik Schmauss 	u32 latency;
2267e62f8227SErik Schmauss 	u32 max_access_rate;
2268e62f8227SErik Schmauss 	u32 min_turnaround_time;
2269e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
2270e62f8227SErik Schmauss 	u64 ack_preserve_mask;
2271e62f8227SErik Schmauss 	u64 ack_set_mask;
2272e62f8227SErik Schmauss 	u64 reserved2;
2273e62f8227SErik Schmauss 	struct acpi_generic_address cmd_complete_register;
2274e62f8227SErik Schmauss 	u64 cmd_complete_mask;
2275e62f8227SErik Schmauss 	struct acpi_generic_address cmd_update_register;
2276e62f8227SErik Schmauss 	u64 cmd_update_preserve_mask;
2277e62f8227SErik Schmauss 	u64 cmd_update_set_mask;
2278e62f8227SErik Schmauss 	struct acpi_generic_address error_status_register;
2279e62f8227SErik Schmauss 	u64 error_status_mask;
2280e62f8227SErik Schmauss };
2281e62f8227SErik Schmauss 
2282e62f8227SErik Schmauss /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
2283e62f8227SErik Schmauss 
2284e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_slave {
2285e62f8227SErik Schmauss 	struct acpi_subtable_header header;
2286e62f8227SErik Schmauss 	u32 platform_interrupt;
2287e62f8227SErik Schmauss 	u8 flags;
2288e62f8227SErik Schmauss 	u8 reserved1;
2289e62f8227SErik Schmauss 	u64 base_address;
2290e62f8227SErik Schmauss 	u32 length;
2291e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
2292e62f8227SErik Schmauss 	u64 preserve_mask;
2293e62f8227SErik Schmauss 	u64 write_mask;
2294e62f8227SErik Schmauss 	u32 latency;
2295e62f8227SErik Schmauss 	u32 max_access_rate;
2296e62f8227SErik Schmauss 	u32 min_turnaround_time;
2297e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
2298e62f8227SErik Schmauss 	u64 ack_preserve_mask;
2299e62f8227SErik Schmauss 	u64 ack_set_mask;
2300e62f8227SErik Schmauss 	u64 reserved2;
2301e62f8227SErik Schmauss 	struct acpi_generic_address cmd_complete_register;
2302e62f8227SErik Schmauss 	u64 cmd_complete_mask;
2303e62f8227SErik Schmauss 	struct acpi_generic_address cmd_update_register;
2304e62f8227SErik Schmauss 	u64 cmd_update_preserve_mask;
2305e62f8227SErik Schmauss 	u64 cmd_update_set_mask;
2306e62f8227SErik Schmauss 	struct acpi_generic_address error_status_register;
2307e62f8227SErik Schmauss 	u64 error_status_mask;
2308e62f8227SErik Schmauss };
2309e62f8227SErik Schmauss 
231071f79a3fSErik Kaneda /* 5: HW Registers based Communications Subspace */
231171f79a3fSErik Kaneda 
231271f79a3fSErik Kaneda struct acpi_pcct_hw_reg {
231371f79a3fSErik Kaneda 	struct acpi_subtable_header header;
231471f79a3fSErik Kaneda 	u16 version;
231571f79a3fSErik Kaneda 	u64 base_address;
231671f79a3fSErik Kaneda 	u64 length;
231771f79a3fSErik Kaneda 	struct acpi_generic_address doorbell_register;
231871f79a3fSErik Kaneda 	u64 doorbell_preserve;
231971f79a3fSErik Kaneda 	u64 doorbell_write;
232071f79a3fSErik Kaneda 	struct acpi_generic_address cmd_complete_register;
232171f79a3fSErik Kaneda 	u64 cmd_complete_mask;
232271f79a3fSErik Kaneda 	struct acpi_generic_address error_status_register;
232371f79a3fSErik Kaneda 	u64 error_status_mask;
232471f79a3fSErik Kaneda 	u32 nominal_latency;
232571f79a3fSErik Kaneda 	u32 min_turnaround_time;
232671f79a3fSErik Kaneda };
232771f79a3fSErik Kaneda 
2328e62f8227SErik Schmauss /* Values for doorbell flags above */
2329e62f8227SErik Schmauss 
2330e62f8227SErik Schmauss #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
2331e62f8227SErik Schmauss #define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
2332e62f8227SErik Schmauss 
2333e62f8227SErik Schmauss /*
2334e62f8227SErik Schmauss  * PCC memory structures (not part of the ACPI table)
2335e62f8227SErik Schmauss  */
2336e62f8227SErik Schmauss 
2337e62f8227SErik Schmauss /* Shared Memory Region */
2338e62f8227SErik Schmauss 
2339e62f8227SErik Schmauss struct acpi_pcct_shared_memory {
2340e62f8227SErik Schmauss 	u32 signature;
2341e62f8227SErik Schmauss 	u16 command;
2342e62f8227SErik Schmauss 	u16 status;
2343e62f8227SErik Schmauss };
2344e62f8227SErik Schmauss 
2345e62f8227SErik Schmauss /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
2346e62f8227SErik Schmauss 
2347e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_shared_memory {
2348e62f8227SErik Schmauss 	u32 signature;
2349e62f8227SErik Schmauss 	u32 flags;
2350e62f8227SErik Schmauss 	u32 length;
2351e62f8227SErik Schmauss 	u32 command;
2352e62f8227SErik Schmauss };
2353e62f8227SErik Schmauss 
2354e62f8227SErik Schmauss /*******************************************************************************
2355e62f8227SErik Schmauss  *
2356e62f8227SErik Schmauss  * PDTT - Platform Debug Trigger Table (ACPI 6.2)
2357e62f8227SErik Schmauss  *        Version 0
2358e62f8227SErik Schmauss  *
2359e62f8227SErik Schmauss  ******************************************************************************/
2360e62f8227SErik Schmauss 
2361e62f8227SErik Schmauss struct acpi_table_pdtt {
2362e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
2363e62f8227SErik Schmauss 	u8 trigger_count;
2364e62f8227SErik Schmauss 	u8 reserved[3];
2365e62f8227SErik Schmauss 	u32 array_offset;
2366e62f8227SErik Schmauss };
2367e62f8227SErik Schmauss 
2368e62f8227SErik Schmauss /*
2369e62f8227SErik Schmauss  * PDTT Communication Channel Identifier Structure.
2370e62f8227SErik Schmauss  * The number of these structures is defined by trigger_count above,
2371e62f8227SErik Schmauss  * starting at array_offset.
2372e62f8227SErik Schmauss  */
2373e62f8227SErik Schmauss struct acpi_pdtt_channel {
2374e62f8227SErik Schmauss 	u8 subchannel_id;
2375e62f8227SErik Schmauss 	u8 flags;
2376e62f8227SErik Schmauss };
2377e62f8227SErik Schmauss 
2378e62f8227SErik Schmauss /* Flags for above */
2379e62f8227SErik Schmauss 
2380e62f8227SErik Schmauss #define ACPI_PDTT_RUNTIME_TRIGGER           (1)
2381e62f8227SErik Schmauss #define ACPI_PDTT_WAIT_COMPLETION           (1<<1)
2382f00175d0SErik Schmauss #define ACPI_PDTT_TRIGGER_ORDER             (1<<2)
2383e62f8227SErik Schmauss 
2384e62f8227SErik Schmauss /*******************************************************************************
2385e62f8227SErik Schmauss  *
23869f400337SErik Kaneda  * PHAT - Platform Health Assessment Table (ACPI 6.4)
23879f400337SErik Kaneda  *        Version 1
23889f400337SErik Kaneda  *
23899f400337SErik Kaneda  ******************************************************************************/
23909f400337SErik Kaneda 
23919f400337SErik Kaneda struct acpi_table_phat {
23929f400337SErik Kaneda 	struct acpi_table_header header;	/* Common ACPI table header */
23939f400337SErik Kaneda };
23949f400337SErik Kaneda 
23959f400337SErik Kaneda /* Common header for PHAT subtables that follow main table */
23969f400337SErik Kaneda 
23979f400337SErik Kaneda struct acpi_phat_header {
23989f400337SErik Kaneda 	u16 type;
23999f400337SErik Kaneda 	u16 length;
24009f400337SErik Kaneda 	u8 revision;
24019f400337SErik Kaneda };
24029f400337SErik Kaneda 
24039f400337SErik Kaneda /* Values for Type field above */
24049f400337SErik Kaneda 
24059f400337SErik Kaneda #define ACPI_PHAT_TYPE_FW_VERSION_DATA  0
24069f400337SErik Kaneda #define ACPI_PHAT_TYPE_FW_HEALTH_DATA   1
24079f400337SErik Kaneda #define ACPI_PHAT_TYPE_RESERVED         2	/* 0x02-0xFFFF are reserved */
24089f400337SErik Kaneda 
24099f400337SErik Kaneda /*
24109f400337SErik Kaneda  * PHAT subtables, correspond to Type in struct acpi_phat_header
24119f400337SErik Kaneda  */
24129f400337SErik Kaneda 
24139f400337SErik Kaneda /* 0: Firmware Version Data Record */
24149f400337SErik Kaneda 
24159f400337SErik Kaneda struct acpi_phat_version_data {
24169f400337SErik Kaneda 	struct acpi_phat_header header;
24179f400337SErik Kaneda 	u8 reserved[3];
24189f400337SErik Kaneda 	u32 element_count;
24199f400337SErik Kaneda };
24209f400337SErik Kaneda 
24219f400337SErik Kaneda struct acpi_phat_version_element {
24229f400337SErik Kaneda 	u8 guid[16];
24239f400337SErik Kaneda 	u64 version_value;
24249f400337SErik Kaneda 	u32 producer_id;
24259f400337SErik Kaneda };
24269f400337SErik Kaneda 
24279f400337SErik Kaneda /* 1: Firmware Health Data Record */
24289f400337SErik Kaneda 
24299f400337SErik Kaneda struct acpi_phat_health_data {
24309f400337SErik Kaneda 	struct acpi_phat_header header;
24319f400337SErik Kaneda 	u8 reserved[2];
24329f400337SErik Kaneda 	u8 health;
24339f400337SErik Kaneda 	u8 device_guid[16];
24349f400337SErik Kaneda 	u32 device_specific_offset;	/* Zero if no Device-specific data */
24359f400337SErik Kaneda };
24369f400337SErik Kaneda 
24379f400337SErik Kaneda /* Values for Health field above */
24389f400337SErik Kaneda 
24399f400337SErik Kaneda #define ACPI_PHAT_ERRORS_FOUND          0
24409f400337SErik Kaneda #define ACPI_PHAT_NO_ERRORS             1
24419f400337SErik Kaneda #define ACPI_PHAT_UNKNOWN_ERRORS        2
24429f400337SErik Kaneda #define ACPI_PHAT_ADVISORY              3
24439f400337SErik Kaneda 
24449f400337SErik Kaneda /*******************************************************************************
24459f400337SErik Kaneda  *
2446e62f8227SErik Schmauss  * PMTT - Platform Memory Topology Table (ACPI 5.0)
2447e62f8227SErik Schmauss  *        Version 1
2448e62f8227SErik Schmauss  *
2449e62f8227SErik Schmauss  ******************************************************************************/
2450e62f8227SErik Schmauss 
2451e62f8227SErik Schmauss struct acpi_table_pmtt {
2452e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
2453cca97d42SBob Moore 	u32 memory_device_count;
2454cca97d42SBob Moore 	/*
2455cca97d42SBob Moore 	 * Immediately followed by:
2456cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
2457cca97d42SBob Moore 	 */
2458e62f8227SErik Schmauss };
2459e62f8227SErik Schmauss 
2460e62f8227SErik Schmauss /* Common header for PMTT subtables that follow main table */
2461e62f8227SErik Schmauss 
2462e62f8227SErik Schmauss struct acpi_pmtt_header {
2463e62f8227SErik Schmauss 	u8 type;
2464e62f8227SErik Schmauss 	u8 reserved1;
2465e62f8227SErik Schmauss 	u16 length;
2466e62f8227SErik Schmauss 	u16 flags;
2467e62f8227SErik Schmauss 	u16 reserved2;
2468cca97d42SBob Moore 	u32 memory_device_count;	/* Zero means no memory device structs follow */
2469cca97d42SBob Moore 	/*
2470cca97d42SBob Moore 	 * Immediately followed by:
2471cca97d42SBob Moore 	 * u8 type_specific_data[]
2472cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
2473cca97d42SBob Moore 	 */
2474e62f8227SErik Schmauss };
2475e62f8227SErik Schmauss 
2476e62f8227SErik Schmauss /* Values for Type field above */
2477e62f8227SErik Schmauss 
2478e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_SOCKET           0
2479e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_CONTROLLER       1
2480e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_DIMM             2
2481cca97d42SBob Moore #define ACPI_PMTT_TYPE_RESERVED         3	/* 0x03-0xFE are reserved */
2482cca97d42SBob Moore #define ACPI_PMTT_TYPE_VENDOR           0xFF
2483e62f8227SErik Schmauss 
2484e62f8227SErik Schmauss /* Values for Flags field above */
2485e62f8227SErik Schmauss 
2486e62f8227SErik Schmauss #define ACPI_PMTT_TOP_LEVEL             0x0001
2487e62f8227SErik Schmauss #define ACPI_PMTT_PHYSICAL              0x0002
2488e62f8227SErik Schmauss #define ACPI_PMTT_MEMORY_TYPE           0x000C
2489e62f8227SErik Schmauss 
2490e62f8227SErik Schmauss /*
2491e62f8227SErik Schmauss  * PMTT subtables, correspond to Type in struct acpi_pmtt_header
2492e62f8227SErik Schmauss  */
2493e62f8227SErik Schmauss 
2494e62f8227SErik Schmauss /* 0: Socket Structure */
2495e62f8227SErik Schmauss 
2496e62f8227SErik Schmauss struct acpi_pmtt_socket {
2497e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
2498e62f8227SErik Schmauss 	u16 socket_id;
2499e62f8227SErik Schmauss 	u16 reserved;
2500e62f8227SErik Schmauss };
2501cca97d42SBob Moore 	/*
2502cca97d42SBob Moore 	 * Immediately followed by:
2503cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
2504cca97d42SBob Moore 	 */
2505e62f8227SErik Schmauss 
2506e62f8227SErik Schmauss /* 1: Memory Controller subtable */
2507e62f8227SErik Schmauss 
2508e62f8227SErik Schmauss struct acpi_pmtt_controller {
2509e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
2510cca97d42SBob Moore 	u16 controller_id;
2511e62f8227SErik Schmauss 	u16 reserved;
2512e62f8227SErik Schmauss };
2513cca97d42SBob Moore 	/*
2514cca97d42SBob Moore 	 * Immediately followed by:
2515cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
2516cca97d42SBob Moore 	 */
2517e62f8227SErik Schmauss 
2518e62f8227SErik Schmauss /* 2: Physical Component Identifier (DIMM) */
2519e62f8227SErik Schmauss 
2520e62f8227SErik Schmauss struct acpi_pmtt_physical_component {
2521e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
2522e62f8227SErik Schmauss 	u32 bios_handle;
2523e62f8227SErik Schmauss };
2524e62f8227SErik Schmauss 
2525cca97d42SBob Moore /* 0xFF: Vendor Specific Data */
2526cca97d42SBob Moore 
2527cca97d42SBob Moore struct acpi_pmtt_vendor_specific {
2528cca97d42SBob Moore 	struct acpi_pmtt_header header;
2529cca97d42SBob Moore 	u8 type_uuid[16];
2530cca97d42SBob Moore 	u8 specific[];
2531cca97d42SBob Moore 	/*
2532cca97d42SBob Moore 	 * Immediately followed by:
2533cca97d42SBob Moore 	 * u8 vendor_specific_data[];
2534cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
2535cca97d42SBob Moore 	 */
2536cca97d42SBob Moore };
2537cca97d42SBob Moore 
2538e62f8227SErik Schmauss /*******************************************************************************
2539e62f8227SErik Schmauss  *
2540e62f8227SErik Schmauss  * PPTT - Processor Properties Topology Table (ACPI 6.2)
2541e62f8227SErik Schmauss  *        Version 1
2542e62f8227SErik Schmauss  *
2543e62f8227SErik Schmauss  ******************************************************************************/
2544e62f8227SErik Schmauss 
2545e62f8227SErik Schmauss struct acpi_table_pptt {
2546e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
2547e62f8227SErik Schmauss };
2548e62f8227SErik Schmauss 
2549e62f8227SErik Schmauss /* Values for Type field above */
2550e62f8227SErik Schmauss 
2551e62f8227SErik Schmauss enum acpi_pptt_type {
2552e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_PROCESSOR = 0,
2553e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_CACHE = 1,
2554e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_ID = 2,
2555e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_RESERVED = 3
2556e62f8227SErik Schmauss };
2557e62f8227SErik Schmauss 
2558e62f8227SErik Schmauss /* 0: Processor Hierarchy Node Structure */
2559e62f8227SErik Schmauss 
2560e62f8227SErik Schmauss struct acpi_pptt_processor {
2561e62f8227SErik Schmauss 	struct acpi_subtable_header header;
2562e62f8227SErik Schmauss 	u16 reserved;
2563e62f8227SErik Schmauss 	u32 flags;
2564e62f8227SErik Schmauss 	u32 parent;
2565e62f8227SErik Schmauss 	u32 acpi_processor_id;
2566e62f8227SErik Schmauss 	u32 number_of_priv_resources;
2567e62f8227SErik Schmauss };
2568e62f8227SErik Schmauss 
2569e62f8227SErik Schmauss /* Flags */
2570e62f8227SErik Schmauss 
2571b5eab512SErik Schmauss #define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
2572b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1<<1)
2573b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1<<2)	/* ACPI 6.3 */
2574b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_LEAF_NODE            (1<<3)	/* ACPI 6.3 */
2575b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_IDENTICAL            (1<<4)	/* ACPI 6.3 */
2576e62f8227SErik Schmauss 
2577e62f8227SErik Schmauss /* 1: Cache Type Structure */
2578e62f8227SErik Schmauss 
2579e62f8227SErik Schmauss struct acpi_pptt_cache {
2580e62f8227SErik Schmauss 	struct acpi_subtable_header header;
2581e62f8227SErik Schmauss 	u16 reserved;
2582e62f8227SErik Schmauss 	u32 flags;
2583e62f8227SErik Schmauss 	u32 next_level_of_cache;
2584e62f8227SErik Schmauss 	u32 size;
2585e62f8227SErik Schmauss 	u32 number_of_sets;
2586e62f8227SErik Schmauss 	u8 associativity;
2587e62f8227SErik Schmauss 	u8 attributes;
2588e62f8227SErik Schmauss 	u16 line_size;
2589e62f8227SErik Schmauss };
2590e62f8227SErik Schmauss 
25915e2e86c0SErik Kaneda /* 1: Cache Type Structure for PPTT version 3 */
25925e2e86c0SErik Kaneda 
25935e2e86c0SErik Kaneda struct acpi_pptt_cache_v1 {
25945e2e86c0SErik Kaneda 	u32 cache_id;
25955e2e86c0SErik Kaneda };
25965e2e86c0SErik Kaneda 
2597e62f8227SErik Schmauss /* Flags */
2598e62f8227SErik Schmauss 
2599e62f8227SErik Schmauss #define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)	/* Physical property valid */
2600e62f8227SErik Schmauss #define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)	/* Number of sets valid */
2601e62f8227SErik Schmauss #define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)	/* Associativity valid */
2602e62f8227SErik Schmauss #define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)	/* Allocation type valid */
2603e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)	/* Cache type valid */
2604e62f8227SErik Schmauss #define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)	/* Write policy valid */
2605e62f8227SErik Schmauss #define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)	/* Line size valid */
26065e2e86c0SErik Kaneda #define ACPI_PPTT_CACHE_ID_VALID            (1<<7)	/* Cache ID valid */
2607e62f8227SErik Schmauss 
2608e62f8227SErik Schmauss /* Masks for Attributes */
2609e62f8227SErik Schmauss 
2610e62f8227SErik Schmauss #define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)	/* Allocation type */
2611e62f8227SErik Schmauss #define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)	/* Cache type */
2612e62f8227SErik Schmauss #define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)	/* Write policy */
2613e62f8227SErik Schmauss 
2614e62f8227SErik Schmauss /* Attributes describing cache */
2615e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)	/* Cache line is allocated on read */
2616e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)	/* Cache line is allocated on write */
2617e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)	/* Cache line is allocated on read and write */
2618e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)	/* Alternate representation of above */
2619e62f8227SErik Schmauss 
2620e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)	/* Data cache */
2621e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)	/* Instruction cache */
2622e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)	/* Unified I & D cache */
2623e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)	/* Alternate representation of above */
2624e62f8227SErik Schmauss 
2625e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_POLICY_WB           (0x0)	/* Cache is write back */
2626e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)	/* Cache is write through */
2627e62f8227SErik Schmauss 
2628e62f8227SErik Schmauss /* 2: ID Structure */
2629e62f8227SErik Schmauss 
2630e62f8227SErik Schmauss struct acpi_pptt_id {
2631e62f8227SErik Schmauss 	struct acpi_subtable_header header;
2632e62f8227SErik Schmauss 	u16 reserved;
2633e62f8227SErik Schmauss 	u32 vendor_id;
2634e62f8227SErik Schmauss 	u64 level1_id;
2635e62f8227SErik Schmauss 	u64 level2_id;
2636e62f8227SErik Schmauss 	u16 major_rev;
2637e62f8227SErik Schmauss 	u16 minor_rev;
2638e62f8227SErik Schmauss 	u16 spin_rev;
2639e62f8227SErik Schmauss };
2640e62f8227SErik Schmauss 
2641e62f8227SErik Schmauss /*******************************************************************************
2642e62f8227SErik Schmauss  *
2643d71df85aSErik Kaneda  * PRMT - Platform Runtime Mechanism Table
2644d71df85aSErik Kaneda  *        Version 1
2645d71df85aSErik Kaneda  *
2646d71df85aSErik Kaneda  ******************************************************************************/
2647d71df85aSErik Kaneda 
2648d71df85aSErik Kaneda struct acpi_table_prmt {
2649d71df85aSErik Kaneda 	struct acpi_table_header header;	/* Common ACPI table header */
2650d71df85aSErik Kaneda };
2651d71df85aSErik Kaneda 
2652d71df85aSErik Kaneda struct acpi_table_prmt_header {
2653d71df85aSErik Kaneda 	u8 platform_guid[16];
2654d71df85aSErik Kaneda 	u32 module_info_offset;
2655d71df85aSErik Kaneda 	u32 module_info_count;
2656d71df85aSErik Kaneda };
2657d71df85aSErik Kaneda 
26589f8c7baeSErik Kaneda struct acpi_prmt_module_header {
26599f8c7baeSErik Kaneda 	u16 revision;
26609f8c7baeSErik Kaneda 	u16 length;
26619f8c7baeSErik Kaneda };
26629f8c7baeSErik Kaneda 
2663d71df85aSErik Kaneda struct acpi_prmt_module_info {
2664d71df85aSErik Kaneda 	u16 revision;
2665d71df85aSErik Kaneda 	u16 length;
2666d71df85aSErik Kaneda 	u8 module_guid[16];
2667d71df85aSErik Kaneda 	u16 major_rev;
2668d71df85aSErik Kaneda 	u16 minor_rev;
2669d71df85aSErik Kaneda 	u16 handler_info_count;
2670d71df85aSErik Kaneda 	u32 handler_info_offset;
2671d71df85aSErik Kaneda 	u64 mmio_list_pointer;
2672d71df85aSErik Kaneda };
2673d71df85aSErik Kaneda 
2674d71df85aSErik Kaneda struct acpi_prmt_handler_info {
2675d71df85aSErik Kaneda 	u16 revision;
2676d71df85aSErik Kaneda 	u16 length;
2677d71df85aSErik Kaneda 	u8 handler_guid[16];
2678d71df85aSErik Kaneda 	u64 handler_address;
2679d71df85aSErik Kaneda 	u64 static_data_buffer_address;
2680d71df85aSErik Kaneda 	u64 acpi_param_buffer_address;
2681d71df85aSErik Kaneda };
2682d71df85aSErik Kaneda 
2683d71df85aSErik Kaneda /*******************************************************************************
2684d71df85aSErik Kaneda  *
2685e62f8227SErik Schmauss  * RASF - RAS Feature Table (ACPI 5.0)
2686e62f8227SErik Schmauss  *        Version 1
2687e62f8227SErik Schmauss  *
2688e62f8227SErik Schmauss  ******************************************************************************/
2689e62f8227SErik Schmauss 
2690e62f8227SErik Schmauss struct acpi_table_rasf {
2691e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
2692e62f8227SErik Schmauss 	u8 channel_id[12];
2693e62f8227SErik Schmauss };
2694e62f8227SErik Schmauss 
2695e62f8227SErik Schmauss /* RASF Platform Communication Channel Shared Memory Region */
2696e62f8227SErik Schmauss 
2697e62f8227SErik Schmauss struct acpi_rasf_shared_memory {
2698e62f8227SErik Schmauss 	u32 signature;
2699e62f8227SErik Schmauss 	u16 command;
2700e62f8227SErik Schmauss 	u16 status;
2701e62f8227SErik Schmauss 	u16 version;
2702e62f8227SErik Schmauss 	u8 capabilities[16];
2703e62f8227SErik Schmauss 	u8 set_capabilities[16];
2704e62f8227SErik Schmauss 	u16 num_parameter_blocks;
2705e62f8227SErik Schmauss 	u32 set_capabilities_status;
2706e62f8227SErik Schmauss };
2707e62f8227SErik Schmauss 
2708e62f8227SErik Schmauss /* RASF Parameter Block Structure Header */
2709e62f8227SErik Schmauss 
2710e62f8227SErik Schmauss struct acpi_rasf_parameter_block {
2711e62f8227SErik Schmauss 	u16 type;
2712e62f8227SErik Schmauss 	u16 version;
2713e62f8227SErik Schmauss 	u16 length;
2714e62f8227SErik Schmauss };
2715e62f8227SErik Schmauss 
2716e62f8227SErik Schmauss /* RASF Parameter Block Structure for PATROL_SCRUB */
2717e62f8227SErik Schmauss 
2718e62f8227SErik Schmauss struct acpi_rasf_patrol_scrub_parameter {
2719e62f8227SErik Schmauss 	struct acpi_rasf_parameter_block header;
2720e62f8227SErik Schmauss 	u16 patrol_scrub_command;
2721e62f8227SErik Schmauss 	u64 requested_address_range[2];
2722e62f8227SErik Schmauss 	u64 actual_address_range[2];
2723e62f8227SErik Schmauss 	u16 flags;
2724e62f8227SErik Schmauss 	u8 requested_speed;
2725e62f8227SErik Schmauss };
2726e62f8227SErik Schmauss 
2727e62f8227SErik Schmauss /* Masks for Flags and Speed fields above */
2728e62f8227SErik Schmauss 
2729e62f8227SErik Schmauss #define ACPI_RASF_SCRUBBER_RUNNING      1
2730e62f8227SErik Schmauss #define ACPI_RASF_SPEED                 (7<<1)
2731e62f8227SErik Schmauss #define ACPI_RASF_SPEED_SLOW            (0<<1)
2732e62f8227SErik Schmauss #define ACPI_RASF_SPEED_MEDIUM          (4<<1)
2733e62f8227SErik Schmauss #define ACPI_RASF_SPEED_FAST            (7<<1)
2734e62f8227SErik Schmauss 
2735e62f8227SErik Schmauss /* Channel Commands */
2736e62f8227SErik Schmauss 
2737e62f8227SErik Schmauss enum acpi_rasf_commands {
2738e62f8227SErik Schmauss 	ACPI_RASF_EXECUTE_RASF_COMMAND = 1
2739e62f8227SErik Schmauss };
2740e62f8227SErik Schmauss 
2741e62f8227SErik Schmauss /* Platform RAS Capabilities */
2742e62f8227SErik Schmauss 
2743e62f8227SErik Schmauss enum acpi_rasf_capabiliities {
2744e62f8227SErik Schmauss 	ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
2745e62f8227SErik Schmauss 	ACPI_SW_PATROL_SCRUB_EXPOSED = 1
2746e62f8227SErik Schmauss };
2747e62f8227SErik Schmauss 
2748e62f8227SErik Schmauss /* Patrol Scrub Commands */
2749e62f8227SErik Schmauss 
2750e62f8227SErik Schmauss enum acpi_rasf_patrol_scrub_commands {
2751e62f8227SErik Schmauss 	ACPI_RASF_GET_PATROL_PARAMETERS = 1,
2752e62f8227SErik Schmauss 	ACPI_RASF_START_PATROL_SCRUBBER = 2,
2753e62f8227SErik Schmauss 	ACPI_RASF_STOP_PATROL_SCRUBBER = 3
2754e62f8227SErik Schmauss };
2755e62f8227SErik Schmauss 
2756e62f8227SErik Schmauss /* Channel Command flags */
2757e62f8227SErik Schmauss 
2758e62f8227SErik Schmauss #define ACPI_RASF_GENERATE_SCI          (1<<15)
2759e62f8227SErik Schmauss 
2760e62f8227SErik Schmauss /* Status values */
2761e62f8227SErik Schmauss 
2762e62f8227SErik Schmauss enum acpi_rasf_status {
2763e62f8227SErik Schmauss 	ACPI_RASF_SUCCESS = 0,
2764e62f8227SErik Schmauss 	ACPI_RASF_NOT_VALID = 1,
2765e62f8227SErik Schmauss 	ACPI_RASF_NOT_SUPPORTED = 2,
2766e62f8227SErik Schmauss 	ACPI_RASF_BUSY = 3,
2767e62f8227SErik Schmauss 	ACPI_RASF_FAILED = 4,
2768e62f8227SErik Schmauss 	ACPI_RASF_ABORTED = 5,
2769e62f8227SErik Schmauss 	ACPI_RASF_INVALID_DATA = 6
2770e62f8227SErik Schmauss };
2771e62f8227SErik Schmauss 
2772e62f8227SErik Schmauss /* Status flags */
2773e62f8227SErik Schmauss 
2774e62f8227SErik Schmauss #define ACPI_RASF_COMMAND_COMPLETE      (1)
2775e62f8227SErik Schmauss #define ACPI_RASF_SCI_DOORBELL          (1<<1)
2776e62f8227SErik Schmauss #define ACPI_RASF_ERROR                 (1<<2)
2777e62f8227SErik Schmauss #define ACPI_RASF_STATUS                (0x1F<<3)
2778e62f8227SErik Schmauss 
2779e62f8227SErik Schmauss /*******************************************************************************
2780e62f8227SErik Schmauss  *
27812e94dc11SShiju Jose  * RAS2 - RAS2 Feature Table (ACPI 6.5)
27822e94dc11SShiju Jose  *        Version 1
27832e94dc11SShiju Jose  *
27842e94dc11SShiju Jose  *
27852e94dc11SShiju Jose  ******************************************************************************/
27862e94dc11SShiju Jose 
27872e94dc11SShiju Jose struct acpi_table_ras2 {
27882e94dc11SShiju Jose 	struct acpi_table_header header;	/* Common ACPI table header */
27892e94dc11SShiju Jose 	u16 reserved;
27902e94dc11SShiju Jose 	u16 num_pcc_descs;
27912e94dc11SShiju Jose };
27922e94dc11SShiju Jose 
27932e94dc11SShiju Jose /* RAS2 Platform Communication Channel Descriptor */
27942e94dc11SShiju Jose 
27952e94dc11SShiju Jose struct acpi_ras2_pcc_desc {
27962e94dc11SShiju Jose 	u8 channel_id;
27972e94dc11SShiju Jose 	u16 reserved;
27982e94dc11SShiju Jose 	u8 feature_type;
27992e94dc11SShiju Jose 	u32 instance;
28002e94dc11SShiju Jose };
28012e94dc11SShiju Jose 
28022e94dc11SShiju Jose /* RAS2 Platform Communication Channel Shared Memory Region */
28032e94dc11SShiju Jose 
28042e94dc11SShiju Jose struct acpi_ras2_shared_memory {
28052e94dc11SShiju Jose 	u32 signature;
28062e94dc11SShiju Jose 	u16 command;
28072e94dc11SShiju Jose 	u16 status;
28082e94dc11SShiju Jose 	u16 version;
28092e94dc11SShiju Jose 	u8 features[16];
28102e94dc11SShiju Jose 	u8 set_capabilities[16];
28112e94dc11SShiju Jose 	u16 num_parameter_blocks;
28122e94dc11SShiju Jose 	u32 set_capabilities_status;
28132e94dc11SShiju Jose };
28142e94dc11SShiju Jose 
28152e94dc11SShiju Jose /* RAS2 Parameter Block Structure for PATROL_SCRUB */
28162e94dc11SShiju Jose 
28172e94dc11SShiju Jose struct acpi_ras2_parameter_block {
28182e94dc11SShiju Jose 	u16 type;
28192e94dc11SShiju Jose 	u16 version;
28202e94dc11SShiju Jose 	u16 length;
28212e94dc11SShiju Jose };
28222e94dc11SShiju Jose 
28232e94dc11SShiju Jose /* RAS2 Parameter Block Structure for PATROL_SCRUB */
28242e94dc11SShiju Jose 
28252e94dc11SShiju Jose struct acpi_ras2_patrol_scrub_parameter {
28262e94dc11SShiju Jose 	struct acpi_ras2_parameter_block header;
28272e94dc11SShiju Jose 	u16 patrol_scrub_command;
28282e94dc11SShiju Jose 	u64 requested_address_range[2];
28292e94dc11SShiju Jose 	u64 actual_address_range[2];
28302e94dc11SShiju Jose 	u32 flags;
28312e94dc11SShiju Jose 	u32 scrub_params_out;
28322e94dc11SShiju Jose 	u32 scrub_params_in;
28332e94dc11SShiju Jose };
28342e94dc11SShiju Jose 
28352e94dc11SShiju Jose /* Masks for Flags field above */
28362e94dc11SShiju Jose 
28372e94dc11SShiju Jose #define ACPI_RAS2_SCRUBBER_RUNNING      1
28382e94dc11SShiju Jose 
28392e94dc11SShiju Jose /* RAS2 Parameter Block Structure for LA2PA_TRANSLATION */
28402e94dc11SShiju Jose 
28412e94dc11SShiju Jose struct acpi_ras2_la2pa_translation_parameter {
28422e94dc11SShiju Jose 	struct acpi_ras2_parameter_block header;
28432e94dc11SShiju Jose 	u16 addr_translation_command;
28442e94dc11SShiju Jose 	u64 sub_inst_id;
28452e94dc11SShiju Jose 	u64 logical_address;
28462e94dc11SShiju Jose 	u64 physical_address;
28472e94dc11SShiju Jose 	u32 status;
28482e94dc11SShiju Jose };
28492e94dc11SShiju Jose 
28502e94dc11SShiju Jose /* Channel Commands */
28512e94dc11SShiju Jose 
28522e94dc11SShiju Jose enum acpi_ras2_commands {
28532e94dc11SShiju Jose 	ACPI_RAS2_EXECUTE_RAS2_COMMAND = 1
28542e94dc11SShiju Jose };
28552e94dc11SShiju Jose 
28562e94dc11SShiju Jose /* Platform RAS2 Features */
28572e94dc11SShiju Jose 
28582e94dc11SShiju Jose enum acpi_ras2_features {
28592e94dc11SShiju Jose 	ACPI_RAS2_PATROL_SCRUB_SUPPORTED = 0,
28602e94dc11SShiju Jose 	ACPI_RAS2_LA2PA_TRANSLATION = 1
28612e94dc11SShiju Jose };
28622e94dc11SShiju Jose 
28632e94dc11SShiju Jose /* RAS2 Patrol Scrub Commands */
28642e94dc11SShiju Jose 
28652e94dc11SShiju Jose enum acpi_ras2_patrol_scrub_commands {
28662e94dc11SShiju Jose 	ACPI_RAS2_GET_PATROL_PARAMETERS = 1,
28672e94dc11SShiju Jose 	ACPI_RAS2_START_PATROL_SCRUBBER = 2,
28682e94dc11SShiju Jose 	ACPI_RAS2_STOP_PATROL_SCRUBBER = 3
28692e94dc11SShiju Jose };
28702e94dc11SShiju Jose 
28712e94dc11SShiju Jose /* RAS2 LA2PA Translation Commands */
28722e94dc11SShiju Jose 
28732e94dc11SShiju Jose enum acpi_ras2_la2_pa_translation_commands {
28742e94dc11SShiju Jose 	ACPI_RAS2_GET_LA2PA_TRANSLATION = 1,
28752e94dc11SShiju Jose };
28762e94dc11SShiju Jose 
28772e94dc11SShiju Jose /* RAS2 LA2PA Translation Status values */
28782e94dc11SShiju Jose 
28792e94dc11SShiju Jose enum acpi_ras2_la2_pa_translation_status {
28802e94dc11SShiju Jose 	ACPI_RAS2_LA2PA_TRANSLATION_SUCCESS = 0,
28812e94dc11SShiju Jose 	ACPI_RAS2_LA2PA_TRANSLATION_FAIL = 1,
28822e94dc11SShiju Jose };
28832e94dc11SShiju Jose 
28842e94dc11SShiju Jose /* Channel Command flags */
28852e94dc11SShiju Jose 
28862e94dc11SShiju Jose #define ACPI_RAS2_GENERATE_SCI          (1<<15)
28872e94dc11SShiju Jose 
28882e94dc11SShiju Jose /* Status values */
28892e94dc11SShiju Jose 
28902e94dc11SShiju Jose enum acpi_ras2_status {
28912e94dc11SShiju Jose 	ACPI_RAS2_SUCCESS = 0,
28922e94dc11SShiju Jose 	ACPI_RAS2_NOT_VALID = 1,
28932e94dc11SShiju Jose 	ACPI_RAS2_NOT_SUPPORTED = 2,
28942e94dc11SShiju Jose 	ACPI_RAS2_BUSY = 3,
28952e94dc11SShiju Jose 	ACPI_RAS2_FAILED = 4,
28962e94dc11SShiju Jose 	ACPI_RAS2_ABORTED = 5,
28972e94dc11SShiju Jose 	ACPI_RAS2_INVALID_DATA = 6
28982e94dc11SShiju Jose };
28992e94dc11SShiju Jose 
29002e94dc11SShiju Jose /* Status flags */
29012e94dc11SShiju Jose 
29022e94dc11SShiju Jose #define ACPI_RAS2_COMMAND_COMPLETE      (1)
29032e94dc11SShiju Jose #define ACPI_RAS2_SCI_DOORBELL          (1<<1)
29042e94dc11SShiju Jose #define ACPI_RAS2_ERROR                 (1<<2)
29052e94dc11SShiju Jose #define ACPI_RAS2_STATUS                (0x1F<<3)
29062e94dc11SShiju Jose 
29072e94dc11SShiju Jose /*******************************************************************************
29082e94dc11SShiju Jose  *
2909536e35c9SBob Moore  * RGRT - Regulatory Graphics Resource Table
2910536e35c9SBob Moore  *        Version 1
2911536e35c9SBob Moore  *
2912536e35c9SBob Moore  * Conforms to "ACPI RGRT" available at:
2913536e35c9SBob Moore  * https://microsoft.github.io/mu/dyn/mu_plus/ms_core_pkg/acpi_RGRT/feature_acpi_rgrt/
2914536e35c9SBob Moore  *
2915536e35c9SBob Moore  ******************************************************************************/
2916536e35c9SBob Moore 
2917536e35c9SBob Moore struct acpi_table_rgrt {
2918536e35c9SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
2919536e35c9SBob Moore 	u16 version;
2920536e35c9SBob Moore 	u8 image_type;
2921536e35c9SBob Moore 	u8 reserved;
2922aa29b208SGustavo A. R. Silva 	u8 image[];
2923536e35c9SBob Moore };
2924536e35c9SBob Moore 
2925536e35c9SBob Moore /* image_type values */
2926536e35c9SBob Moore 
2927536e35c9SBob Moore enum acpi_rgrt_image_type {
2928536e35c9SBob Moore 	ACPI_RGRT_TYPE_RESERVED0 = 0,
2929536e35c9SBob Moore 	ACPI_RGRT_IMAGE_TYPE_PNG = 1,
2930536e35c9SBob Moore 	ACPI_RGRT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
2931536e35c9SBob Moore };
2932536e35c9SBob Moore 
2933536e35c9SBob Moore /*******************************************************************************
2934536e35c9SBob Moore  *
2935003567a3SSunil V L  * RHCT - RISC-V Hart Capabilities Table
2936003567a3SSunil V L  *        Version 1
2937003567a3SSunil V L  *
2938003567a3SSunil V L  ******************************************************************************/
2939003567a3SSunil V L 
2940003567a3SSunil V L struct acpi_table_rhct {
2941003567a3SSunil V L 	struct acpi_table_header header;	/* Common ACPI table header */
2942fe85f8ffSSunil V L 	u32 flags;		/* RHCT flags */
2943003567a3SSunil V L 	u64 time_base_freq;
2944003567a3SSunil V L 	u32 node_count;
2945003567a3SSunil V L 	u32 node_offset;
2946003567a3SSunil V L };
2947003567a3SSunil V L 
2948fe85f8ffSSunil V L /* RHCT Flags */
2949fe85f8ffSSunil V L 
2950fe85f8ffSSunil V L #define ACPI_RHCT_TIMER_CANNOT_WAKEUP_CPU       (1)
2951003567a3SSunil V L /*
2952003567a3SSunil V L  * RHCT subtables
2953003567a3SSunil V L  */
2954003567a3SSunil V L struct acpi_rhct_node_header {
2955003567a3SSunil V L 	u16 type;
2956003567a3SSunil V L 	u16 length;
2957003567a3SSunil V L 	u16 revision;
2958003567a3SSunil V L };
2959003567a3SSunil V L 
2960003567a3SSunil V L /* Values for RHCT subtable Type above */
2961003567a3SSunil V L 
2962003567a3SSunil V L enum acpi_rhct_node_type {
2963003567a3SSunil V L 	ACPI_RHCT_NODE_TYPE_ISA_STRING = 0x0000,
2964fe85f8ffSSunil V L 	ACPI_RHCT_NODE_TYPE_CMO = 0x0001,
2965fe85f8ffSSunil V L 	ACPI_RHCT_NODE_TYPE_MMU = 0x0002,
2966fe85f8ffSSunil V L 	ACPI_RHCT_NODE_TYPE_RESERVED = 0x0003,
2967003567a3SSunil V L 	ACPI_RHCT_NODE_TYPE_HART_INFO = 0xFFFF,
2968003567a3SSunil V L };
2969003567a3SSunil V L 
2970003567a3SSunil V L /*
2971003567a3SSunil V L  * RHCT node specific subtables
2972003567a3SSunil V L  */
2973003567a3SSunil V L 
2974003567a3SSunil V L /* ISA string node structure */
2975003567a3SSunil V L struct acpi_rhct_isa_string {
2976003567a3SSunil V L 	u16 isa_length;
2977003567a3SSunil V L 	char isa[];
2978003567a3SSunil V L };
2979003567a3SSunil V L 
2980fe85f8ffSSunil V L struct acpi_rhct_cmo_node {
2981fe85f8ffSSunil V L 	u8 reserved;		/* Must be zero */
2982fe85f8ffSSunil V L 	u8 cbom_size;		/* CBOM size in powerof 2 */
2983fe85f8ffSSunil V L 	u8 cbop_size;		/* CBOP size in powerof 2 */
2984fe85f8ffSSunil V L 	u8 cboz_size;		/* CBOZ size in powerof 2 */
2985fe85f8ffSSunil V L };
2986fe85f8ffSSunil V L 
2987fe85f8ffSSunil V L struct acpi_rhct_mmu_node {
2988fe85f8ffSSunil V L 	u8 reserved;		/* Must be zero */
2989fe85f8ffSSunil V L 	u8 mmu_type;		/* Virtual Address Scheme */
2990fe85f8ffSSunil V L };
2991fe85f8ffSSunil V L 
2992fe85f8ffSSunil V L enum acpi_rhct_mmu_type {
2993fe85f8ffSSunil V L 	ACPI_RHCT_MMU_TYPE_SV39 = 0,
2994fe85f8ffSSunil V L 	ACPI_RHCT_MMU_TYPE_SV48 = 1,
2995fe85f8ffSSunil V L 	ACPI_RHCT_MMU_TYPE_SV57 = 2
2996fe85f8ffSSunil V L };
2997fe85f8ffSSunil V L 
2998003567a3SSunil V L /* Hart Info node structure */
2999003567a3SSunil V L struct acpi_rhct_hart_info {
3000003567a3SSunil V L 	u16 num_offsets;
3001003567a3SSunil V L 	u32 uid;		/* ACPI processor UID */
3002003567a3SSunil V L };
3003003567a3SSunil V L 
3004003567a3SSunil V L /*******************************************************************************
3005003567a3SSunil V L  *
3006e62f8227SErik Schmauss  * SBST - Smart Battery Specification Table
3007e62f8227SErik Schmauss  *        Version 1
3008e62f8227SErik Schmauss  *
3009e62f8227SErik Schmauss  ******************************************************************************/
3010e62f8227SErik Schmauss 
3011e62f8227SErik Schmauss struct acpi_table_sbst {
3012e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
3013e62f8227SErik Schmauss 	u32 warning_level;
3014e62f8227SErik Schmauss 	u32 low_level;
3015e62f8227SErik Schmauss 	u32 critical_level;
3016e62f8227SErik Schmauss };
3017e62f8227SErik Schmauss 
3018e62f8227SErik Schmauss /*******************************************************************************
3019e62f8227SErik Schmauss  *
30203bd38469SJames Morse  * SDEI - Software Delegated Exception Interface Descriptor Table
30213bd38469SJames Morse  *
30223bd38469SJames Morse  * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
30233bd38469SJames Morse  * May 8th, 2017. Copyright 2017 ARM Ltd.
30243bd38469SJames Morse  *
30253bd38469SJames Morse  ******************************************************************************/
30263bd38469SJames Morse 
30273bd38469SJames Morse struct acpi_table_sdei {
30283bd38469SJames Morse 	struct acpi_table_header header;	/* Common ACPI table header */
30293bd38469SJames Morse };
30303bd38469SJames Morse 
30313bd38469SJames Morse /*******************************************************************************
30323bd38469SJames Morse  *
3033e62f8227SErik Schmauss  * SDEV - Secure Devices Table (ACPI 6.2)
3034e62f8227SErik Schmauss  *        Version 1
30355cf4d733SBob Moore  *
30365cf4d733SBob Moore  ******************************************************************************/
30375cf4d733SBob Moore 
3038e62f8227SErik Schmauss struct acpi_table_sdev {
30395cf4d733SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
30405cf4d733SBob Moore };
30415cf4d733SBob Moore 
3042e62f8227SErik Schmauss struct acpi_sdev_header {
3043e62f8227SErik Schmauss 	u8 type;
3044e62f8227SErik Schmauss 	u8 flags;
3045e62f8227SErik Schmauss 	u16 length;
3046b24aad44SBob Moore };
3047b24aad44SBob Moore 
3048e62f8227SErik Schmauss /* Values for subtable type above */
30496e2d5ebdSBob Moore 
3050e62f8227SErik Schmauss enum acpi_sdev_type {
3051e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
3052e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
3053e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_RESERVED = 2	/* 2 and greater are reserved */
30546e2d5ebdSBob Moore };
30556e2d5ebdSBob Moore 
3056e62f8227SErik Schmauss /* Values for flags above */
30576e2d5ebdSBob Moore 
3058e62f8227SErik Schmauss #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS    (1)
305914012d2fSErik Kaneda #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1)
306015a61aa1SBob Moore 
306115a61aa1SBob Moore /*
3062e62f8227SErik Schmauss  * SDEV subtables
306315a61aa1SBob Moore  */
306415a61aa1SBob Moore 
3065e62f8227SErik Schmauss /* 0: Namespace Device Based Secure Device Structure */
3066e62f8227SErik Schmauss 
3067e62f8227SErik Schmauss struct acpi_sdev_namespace {
3068e62f8227SErik Schmauss 	struct acpi_sdev_header header;
3069e62f8227SErik Schmauss 	u16 device_id_offset;
3070e62f8227SErik Schmauss 	u16 device_id_length;
3071e62f8227SErik Schmauss 	u16 vendor_data_offset;
3072e62f8227SErik Schmauss 	u16 vendor_data_length;
3073b24aad44SBob Moore };
3074b24aad44SBob Moore 
307514012d2fSErik Kaneda struct acpi_sdev_secure_component {
307614012d2fSErik Kaneda 	u16 secure_component_offset;
307714012d2fSErik Kaneda 	u16 secure_component_length;
307814012d2fSErik Kaneda };
307914012d2fSErik Kaneda 
308014012d2fSErik Kaneda /*
308114012d2fSErik Kaneda  * SDEV sub-subtables ("Components") for above
308214012d2fSErik Kaneda  */
308314012d2fSErik Kaneda struct acpi_sdev_component {
308414012d2fSErik Kaneda 	struct acpi_sdev_header header;
308514012d2fSErik Kaneda };
308614012d2fSErik Kaneda 
308714012d2fSErik Kaneda /* Values for sub-subtable type above */
308814012d2fSErik Kaneda 
308914012d2fSErik Kaneda enum acpi_sac_type {
309014012d2fSErik Kaneda 	ACPI_SDEV_TYPE_ID_COMPONENT = 0,
309114012d2fSErik Kaneda 	ACPI_SDEV_TYPE_MEM_COMPONENT = 1
309214012d2fSErik Kaneda };
309314012d2fSErik Kaneda 
309414012d2fSErik Kaneda struct acpi_sdev_id_component {
309514012d2fSErik Kaneda 	struct acpi_sdev_header header;
309614012d2fSErik Kaneda 	u16 hardware_id_offset;
309714012d2fSErik Kaneda 	u16 hardware_id_length;
309814012d2fSErik Kaneda 	u16 subsystem_id_offset;
309914012d2fSErik Kaneda 	u16 subsystem_id_length;
310014012d2fSErik Kaneda 	u16 hardware_revision;
310114012d2fSErik Kaneda 	u8 hardware_rev_present;
310214012d2fSErik Kaneda 	u8 class_code_present;
310314012d2fSErik Kaneda 	u8 pci_base_class;
310414012d2fSErik Kaneda 	u8 pci_sub_class;
310514012d2fSErik Kaneda 	u8 pci_programming_xface;
310614012d2fSErik Kaneda };
310714012d2fSErik Kaneda 
310814012d2fSErik Kaneda struct acpi_sdev_mem_component {
310914012d2fSErik Kaneda 	struct acpi_sdev_header header;
311014012d2fSErik Kaneda 	u32 reserved;
311114012d2fSErik Kaneda 	u64 memory_base_address;
311214012d2fSErik Kaneda 	u64 memory_length;
311314012d2fSErik Kaneda };
311414012d2fSErik Kaneda 
3115e62f8227SErik Schmauss /* 1: PCIe Endpoint Device Based Device Structure */
3116e62f8227SErik Schmauss 
3117e62f8227SErik Schmauss struct acpi_sdev_pcie {
3118e62f8227SErik Schmauss 	struct acpi_sdev_header header;
3119e62f8227SErik Schmauss 	u16 segment;
3120e62f8227SErik Schmauss 	u16 start_bus;
3121e62f8227SErik Schmauss 	u16 path_offset;
3122e62f8227SErik Schmauss 	u16 path_length;
3123e62f8227SErik Schmauss 	u16 vendor_data_offset;
3124e62f8227SErik Schmauss 	u16 vendor_data_length;
3125e62f8227SErik Schmauss };
3126e62f8227SErik Schmauss 
3127e62f8227SErik Schmauss /* 1a: PCIe Endpoint path entry */
3128e62f8227SErik Schmauss 
3129e62f8227SErik Schmauss struct acpi_sdev_pcie_path {
31309005694eSBob Moore 	u8 device;
31319005694eSBob Moore 	u8 function;
31329005694eSBob Moore };
31339005694eSBob Moore 
31348288f69eSKuppuswamy Sathyanarayanan /*******************************************************************************
31358288f69eSKuppuswamy Sathyanarayanan  *
31368288f69eSKuppuswamy Sathyanarayanan  * SVKL - Storage Volume Key Location Table (ACPI 6.4)
31376496f03eSBob Moore  *        From: "Guest-Host-Communication Interface (GHCI) for Intel
31386496f03eSBob Moore  *        Trust Domain Extensions (Intel TDX)".
31398288f69eSKuppuswamy Sathyanarayanan  *        Version 1
31408288f69eSKuppuswamy Sathyanarayanan  *
31418288f69eSKuppuswamy Sathyanarayanan  ******************************************************************************/
31428288f69eSKuppuswamy Sathyanarayanan 
31438288f69eSKuppuswamy Sathyanarayanan struct acpi_table_svkl {
31448288f69eSKuppuswamy Sathyanarayanan 	struct acpi_table_header header;	/* Common ACPI table header */
31458288f69eSKuppuswamy Sathyanarayanan 	u32 count;
31468288f69eSKuppuswamy Sathyanarayanan };
31478288f69eSKuppuswamy Sathyanarayanan 
31486496f03eSBob Moore struct acpi_svkl_key {
31498288f69eSKuppuswamy Sathyanarayanan 	u16 type;
31508288f69eSKuppuswamy Sathyanarayanan 	u16 format;
31518288f69eSKuppuswamy Sathyanarayanan 	u32 size;
31528288f69eSKuppuswamy Sathyanarayanan 	u64 address;
31538288f69eSKuppuswamy Sathyanarayanan };
31548288f69eSKuppuswamy Sathyanarayanan 
31558288f69eSKuppuswamy Sathyanarayanan enum acpi_svkl_type {
31568288f69eSKuppuswamy Sathyanarayanan 	ACPI_SVKL_TYPE_MAIN_STORAGE = 0,
31578288f69eSKuppuswamy Sathyanarayanan 	ACPI_SVKL_TYPE_RESERVED = 1	/* 1 and greater are reserved */
31588288f69eSKuppuswamy Sathyanarayanan };
31598288f69eSKuppuswamy Sathyanarayanan 
31608288f69eSKuppuswamy Sathyanarayanan enum acpi_svkl_format {
31618288f69eSKuppuswamy Sathyanarayanan 	ACPI_SVKL_FORMAT_RAW_BINARY = 0,
31628288f69eSKuppuswamy Sathyanarayanan 	ACPI_SVKL_FORMAT_RESERVED = 1	/* 1 and greater are reserved */
31638288f69eSKuppuswamy Sathyanarayanan };
31648288f69eSKuppuswamy Sathyanarayanan 
31652de6bb92SBob Moore /*******************************************************************************
31662de6bb92SBob Moore  *
31672de6bb92SBob Moore  * TDEL - TD-Event Log
31682de6bb92SBob Moore  *        From: "Guest-Host-Communication Interface (GHCI) for Intel
31692de6bb92SBob Moore  *        Trust Domain Extensions (Intel TDX)".
31702de6bb92SBob Moore  *        September 2020
31712de6bb92SBob Moore  *
31722de6bb92SBob Moore  ******************************************************************************/
31732de6bb92SBob Moore 
31742de6bb92SBob Moore struct acpi_table_tdel {
31752de6bb92SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
31762de6bb92SBob Moore 	u32 reserved;
31772de6bb92SBob Moore 	u64 log_area_minimum_length;
31782de6bb92SBob Moore 	u64 log_area_start_address;
31792de6bb92SBob Moore };
31802de6bb92SBob Moore 
31816e596084SRobert Moore /* Reset to default packing */
31826e596084SRobert Moore 
31836e596084SRobert Moore #pragma pack()
3184b24aad44SBob Moore 
3185b24aad44SBob Moore #endif				/* __ACTBL2_H__ */
3186