xref: /openbmc/linux/include/acpi/actbl2.h (revision d71df85a)
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  *
64441e55dSBob Moore  * Copyright (C) 2000 - 2021, 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  */
279401eafaSBob Moore #define ACPI_SIG_BDAT           "BDAT"	/* BIOS Data ACPI Table */
28874f6a72SLv Zheng #define ACPI_SIG_IORT           "IORT"	/* IO Remapping Table */
296e2d5ebdSBob Moore #define ACPI_SIG_IVRS           "IVRS"	/* I/O Virtualization Reporting Structure */
30d36d4e30SBob Moore #define ACPI_SIG_LPIT           "LPIT"	/* Low Power Idle Table */
31e62f8227SErik Schmauss #define ACPI_SIG_MADT           "APIC"	/* Multiple APIC Description Table */
32b24aad44SBob Moore #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
330e264f0bSBob Moore #define ACPI_SIG_MCHI           "MCHI"	/* Management Controller Host Interface table */
34e62f8227SErik Schmauss #define ACPI_SIG_MPST           "MPST"	/* Memory Power State Table */
35e62f8227SErik Schmauss #define ACPI_SIG_MSCT           "MSCT"	/* Maximum System Characteristics Table */
365132f2faSBob Moore #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
37e62f8227SErik Schmauss #define ACPI_SIG_NFIT           "NFIT"	/* NVDIMM Firmware Interface Table */
38e62f8227SErik Schmauss #define ACPI_SIG_PCCT           "PCCT"	/* Platform Communications Channel Table */
39e62f8227SErik Schmauss #define ACPI_SIG_PDTT           "PDTT"	/* Platform Debug Trigger Table */
409f400337SErik Kaneda #define ACPI_SIG_PHAT           "PHAT"	/* Platform Health Assessment Table */
41e62f8227SErik Schmauss #define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table */
42e62f8227SErik Schmauss #define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
43*d71df85aSErik Kaneda #define ACPI_SIG_PRMT           "PRMT"	/* Platform Runtime Mechanism Table */
44e62f8227SErik Schmauss #define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
45536e35c9SBob Moore #define ACPI_SIG_RGRT           "RGRT"	/* Regulatory Graphics Resource Table */
46e62f8227SErik Schmauss #define ACPI_SIG_SBST           "SBST"	/* Smart Battery Specification Table */
473bd38469SJames Morse #define ACPI_SIG_SDEI           "SDEI"	/* Software Delegated Exception Interface Table */
48e62f8227SErik Schmauss #define ACPI_SIG_SDEV           "SDEV"	/* Secure Devices table */
4988055d8fSCezary Rojewski #define ACPI_SIG_NHLT           "NHLT"	/* Non-HDAudio Link Table */
508288f69eSKuppuswamy Sathyanarayanan #define ACPI_SIG_SVKL           "SVKL"	/* Storage Volume Key Location Table */
514461cf54SBob Moore 
52b24aad44SBob Moore /*
53b24aad44SBob Moore  * All tables must be byte-packed to match the ACPI specification, since
54b24aad44SBob Moore  * the tables are provided by the system BIOS.
55b24aad44SBob Moore  */
56b24aad44SBob Moore #pragma pack(1)
57b24aad44SBob Moore 
58b24aad44SBob Moore /*
59be030a57SBob Moore  * Note: C bitfields are not used for this reason:
60be030a57SBob Moore  *
61be030a57SBob Moore  * "Bitfields are great and easy to read, but unfortunately the C language
62be030a57SBob Moore  * does not specify the layout of bitfields in memory, which means they are
63be030a57SBob Moore  * essentially useless for dealing with packed data in on-disk formats or
64be030a57SBob Moore  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
65be030a57SBob Moore  * this decision was a design error in C. Ritchie could have picked an order
66be030a57SBob Moore  * and stuck with it." Norman Ramsey.
67be030a57SBob Moore  * See http://stackoverflow.com/a/1053662/41661
68b24aad44SBob Moore  */
69b24aad44SBob Moore 
70b24aad44SBob Moore /*******************************************************************************
71b24aad44SBob Moore  *
729401eafaSBob Moore  * BDAT - BIOS Data ACPI Table
739401eafaSBob Moore  *
749401eafaSBob Moore  * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5
759401eafaSBob Moore  * Nov 2020
769401eafaSBob Moore  *
779401eafaSBob Moore  ******************************************************************************/
789401eafaSBob Moore 
799401eafaSBob Moore struct acpi_table_bdat {
809401eafaSBob Moore 	struct acpi_table_header header;
819401eafaSBob Moore 	struct acpi_generic_address gas;
829401eafaSBob Moore };
839401eafaSBob Moore 
849401eafaSBob Moore /*******************************************************************************
859401eafaSBob Moore  *
86874f6a72SLv Zheng  * IORT - IO Remapping Table
87874f6a72SLv Zheng  *
88874f6a72SLv Zheng  * Conforms to "IO Remapping Table System Software on ARM Platforms",
898e1fdd7fSShameer Kolothum  * Document number: ARM DEN 0049E.b, Feb 2021
90874f6a72SLv Zheng  *
91874f6a72SLv Zheng  ******************************************************************************/
92874f6a72SLv Zheng 
93874f6a72SLv Zheng struct acpi_table_iort {
94874f6a72SLv Zheng 	struct acpi_table_header header;
95874f6a72SLv Zheng 	u32 node_count;
96874f6a72SLv Zheng 	u32 node_offset;
97874f6a72SLv Zheng 	u32 reserved;
98874f6a72SLv Zheng };
99874f6a72SLv Zheng 
100874f6a72SLv Zheng /*
101874f6a72SLv Zheng  * IORT subtables
102874f6a72SLv Zheng  */
103874f6a72SLv Zheng struct acpi_iort_node {
104874f6a72SLv Zheng 	u8 type;
105874f6a72SLv Zheng 	u16 length;
106874f6a72SLv Zheng 	u8 revision;
1078e1fdd7fSShameer Kolothum 	u32 identifier;
108874f6a72SLv Zheng 	u32 mapping_count;
109874f6a72SLv Zheng 	u32 mapping_offset;
110874f6a72SLv Zheng 	char node_data[1];
111874f6a72SLv Zheng };
112874f6a72SLv Zheng 
113874f6a72SLv Zheng /* Values for subtable Type above */
114874f6a72SLv Zheng 
115874f6a72SLv Zheng enum acpi_iort_node_type {
116874f6a72SLv Zheng 	ACPI_IORT_NODE_ITS_GROUP = 0x00,
117874f6a72SLv Zheng 	ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
118874f6a72SLv Zheng 	ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
1194ac78bafSAl Stone 	ACPI_IORT_NODE_SMMU = 0x03,
120a53eaef6SRobin Murphy 	ACPI_IORT_NODE_SMMU_V3 = 0x04,
1218e1fdd7fSShameer Kolothum 	ACPI_IORT_NODE_PMCG = 0x05,
1228e1fdd7fSShameer Kolothum 	ACPI_IORT_NODE_RMR = 0x06,
123874f6a72SLv Zheng };
124874f6a72SLv Zheng 
125874f6a72SLv Zheng struct acpi_iort_id_mapping {
126874f6a72SLv Zheng 	u32 input_base;		/* Lowest value in input range */
127874f6a72SLv Zheng 	u32 id_count;		/* Number of IDs */
128874f6a72SLv Zheng 	u32 output_base;	/* Lowest value in output range */
129874f6a72SLv Zheng 	u32 output_reference;	/* A reference to the output node */
130874f6a72SLv Zheng 	u32 flags;
131874f6a72SLv Zheng };
132874f6a72SLv Zheng 
133874f6a72SLv Zheng /* Masks for Flags field above for IORT subtable */
134874f6a72SLv Zheng 
135874f6a72SLv Zheng #define ACPI_IORT_ID_SINGLE_MAPPING (1)
136874f6a72SLv Zheng 
137874f6a72SLv Zheng struct acpi_iort_memory_access {
138874f6a72SLv Zheng 	u32 cache_coherency;
139874f6a72SLv Zheng 	u8 hints;
140874f6a72SLv Zheng 	u16 reserved;
141874f6a72SLv Zheng 	u8 memory_flags;
142874f6a72SLv Zheng };
143874f6a72SLv Zheng 
144874f6a72SLv Zheng /* Values for cache_coherency field above */
145874f6a72SLv Zheng 
146874f6a72SLv Zheng #define ACPI_IORT_NODE_COHERENT         0x00000001	/* The device node is fully coherent */
147874f6a72SLv Zheng #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000	/* The device node is not coherent */
148874f6a72SLv Zheng 
149874f6a72SLv Zheng /* Masks for Hints field above */
150874f6a72SLv Zheng 
151874f6a72SLv Zheng #define ACPI_IORT_HT_TRANSIENT          (1)
152874f6a72SLv Zheng #define ACPI_IORT_HT_WRITE              (1<<1)
153874f6a72SLv Zheng #define ACPI_IORT_HT_READ               (1<<2)
154874f6a72SLv Zheng #define ACPI_IORT_HT_OVERRIDE           (1<<3)
155874f6a72SLv Zheng 
156874f6a72SLv Zheng /* Masks for memory_flags field above */
157874f6a72SLv Zheng 
158874f6a72SLv Zheng #define ACPI_IORT_MF_COHERENCY          (1)
159874f6a72SLv Zheng #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
160874f6a72SLv Zheng 
161874f6a72SLv Zheng /*
162874f6a72SLv Zheng  * IORT node specific subtables
163874f6a72SLv Zheng  */
164874f6a72SLv Zheng struct acpi_iort_its_group {
165874f6a72SLv Zheng 	u32 its_count;
166c163f90cSErik Schmauss 	u32 identifiers[1];	/* GIC ITS identifier array */
167874f6a72SLv Zheng };
168874f6a72SLv Zheng 
169874f6a72SLv Zheng struct acpi_iort_named_component {
170874f6a72SLv Zheng 	u32 node_flags;
171874f6a72SLv Zheng 	u64 memory_properties;	/* Memory access properties */
172874f6a72SLv Zheng 	u8 memory_address_limit;	/* Memory address size limit */
173874f6a72SLv Zheng 	char device_name[1];	/* Path of namespace object */
174874f6a72SLv Zheng };
175874f6a72SLv Zheng 
176d87be043SRobin Murphy /* Masks for Flags field above */
177d87be043SRobin Murphy 
178d87be043SRobin Murphy #define ACPI_IORT_NC_STALL_SUPPORTED    (1)
179d87be043SRobin Murphy #define ACPI_IORT_NC_PASID_BITS         (31<<1)
180d87be043SRobin Murphy 
181874f6a72SLv Zheng struct acpi_iort_root_complex {
182874f6a72SLv Zheng 	u64 memory_properties;	/* Memory access properties */
183874f6a72SLv Zheng 	u32 ats_attribute;
184874f6a72SLv Zheng 	u32 pci_segment_number;
185d87be043SRobin Murphy 	u8 memory_address_limit;	/* Memory address size limit */
186d87be043SRobin Murphy 	u8 reserved[3];		/* Reserved, must be zero */
187874f6a72SLv Zheng };
188874f6a72SLv Zheng 
1898e1fdd7fSShameer Kolothum /* Masks for ats_attribute field above */
190874f6a72SLv Zheng 
1918e1fdd7fSShameer Kolothum #define ACPI_IORT_ATS_SUPPORTED         (1)	/* The root complex ATS support */
1928e1fdd7fSShameer Kolothum #define ACPI_IORT_PRI_SUPPORTED         (1<<1)	/* The root complex PRI support */
1938e1fdd7fSShameer Kolothum #define ACPI_IORT_PASID_FWD_SUPPORTED   (1<<2)	/* The root complex PASID forward support */
194874f6a72SLv Zheng 
195874f6a72SLv Zheng struct acpi_iort_smmu {
196874f6a72SLv Zheng 	u64 base_address;	/* SMMU base address */
197874f6a72SLv Zheng 	u64 span;		/* Length of memory range */
198874f6a72SLv Zheng 	u32 model;
199874f6a72SLv Zheng 	u32 flags;
200874f6a72SLv Zheng 	u32 global_interrupt_offset;
201874f6a72SLv Zheng 	u32 context_interrupt_count;
202874f6a72SLv Zheng 	u32 context_interrupt_offset;
203874f6a72SLv Zheng 	u32 pmu_interrupt_count;
204874f6a72SLv Zheng 	u32 pmu_interrupt_offset;
205874f6a72SLv Zheng 	u64 interrupts[1];	/* Interrupt array */
206874f6a72SLv Zheng };
207874f6a72SLv Zheng 
208874f6a72SLv Zheng /* Values for Model field above */
209874f6a72SLv Zheng 
210874f6a72SLv Zheng #define ACPI_IORT_SMMU_V1               0x00000000	/* Generic SMMUv1 */
211874f6a72SLv Zheng #define ACPI_IORT_SMMU_V2               0x00000001	/* Generic SMMUv2 */
212874f6a72SLv Zheng #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002	/* ARM Corelink MMU-400 */
213874f6a72SLv Zheng #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003	/* ARM Corelink MMU-500 */
2140c2021c0SRobin Murphy #define ACPI_IORT_SMMU_CORELINK_MMU401  0x00000004	/* ARM Corelink MMU-401 */
2150c2021c0SRobin Murphy #define ACPI_IORT_SMMU_CAVIUM_THUNDERX  0x00000005	/* Cavium thunder_x SMMUv2 */
216874f6a72SLv Zheng 
217874f6a72SLv Zheng /* Masks for Flags field above */
218874f6a72SLv Zheng 
219874f6a72SLv Zheng #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
220874f6a72SLv Zheng #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
221874f6a72SLv Zheng 
222bb1e23e6SLv Zheng /* Global interrupt format */
223bb1e23e6SLv Zheng 
224bb1e23e6SLv Zheng struct acpi_iort_smmu_gsi {
225bb1e23e6SLv Zheng 	u32 nsg_irpt;
226bb1e23e6SLv Zheng 	u32 nsg_irpt_flags;
227bb1e23e6SLv Zheng 	u32 nsg_cfg_irpt;
228bb1e23e6SLv Zheng 	u32 nsg_cfg_irpt_flags;
229bb1e23e6SLv Zheng };
230bb1e23e6SLv Zheng 
2314ac78bafSAl Stone struct acpi_iort_smmu_v3 {
2324ac78bafSAl Stone 	u64 base_address;	/* SMMUv3 base address */
2334ac78bafSAl Stone 	u32 flags;
2344ac78bafSAl Stone 	u32 reserved;
2354ac78bafSAl Stone 	u64 vatos_address;
2360c2021c0SRobin Murphy 	u32 model;
2374ac78bafSAl Stone 	u32 event_gsiv;
2384ac78bafSAl Stone 	u32 pri_gsiv;
2394ac78bafSAl Stone 	u32 gerr_gsiv;
2404ac78bafSAl Stone 	u32 sync_gsiv;
241d87be043SRobin Murphy 	u32 pxm;
2424c106aa4SHanjun Guo 	u32 id_mapping_index;
2434ac78bafSAl Stone };
2444ac78bafSAl Stone 
2450c2021c0SRobin Murphy /* Values for Model field above */
2460c2021c0SRobin Murphy 
2470c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_GENERIC           0x00000000	/* Generic SMMUv3 */
2480c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_HISILICON_HI161X  0x00000001	/* hi_silicon Hi161x SMMUv3 */
2490c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX     0x00000002	/* Cavium CN99xx SMMUv3 */
2500c2021c0SRobin Murphy 
2514ac78bafSAl Stone /* Masks for Flags field above */
2524ac78bafSAl Stone 
2534ac78bafSAl Stone #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
254d87be043SRobin Murphy #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (3<<1)
255c9442300SGanapatrao Kulkarni #define ACPI_IORT_SMMU_V3_PXM_VALID         (1<<3)
2564ac78bafSAl Stone 
257a53eaef6SRobin Murphy struct acpi_iort_pmcg {
258a53eaef6SRobin Murphy 	u64 page0_base_address;
259a53eaef6SRobin Murphy 	u32 overflow_gsiv;
260a53eaef6SRobin Murphy 	u32 node_reference;
261a53eaef6SRobin Murphy 	u64 page1_base_address;
262a53eaef6SRobin Murphy };
263a53eaef6SRobin Murphy 
2648e1fdd7fSShameer Kolothum struct acpi_iort_rmr {
2658e1fdd7fSShameer Kolothum 	u32 flags;
2668e1fdd7fSShameer Kolothum 	u32 rmr_count;
2678e1fdd7fSShameer Kolothum 	u32 rmr_offset;
2688e1fdd7fSShameer Kolothum };
2698e1fdd7fSShameer Kolothum 
2708e1fdd7fSShameer Kolothum struct acpi_iort_rmr_desc {
2718e1fdd7fSShameer Kolothum 	u64 base_address;
2728e1fdd7fSShameer Kolothum 	u64 length;
2738e1fdd7fSShameer Kolothum 	u32 reserved;
2748e1fdd7fSShameer Kolothum };
2758e1fdd7fSShameer Kolothum 
276874f6a72SLv Zheng /*******************************************************************************
277874f6a72SLv Zheng  *
2786e2d5ebdSBob Moore  * IVRS - I/O Virtualization Reporting Structure
2796e2d5ebdSBob Moore  *        Version 1
2806e2d5ebdSBob Moore  *
2816e2d5ebdSBob Moore  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
2826e2d5ebdSBob Moore  * Revision 1.26, February 2009.
2836e2d5ebdSBob Moore  *
2846e2d5ebdSBob Moore  ******************************************************************************/
2856e2d5ebdSBob Moore 
2866e2d5ebdSBob Moore struct acpi_table_ivrs {
2876e2d5ebdSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
2886e2d5ebdSBob Moore 	u32 info;		/* Common virtualization info */
2896e2d5ebdSBob Moore 	u64 reserved;
2906e2d5ebdSBob Moore };
2916e2d5ebdSBob Moore 
2926e2d5ebdSBob Moore /* Values for Info field above */
2936e2d5ebdSBob Moore 
2946e2d5ebdSBob Moore #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00	/* 7 bits, physical address size */
2956e2d5ebdSBob Moore #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000	/* 7 bits, virtual address size */
2966e2d5ebdSBob Moore #define ACPI_IVRS_ATS_RESERVED      0x00400000	/* ATS address translation range reserved */
2976e2d5ebdSBob Moore 
2986e2d5ebdSBob Moore /* IVRS subtable header */
2996e2d5ebdSBob Moore 
3006e2d5ebdSBob Moore struct acpi_ivrs_header {
3016e2d5ebdSBob Moore 	u8 type;		/* Subtable type */
3026e2d5ebdSBob Moore 	u8 flags;
3036e2d5ebdSBob Moore 	u16 length;		/* Subtable length */
3046e2d5ebdSBob Moore 	u16 device_id;		/* ID of IOMMU */
3056e2d5ebdSBob Moore };
3066e2d5ebdSBob Moore 
3076e2d5ebdSBob Moore /* Values for subtable Type above */
3086e2d5ebdSBob Moore 
3096e2d5ebdSBob Moore enum acpi_ivrs_type {
3101f6239caSMichał Żygowski 	ACPI_IVRS_TYPE_HARDWARE1 = 0x10,
3111f6239caSMichał Żygowski 	ACPI_IVRS_TYPE_HARDWARE2 = 0x11,
3127ce7a445SAlexander Monakov 	ACPI_IVRS_TYPE_HARDWARE3 = 0x40,
3136e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY1 = 0x20,
3146e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY2 = 0x21,
3156e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY3 = 0x22
3166e2d5ebdSBob Moore };
3176e2d5ebdSBob Moore 
3186e2d5ebdSBob Moore /* Masks for Flags field above for IVHD subtable */
3196e2d5ebdSBob Moore 
3206e2d5ebdSBob Moore #define ACPI_IVHD_TT_ENABLE         (1)
3216e2d5ebdSBob Moore #define ACPI_IVHD_PASS_PW           (1<<1)
3226e2d5ebdSBob Moore #define ACPI_IVHD_RES_PASS_PW       (1<<2)
3236e2d5ebdSBob Moore #define ACPI_IVHD_ISOC              (1<<3)
3246e2d5ebdSBob Moore #define ACPI_IVHD_IOTLB             (1<<4)
3256e2d5ebdSBob Moore 
3266e2d5ebdSBob Moore /* Masks for Flags field above for IVMD subtable */
3276e2d5ebdSBob Moore 
3286e2d5ebdSBob Moore #define ACPI_IVMD_UNITY             (1)
3296e2d5ebdSBob Moore #define ACPI_IVMD_READ              (1<<1)
3306e2d5ebdSBob Moore #define ACPI_IVMD_WRITE             (1<<2)
3316e2d5ebdSBob Moore #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
3326e2d5ebdSBob Moore 
3336e2d5ebdSBob Moore /*
3346e2d5ebdSBob Moore  * IVRS subtables, correspond to Type in struct acpi_ivrs_header
3356e2d5ebdSBob Moore  */
3366e2d5ebdSBob Moore 
3376e2d5ebdSBob Moore /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
3386e2d5ebdSBob Moore 
3391f6239caSMichał Żygowski struct acpi_ivrs_hardware_10 {
3406e2d5ebdSBob Moore 	struct acpi_ivrs_header header;
3416e2d5ebdSBob Moore 	u16 capability_offset;	/* Offset for IOMMU control fields */
3426e2d5ebdSBob Moore 	u64 base_address;	/* IOMMU control registers */
3436e2d5ebdSBob Moore 	u16 pci_segment_group;
3446e2d5ebdSBob Moore 	u16 info;		/* MSI number and unit ID */
3450dc7e795SMichał Żygowski 	u32 feature_reporting;
3466e2d5ebdSBob Moore };
3476e2d5ebdSBob Moore 
3481f6239caSMichał Żygowski /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
3491f6239caSMichał Żygowski 
3501f6239caSMichał Żygowski struct acpi_ivrs_hardware_11 {
3511f6239caSMichał Żygowski 	struct acpi_ivrs_header header;
3521f6239caSMichał Żygowski 	u16 capability_offset;	/* Offset for IOMMU control fields */
3531f6239caSMichał Żygowski 	u64 base_address;	/* IOMMU control registers */
3541f6239caSMichał Żygowski 	u16 pci_segment_group;
3551f6239caSMichał Żygowski 	u16 info;		/* MSI number and unit ID */
3561f6239caSMichał Żygowski 	u32 attributes;
3571f6239caSMichał Żygowski 	u64 efr_register_image;
3581f6239caSMichał Żygowski 	u64 reserved;
3591f6239caSMichał Żygowski };
3601f6239caSMichał Żygowski 
3616e2d5ebdSBob Moore /* Masks for Info field above */
3626e2d5ebdSBob Moore 
3636e2d5ebdSBob Moore #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F	/* 5 bits, MSI message number */
364ba494beeSBob Moore #define ACPI_IVHD_UNIT_ID_MASK      0x1F00	/* 5 bits, unit_ID */
3656e2d5ebdSBob Moore 
3666e2d5ebdSBob Moore /*
3676e2d5ebdSBob Moore  * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
3686e2d5ebdSBob Moore  * Upper two bits of the Type field are the (encoded) length of the structure.
3696e2d5ebdSBob Moore  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
3706e2d5ebdSBob Moore  * are reserved for future use but not defined.
3716e2d5ebdSBob Moore  */
3726e2d5ebdSBob Moore struct acpi_ivrs_de_header {
3736e2d5ebdSBob Moore 	u8 type;
3746e2d5ebdSBob Moore 	u16 id;
3756e2d5ebdSBob Moore 	u8 data_setting;
3766e2d5ebdSBob Moore };
3776e2d5ebdSBob Moore 
3786e2d5ebdSBob Moore /* Length of device entry is in the top two bits of Type field above */
3796e2d5ebdSBob Moore 
3806e2d5ebdSBob Moore #define ACPI_IVHD_ENTRY_LENGTH      0xC0
3816e2d5ebdSBob Moore 
3826e2d5ebdSBob Moore /* Values for device entry Type field above */
3836e2d5ebdSBob Moore 
3846e2d5ebdSBob Moore enum acpi_ivrs_device_entry_type {
3856e2d5ebdSBob Moore 	/* 4-byte device entries, all use struct acpi_ivrs_device4 */
3866e2d5ebdSBob Moore 
3876e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_PAD4 = 0,
3886e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALL = 1,
3896e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_SELECT = 2,
3906e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_START = 3,
3916e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_END = 4,
3926e2d5ebdSBob Moore 
3936e2d5ebdSBob Moore 	/* 8-byte device entries */
3946e2d5ebdSBob Moore 
3956e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_PAD8 = 64,
3966e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_NOT_USED = 65,
3976e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALIAS_SELECT = 66,	/* Uses struct acpi_ivrs_device8a */
3986e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALIAS_START = 67,	/* Uses struct acpi_ivrs_device8a */
3996e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_EXT_SELECT = 70,	/* Uses struct acpi_ivrs_device8b */
4006e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_EXT_START = 71,	/* Uses struct acpi_ivrs_device8b */
4017ce7a445SAlexander Monakov 	ACPI_IVRS_TYPE_SPECIAL = 72,	/* Uses struct acpi_ivrs_device8c */
4027ce7a445SAlexander Monakov 
4037ce7a445SAlexander Monakov 	/* Variable-length device entries */
4047ce7a445SAlexander Monakov 
4057ce7a445SAlexander Monakov 	ACPI_IVRS_TYPE_HID = 240	/* Uses ACPI_IVRS_DEVICE_HID */
4066e2d5ebdSBob Moore };
4076e2d5ebdSBob Moore 
4086e2d5ebdSBob Moore /* Values for Data field above */
4096e2d5ebdSBob Moore 
4106e2d5ebdSBob Moore #define ACPI_IVHD_INIT_PASS         (1)
4116e2d5ebdSBob Moore #define ACPI_IVHD_EINT_PASS         (1<<1)
4126e2d5ebdSBob Moore #define ACPI_IVHD_NMI_PASS          (1<<2)
4136e2d5ebdSBob Moore #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
4146e2d5ebdSBob Moore #define ACPI_IVHD_LINT0_PASS        (1<<6)
4156e2d5ebdSBob Moore #define ACPI_IVHD_LINT1_PASS        (1<<7)
4166e2d5ebdSBob Moore 
4176e2d5ebdSBob Moore /* Types 0-4: 4-byte device entry */
4186e2d5ebdSBob Moore 
4196e2d5ebdSBob Moore struct acpi_ivrs_device4 {
4206e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
4216e2d5ebdSBob Moore };
4226e2d5ebdSBob Moore 
4236e2d5ebdSBob Moore /* Types 66-67: 8-byte device entry */
4246e2d5ebdSBob Moore 
4256e2d5ebdSBob Moore struct acpi_ivrs_device8a {
4266e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
4276e2d5ebdSBob Moore 	u8 reserved1;
4286e2d5ebdSBob Moore 	u16 used_id;
4296e2d5ebdSBob Moore 	u8 reserved2;
4306e2d5ebdSBob Moore };
4316e2d5ebdSBob Moore 
4326e2d5ebdSBob Moore /* Types 70-71: 8-byte device entry */
4336e2d5ebdSBob Moore 
4346e2d5ebdSBob Moore struct acpi_ivrs_device8b {
4356e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
4366e2d5ebdSBob Moore 	u32 extended_data;
4376e2d5ebdSBob Moore };
4386e2d5ebdSBob Moore 
4396e2d5ebdSBob Moore /* Values for extended_data above */
4406e2d5ebdSBob Moore 
4416e2d5ebdSBob Moore #define ACPI_IVHD_ATS_DISABLED      (1<<31)
4426e2d5ebdSBob Moore 
4436e2d5ebdSBob Moore /* Type 72: 8-byte device entry */
4446e2d5ebdSBob Moore 
4456e2d5ebdSBob Moore struct acpi_ivrs_device8c {
4466e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
4476e2d5ebdSBob Moore 	u8 handle;
4486e2d5ebdSBob Moore 	u16 used_id;
4496e2d5ebdSBob Moore 	u8 variety;
4506e2d5ebdSBob Moore };
4516e2d5ebdSBob Moore 
4526e2d5ebdSBob Moore /* Values for Variety field above */
4536e2d5ebdSBob Moore 
4546e2d5ebdSBob Moore #define ACPI_IVHD_IOAPIC            1
4556e2d5ebdSBob Moore #define ACPI_IVHD_HPET              2
4566e2d5ebdSBob Moore 
4577ce7a445SAlexander Monakov /* Type 240: variable-length device entry */
4587ce7a445SAlexander Monakov 
4597ce7a445SAlexander Monakov struct acpi_ivrs_device_hid {
4607ce7a445SAlexander Monakov 	struct acpi_ivrs_de_header header;
4617ce7a445SAlexander Monakov 	u64 acpi_hid;
4627ce7a445SAlexander Monakov 	u64 acpi_cid;
4637ce7a445SAlexander Monakov 	u8 uid_type;
4647ce7a445SAlexander Monakov 	u8 uid_length;
4657ce7a445SAlexander Monakov };
4667ce7a445SAlexander Monakov 
467c160b7d2SBob Moore /* Values for uid_type above */
468c160b7d2SBob Moore 
469c160b7d2SBob Moore #define ACPI_IVRS_UID_NOT_PRESENT   0
470c160b7d2SBob Moore #define ACPI_IVRS_UID_IS_INTEGER    1
471c160b7d2SBob Moore #define ACPI_IVRS_UID_IS_STRING     2
472c160b7d2SBob Moore 
4736e2d5ebdSBob Moore /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
4746e2d5ebdSBob Moore 
4756e2d5ebdSBob Moore struct acpi_ivrs_memory {
4766e2d5ebdSBob Moore 	struct acpi_ivrs_header header;
4776e2d5ebdSBob Moore 	u16 aux_data;
4786e2d5ebdSBob Moore 	u64 reserved;
4796e2d5ebdSBob Moore 	u64 start_address;
4806e2d5ebdSBob Moore 	u64 memory_length;
4816e2d5ebdSBob Moore };
4826e2d5ebdSBob Moore 
4836e2d5ebdSBob Moore /*******************************************************************************
4846e2d5ebdSBob Moore  *
485d36d4e30SBob Moore  * LPIT - Low Power Idle Table
486d36d4e30SBob Moore  *
4879ab8cf1bSBob Moore  * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
488d36d4e30SBob Moore  *
489d36d4e30SBob Moore  ******************************************************************************/
490d36d4e30SBob Moore 
491d36d4e30SBob Moore struct acpi_table_lpit {
492d36d4e30SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
493d36d4e30SBob Moore };
494d36d4e30SBob Moore 
495d36d4e30SBob Moore /* LPIT subtable header */
496d36d4e30SBob Moore 
497d36d4e30SBob Moore struct acpi_lpit_header {
498d36d4e30SBob Moore 	u32 type;		/* Subtable type */
499d36d4e30SBob Moore 	u32 length;		/* Subtable length */
500d36d4e30SBob Moore 	u16 unique_id;
501d36d4e30SBob Moore 	u16 reserved;
502d36d4e30SBob Moore 	u32 flags;
503d36d4e30SBob Moore };
504d36d4e30SBob Moore 
505d36d4e30SBob Moore /* Values for subtable Type above */
506d36d4e30SBob Moore 
507d36d4e30SBob Moore enum acpi_lpit_type {
508d36d4e30SBob Moore 	ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
5099ab8cf1bSBob Moore 	ACPI_LPIT_TYPE_RESERVED = 0x01	/* 1 and above are reserved */
510d36d4e30SBob Moore };
511d36d4e30SBob Moore 
512d36d4e30SBob Moore /* Masks for Flags field above  */
513d36d4e30SBob Moore 
514d36d4e30SBob Moore #define ACPI_LPIT_STATE_DISABLED    (1)
515d36d4e30SBob Moore #define ACPI_LPIT_NO_COUNTER        (1<<1)
516d36d4e30SBob Moore 
517d36d4e30SBob Moore /*
518d36d4e30SBob Moore  * LPIT subtables, correspond to Type in struct acpi_lpit_header
519d36d4e30SBob Moore  */
520d36d4e30SBob Moore 
521d36d4e30SBob Moore /* 0x00: Native C-state instruction based LPI structure */
522d36d4e30SBob Moore 
523d36d4e30SBob Moore struct acpi_lpit_native {
524d36d4e30SBob Moore 	struct acpi_lpit_header header;
525d36d4e30SBob Moore 	struct acpi_generic_address entry_trigger;
526d36d4e30SBob Moore 	u32 residency;
527d36d4e30SBob Moore 	u32 latency;
528d36d4e30SBob Moore 	struct acpi_generic_address residency_counter;
529d36d4e30SBob Moore 	u64 counter_frequency;
530d36d4e30SBob Moore };
531d36d4e30SBob Moore 
532d36d4e30SBob Moore /*******************************************************************************
533d36d4e30SBob Moore  *
534e62f8227SErik Schmauss  * MADT - Multiple APIC Description Table
535e62f8227SErik Schmauss  *        Version 3
536e62f8227SErik Schmauss  *
537e62f8227SErik Schmauss  ******************************************************************************/
538e62f8227SErik Schmauss 
539e62f8227SErik Schmauss struct acpi_table_madt {
540e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
541e62f8227SErik Schmauss 	u32 address;		/* Physical address of local APIC */
542e62f8227SErik Schmauss 	u32 flags;
543e62f8227SErik Schmauss };
544e62f8227SErik Schmauss 
545e62f8227SErik Schmauss /* Masks for Flags field above */
546e62f8227SErik Schmauss 
547e62f8227SErik Schmauss #define ACPI_MADT_PCAT_COMPAT       (1)	/* 00: System also has dual 8259s */
548e62f8227SErik Schmauss 
549e62f8227SErik Schmauss /* Values for PCATCompat flag */
550e62f8227SErik Schmauss 
551e62f8227SErik Schmauss #define ACPI_MADT_DUAL_PIC          1
552e62f8227SErik Schmauss #define ACPI_MADT_MULTIPLE_APIC     0
553e62f8227SErik Schmauss 
554e62f8227SErik Schmauss /* Values for MADT subtable type in struct acpi_subtable_header */
555e62f8227SErik Schmauss 
556e62f8227SErik Schmauss enum acpi_madt_type {
557e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC = 0,
558e62f8227SErik Schmauss 	ACPI_MADT_TYPE_IO_APIC = 1,
559e62f8227SErik Schmauss 	ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
560e62f8227SErik Schmauss 	ACPI_MADT_TYPE_NMI_SOURCE = 3,
561e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
562e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
563e62f8227SErik Schmauss 	ACPI_MADT_TYPE_IO_SAPIC = 6,
564e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
565e62f8227SErik Schmauss 	ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
566e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
567e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
568e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
569e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
570e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
571e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
572e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
5739557cb8cSErik Kaneda 	ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16,
5749557cb8cSErik Kaneda 	ACPI_MADT_TYPE_RESERVED = 17	/* 17 and greater are reserved */
575e62f8227SErik Schmauss };
576e62f8227SErik Schmauss 
577e62f8227SErik Schmauss /*
578e62f8227SErik Schmauss  * MADT Subtables, correspond to Type in struct acpi_subtable_header
579e62f8227SErik Schmauss  */
580e62f8227SErik Schmauss 
581e62f8227SErik Schmauss /* 0: Processor Local APIC */
582e62f8227SErik Schmauss 
583e62f8227SErik Schmauss struct acpi_madt_local_apic {
584e62f8227SErik Schmauss 	struct acpi_subtable_header header;
585e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
586e62f8227SErik Schmauss 	u8 id;			/* Processor's local APIC id */
587e62f8227SErik Schmauss 	u32 lapic_flags;
588e62f8227SErik Schmauss };
589e62f8227SErik Schmauss 
590e62f8227SErik Schmauss /* 1: IO APIC */
591e62f8227SErik Schmauss 
592e62f8227SErik Schmauss struct acpi_madt_io_apic {
593e62f8227SErik Schmauss 	struct acpi_subtable_header header;
594e62f8227SErik Schmauss 	u8 id;			/* I/O APIC ID */
595e62f8227SErik Schmauss 	u8 reserved;		/* reserved - must be zero */
596e62f8227SErik Schmauss 	u32 address;		/* APIC physical address */
597e62f8227SErik Schmauss 	u32 global_irq_base;	/* Global system interrupt where INTI lines start */
598e62f8227SErik Schmauss };
599e62f8227SErik Schmauss 
600e62f8227SErik Schmauss /* 2: Interrupt Override */
601e62f8227SErik Schmauss 
602e62f8227SErik Schmauss struct acpi_madt_interrupt_override {
603e62f8227SErik Schmauss 	struct acpi_subtable_header header;
604e62f8227SErik Schmauss 	u8 bus;			/* 0 - ISA */
605e62f8227SErik Schmauss 	u8 source_irq;		/* Interrupt source (IRQ) */
606e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
607e62f8227SErik Schmauss 	u16 inti_flags;
608e62f8227SErik Schmauss };
609e62f8227SErik Schmauss 
610e62f8227SErik Schmauss /* 3: NMI Source */
611e62f8227SErik Schmauss 
612e62f8227SErik Schmauss struct acpi_madt_nmi_source {
613e62f8227SErik Schmauss 	struct acpi_subtable_header header;
614e62f8227SErik Schmauss 	u16 inti_flags;
615e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
616e62f8227SErik Schmauss };
617e62f8227SErik Schmauss 
618e62f8227SErik Schmauss /* 4: Local APIC NMI */
619e62f8227SErik Schmauss 
620e62f8227SErik Schmauss struct acpi_madt_local_apic_nmi {
621e62f8227SErik Schmauss 	struct acpi_subtable_header header;
622e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
623e62f8227SErik Schmauss 	u16 inti_flags;
624e62f8227SErik Schmauss 	u8 lint;		/* LINTn to which NMI is connected */
625e62f8227SErik Schmauss };
626e62f8227SErik Schmauss 
627e62f8227SErik Schmauss /* 5: Address Override */
628e62f8227SErik Schmauss 
629e62f8227SErik Schmauss struct acpi_madt_local_apic_override {
630e62f8227SErik Schmauss 	struct acpi_subtable_header header;
631e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
632e62f8227SErik Schmauss 	u64 address;		/* APIC physical address */
633e62f8227SErik Schmauss };
634e62f8227SErik Schmauss 
635e62f8227SErik Schmauss /* 6: I/O Sapic */
636e62f8227SErik Schmauss 
637e62f8227SErik Schmauss struct acpi_madt_io_sapic {
638e62f8227SErik Schmauss 	struct acpi_subtable_header header;
639e62f8227SErik Schmauss 	u8 id;			/* I/O SAPIC ID */
640e62f8227SErik Schmauss 	u8 reserved;		/* Reserved, must be zero */
641e62f8227SErik Schmauss 	u32 global_irq_base;	/* Global interrupt for SAPIC start */
642e62f8227SErik Schmauss 	u64 address;		/* SAPIC physical address */
643e62f8227SErik Schmauss };
644e62f8227SErik Schmauss 
645e62f8227SErik Schmauss /* 7: Local Sapic */
646e62f8227SErik Schmauss 
647e62f8227SErik Schmauss struct acpi_madt_local_sapic {
648e62f8227SErik Schmauss 	struct acpi_subtable_header header;
649e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
650e62f8227SErik Schmauss 	u8 id;			/* SAPIC ID */
651e62f8227SErik Schmauss 	u8 eid;			/* SAPIC EID */
652e62f8227SErik Schmauss 	u8 reserved[3];		/* Reserved, must be zero */
653e62f8227SErik Schmauss 	u32 lapic_flags;
654e62f8227SErik Schmauss 	u32 uid;		/* Numeric UID - ACPI 3.0 */
655e62f8227SErik Schmauss 	char uid_string[1];	/* String UID  - ACPI 3.0 */
656e62f8227SErik Schmauss };
657e62f8227SErik Schmauss 
658e62f8227SErik Schmauss /* 8: Platform Interrupt Source */
659e62f8227SErik Schmauss 
660e62f8227SErik Schmauss struct acpi_madt_interrupt_source {
661e62f8227SErik Schmauss 	struct acpi_subtable_header header;
662e62f8227SErik Schmauss 	u16 inti_flags;
663e62f8227SErik Schmauss 	u8 type;		/* 1=PMI, 2=INIT, 3=corrected */
664e62f8227SErik Schmauss 	u8 id;			/* Processor ID */
665e62f8227SErik Schmauss 	u8 eid;			/* Processor EID */
666e62f8227SErik Schmauss 	u8 io_sapic_vector;	/* Vector value for PMI interrupts */
667e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
668e62f8227SErik Schmauss 	u32 flags;		/* Interrupt Source Flags */
669e62f8227SErik Schmauss };
670e62f8227SErik Schmauss 
671e62f8227SErik Schmauss /* Masks for Flags field above */
672e62f8227SErik Schmauss 
673e62f8227SErik Schmauss #define ACPI_MADT_CPEI_OVERRIDE     (1)
674e62f8227SErik Schmauss 
675e62f8227SErik Schmauss /* 9: Processor Local X2APIC (ACPI 4.0) */
676e62f8227SErik Schmauss 
677e62f8227SErik Schmauss struct acpi_madt_local_x2apic {
678e62f8227SErik Schmauss 	struct acpi_subtable_header header;
679e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
680e62f8227SErik Schmauss 	u32 local_apic_id;	/* Processor x2APIC ID  */
681e62f8227SErik Schmauss 	u32 lapic_flags;
682e62f8227SErik Schmauss 	u32 uid;		/* ACPI processor UID */
683e62f8227SErik Schmauss };
684e62f8227SErik Schmauss 
685e62f8227SErik Schmauss /* 10: Local X2APIC NMI (ACPI 4.0) */
686e62f8227SErik Schmauss 
687e62f8227SErik Schmauss struct acpi_madt_local_x2apic_nmi {
688e62f8227SErik Schmauss 	struct acpi_subtable_header header;
689e62f8227SErik Schmauss 	u16 inti_flags;
690e62f8227SErik Schmauss 	u32 uid;		/* ACPI processor UID */
691e62f8227SErik Schmauss 	u8 lint;		/* LINTn to which NMI is connected */
692e62f8227SErik Schmauss 	u8 reserved[3];		/* reserved - must be zero */
693e62f8227SErik Schmauss };
694e62f8227SErik Schmauss 
695e646e0a5SErik Schmauss /* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */
696e62f8227SErik Schmauss 
697e62f8227SErik Schmauss struct acpi_madt_generic_interrupt {
698e62f8227SErik Schmauss 	struct acpi_subtable_header header;
699e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
700e62f8227SErik Schmauss 	u32 cpu_interface_number;
701e62f8227SErik Schmauss 	u32 uid;
702e62f8227SErik Schmauss 	u32 flags;
703e62f8227SErik Schmauss 	u32 parking_version;
704e62f8227SErik Schmauss 	u32 performance_interrupt;
705e62f8227SErik Schmauss 	u64 parked_address;
706e62f8227SErik Schmauss 	u64 base_address;
707e62f8227SErik Schmauss 	u64 gicv_base_address;
708e62f8227SErik Schmauss 	u64 gich_base_address;
709e62f8227SErik Schmauss 	u32 vgic_interrupt;
710e62f8227SErik Schmauss 	u64 gicr_base_address;
711e62f8227SErik Schmauss 	u64 arm_mpidr;
712e62f8227SErik Schmauss 	u8 efficiency_class;
713e646e0a5SErik Schmauss 	u8 reserved2[1];
714e646e0a5SErik Schmauss 	u16 spe_interrupt;	/* ACPI 6.3 */
715e62f8227SErik Schmauss };
716e62f8227SErik Schmauss 
717e62f8227SErik Schmauss /* Masks for Flags field above */
718e62f8227SErik Schmauss 
719e62f8227SErik Schmauss /* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
720e62f8227SErik Schmauss #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)	/* 01: Performance Interrupt Mode */
721e62f8227SErik Schmauss #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)	/* 02: VGIC Maintenance Interrupt mode */
722e62f8227SErik Schmauss 
723e62f8227SErik Schmauss /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
724e62f8227SErik Schmauss 
725e62f8227SErik Schmauss struct acpi_madt_generic_distributor {
726e62f8227SErik Schmauss 	struct acpi_subtable_header header;
727e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
728e62f8227SErik Schmauss 	u32 gic_id;
729e62f8227SErik Schmauss 	u64 base_address;
730e62f8227SErik Schmauss 	u32 global_irq_base;
731e62f8227SErik Schmauss 	u8 version;
732e62f8227SErik Schmauss 	u8 reserved2[3];	/* reserved - must be zero */
733e62f8227SErik Schmauss };
734e62f8227SErik Schmauss 
735e62f8227SErik Schmauss /* Values for Version field above */
736e62f8227SErik Schmauss 
737e62f8227SErik Schmauss enum acpi_madt_gic_version {
738e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_NONE = 0,
739e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V1 = 1,
740e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V2 = 2,
741e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V3 = 3,
742e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V4 = 4,
743e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_RESERVED = 5	/* 5 and greater are reserved */
744e62f8227SErik Schmauss };
745e62f8227SErik Schmauss 
746e62f8227SErik Schmauss /* 13: Generic MSI Frame (ACPI 5.1) */
747e62f8227SErik Schmauss 
748e62f8227SErik Schmauss struct acpi_madt_generic_msi_frame {
749e62f8227SErik Schmauss 	struct acpi_subtable_header header;
750e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
751e62f8227SErik Schmauss 	u32 msi_frame_id;
752e62f8227SErik Schmauss 	u64 base_address;
753e62f8227SErik Schmauss 	u32 flags;
754e62f8227SErik Schmauss 	u16 spi_count;
755e62f8227SErik Schmauss 	u16 spi_base;
756e62f8227SErik Schmauss };
757e62f8227SErik Schmauss 
758e62f8227SErik Schmauss /* Masks for Flags field above */
759e62f8227SErik Schmauss 
760e62f8227SErik Schmauss #define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
761e62f8227SErik Schmauss 
762e62f8227SErik Schmauss /* 14: Generic Redistributor (ACPI 5.1) */
763e62f8227SErik Schmauss 
764e62f8227SErik Schmauss struct acpi_madt_generic_redistributor {
765e62f8227SErik Schmauss 	struct acpi_subtable_header header;
766e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
767e62f8227SErik Schmauss 	u64 base_address;
768e62f8227SErik Schmauss 	u32 length;
769e62f8227SErik Schmauss };
770e62f8227SErik Schmauss 
771e62f8227SErik Schmauss /* 15: Generic Translator (ACPI 6.0) */
772e62f8227SErik Schmauss 
773e62f8227SErik Schmauss struct acpi_madt_generic_translator {
774e62f8227SErik Schmauss 	struct acpi_subtable_header header;
775e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
776e62f8227SErik Schmauss 	u32 translation_id;
777e62f8227SErik Schmauss 	u64 base_address;
778e62f8227SErik Schmauss 	u32 reserved2;
779e62f8227SErik Schmauss };
780e62f8227SErik Schmauss 
7819557cb8cSErik Kaneda /* 16: Multiprocessor wakeup (ACPI 6.4) */
7829557cb8cSErik Kaneda 
7839557cb8cSErik Kaneda struct acpi_madt_multiproc_wakeup {
7849557cb8cSErik Kaneda 	struct acpi_subtable_header header;
7859557cb8cSErik Kaneda 	u16 mailbox_version;
7869557cb8cSErik Kaneda 	u32 reserved;		/* reserved - must be zero */
7879557cb8cSErik Kaneda 	u64 base_address;
7889557cb8cSErik Kaneda };
7899557cb8cSErik Kaneda 
79042d96e16SKuppuswamy Sathyanarayanan #define ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE	2032
79142d96e16SKuppuswamy Sathyanarayanan #define ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE	2048
79242d96e16SKuppuswamy Sathyanarayanan 
79342d96e16SKuppuswamy Sathyanarayanan struct acpi_madt_multiproc_wakeup_mailbox {
79442d96e16SKuppuswamy Sathyanarayanan 	u16 command;
79542d96e16SKuppuswamy Sathyanarayanan 	u16 reserved;		/* reserved - must be zero */
79642d96e16SKuppuswamy Sathyanarayanan 	u32 apic_id;
79742d96e16SKuppuswamy Sathyanarayanan 	u64 wakeup_vector;
79842d96e16SKuppuswamy Sathyanarayanan 	u8 reserved_os[ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE];	/* reserved for OS use */
79942d96e16SKuppuswamy Sathyanarayanan 	u8 reserved_firmware[ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE];	/* reserved for firmware use */
80042d96e16SKuppuswamy Sathyanarayanan };
80142d96e16SKuppuswamy Sathyanarayanan 
80242d96e16SKuppuswamy Sathyanarayanan #define ACPI_MP_WAKE_COMMAND_WAKEUP    1
80342d96e16SKuppuswamy Sathyanarayanan 
804e62f8227SErik Schmauss /*
805e62f8227SErik Schmauss  * Common flags fields for MADT subtables
806e62f8227SErik Schmauss  */
807e62f8227SErik Schmauss 
808e62f8227SErik Schmauss /* MADT Local APIC flags */
809e62f8227SErik Schmauss 
810e62f8227SErik Schmauss #define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if set */
811e62f8227SErik Schmauss 
812e62f8227SErik Schmauss /* MADT MPS INTI flags (inti_flags) */
813e62f8227SErik Schmauss 
814e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_MASK     (3)	/* 00-01: Polarity of APIC I/O input signals */
815e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_MASK      (3<<2)	/* 02-03: Trigger mode of APIC input signals */
816e62f8227SErik Schmauss 
817e62f8227SErik Schmauss /* Values for MPS INTI flags */
818e62f8227SErik Schmauss 
819e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_CONFORMS       0
820e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
821e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_RESERVED       2
822e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
823e62f8227SErik Schmauss 
824e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_CONFORMS        (0)
825e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
826e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
827e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
828e62f8227SErik Schmauss 
829e62f8227SErik Schmauss /*******************************************************************************
830e62f8227SErik Schmauss  *
8311a49b72cSBob Moore  * MCFG - PCI Memory Mapped Configuration table and subtable
8326e2d5ebdSBob Moore  *        Version 1
8336e2d5ebdSBob Moore  *
8346e2d5ebdSBob Moore  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
835b24aad44SBob Moore  *
836b24aad44SBob Moore  ******************************************************************************/
837b24aad44SBob Moore 
838b24aad44SBob Moore struct acpi_table_mcfg {
839b24aad44SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
840b24aad44SBob Moore 	u8 reserved[8];
841b24aad44SBob Moore };
842b24aad44SBob Moore 
843b24aad44SBob Moore /* Subtable */
844b24aad44SBob Moore 
845b24aad44SBob Moore struct acpi_mcfg_allocation {
846b24aad44SBob Moore 	u64 address;		/* Base address, processor-relative */
847b24aad44SBob Moore 	u16 pci_segment;	/* PCI segment group number */
848b24aad44SBob Moore 	u8 start_bus_number;	/* Starting PCI Bus number */
849b24aad44SBob Moore 	u8 end_bus_number;	/* Final PCI Bus number */
850b24aad44SBob Moore 	u32 reserved;
851b24aad44SBob Moore };
852b24aad44SBob Moore 
853b24aad44SBob Moore /*******************************************************************************
854b24aad44SBob Moore  *
8550e264f0bSBob Moore  * MCHI - Management Controller Host Interface Table
8560e264f0bSBob Moore  *        Version 1
8570e264f0bSBob Moore  *
8580e264f0bSBob Moore  * Conforms to "Management Component Transport Protocol (MCTP) Host
8590e264f0bSBob Moore  * Interface Specification", Revision 1.0.0a, October 13, 2009
8600e264f0bSBob Moore  *
8610e264f0bSBob Moore  ******************************************************************************/
8620e264f0bSBob Moore 
8630e264f0bSBob Moore struct acpi_table_mchi {
8640e264f0bSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
8650e264f0bSBob Moore 	u8 interface_type;
8660e264f0bSBob Moore 	u8 protocol;
8670e264f0bSBob Moore 	u64 protocol_data;
8680e264f0bSBob Moore 	u8 interrupt_type;
8690e264f0bSBob Moore 	u8 gpe;
8700e264f0bSBob Moore 	u8 pci_device_flag;
8710e264f0bSBob Moore 	u32 global_interrupt;
8720e264f0bSBob Moore 	struct acpi_generic_address control_register;
8730e264f0bSBob Moore 	u8 pci_segment;
8740e264f0bSBob Moore 	u8 pci_bus;
8750e264f0bSBob Moore 	u8 pci_device;
8760e264f0bSBob Moore 	u8 pci_function;
8770e264f0bSBob Moore };
8780e264f0bSBob Moore 
8790e264f0bSBob Moore /*******************************************************************************
8800e264f0bSBob Moore  *
881e62f8227SErik Schmauss  * MPST - Memory Power State Table (ACPI 5.0)
882e62f8227SErik Schmauss  *        Version 1
883e62f8227SErik Schmauss  *
884e62f8227SErik Schmauss  ******************************************************************************/
885e62f8227SErik Schmauss 
886e62f8227SErik Schmauss #define ACPI_MPST_CHANNEL_INFO \
887e62f8227SErik Schmauss 	u8                              channel_id; \
888e62f8227SErik Schmauss 	u8                              reserved1[3]; \
889e62f8227SErik Schmauss 	u16                             power_node_count; \
890e62f8227SErik Schmauss 	u16                             reserved2;
891e62f8227SErik Schmauss 
892e62f8227SErik Schmauss /* Main table */
893e62f8227SErik Schmauss 
894e62f8227SErik Schmauss struct acpi_table_mpst {
895e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
896e62f8227SErik Schmauss 	 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
897e62f8227SErik Schmauss };
898e62f8227SErik Schmauss 
899e62f8227SErik Schmauss /* Memory Platform Communication Channel Info */
900e62f8227SErik Schmauss 
901e62f8227SErik Schmauss struct acpi_mpst_channel {
902e62f8227SErik Schmauss 	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
903e62f8227SErik Schmauss };
904e62f8227SErik Schmauss 
905e62f8227SErik Schmauss /* Memory Power Node Structure */
906e62f8227SErik Schmauss 
907e62f8227SErik Schmauss struct acpi_mpst_power_node {
908e62f8227SErik Schmauss 	u8 flags;
909e62f8227SErik Schmauss 	u8 reserved1;
910e62f8227SErik Schmauss 	u16 node_id;
911e62f8227SErik Schmauss 	u32 length;
912e62f8227SErik Schmauss 	u64 range_address;
913e62f8227SErik Schmauss 	u64 range_length;
914e62f8227SErik Schmauss 	u32 num_power_states;
915e62f8227SErik Schmauss 	u32 num_physical_components;
916e62f8227SErik Schmauss };
917e62f8227SErik Schmauss 
918e62f8227SErik Schmauss /* Values for Flags field above */
919e62f8227SErik Schmauss 
920e62f8227SErik Schmauss #define ACPI_MPST_ENABLED               1
921e62f8227SErik Schmauss #define ACPI_MPST_POWER_MANAGED         2
922e62f8227SErik Schmauss #define ACPI_MPST_HOT_PLUG_CAPABLE      4
923e62f8227SErik Schmauss 
924e62f8227SErik Schmauss /* Memory Power State Structure (follows POWER_NODE above) */
925e62f8227SErik Schmauss 
926e62f8227SErik Schmauss struct acpi_mpst_power_state {
927e62f8227SErik Schmauss 	u8 power_state;
928e62f8227SErik Schmauss 	u8 info_index;
929e62f8227SErik Schmauss };
930e62f8227SErik Schmauss 
931e62f8227SErik Schmauss /* Physical Component ID Structure (follows POWER_STATE above) */
932e62f8227SErik Schmauss 
933e62f8227SErik Schmauss struct acpi_mpst_component {
934e62f8227SErik Schmauss 	u16 component_id;
935e62f8227SErik Schmauss };
936e62f8227SErik Schmauss 
937e62f8227SErik Schmauss /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
938e62f8227SErik Schmauss 
939e62f8227SErik Schmauss struct acpi_mpst_data_hdr {
940e62f8227SErik Schmauss 	u16 characteristics_count;
941e62f8227SErik Schmauss 	u16 reserved;
942e62f8227SErik Schmauss };
943e62f8227SErik Schmauss 
944e62f8227SErik Schmauss struct acpi_mpst_power_data {
945e62f8227SErik Schmauss 	u8 structure_id;
946e62f8227SErik Schmauss 	u8 flags;
947e62f8227SErik Schmauss 	u16 reserved1;
948e62f8227SErik Schmauss 	u32 average_power;
949e62f8227SErik Schmauss 	u32 power_saving;
950e62f8227SErik Schmauss 	u64 exit_latency;
951e62f8227SErik Schmauss 	u64 reserved2;
952e62f8227SErik Schmauss };
953e62f8227SErik Schmauss 
954e62f8227SErik Schmauss /* Values for Flags field above */
955e62f8227SErik Schmauss 
956e62f8227SErik Schmauss #define ACPI_MPST_PRESERVE              1
957e62f8227SErik Schmauss #define ACPI_MPST_AUTOENTRY             2
958e62f8227SErik Schmauss #define ACPI_MPST_AUTOEXIT              4
959e62f8227SErik Schmauss 
960e62f8227SErik Schmauss /* Shared Memory Region (not part of an ACPI table) */
961e62f8227SErik Schmauss 
962e62f8227SErik Schmauss struct acpi_mpst_shared {
963e62f8227SErik Schmauss 	u32 signature;
964e62f8227SErik Schmauss 	u16 pcc_command;
965e62f8227SErik Schmauss 	u16 pcc_status;
966e62f8227SErik Schmauss 	u32 command_register;
967e62f8227SErik Schmauss 	u32 status_register;
968e62f8227SErik Schmauss 	u32 power_state_id;
969e62f8227SErik Schmauss 	u32 power_node_id;
970e62f8227SErik Schmauss 	u64 energy_consumed;
971e62f8227SErik Schmauss 	u64 average_power;
972e62f8227SErik Schmauss };
973e62f8227SErik Schmauss 
974e62f8227SErik Schmauss /*******************************************************************************
975e62f8227SErik Schmauss  *
976e62f8227SErik Schmauss  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
977e62f8227SErik Schmauss  *        Version 1
978e62f8227SErik Schmauss  *
979e62f8227SErik Schmauss  ******************************************************************************/
980e62f8227SErik Schmauss 
981e62f8227SErik Schmauss struct acpi_table_msct {
982e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
983e62f8227SErik Schmauss 	u32 proximity_offset;	/* Location of proximity info struct(s) */
984e62f8227SErik Schmauss 	u32 max_proximity_domains;	/* Max number of proximity domains */
985e62f8227SErik Schmauss 	u32 max_clock_domains;	/* Max number of clock domains */
986e62f8227SErik Schmauss 	u64 max_address;	/* Max physical address in system */
987e62f8227SErik Schmauss };
988e62f8227SErik Schmauss 
989e62f8227SErik Schmauss /* subtable - Maximum Proximity Domain Information. Version 1 */
990e62f8227SErik Schmauss 
991e62f8227SErik Schmauss struct acpi_msct_proximity {
992e62f8227SErik Schmauss 	u8 revision;
993e62f8227SErik Schmauss 	u8 length;
994e62f8227SErik Schmauss 	u32 range_start;	/* Start of domain range */
995e62f8227SErik Schmauss 	u32 range_end;		/* End of domain range */
996e62f8227SErik Schmauss 	u32 processor_capacity;
997e62f8227SErik Schmauss 	u64 memory_capacity;	/* In bytes */
998e62f8227SErik Schmauss };
999e62f8227SErik Schmauss 
1000e62f8227SErik Schmauss /*******************************************************************************
1001e62f8227SErik Schmauss  *
10025132f2faSBob Moore  * MSDM - Microsoft Data Management table
10035132f2faSBob Moore  *
10045132f2faSBob Moore  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
10055132f2faSBob Moore  * November 29, 2011. Copyright 2011 Microsoft
10065132f2faSBob Moore  *
10075132f2faSBob Moore  ******************************************************************************/
10085132f2faSBob Moore 
10095132f2faSBob Moore /* Basic MSDM table is only the common ACPI header */
10105132f2faSBob Moore 
10115132f2faSBob Moore struct acpi_table_msdm {
10125132f2faSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
10135132f2faSBob Moore };
10145132f2faSBob Moore 
10155132f2faSBob Moore /*******************************************************************************
10165132f2faSBob Moore  *
1017e62f8227SErik Schmauss  * NFIT - NVDIMM Interface Table (ACPI 6.0+)
1018e62f8227SErik Schmauss  *        Version 1
1019e62f8227SErik Schmauss  *
1020e62f8227SErik Schmauss  ******************************************************************************/
1021e62f8227SErik Schmauss 
1022e62f8227SErik Schmauss struct acpi_table_nfit {
1023e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1024e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
1025e62f8227SErik Schmauss };
1026e62f8227SErik Schmauss 
1027e62f8227SErik Schmauss /* Subtable header for NFIT */
1028e62f8227SErik Schmauss 
1029e62f8227SErik Schmauss struct acpi_nfit_header {
1030e62f8227SErik Schmauss 	u16 type;
1031e62f8227SErik Schmauss 	u16 length;
1032e62f8227SErik Schmauss };
1033e62f8227SErik Schmauss 
1034e62f8227SErik Schmauss /* Values for subtable type in struct acpi_nfit_header */
1035e62f8227SErik Schmauss 
1036e62f8227SErik Schmauss enum acpi_nfit_type {
1037e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
1038e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_MEMORY_MAP = 1,
1039e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_INTERLEAVE = 2,
1040e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_SMBIOS = 3,
1041e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_CONTROL_REGION = 4,
1042e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_DATA_REGION = 5,
1043e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
1044e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_CAPABILITIES = 7,
1045e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_RESERVED = 8	/* 8 and greater are reserved */
1046e62f8227SErik Schmauss };
1047e62f8227SErik Schmauss 
1048e62f8227SErik Schmauss /*
1049e62f8227SErik Schmauss  * NFIT Subtables
1050e62f8227SErik Schmauss  */
1051e62f8227SErik Schmauss 
1052e62f8227SErik Schmauss /* 0: System Physical Address Range Structure */
1053e62f8227SErik Schmauss 
1054e62f8227SErik Schmauss struct acpi_nfit_system_address {
1055e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1056e62f8227SErik Schmauss 	u16 range_index;
1057e62f8227SErik Schmauss 	u16 flags;
1058e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
1059e62f8227SErik Schmauss 	u32 proximity_domain;
1060e62f8227SErik Schmauss 	u8 range_guid[16];
1061e62f8227SErik Schmauss 	u64 address;
1062e62f8227SErik Schmauss 	u64 length;
1063e62f8227SErik Schmauss 	u64 memory_mapping;
1064cf16b05cSBob Moore 	u64 location_cookie;	/* ACPI 6.4 */
1065e62f8227SErik Schmauss };
1066e62f8227SErik Schmauss 
1067e62f8227SErik Schmauss /* Flags */
1068e62f8227SErik Schmauss 
1069e62f8227SErik Schmauss #define ACPI_NFIT_ADD_ONLINE_ONLY       (1)	/* 00: Add/Online Operation Only */
1070e62f8227SErik Schmauss #define ACPI_NFIT_PROXIMITY_VALID       (1<<1)	/* 01: Proximity Domain Valid */
1071cf16b05cSBob Moore #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2)	/* 02: SPA location cookie valid (ACPI 6.4) */
1072e62f8227SErik Schmauss 
1073e62f8227SErik Schmauss /* Range Type GUIDs appear in the include/acuuid.h file */
1074e62f8227SErik Schmauss 
1075e62f8227SErik Schmauss /* 1: Memory Device to System Address Range Map Structure */
1076e62f8227SErik Schmauss 
1077e62f8227SErik Schmauss struct acpi_nfit_memory_map {
1078e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1079e62f8227SErik Schmauss 	u32 device_handle;
1080e62f8227SErik Schmauss 	u16 physical_id;
1081e62f8227SErik Schmauss 	u16 region_id;
1082e62f8227SErik Schmauss 	u16 range_index;
1083e62f8227SErik Schmauss 	u16 region_index;
1084e62f8227SErik Schmauss 	u64 region_size;
1085e62f8227SErik Schmauss 	u64 region_offset;
1086e62f8227SErik Schmauss 	u64 address;
1087e62f8227SErik Schmauss 	u16 interleave_index;
1088e62f8227SErik Schmauss 	u16 interleave_ways;
1089e62f8227SErik Schmauss 	u16 flags;
1090e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
1091e62f8227SErik Schmauss };
1092e62f8227SErik Schmauss 
1093e62f8227SErik Schmauss /* Flags */
1094e62f8227SErik Schmauss 
1095e62f8227SErik Schmauss #define ACPI_NFIT_MEM_SAVE_FAILED       (1)	/* 00: Last SAVE to Memory Device failed */
1096e62f8227SErik Schmauss #define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)	/* 01: Last RESTORE from Memory Device failed */
1097e62f8227SErik Schmauss #define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)	/* 02: Platform flush failed */
1098e62f8227SErik Schmauss #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device is not armed */
1099e62f8227SErik Schmauss #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device observed SMART/health events */
1100e62f8227SErik Schmauss #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health events enabled */
1101e62f8227SErik Schmauss #define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to SPA failed */
1102e62f8227SErik Schmauss 
1103e62f8227SErik Schmauss /* 2: Interleave Structure */
1104e62f8227SErik Schmauss 
1105e62f8227SErik Schmauss struct acpi_nfit_interleave {
1106e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1107e62f8227SErik Schmauss 	u16 interleave_index;
1108e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
1109e62f8227SErik Schmauss 	u32 line_count;
1110e62f8227SErik Schmauss 	u32 line_size;
1111e62f8227SErik Schmauss 	u32 line_offset[1];	/* Variable length */
1112e62f8227SErik Schmauss };
1113e62f8227SErik Schmauss 
1114e62f8227SErik Schmauss /* 3: SMBIOS Management Information Structure */
1115e62f8227SErik Schmauss 
1116e62f8227SErik Schmauss struct acpi_nfit_smbios {
1117e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1118e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
1119e62f8227SErik Schmauss 	u8 data[1];		/* Variable length */
1120e62f8227SErik Schmauss };
1121e62f8227SErik Schmauss 
1122e62f8227SErik Schmauss /* 4: NVDIMM Control Region Structure */
1123e62f8227SErik Schmauss 
1124e62f8227SErik Schmauss struct acpi_nfit_control_region {
1125e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1126e62f8227SErik Schmauss 	u16 region_index;
1127e62f8227SErik Schmauss 	u16 vendor_id;
1128e62f8227SErik Schmauss 	u16 device_id;
1129e62f8227SErik Schmauss 	u16 revision_id;
1130e62f8227SErik Schmauss 	u16 subsystem_vendor_id;
1131e62f8227SErik Schmauss 	u16 subsystem_device_id;
1132e62f8227SErik Schmauss 	u16 subsystem_revision_id;
1133e62f8227SErik Schmauss 	u8 valid_fields;
1134e62f8227SErik Schmauss 	u8 manufacturing_location;
1135e62f8227SErik Schmauss 	u16 manufacturing_date;
1136e62f8227SErik Schmauss 	u8 reserved[2];		/* Reserved, must be zero */
1137e62f8227SErik Schmauss 	u32 serial_number;
1138e62f8227SErik Schmauss 	u16 code;
1139e62f8227SErik Schmauss 	u16 windows;
1140e62f8227SErik Schmauss 	u64 window_size;
1141e62f8227SErik Schmauss 	u64 command_offset;
1142e62f8227SErik Schmauss 	u64 command_size;
1143e62f8227SErik Schmauss 	u64 status_offset;
1144e62f8227SErik Schmauss 	u64 status_size;
1145e62f8227SErik Schmauss 	u16 flags;
1146e62f8227SErik Schmauss 	u8 reserved1[6];	/* Reserved, must be zero */
1147e62f8227SErik Schmauss };
1148e62f8227SErik Schmauss 
1149e62f8227SErik Schmauss /* Flags */
1150e62f8227SErik Schmauss 
1151e62f8227SErik Schmauss #define ACPI_NFIT_CONTROL_BUFFERED          (1)	/* Block Data Windows implementation is buffered */
1152e62f8227SErik Schmauss 
1153e62f8227SErik Schmauss /* valid_fields bits */
1154e62f8227SErik Schmauss 
1155e62f8227SErik Schmauss #define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)	/* Manufacturing fields are valid */
1156e62f8227SErik Schmauss 
1157e62f8227SErik Schmauss /* 5: NVDIMM Block Data Window Region Structure */
1158e62f8227SErik Schmauss 
1159e62f8227SErik Schmauss struct acpi_nfit_data_region {
1160e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1161e62f8227SErik Schmauss 	u16 region_index;
1162e62f8227SErik Schmauss 	u16 windows;
1163e62f8227SErik Schmauss 	u64 offset;
1164e62f8227SErik Schmauss 	u64 size;
1165e62f8227SErik Schmauss 	u64 capacity;
1166e62f8227SErik Schmauss 	u64 start_address;
1167e62f8227SErik Schmauss };
1168e62f8227SErik Schmauss 
1169e62f8227SErik Schmauss /* 6: Flush Hint Address Structure */
1170e62f8227SErik Schmauss 
1171e62f8227SErik Schmauss struct acpi_nfit_flush_address {
1172e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1173e62f8227SErik Schmauss 	u32 device_handle;
1174e62f8227SErik Schmauss 	u16 hint_count;
1175e62f8227SErik Schmauss 	u8 reserved[6];		/* Reserved, must be zero */
1176e62f8227SErik Schmauss 	u64 hint_address[1];	/* Variable length */
1177e62f8227SErik Schmauss };
1178e62f8227SErik Schmauss 
1179e62f8227SErik Schmauss /* 7: Platform Capabilities Structure */
1180e62f8227SErik Schmauss 
1181e62f8227SErik Schmauss struct acpi_nfit_capabilities {
1182e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1183e62f8227SErik Schmauss 	u8 highest_capability;
1184e62f8227SErik Schmauss 	u8 reserved[3];		/* Reserved, must be zero */
1185e62f8227SErik Schmauss 	u32 capabilities;
1186e62f8227SErik Schmauss 	u32 reserved2;
1187e62f8227SErik Schmauss };
1188e62f8227SErik Schmauss 
1189e62f8227SErik Schmauss /* Capabilities Flags */
1190e62f8227SErik Schmauss 
1191e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH       (1)	/* 00: Cache Flush to NVDIMM capable */
1192e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_MEM_FLUSH         (1<<1)	/* 01: Memory Flush to NVDIMM capable */
1193e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING     (1<<2)	/* 02: Memory Mirroring capable */
1194e62f8227SErik Schmauss 
1195e62f8227SErik Schmauss /*
1196e62f8227SErik Schmauss  * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
1197e62f8227SErik Schmauss  */
1198e62f8227SErik Schmauss struct nfit_device_handle {
1199e62f8227SErik Schmauss 	u32 handle;
1200e62f8227SErik Schmauss };
1201e62f8227SErik Schmauss 
1202e62f8227SErik Schmauss /* Device handle construction and extraction macros */
1203e62f8227SErik Schmauss 
1204e62f8227SErik Schmauss #define ACPI_NFIT_DIMM_NUMBER_MASK              0x0000000F
1205e62f8227SErik Schmauss #define ACPI_NFIT_CHANNEL_NUMBER_MASK           0x000000F0
1206e62f8227SErik Schmauss #define ACPI_NFIT_MEMORY_ID_MASK                0x00000F00
1207e62f8227SErik Schmauss #define ACPI_NFIT_SOCKET_ID_MASK                0x0000F000
1208e62f8227SErik Schmauss #define ACPI_NFIT_NODE_ID_MASK                  0x0FFF0000
1209e62f8227SErik Schmauss 
1210e62f8227SErik Schmauss #define ACPI_NFIT_DIMM_NUMBER_OFFSET            0
1211e62f8227SErik Schmauss #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET         4
1212e62f8227SErik Schmauss #define ACPI_NFIT_MEMORY_ID_OFFSET              8
1213e62f8227SErik Schmauss #define ACPI_NFIT_SOCKET_ID_OFFSET              12
1214e62f8227SErik Schmauss #define ACPI_NFIT_NODE_ID_OFFSET                16
1215e62f8227SErik Schmauss 
1216e62f8227SErik Schmauss /* Macro to construct a NFIT/NVDIMM device handle */
1217e62f8227SErik Schmauss 
1218e62f8227SErik Schmauss #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
1219e62f8227SErik Schmauss 	((dimm)                                         | \
1220e62f8227SErik Schmauss 	((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET)  | \
1221e62f8227SErik Schmauss 	((memory)  << ACPI_NFIT_MEMORY_ID_OFFSET)       | \
1222e62f8227SErik Schmauss 	((socket)  << ACPI_NFIT_SOCKET_ID_OFFSET)       | \
1223e62f8227SErik Schmauss 	((node)    << ACPI_NFIT_NODE_ID_OFFSET))
1224e62f8227SErik Schmauss 
1225e62f8227SErik Schmauss /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
1226e62f8227SErik Schmauss 
1227e62f8227SErik Schmauss #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
1228e62f8227SErik Schmauss 	((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
1229e62f8227SErik Schmauss 
1230e62f8227SErik Schmauss #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
1231e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
1232e62f8227SErik Schmauss 
1233e62f8227SErik Schmauss #define ACPI_NFIT_GET_MEMORY_ID(handle) \
1234e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_MEMORY_ID_MASK)      >> ACPI_NFIT_MEMORY_ID_OFFSET)
1235e62f8227SErik Schmauss 
1236e62f8227SErik Schmauss #define ACPI_NFIT_GET_SOCKET_ID(handle) \
1237e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_SOCKET_ID_MASK)      >> ACPI_NFIT_SOCKET_ID_OFFSET)
1238e62f8227SErik Schmauss 
1239e62f8227SErik Schmauss #define ACPI_NFIT_GET_NODE_ID(handle) \
1240e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_NODE_ID_MASK)        >> ACPI_NFIT_NODE_ID_OFFSET)
1241e62f8227SErik Schmauss 
1242e62f8227SErik Schmauss /*******************************************************************************
1243e62f8227SErik Schmauss  *
1244e62f8227SErik Schmauss  * PCCT - Platform Communications Channel Table (ACPI 5.0)
1245e62f8227SErik Schmauss  *        Version 2 (ACPI 6.2)
1246e62f8227SErik Schmauss  *
1247e62f8227SErik Schmauss  ******************************************************************************/
1248e62f8227SErik Schmauss 
1249e62f8227SErik Schmauss struct acpi_table_pcct {
1250e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1251e62f8227SErik Schmauss 	u32 flags;
1252e62f8227SErik Schmauss 	u64 reserved;
1253e62f8227SErik Schmauss };
1254e62f8227SErik Schmauss 
1255e62f8227SErik Schmauss /* Values for Flags field above */
1256e62f8227SErik Schmauss 
1257e62f8227SErik Schmauss #define ACPI_PCCT_DOORBELL              1
1258e62f8227SErik Schmauss 
1259e62f8227SErik Schmauss /* Values for subtable type in struct acpi_subtable_header */
1260e62f8227SErik Schmauss 
1261e62f8227SErik Schmauss enum acpi_pcct_type {
1262e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
1263e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
1264e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2,	/* ACPI 6.1 */
1265e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3,	/* ACPI 6.2 */
1266e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4,	/* ACPI 6.2 */
126771f79a3fSErik Kaneda 	ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE = 5,	/* ACPI 6.4 */
126871f79a3fSErik Kaneda 	ACPI_PCCT_TYPE_RESERVED = 6	/* 6 and greater are reserved */
1269e62f8227SErik Schmauss };
1270e62f8227SErik Schmauss 
1271e62f8227SErik Schmauss /*
1272e62f8227SErik Schmauss  * PCCT Subtables, correspond to Type in struct acpi_subtable_header
1273e62f8227SErik Schmauss  */
1274e62f8227SErik Schmauss 
1275e62f8227SErik Schmauss /* 0: Generic Communications Subspace */
1276e62f8227SErik Schmauss 
1277e62f8227SErik Schmauss struct acpi_pcct_subspace {
1278e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1279e62f8227SErik Schmauss 	u8 reserved[6];
1280e62f8227SErik Schmauss 	u64 base_address;
1281e62f8227SErik Schmauss 	u64 length;
1282e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1283e62f8227SErik Schmauss 	u64 preserve_mask;
1284e62f8227SErik Schmauss 	u64 write_mask;
1285e62f8227SErik Schmauss 	u32 latency;
1286e62f8227SErik Schmauss 	u32 max_access_rate;
1287e62f8227SErik Schmauss 	u16 min_turnaround_time;
1288e62f8227SErik Schmauss };
1289e62f8227SErik Schmauss 
1290e62f8227SErik Schmauss /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
1291e62f8227SErik Schmauss 
1292e62f8227SErik Schmauss struct acpi_pcct_hw_reduced {
1293e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1294e62f8227SErik Schmauss 	u32 platform_interrupt;
1295e62f8227SErik Schmauss 	u8 flags;
1296e62f8227SErik Schmauss 	u8 reserved;
1297e62f8227SErik Schmauss 	u64 base_address;
1298e62f8227SErik Schmauss 	u64 length;
1299e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1300e62f8227SErik Schmauss 	u64 preserve_mask;
1301e62f8227SErik Schmauss 	u64 write_mask;
1302e62f8227SErik Schmauss 	u32 latency;
1303e62f8227SErik Schmauss 	u32 max_access_rate;
1304e62f8227SErik Schmauss 	u16 min_turnaround_time;
1305e62f8227SErik Schmauss };
1306e62f8227SErik Schmauss 
1307e62f8227SErik Schmauss /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
1308e62f8227SErik Schmauss 
1309e62f8227SErik Schmauss struct acpi_pcct_hw_reduced_type2 {
1310e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1311e62f8227SErik Schmauss 	u32 platform_interrupt;
1312e62f8227SErik Schmauss 	u8 flags;
1313e62f8227SErik Schmauss 	u8 reserved;
1314e62f8227SErik Schmauss 	u64 base_address;
1315e62f8227SErik Schmauss 	u64 length;
1316e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1317e62f8227SErik Schmauss 	u64 preserve_mask;
1318e62f8227SErik Schmauss 	u64 write_mask;
1319e62f8227SErik Schmauss 	u32 latency;
1320e62f8227SErik Schmauss 	u32 max_access_rate;
1321e62f8227SErik Schmauss 	u16 min_turnaround_time;
1322e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
1323e62f8227SErik Schmauss 	u64 ack_preserve_mask;
1324e62f8227SErik Schmauss 	u64 ack_write_mask;
1325e62f8227SErik Schmauss };
1326e62f8227SErik Schmauss 
1327e62f8227SErik Schmauss /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
1328e62f8227SErik Schmauss 
1329e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_master {
1330e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1331e62f8227SErik Schmauss 	u32 platform_interrupt;
1332e62f8227SErik Schmauss 	u8 flags;
1333e62f8227SErik Schmauss 	u8 reserved1;
1334e62f8227SErik Schmauss 	u64 base_address;
1335e62f8227SErik Schmauss 	u32 length;
1336e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1337e62f8227SErik Schmauss 	u64 preserve_mask;
1338e62f8227SErik Schmauss 	u64 write_mask;
1339e62f8227SErik Schmauss 	u32 latency;
1340e62f8227SErik Schmauss 	u32 max_access_rate;
1341e62f8227SErik Schmauss 	u32 min_turnaround_time;
1342e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
1343e62f8227SErik Schmauss 	u64 ack_preserve_mask;
1344e62f8227SErik Schmauss 	u64 ack_set_mask;
1345e62f8227SErik Schmauss 	u64 reserved2;
1346e62f8227SErik Schmauss 	struct acpi_generic_address cmd_complete_register;
1347e62f8227SErik Schmauss 	u64 cmd_complete_mask;
1348e62f8227SErik Schmauss 	struct acpi_generic_address cmd_update_register;
1349e62f8227SErik Schmauss 	u64 cmd_update_preserve_mask;
1350e62f8227SErik Schmauss 	u64 cmd_update_set_mask;
1351e62f8227SErik Schmauss 	struct acpi_generic_address error_status_register;
1352e62f8227SErik Schmauss 	u64 error_status_mask;
1353e62f8227SErik Schmauss };
1354e62f8227SErik Schmauss 
1355e62f8227SErik Schmauss /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
1356e62f8227SErik Schmauss 
1357e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_slave {
1358e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1359e62f8227SErik Schmauss 	u32 platform_interrupt;
1360e62f8227SErik Schmauss 	u8 flags;
1361e62f8227SErik Schmauss 	u8 reserved1;
1362e62f8227SErik Schmauss 	u64 base_address;
1363e62f8227SErik Schmauss 	u32 length;
1364e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1365e62f8227SErik Schmauss 	u64 preserve_mask;
1366e62f8227SErik Schmauss 	u64 write_mask;
1367e62f8227SErik Schmauss 	u32 latency;
1368e62f8227SErik Schmauss 	u32 max_access_rate;
1369e62f8227SErik Schmauss 	u32 min_turnaround_time;
1370e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
1371e62f8227SErik Schmauss 	u64 ack_preserve_mask;
1372e62f8227SErik Schmauss 	u64 ack_set_mask;
1373e62f8227SErik Schmauss 	u64 reserved2;
1374e62f8227SErik Schmauss 	struct acpi_generic_address cmd_complete_register;
1375e62f8227SErik Schmauss 	u64 cmd_complete_mask;
1376e62f8227SErik Schmauss 	struct acpi_generic_address cmd_update_register;
1377e62f8227SErik Schmauss 	u64 cmd_update_preserve_mask;
1378e62f8227SErik Schmauss 	u64 cmd_update_set_mask;
1379e62f8227SErik Schmauss 	struct acpi_generic_address error_status_register;
1380e62f8227SErik Schmauss 	u64 error_status_mask;
1381e62f8227SErik Schmauss };
1382e62f8227SErik Schmauss 
138371f79a3fSErik Kaneda /* 5: HW Registers based Communications Subspace */
138471f79a3fSErik Kaneda 
138571f79a3fSErik Kaneda struct acpi_pcct_hw_reg {
138671f79a3fSErik Kaneda 	struct acpi_subtable_header header;
138771f79a3fSErik Kaneda 	u16 version;
138871f79a3fSErik Kaneda 	u64 base_address;
138971f79a3fSErik Kaneda 	u64 length;
139071f79a3fSErik Kaneda 	struct acpi_generic_address doorbell_register;
139171f79a3fSErik Kaneda 	u64 doorbell_preserve;
139271f79a3fSErik Kaneda 	u64 doorbell_write;
139371f79a3fSErik Kaneda 	struct acpi_generic_address cmd_complete_register;
139471f79a3fSErik Kaneda 	u64 cmd_complete_mask;
139571f79a3fSErik Kaneda 	struct acpi_generic_address error_status_register;
139671f79a3fSErik Kaneda 	u64 error_status_mask;
139771f79a3fSErik Kaneda 	u32 nominal_latency;
139871f79a3fSErik Kaneda 	u32 min_turnaround_time;
139971f79a3fSErik Kaneda };
140071f79a3fSErik Kaneda 
1401e62f8227SErik Schmauss /* Values for doorbell flags above */
1402e62f8227SErik Schmauss 
1403e62f8227SErik Schmauss #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
1404e62f8227SErik Schmauss #define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
1405e62f8227SErik Schmauss 
1406e62f8227SErik Schmauss /*
1407e62f8227SErik Schmauss  * PCC memory structures (not part of the ACPI table)
1408e62f8227SErik Schmauss  */
1409e62f8227SErik Schmauss 
1410e62f8227SErik Schmauss /* Shared Memory Region */
1411e62f8227SErik Schmauss 
1412e62f8227SErik Schmauss struct acpi_pcct_shared_memory {
1413e62f8227SErik Schmauss 	u32 signature;
1414e62f8227SErik Schmauss 	u16 command;
1415e62f8227SErik Schmauss 	u16 status;
1416e62f8227SErik Schmauss };
1417e62f8227SErik Schmauss 
1418e62f8227SErik Schmauss /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
1419e62f8227SErik Schmauss 
1420e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_shared_memory {
1421e62f8227SErik Schmauss 	u32 signature;
1422e62f8227SErik Schmauss 	u32 flags;
1423e62f8227SErik Schmauss 	u32 length;
1424e62f8227SErik Schmauss 	u32 command;
1425e62f8227SErik Schmauss };
1426e62f8227SErik Schmauss 
1427e62f8227SErik Schmauss /*******************************************************************************
1428e62f8227SErik Schmauss  *
1429e62f8227SErik Schmauss  * PDTT - Platform Debug Trigger Table (ACPI 6.2)
1430e62f8227SErik Schmauss  *        Version 0
1431e62f8227SErik Schmauss  *
1432e62f8227SErik Schmauss  ******************************************************************************/
1433e62f8227SErik Schmauss 
1434e62f8227SErik Schmauss struct acpi_table_pdtt {
1435e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1436e62f8227SErik Schmauss 	u8 trigger_count;
1437e62f8227SErik Schmauss 	u8 reserved[3];
1438e62f8227SErik Schmauss 	u32 array_offset;
1439e62f8227SErik Schmauss };
1440e62f8227SErik Schmauss 
1441e62f8227SErik Schmauss /*
1442e62f8227SErik Schmauss  * PDTT Communication Channel Identifier Structure.
1443e62f8227SErik Schmauss  * The number of these structures is defined by trigger_count above,
1444e62f8227SErik Schmauss  * starting at array_offset.
1445e62f8227SErik Schmauss  */
1446e62f8227SErik Schmauss struct acpi_pdtt_channel {
1447e62f8227SErik Schmauss 	u8 subchannel_id;
1448e62f8227SErik Schmauss 	u8 flags;
1449e62f8227SErik Schmauss };
1450e62f8227SErik Schmauss 
1451e62f8227SErik Schmauss /* Flags for above */
1452e62f8227SErik Schmauss 
1453e62f8227SErik Schmauss #define ACPI_PDTT_RUNTIME_TRIGGER           (1)
1454e62f8227SErik Schmauss #define ACPI_PDTT_WAIT_COMPLETION           (1<<1)
1455f00175d0SErik Schmauss #define ACPI_PDTT_TRIGGER_ORDER             (1<<2)
1456e62f8227SErik Schmauss 
1457e62f8227SErik Schmauss /*******************************************************************************
1458e62f8227SErik Schmauss  *
14599f400337SErik Kaneda  * PHAT - Platform Health Assessment Table (ACPI 6.4)
14609f400337SErik Kaneda  *        Version 1
14619f400337SErik Kaneda  *
14629f400337SErik Kaneda  ******************************************************************************/
14639f400337SErik Kaneda 
14649f400337SErik Kaneda struct acpi_table_phat {
14659f400337SErik Kaneda 	struct acpi_table_header header;	/* Common ACPI table header */
14669f400337SErik Kaneda };
14679f400337SErik Kaneda 
14689f400337SErik Kaneda /* Common header for PHAT subtables that follow main table */
14699f400337SErik Kaneda 
14709f400337SErik Kaneda struct acpi_phat_header {
14719f400337SErik Kaneda 	u16 type;
14729f400337SErik Kaneda 	u16 length;
14739f400337SErik Kaneda 	u8 revision;
14749f400337SErik Kaneda };
14759f400337SErik Kaneda 
14769f400337SErik Kaneda /* Values for Type field above */
14779f400337SErik Kaneda 
14789f400337SErik Kaneda #define ACPI_PHAT_TYPE_FW_VERSION_DATA  0
14799f400337SErik Kaneda #define ACPI_PHAT_TYPE_FW_HEALTH_DATA   1
14809f400337SErik Kaneda #define ACPI_PHAT_TYPE_RESERVED         2	/* 0x02-0xFFFF are reserved */
14819f400337SErik Kaneda 
14829f400337SErik Kaneda /*
14839f400337SErik Kaneda  * PHAT subtables, correspond to Type in struct acpi_phat_header
14849f400337SErik Kaneda  */
14859f400337SErik Kaneda 
14869f400337SErik Kaneda /* 0: Firmware Version Data Record */
14879f400337SErik Kaneda 
14889f400337SErik Kaneda struct acpi_phat_version_data {
14899f400337SErik Kaneda 	struct acpi_phat_header header;
14909f400337SErik Kaneda 	u8 reserved[3];
14919f400337SErik Kaneda 	u32 element_count;
14929f400337SErik Kaneda };
14939f400337SErik Kaneda 
14949f400337SErik Kaneda struct acpi_phat_version_element {
14959f400337SErik Kaneda 	u8 guid[16];
14969f400337SErik Kaneda 	u64 version_value;
14979f400337SErik Kaneda 	u32 producer_id;
14989f400337SErik Kaneda };
14999f400337SErik Kaneda 
15009f400337SErik Kaneda /* 1: Firmware Health Data Record */
15019f400337SErik Kaneda 
15029f400337SErik Kaneda struct acpi_phat_health_data {
15039f400337SErik Kaneda 	struct acpi_phat_header header;
15049f400337SErik Kaneda 	u8 reserved[2];
15059f400337SErik Kaneda 	u8 health;
15069f400337SErik Kaneda 	u8 device_guid[16];
15079f400337SErik Kaneda 	u32 device_specific_offset;	/* Zero if no Device-specific data */
15089f400337SErik Kaneda };
15099f400337SErik Kaneda 
15109f400337SErik Kaneda /* Values for Health field above */
15119f400337SErik Kaneda 
15129f400337SErik Kaneda #define ACPI_PHAT_ERRORS_FOUND          0
15139f400337SErik Kaneda #define ACPI_PHAT_NO_ERRORS             1
15149f400337SErik Kaneda #define ACPI_PHAT_UNKNOWN_ERRORS        2
15159f400337SErik Kaneda #define ACPI_PHAT_ADVISORY              3
15169f400337SErik Kaneda 
15179f400337SErik Kaneda /*******************************************************************************
15189f400337SErik Kaneda  *
1519e62f8227SErik Schmauss  * PMTT - Platform Memory Topology Table (ACPI 5.0)
1520e62f8227SErik Schmauss  *        Version 1
1521e62f8227SErik Schmauss  *
1522e62f8227SErik Schmauss  ******************************************************************************/
1523e62f8227SErik Schmauss 
1524e62f8227SErik Schmauss struct acpi_table_pmtt {
1525e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1526cca97d42SBob Moore 	u32 memory_device_count;
1527cca97d42SBob Moore 	/*
1528cca97d42SBob Moore 	 * Immediately followed by:
1529cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
1530cca97d42SBob Moore 	 */
1531e62f8227SErik Schmauss };
1532e62f8227SErik Schmauss 
1533e62f8227SErik Schmauss /* Common header for PMTT subtables that follow main table */
1534e62f8227SErik Schmauss 
1535e62f8227SErik Schmauss struct acpi_pmtt_header {
1536e62f8227SErik Schmauss 	u8 type;
1537e62f8227SErik Schmauss 	u8 reserved1;
1538e62f8227SErik Schmauss 	u16 length;
1539e62f8227SErik Schmauss 	u16 flags;
1540e62f8227SErik Schmauss 	u16 reserved2;
1541cca97d42SBob Moore 	u32 memory_device_count;	/* Zero means no memory device structs follow */
1542cca97d42SBob Moore 	/*
1543cca97d42SBob Moore 	 * Immediately followed by:
1544cca97d42SBob Moore 	 * u8 type_specific_data[]
1545cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
1546cca97d42SBob Moore 	 */
1547e62f8227SErik Schmauss };
1548e62f8227SErik Schmauss 
1549e62f8227SErik Schmauss /* Values for Type field above */
1550e62f8227SErik Schmauss 
1551e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_SOCKET           0
1552e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_CONTROLLER       1
1553e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_DIMM             2
1554cca97d42SBob Moore #define ACPI_PMTT_TYPE_RESERVED         3	/* 0x03-0xFE are reserved */
1555cca97d42SBob Moore #define ACPI_PMTT_TYPE_VENDOR           0xFF
1556e62f8227SErik Schmauss 
1557e62f8227SErik Schmauss /* Values for Flags field above */
1558e62f8227SErik Schmauss 
1559e62f8227SErik Schmauss #define ACPI_PMTT_TOP_LEVEL             0x0001
1560e62f8227SErik Schmauss #define ACPI_PMTT_PHYSICAL              0x0002
1561e62f8227SErik Schmauss #define ACPI_PMTT_MEMORY_TYPE           0x000C
1562e62f8227SErik Schmauss 
1563e62f8227SErik Schmauss /*
1564e62f8227SErik Schmauss  * PMTT subtables, correspond to Type in struct acpi_pmtt_header
1565e62f8227SErik Schmauss  */
1566e62f8227SErik Schmauss 
1567e62f8227SErik Schmauss /* 0: Socket Structure */
1568e62f8227SErik Schmauss 
1569e62f8227SErik Schmauss struct acpi_pmtt_socket {
1570e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
1571e62f8227SErik Schmauss 	u16 socket_id;
1572e62f8227SErik Schmauss 	u16 reserved;
1573e62f8227SErik Schmauss };
1574cca97d42SBob Moore 	/*
1575cca97d42SBob Moore 	 * Immediately followed by:
1576cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
1577cca97d42SBob Moore 	 */
1578e62f8227SErik Schmauss 
1579e62f8227SErik Schmauss /* 1: Memory Controller subtable */
1580e62f8227SErik Schmauss 
1581e62f8227SErik Schmauss struct acpi_pmtt_controller {
1582e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
1583cca97d42SBob Moore 	u16 controller_id;
1584e62f8227SErik Schmauss 	u16 reserved;
1585e62f8227SErik Schmauss };
1586cca97d42SBob Moore 	/*
1587cca97d42SBob Moore 	 * Immediately followed by:
1588cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
1589cca97d42SBob Moore 	 */
1590e62f8227SErik Schmauss 
1591e62f8227SErik Schmauss /* 2: Physical Component Identifier (DIMM) */
1592e62f8227SErik Schmauss 
1593e62f8227SErik Schmauss struct acpi_pmtt_physical_component {
1594e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
1595e62f8227SErik Schmauss 	u32 bios_handle;
1596e62f8227SErik Schmauss };
1597e62f8227SErik Schmauss 
1598cca97d42SBob Moore /* 0xFF: Vendor Specific Data */
1599cca97d42SBob Moore 
1600cca97d42SBob Moore struct acpi_pmtt_vendor_specific {
1601cca97d42SBob Moore 	struct acpi_pmtt_header header;
1602cca97d42SBob Moore 	u8 type_uuid[16];
1603cca97d42SBob Moore 	u8 specific[];
1604cca97d42SBob Moore 	/*
1605cca97d42SBob Moore 	 * Immediately followed by:
1606cca97d42SBob Moore 	 * u8 vendor_specific_data[];
1607cca97d42SBob Moore 	 * MEMORY_DEVICE memory_device_struct[memory_device_count];
1608cca97d42SBob Moore 	 */
1609cca97d42SBob Moore };
1610cca97d42SBob Moore 
1611e62f8227SErik Schmauss /*******************************************************************************
1612e62f8227SErik Schmauss  *
1613e62f8227SErik Schmauss  * PPTT - Processor Properties Topology Table (ACPI 6.2)
1614e62f8227SErik Schmauss  *        Version 1
1615e62f8227SErik Schmauss  *
1616e62f8227SErik Schmauss  ******************************************************************************/
1617e62f8227SErik Schmauss 
1618e62f8227SErik Schmauss struct acpi_table_pptt {
1619e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1620e62f8227SErik Schmauss };
1621e62f8227SErik Schmauss 
1622e62f8227SErik Schmauss /* Values for Type field above */
1623e62f8227SErik Schmauss 
1624e62f8227SErik Schmauss enum acpi_pptt_type {
1625e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_PROCESSOR = 0,
1626e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_CACHE = 1,
1627e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_ID = 2,
1628e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_RESERVED = 3
1629e62f8227SErik Schmauss };
1630e62f8227SErik Schmauss 
1631e62f8227SErik Schmauss /* 0: Processor Hierarchy Node Structure */
1632e62f8227SErik Schmauss 
1633e62f8227SErik Schmauss struct acpi_pptt_processor {
1634e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1635e62f8227SErik Schmauss 	u16 reserved;
1636e62f8227SErik Schmauss 	u32 flags;
1637e62f8227SErik Schmauss 	u32 parent;
1638e62f8227SErik Schmauss 	u32 acpi_processor_id;
1639e62f8227SErik Schmauss 	u32 number_of_priv_resources;
1640e62f8227SErik Schmauss };
1641e62f8227SErik Schmauss 
1642e62f8227SErik Schmauss /* Flags */
1643e62f8227SErik Schmauss 
1644b5eab512SErik Schmauss #define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
1645b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1<<1)
1646b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1<<2)	/* ACPI 6.3 */
1647b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_LEAF_NODE            (1<<3)	/* ACPI 6.3 */
1648b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_IDENTICAL            (1<<4)	/* ACPI 6.3 */
1649e62f8227SErik Schmauss 
1650e62f8227SErik Schmauss /* 1: Cache Type Structure */
1651e62f8227SErik Schmauss 
1652e62f8227SErik Schmauss struct acpi_pptt_cache {
1653e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1654e62f8227SErik Schmauss 	u16 reserved;
1655e62f8227SErik Schmauss 	u32 flags;
1656e62f8227SErik Schmauss 	u32 next_level_of_cache;
1657e62f8227SErik Schmauss 	u32 size;
1658e62f8227SErik Schmauss 	u32 number_of_sets;
1659e62f8227SErik Schmauss 	u8 associativity;
1660e62f8227SErik Schmauss 	u8 attributes;
1661e62f8227SErik Schmauss 	u16 line_size;
1662e62f8227SErik Schmauss };
1663e62f8227SErik Schmauss 
16645e2e86c0SErik Kaneda /* 1: Cache Type Structure for PPTT version 3 */
16655e2e86c0SErik Kaneda 
16665e2e86c0SErik Kaneda struct acpi_pptt_cache_v1 {
16675e2e86c0SErik Kaneda 	u32 cache_id;
16685e2e86c0SErik Kaneda };
16695e2e86c0SErik Kaneda 
1670e62f8227SErik Schmauss /* Flags */
1671e62f8227SErik Schmauss 
1672e62f8227SErik Schmauss #define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)	/* Physical property valid */
1673e62f8227SErik Schmauss #define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)	/* Number of sets valid */
1674e62f8227SErik Schmauss #define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)	/* Associativity valid */
1675e62f8227SErik Schmauss #define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)	/* Allocation type valid */
1676e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)	/* Cache type valid */
1677e62f8227SErik Schmauss #define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)	/* Write policy valid */
1678e62f8227SErik Schmauss #define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)	/* Line size valid */
16795e2e86c0SErik Kaneda #define ACPI_PPTT_CACHE_ID_VALID            (1<<7)	/* Cache ID valid */
1680e62f8227SErik Schmauss 
1681e62f8227SErik Schmauss /* Masks for Attributes */
1682e62f8227SErik Schmauss 
1683e62f8227SErik Schmauss #define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)	/* Allocation type */
1684e62f8227SErik Schmauss #define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)	/* Cache type */
1685e62f8227SErik Schmauss #define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)	/* Write policy */
1686e62f8227SErik Schmauss 
1687e62f8227SErik Schmauss /* Attributes describing cache */
1688e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)	/* Cache line is allocated on read */
1689e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)	/* Cache line is allocated on write */
1690e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)	/* Cache line is allocated on read and write */
1691e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)	/* Alternate representation of above */
1692e62f8227SErik Schmauss 
1693e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)	/* Data cache */
1694e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)	/* Instruction cache */
1695e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)	/* Unified I & D cache */
1696e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)	/* Alternate representation of above */
1697e62f8227SErik Schmauss 
1698e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_POLICY_WB           (0x0)	/* Cache is write back */
1699e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)	/* Cache is write through */
1700e62f8227SErik Schmauss 
1701e62f8227SErik Schmauss /* 2: ID Structure */
1702e62f8227SErik Schmauss 
1703e62f8227SErik Schmauss struct acpi_pptt_id {
1704e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1705e62f8227SErik Schmauss 	u16 reserved;
1706e62f8227SErik Schmauss 	u32 vendor_id;
1707e62f8227SErik Schmauss 	u64 level1_id;
1708e62f8227SErik Schmauss 	u64 level2_id;
1709e62f8227SErik Schmauss 	u16 major_rev;
1710e62f8227SErik Schmauss 	u16 minor_rev;
1711e62f8227SErik Schmauss 	u16 spin_rev;
1712e62f8227SErik Schmauss };
1713e62f8227SErik Schmauss 
1714e62f8227SErik Schmauss /*******************************************************************************
1715e62f8227SErik Schmauss  *
1716*d71df85aSErik Kaneda  * PRMT - Platform Runtime Mechanism Table
1717*d71df85aSErik Kaneda  *        Version 1
1718*d71df85aSErik Kaneda  *
1719*d71df85aSErik Kaneda  ******************************************************************************/
1720*d71df85aSErik Kaneda 
1721*d71df85aSErik Kaneda struct acpi_table_prmt {
1722*d71df85aSErik Kaneda 	struct acpi_table_header header;	/* Common ACPI table header */
1723*d71df85aSErik Kaneda };
1724*d71df85aSErik Kaneda 
1725*d71df85aSErik Kaneda struct acpi_table_prmt_header {
1726*d71df85aSErik Kaneda 	u8 platform_guid[16];
1727*d71df85aSErik Kaneda 	u32 module_info_offset;
1728*d71df85aSErik Kaneda 	u32 module_info_count;
1729*d71df85aSErik Kaneda };
1730*d71df85aSErik Kaneda 
1731*d71df85aSErik Kaneda struct acpi_prmt_module_info {
1732*d71df85aSErik Kaneda 	u16 revision;
1733*d71df85aSErik Kaneda 	u16 length;
1734*d71df85aSErik Kaneda 	u8 module_guid[16];
1735*d71df85aSErik Kaneda 	u16 major_rev;
1736*d71df85aSErik Kaneda 	u16 minor_rev;
1737*d71df85aSErik Kaneda 	u16 handler_info_count;
1738*d71df85aSErik Kaneda 	u32 handler_info_offset;
1739*d71df85aSErik Kaneda 	u64 mmio_list_pointer;
1740*d71df85aSErik Kaneda };
1741*d71df85aSErik Kaneda 
1742*d71df85aSErik Kaneda struct acpi_prmt_handler_info {
1743*d71df85aSErik Kaneda 	u16 revision;
1744*d71df85aSErik Kaneda 	u16 length;
1745*d71df85aSErik Kaneda 	u8 handler_guid[16];
1746*d71df85aSErik Kaneda 	u64 handler_address;
1747*d71df85aSErik Kaneda 	u64 static_data_buffer_address;
1748*d71df85aSErik Kaneda 	u64 acpi_param_buffer_address;
1749*d71df85aSErik Kaneda };
1750*d71df85aSErik Kaneda 
1751*d71df85aSErik Kaneda /*******************************************************************************
1752*d71df85aSErik Kaneda  *
1753e62f8227SErik Schmauss  * RASF - RAS Feature Table (ACPI 5.0)
1754e62f8227SErik Schmauss  *        Version 1
1755e62f8227SErik Schmauss  *
1756e62f8227SErik Schmauss  ******************************************************************************/
1757e62f8227SErik Schmauss 
1758e62f8227SErik Schmauss struct acpi_table_rasf {
1759e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1760e62f8227SErik Schmauss 	u8 channel_id[12];
1761e62f8227SErik Schmauss };
1762e62f8227SErik Schmauss 
1763e62f8227SErik Schmauss /* RASF Platform Communication Channel Shared Memory Region */
1764e62f8227SErik Schmauss 
1765e62f8227SErik Schmauss struct acpi_rasf_shared_memory {
1766e62f8227SErik Schmauss 	u32 signature;
1767e62f8227SErik Schmauss 	u16 command;
1768e62f8227SErik Schmauss 	u16 status;
1769e62f8227SErik Schmauss 	u16 version;
1770e62f8227SErik Schmauss 	u8 capabilities[16];
1771e62f8227SErik Schmauss 	u8 set_capabilities[16];
1772e62f8227SErik Schmauss 	u16 num_parameter_blocks;
1773e62f8227SErik Schmauss 	u32 set_capabilities_status;
1774e62f8227SErik Schmauss };
1775e62f8227SErik Schmauss 
1776e62f8227SErik Schmauss /* RASF Parameter Block Structure Header */
1777e62f8227SErik Schmauss 
1778e62f8227SErik Schmauss struct acpi_rasf_parameter_block {
1779e62f8227SErik Schmauss 	u16 type;
1780e62f8227SErik Schmauss 	u16 version;
1781e62f8227SErik Schmauss 	u16 length;
1782e62f8227SErik Schmauss };
1783e62f8227SErik Schmauss 
1784e62f8227SErik Schmauss /* RASF Parameter Block Structure for PATROL_SCRUB */
1785e62f8227SErik Schmauss 
1786e62f8227SErik Schmauss struct acpi_rasf_patrol_scrub_parameter {
1787e62f8227SErik Schmauss 	struct acpi_rasf_parameter_block header;
1788e62f8227SErik Schmauss 	u16 patrol_scrub_command;
1789e62f8227SErik Schmauss 	u64 requested_address_range[2];
1790e62f8227SErik Schmauss 	u64 actual_address_range[2];
1791e62f8227SErik Schmauss 	u16 flags;
1792e62f8227SErik Schmauss 	u8 requested_speed;
1793e62f8227SErik Schmauss };
1794e62f8227SErik Schmauss 
1795e62f8227SErik Schmauss /* Masks for Flags and Speed fields above */
1796e62f8227SErik Schmauss 
1797e62f8227SErik Schmauss #define ACPI_RASF_SCRUBBER_RUNNING      1
1798e62f8227SErik Schmauss #define ACPI_RASF_SPEED                 (7<<1)
1799e62f8227SErik Schmauss #define ACPI_RASF_SPEED_SLOW            (0<<1)
1800e62f8227SErik Schmauss #define ACPI_RASF_SPEED_MEDIUM          (4<<1)
1801e62f8227SErik Schmauss #define ACPI_RASF_SPEED_FAST            (7<<1)
1802e62f8227SErik Schmauss 
1803e62f8227SErik Schmauss /* Channel Commands */
1804e62f8227SErik Schmauss 
1805e62f8227SErik Schmauss enum acpi_rasf_commands {
1806e62f8227SErik Schmauss 	ACPI_RASF_EXECUTE_RASF_COMMAND = 1
1807e62f8227SErik Schmauss };
1808e62f8227SErik Schmauss 
1809e62f8227SErik Schmauss /* Platform RAS Capabilities */
1810e62f8227SErik Schmauss 
1811e62f8227SErik Schmauss enum acpi_rasf_capabiliities {
1812e62f8227SErik Schmauss 	ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
1813e62f8227SErik Schmauss 	ACPI_SW_PATROL_SCRUB_EXPOSED = 1
1814e62f8227SErik Schmauss };
1815e62f8227SErik Schmauss 
1816e62f8227SErik Schmauss /* Patrol Scrub Commands */
1817e62f8227SErik Schmauss 
1818e62f8227SErik Schmauss enum acpi_rasf_patrol_scrub_commands {
1819e62f8227SErik Schmauss 	ACPI_RASF_GET_PATROL_PARAMETERS = 1,
1820e62f8227SErik Schmauss 	ACPI_RASF_START_PATROL_SCRUBBER = 2,
1821e62f8227SErik Schmauss 	ACPI_RASF_STOP_PATROL_SCRUBBER = 3
1822e62f8227SErik Schmauss };
1823e62f8227SErik Schmauss 
1824e62f8227SErik Schmauss /* Channel Command flags */
1825e62f8227SErik Schmauss 
1826e62f8227SErik Schmauss #define ACPI_RASF_GENERATE_SCI          (1<<15)
1827e62f8227SErik Schmauss 
1828e62f8227SErik Schmauss /* Status values */
1829e62f8227SErik Schmauss 
1830e62f8227SErik Schmauss enum acpi_rasf_status {
1831e62f8227SErik Schmauss 	ACPI_RASF_SUCCESS = 0,
1832e62f8227SErik Schmauss 	ACPI_RASF_NOT_VALID = 1,
1833e62f8227SErik Schmauss 	ACPI_RASF_NOT_SUPPORTED = 2,
1834e62f8227SErik Schmauss 	ACPI_RASF_BUSY = 3,
1835e62f8227SErik Schmauss 	ACPI_RASF_FAILED = 4,
1836e62f8227SErik Schmauss 	ACPI_RASF_ABORTED = 5,
1837e62f8227SErik Schmauss 	ACPI_RASF_INVALID_DATA = 6
1838e62f8227SErik Schmauss };
1839e62f8227SErik Schmauss 
1840e62f8227SErik Schmauss /* Status flags */
1841e62f8227SErik Schmauss 
1842e62f8227SErik Schmauss #define ACPI_RASF_COMMAND_COMPLETE      (1)
1843e62f8227SErik Schmauss #define ACPI_RASF_SCI_DOORBELL          (1<<1)
1844e62f8227SErik Schmauss #define ACPI_RASF_ERROR                 (1<<2)
1845e62f8227SErik Schmauss #define ACPI_RASF_STATUS                (0x1F<<3)
1846e62f8227SErik Schmauss 
1847e62f8227SErik Schmauss /*******************************************************************************
1848e62f8227SErik Schmauss  *
1849536e35c9SBob Moore  * RGRT - Regulatory Graphics Resource Table
1850536e35c9SBob Moore  *        Version 1
1851536e35c9SBob Moore  *
1852536e35c9SBob Moore  * Conforms to "ACPI RGRT" available at:
1853536e35c9SBob Moore  * https://microsoft.github.io/mu/dyn/mu_plus/ms_core_pkg/acpi_RGRT/feature_acpi_rgrt/
1854536e35c9SBob Moore  *
1855536e35c9SBob Moore  ******************************************************************************/
1856536e35c9SBob Moore 
1857536e35c9SBob Moore struct acpi_table_rgrt {
1858536e35c9SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1859536e35c9SBob Moore 	u16 version;
1860536e35c9SBob Moore 	u8 image_type;
1861536e35c9SBob Moore 	u8 reserved;
1862536e35c9SBob Moore 	u8 image[0];
1863536e35c9SBob Moore };
1864536e35c9SBob Moore 
1865536e35c9SBob Moore /* image_type values */
1866536e35c9SBob Moore 
1867536e35c9SBob Moore enum acpi_rgrt_image_type {
1868536e35c9SBob Moore 	ACPI_RGRT_TYPE_RESERVED0 = 0,
1869536e35c9SBob Moore 	ACPI_RGRT_IMAGE_TYPE_PNG = 1,
1870536e35c9SBob Moore 	ACPI_RGRT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
1871536e35c9SBob Moore };
1872536e35c9SBob Moore 
1873536e35c9SBob Moore /*******************************************************************************
1874536e35c9SBob Moore  *
1875e62f8227SErik Schmauss  * SBST - Smart Battery Specification Table
1876e62f8227SErik Schmauss  *        Version 1
1877e62f8227SErik Schmauss  *
1878e62f8227SErik Schmauss  ******************************************************************************/
1879e62f8227SErik Schmauss 
1880e62f8227SErik Schmauss struct acpi_table_sbst {
1881e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1882e62f8227SErik Schmauss 	u32 warning_level;
1883e62f8227SErik Schmauss 	u32 low_level;
1884e62f8227SErik Schmauss 	u32 critical_level;
1885e62f8227SErik Schmauss };
1886e62f8227SErik Schmauss 
1887e62f8227SErik Schmauss /*******************************************************************************
1888e62f8227SErik Schmauss  *
18893bd38469SJames Morse  * SDEI - Software Delegated Exception Interface Descriptor Table
18903bd38469SJames Morse  *
18913bd38469SJames Morse  * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
18923bd38469SJames Morse  * May 8th, 2017. Copyright 2017 ARM Ltd.
18933bd38469SJames Morse  *
18943bd38469SJames Morse  ******************************************************************************/
18953bd38469SJames Morse 
18963bd38469SJames Morse struct acpi_table_sdei {
18973bd38469SJames Morse 	struct acpi_table_header header;	/* Common ACPI table header */
18983bd38469SJames Morse };
18993bd38469SJames Morse 
19003bd38469SJames Morse /*******************************************************************************
19013bd38469SJames Morse  *
1902e62f8227SErik Schmauss  * SDEV - Secure Devices Table (ACPI 6.2)
1903e62f8227SErik Schmauss  *        Version 1
19045cf4d733SBob Moore  *
19055cf4d733SBob Moore  ******************************************************************************/
19065cf4d733SBob Moore 
1907e62f8227SErik Schmauss struct acpi_table_sdev {
19085cf4d733SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
19095cf4d733SBob Moore };
19105cf4d733SBob Moore 
1911e62f8227SErik Schmauss struct acpi_sdev_header {
1912e62f8227SErik Schmauss 	u8 type;
1913e62f8227SErik Schmauss 	u8 flags;
1914e62f8227SErik Schmauss 	u16 length;
1915b24aad44SBob Moore };
1916b24aad44SBob Moore 
1917e62f8227SErik Schmauss /* Values for subtable type above */
19186e2d5ebdSBob Moore 
1919e62f8227SErik Schmauss enum acpi_sdev_type {
1920e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
1921e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
1922e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_RESERVED = 2	/* 2 and greater are reserved */
19236e2d5ebdSBob Moore };
19246e2d5ebdSBob Moore 
1925e62f8227SErik Schmauss /* Values for flags above */
19266e2d5ebdSBob Moore 
1927e62f8227SErik Schmauss #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS    (1)
192814012d2fSErik Kaneda #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1)
192915a61aa1SBob Moore 
193015a61aa1SBob Moore /*
1931e62f8227SErik Schmauss  * SDEV subtables
193215a61aa1SBob Moore  */
193315a61aa1SBob Moore 
1934e62f8227SErik Schmauss /* 0: Namespace Device Based Secure Device Structure */
1935e62f8227SErik Schmauss 
1936e62f8227SErik Schmauss struct acpi_sdev_namespace {
1937e62f8227SErik Schmauss 	struct acpi_sdev_header header;
1938e62f8227SErik Schmauss 	u16 device_id_offset;
1939e62f8227SErik Schmauss 	u16 device_id_length;
1940e62f8227SErik Schmauss 	u16 vendor_data_offset;
1941e62f8227SErik Schmauss 	u16 vendor_data_length;
1942b24aad44SBob Moore };
1943b24aad44SBob Moore 
194414012d2fSErik Kaneda struct acpi_sdev_secure_component {
194514012d2fSErik Kaneda 	u16 secure_component_offset;
194614012d2fSErik Kaneda 	u16 secure_component_length;
194714012d2fSErik Kaneda };
194814012d2fSErik Kaneda 
194914012d2fSErik Kaneda /*
195014012d2fSErik Kaneda  * SDEV sub-subtables ("Components") for above
195114012d2fSErik Kaneda  */
195214012d2fSErik Kaneda struct acpi_sdev_component {
195314012d2fSErik Kaneda 	struct acpi_sdev_header header;
195414012d2fSErik Kaneda };
195514012d2fSErik Kaneda 
195614012d2fSErik Kaneda /* Values for sub-subtable type above */
195714012d2fSErik Kaneda 
195814012d2fSErik Kaneda enum acpi_sac_type {
195914012d2fSErik Kaneda 	ACPI_SDEV_TYPE_ID_COMPONENT = 0,
196014012d2fSErik Kaneda 	ACPI_SDEV_TYPE_MEM_COMPONENT = 1
196114012d2fSErik Kaneda };
196214012d2fSErik Kaneda 
196314012d2fSErik Kaneda struct acpi_sdev_id_component {
196414012d2fSErik Kaneda 	struct acpi_sdev_header header;
196514012d2fSErik Kaneda 	u16 hardware_id_offset;
196614012d2fSErik Kaneda 	u16 hardware_id_length;
196714012d2fSErik Kaneda 	u16 subsystem_id_offset;
196814012d2fSErik Kaneda 	u16 subsystem_id_length;
196914012d2fSErik Kaneda 	u16 hardware_revision;
197014012d2fSErik Kaneda 	u8 hardware_rev_present;
197114012d2fSErik Kaneda 	u8 class_code_present;
197214012d2fSErik Kaneda 	u8 pci_base_class;
197314012d2fSErik Kaneda 	u8 pci_sub_class;
197414012d2fSErik Kaneda 	u8 pci_programming_xface;
197514012d2fSErik Kaneda };
197614012d2fSErik Kaneda 
197714012d2fSErik Kaneda struct acpi_sdev_mem_component {
197814012d2fSErik Kaneda 	struct acpi_sdev_header header;
197914012d2fSErik Kaneda 	u32 reserved;
198014012d2fSErik Kaneda 	u64 memory_base_address;
198114012d2fSErik Kaneda 	u64 memory_length;
198214012d2fSErik Kaneda };
198314012d2fSErik Kaneda 
1984e62f8227SErik Schmauss /* 1: PCIe Endpoint Device Based Device Structure */
1985e62f8227SErik Schmauss 
1986e62f8227SErik Schmauss struct acpi_sdev_pcie {
1987e62f8227SErik Schmauss 	struct acpi_sdev_header header;
1988e62f8227SErik Schmauss 	u16 segment;
1989e62f8227SErik Schmauss 	u16 start_bus;
1990e62f8227SErik Schmauss 	u16 path_offset;
1991e62f8227SErik Schmauss 	u16 path_length;
1992e62f8227SErik Schmauss 	u16 vendor_data_offset;
1993e62f8227SErik Schmauss 	u16 vendor_data_length;
1994e62f8227SErik Schmauss };
1995e62f8227SErik Schmauss 
1996e62f8227SErik Schmauss /* 1a: PCIe Endpoint path entry */
1997e62f8227SErik Schmauss 
1998e62f8227SErik Schmauss struct acpi_sdev_pcie_path {
19999005694eSBob Moore 	u8 device;
20009005694eSBob Moore 	u8 function;
20019005694eSBob Moore };
20029005694eSBob Moore 
20038288f69eSKuppuswamy Sathyanarayanan /*******************************************************************************
20048288f69eSKuppuswamy Sathyanarayanan  *
20058288f69eSKuppuswamy Sathyanarayanan  * SVKL - Storage Volume Key Location Table (ACPI 6.4)
20066496f03eSBob Moore  *        From: "Guest-Host-Communication Interface (GHCI) for Intel
20076496f03eSBob Moore  *        Trust Domain Extensions (Intel TDX)".
20088288f69eSKuppuswamy Sathyanarayanan  *        Version 1
20098288f69eSKuppuswamy Sathyanarayanan  *
20108288f69eSKuppuswamy Sathyanarayanan  ******************************************************************************/
20118288f69eSKuppuswamy Sathyanarayanan 
20128288f69eSKuppuswamy Sathyanarayanan struct acpi_table_svkl {
20138288f69eSKuppuswamy Sathyanarayanan 	struct acpi_table_header header;	/* Common ACPI table header */
20148288f69eSKuppuswamy Sathyanarayanan 	u32 count;
20158288f69eSKuppuswamy Sathyanarayanan };
20168288f69eSKuppuswamy Sathyanarayanan 
20176496f03eSBob Moore struct acpi_svkl_key {
20188288f69eSKuppuswamy Sathyanarayanan 	u16 type;
20198288f69eSKuppuswamy Sathyanarayanan 	u16 format;
20208288f69eSKuppuswamy Sathyanarayanan 	u32 size;
20218288f69eSKuppuswamy Sathyanarayanan 	u64 address;
20228288f69eSKuppuswamy Sathyanarayanan };
20238288f69eSKuppuswamy Sathyanarayanan 
20248288f69eSKuppuswamy Sathyanarayanan enum acpi_svkl_type {
20258288f69eSKuppuswamy Sathyanarayanan 	ACPI_SVKL_TYPE_MAIN_STORAGE = 0,
20268288f69eSKuppuswamy Sathyanarayanan 	ACPI_SVKL_TYPE_RESERVED = 1	/* 1 and greater are reserved */
20278288f69eSKuppuswamy Sathyanarayanan };
20288288f69eSKuppuswamy Sathyanarayanan 
20298288f69eSKuppuswamy Sathyanarayanan enum acpi_svkl_format {
20308288f69eSKuppuswamy Sathyanarayanan 	ACPI_SVKL_FORMAT_RAW_BINARY = 0,
20318288f69eSKuppuswamy Sathyanarayanan 	ACPI_SVKL_FORMAT_RESERVED = 1	/* 1 and greater are reserved */
20328288f69eSKuppuswamy Sathyanarayanan };
20338288f69eSKuppuswamy Sathyanarayanan 
20346e596084SRobert Moore /* Reset to default packing */
20356e596084SRobert Moore 
20366e596084SRobert Moore #pragma pack()
2037b24aad44SBob Moore 
2038b24aad44SBob Moore #endif				/* __ACTBL2_H__ */
2039