xref: /openbmc/linux/include/acpi/actbl2.h (revision 88055d8f)
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  *
6800ba7c5SBob Moore  * Copyright (C) 2000 - 2020, 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  */
27874f6a72SLv Zheng #define ACPI_SIG_IORT           "IORT"	/* IO Remapping Table */
286e2d5ebdSBob Moore #define ACPI_SIG_IVRS           "IVRS"	/* I/O Virtualization Reporting Structure */
29d36d4e30SBob Moore #define ACPI_SIG_LPIT           "LPIT"	/* Low Power Idle Table */
30e62f8227SErik Schmauss #define ACPI_SIG_MADT           "APIC"	/* Multiple APIC Description Table */
31b24aad44SBob Moore #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
320e264f0bSBob Moore #define ACPI_SIG_MCHI           "MCHI"	/* Management Controller Host Interface table */
33e62f8227SErik Schmauss #define ACPI_SIG_MPST           "MPST"	/* Memory Power State Table */
34e62f8227SErik Schmauss #define ACPI_SIG_MSCT           "MSCT"	/* Maximum System Characteristics Table */
355132f2faSBob Moore #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
3698b5c993SLv Zheng #define ACPI_SIG_MTMR           "MTMR"	/* MID Timer 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 */
40e62f8227SErik Schmauss #define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table */
41e62f8227SErik Schmauss #define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
42e62f8227SErik Schmauss #define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
43e62f8227SErik Schmauss #define ACPI_SIG_SBST           "SBST"	/* Smart Battery Specification Table */
443bd38469SJames Morse #define ACPI_SIG_SDEI           "SDEI"	/* Software Delegated Exception Interface Table */
45e62f8227SErik Schmauss #define ACPI_SIG_SDEV           "SDEV"	/* Secure Devices table */
4688055d8fSCezary Rojewski #define ACPI_SIG_NHLT           "NHLT"	/* Non-HDAudio Link Table */
474461cf54SBob Moore 
48b24aad44SBob Moore /*
49b24aad44SBob Moore  * All tables must be byte-packed to match the ACPI specification, since
50b24aad44SBob Moore  * the tables are provided by the system BIOS.
51b24aad44SBob Moore  */
52b24aad44SBob Moore #pragma pack(1)
53b24aad44SBob Moore 
54b24aad44SBob Moore /*
55be030a57SBob Moore  * Note: C bitfields are not used for this reason:
56be030a57SBob Moore  *
57be030a57SBob Moore  * "Bitfields are great and easy to read, but unfortunately the C language
58be030a57SBob Moore  * does not specify the layout of bitfields in memory, which means they are
59be030a57SBob Moore  * essentially useless for dealing with packed data in on-disk formats or
60be030a57SBob Moore  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
61be030a57SBob Moore  * this decision was a design error in C. Ritchie could have picked an order
62be030a57SBob Moore  * and stuck with it." Norman Ramsey.
63be030a57SBob Moore  * See http://stackoverflow.com/a/1053662/41661
64b24aad44SBob Moore  */
65b24aad44SBob Moore 
66b24aad44SBob Moore /*******************************************************************************
67b24aad44SBob Moore  *
68874f6a72SLv Zheng  * IORT - IO Remapping Table
69874f6a72SLv Zheng  *
70874f6a72SLv Zheng  * Conforms to "IO Remapping Table System Software on ARM Platforms",
71d87be043SRobin Murphy  * Document number: ARM DEN 0049D, March 2018
72874f6a72SLv Zheng  *
73874f6a72SLv Zheng  ******************************************************************************/
74874f6a72SLv Zheng 
75874f6a72SLv Zheng struct acpi_table_iort {
76874f6a72SLv Zheng 	struct acpi_table_header header;
77874f6a72SLv Zheng 	u32 node_count;
78874f6a72SLv Zheng 	u32 node_offset;
79874f6a72SLv Zheng 	u32 reserved;
80874f6a72SLv Zheng };
81874f6a72SLv Zheng 
82874f6a72SLv Zheng /*
83874f6a72SLv Zheng  * IORT subtables
84874f6a72SLv Zheng  */
85874f6a72SLv Zheng struct acpi_iort_node {
86874f6a72SLv Zheng 	u8 type;
87874f6a72SLv Zheng 	u16 length;
88874f6a72SLv Zheng 	u8 revision;
89874f6a72SLv Zheng 	u32 reserved;
90874f6a72SLv Zheng 	u32 mapping_count;
91874f6a72SLv Zheng 	u32 mapping_offset;
92874f6a72SLv Zheng 	char node_data[1];
93874f6a72SLv Zheng };
94874f6a72SLv Zheng 
95874f6a72SLv Zheng /* Values for subtable Type above */
96874f6a72SLv Zheng 
97874f6a72SLv Zheng enum acpi_iort_node_type {
98874f6a72SLv Zheng 	ACPI_IORT_NODE_ITS_GROUP = 0x00,
99874f6a72SLv Zheng 	ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
100874f6a72SLv Zheng 	ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
1014ac78bafSAl Stone 	ACPI_IORT_NODE_SMMU = 0x03,
102a53eaef6SRobin Murphy 	ACPI_IORT_NODE_SMMU_V3 = 0x04,
103a53eaef6SRobin Murphy 	ACPI_IORT_NODE_PMCG = 0x05
104874f6a72SLv Zheng };
105874f6a72SLv Zheng 
106874f6a72SLv Zheng struct acpi_iort_id_mapping {
107874f6a72SLv Zheng 	u32 input_base;		/* Lowest value in input range */
108874f6a72SLv Zheng 	u32 id_count;		/* Number of IDs */
109874f6a72SLv Zheng 	u32 output_base;	/* Lowest value in output range */
110874f6a72SLv Zheng 	u32 output_reference;	/* A reference to the output node */
111874f6a72SLv Zheng 	u32 flags;
112874f6a72SLv Zheng };
113874f6a72SLv Zheng 
114874f6a72SLv Zheng /* Masks for Flags field above for IORT subtable */
115874f6a72SLv Zheng 
116874f6a72SLv Zheng #define ACPI_IORT_ID_SINGLE_MAPPING (1)
117874f6a72SLv Zheng 
118874f6a72SLv Zheng struct acpi_iort_memory_access {
119874f6a72SLv Zheng 	u32 cache_coherency;
120874f6a72SLv Zheng 	u8 hints;
121874f6a72SLv Zheng 	u16 reserved;
122874f6a72SLv Zheng 	u8 memory_flags;
123874f6a72SLv Zheng };
124874f6a72SLv Zheng 
125874f6a72SLv Zheng /* Values for cache_coherency field above */
126874f6a72SLv Zheng 
127874f6a72SLv Zheng #define ACPI_IORT_NODE_COHERENT         0x00000001	/* The device node is fully coherent */
128874f6a72SLv Zheng #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000	/* The device node is not coherent */
129874f6a72SLv Zheng 
130874f6a72SLv Zheng /* Masks for Hints field above */
131874f6a72SLv Zheng 
132874f6a72SLv Zheng #define ACPI_IORT_HT_TRANSIENT          (1)
133874f6a72SLv Zheng #define ACPI_IORT_HT_WRITE              (1<<1)
134874f6a72SLv Zheng #define ACPI_IORT_HT_READ               (1<<2)
135874f6a72SLv Zheng #define ACPI_IORT_HT_OVERRIDE           (1<<3)
136874f6a72SLv Zheng 
137874f6a72SLv Zheng /* Masks for memory_flags field above */
138874f6a72SLv Zheng 
139874f6a72SLv Zheng #define ACPI_IORT_MF_COHERENCY          (1)
140874f6a72SLv Zheng #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
141874f6a72SLv Zheng 
142874f6a72SLv Zheng /*
143874f6a72SLv Zheng  * IORT node specific subtables
144874f6a72SLv Zheng  */
145874f6a72SLv Zheng struct acpi_iort_its_group {
146874f6a72SLv Zheng 	u32 its_count;
147c163f90cSErik Schmauss 	u32 identifiers[1];	/* GIC ITS identifier array */
148874f6a72SLv Zheng };
149874f6a72SLv Zheng 
150874f6a72SLv Zheng struct acpi_iort_named_component {
151874f6a72SLv Zheng 	u32 node_flags;
152874f6a72SLv Zheng 	u64 memory_properties;	/* Memory access properties */
153874f6a72SLv Zheng 	u8 memory_address_limit;	/* Memory address size limit */
154874f6a72SLv Zheng 	char device_name[1];	/* Path of namespace object */
155874f6a72SLv Zheng };
156874f6a72SLv Zheng 
157d87be043SRobin Murphy /* Masks for Flags field above */
158d87be043SRobin Murphy 
159d87be043SRobin Murphy #define ACPI_IORT_NC_STALL_SUPPORTED    (1)
160d87be043SRobin Murphy #define ACPI_IORT_NC_PASID_BITS         (31<<1)
161d87be043SRobin Murphy 
162874f6a72SLv Zheng struct acpi_iort_root_complex {
163874f6a72SLv Zheng 	u64 memory_properties;	/* Memory access properties */
164874f6a72SLv Zheng 	u32 ats_attribute;
165874f6a72SLv Zheng 	u32 pci_segment_number;
166d87be043SRobin Murphy 	u8 memory_address_limit;	/* Memory address size limit */
167d87be043SRobin Murphy 	u8 reserved[3];		/* Reserved, must be zero */
168874f6a72SLv Zheng };
169874f6a72SLv Zheng 
170874f6a72SLv Zheng /* Values for ats_attribute field above */
171874f6a72SLv Zheng 
172874f6a72SLv Zheng #define ACPI_IORT_ATS_SUPPORTED         0x00000001	/* The root complex supports ATS */
173874f6a72SLv Zheng #define ACPI_IORT_ATS_UNSUPPORTED       0x00000000	/* The root complex doesn't support ATS */
174874f6a72SLv Zheng 
175874f6a72SLv Zheng struct acpi_iort_smmu {
176874f6a72SLv Zheng 	u64 base_address;	/* SMMU base address */
177874f6a72SLv Zheng 	u64 span;		/* Length of memory range */
178874f6a72SLv Zheng 	u32 model;
179874f6a72SLv Zheng 	u32 flags;
180874f6a72SLv Zheng 	u32 global_interrupt_offset;
181874f6a72SLv Zheng 	u32 context_interrupt_count;
182874f6a72SLv Zheng 	u32 context_interrupt_offset;
183874f6a72SLv Zheng 	u32 pmu_interrupt_count;
184874f6a72SLv Zheng 	u32 pmu_interrupt_offset;
185874f6a72SLv Zheng 	u64 interrupts[1];	/* Interrupt array */
186874f6a72SLv Zheng };
187874f6a72SLv Zheng 
188874f6a72SLv Zheng /* Values for Model field above */
189874f6a72SLv Zheng 
190874f6a72SLv Zheng #define ACPI_IORT_SMMU_V1               0x00000000	/* Generic SMMUv1 */
191874f6a72SLv Zheng #define ACPI_IORT_SMMU_V2               0x00000001	/* Generic SMMUv2 */
192874f6a72SLv Zheng #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002	/* ARM Corelink MMU-400 */
193874f6a72SLv Zheng #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003	/* ARM Corelink MMU-500 */
1940c2021c0SRobin Murphy #define ACPI_IORT_SMMU_CORELINK_MMU401  0x00000004	/* ARM Corelink MMU-401 */
1950c2021c0SRobin Murphy #define ACPI_IORT_SMMU_CAVIUM_THUNDERX  0x00000005	/* Cavium thunder_x SMMUv2 */
196874f6a72SLv Zheng 
197874f6a72SLv Zheng /* Masks for Flags field above */
198874f6a72SLv Zheng 
199874f6a72SLv Zheng #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
200874f6a72SLv Zheng #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
201874f6a72SLv Zheng 
202bb1e23e6SLv Zheng /* Global interrupt format */
203bb1e23e6SLv Zheng 
204bb1e23e6SLv Zheng struct acpi_iort_smmu_gsi {
205bb1e23e6SLv Zheng 	u32 nsg_irpt;
206bb1e23e6SLv Zheng 	u32 nsg_irpt_flags;
207bb1e23e6SLv Zheng 	u32 nsg_cfg_irpt;
208bb1e23e6SLv Zheng 	u32 nsg_cfg_irpt_flags;
209bb1e23e6SLv Zheng };
210bb1e23e6SLv Zheng 
2114ac78bafSAl Stone struct acpi_iort_smmu_v3 {
2124ac78bafSAl Stone 	u64 base_address;	/* SMMUv3 base address */
2134ac78bafSAl Stone 	u32 flags;
2144ac78bafSAl Stone 	u32 reserved;
2154ac78bafSAl Stone 	u64 vatos_address;
2160c2021c0SRobin Murphy 	u32 model;
2174ac78bafSAl Stone 	u32 event_gsiv;
2184ac78bafSAl Stone 	u32 pri_gsiv;
2194ac78bafSAl Stone 	u32 gerr_gsiv;
2204ac78bafSAl Stone 	u32 sync_gsiv;
221d87be043SRobin Murphy 	u32 pxm;
2224c106aa4SHanjun Guo 	u32 id_mapping_index;
2234ac78bafSAl Stone };
2244ac78bafSAl Stone 
2250c2021c0SRobin Murphy /* Values for Model field above */
2260c2021c0SRobin Murphy 
2270c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_GENERIC           0x00000000	/* Generic SMMUv3 */
2280c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_HISILICON_HI161X  0x00000001	/* hi_silicon Hi161x SMMUv3 */
2290c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX     0x00000002	/* Cavium CN99xx SMMUv3 */
2300c2021c0SRobin Murphy 
2314ac78bafSAl Stone /* Masks for Flags field above */
2324ac78bafSAl Stone 
2334ac78bafSAl Stone #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
234d87be043SRobin Murphy #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (3<<1)
235c9442300SGanapatrao Kulkarni #define ACPI_IORT_SMMU_V3_PXM_VALID         (1<<3)
2364ac78bafSAl Stone 
237a53eaef6SRobin Murphy struct acpi_iort_pmcg {
238a53eaef6SRobin Murphy 	u64 page0_base_address;
239a53eaef6SRobin Murphy 	u32 overflow_gsiv;
240a53eaef6SRobin Murphy 	u32 node_reference;
241a53eaef6SRobin Murphy 	u64 page1_base_address;
242a53eaef6SRobin Murphy };
243a53eaef6SRobin Murphy 
244874f6a72SLv Zheng /*******************************************************************************
245874f6a72SLv Zheng  *
2466e2d5ebdSBob Moore  * IVRS - I/O Virtualization Reporting Structure
2476e2d5ebdSBob Moore  *        Version 1
2486e2d5ebdSBob Moore  *
2496e2d5ebdSBob Moore  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
2506e2d5ebdSBob Moore  * Revision 1.26, February 2009.
2516e2d5ebdSBob Moore  *
2526e2d5ebdSBob Moore  ******************************************************************************/
2536e2d5ebdSBob Moore 
2546e2d5ebdSBob Moore struct acpi_table_ivrs {
2556e2d5ebdSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
2566e2d5ebdSBob Moore 	u32 info;		/* Common virtualization info */
2576e2d5ebdSBob Moore 	u64 reserved;
2586e2d5ebdSBob Moore };
2596e2d5ebdSBob Moore 
2606e2d5ebdSBob Moore /* Values for Info field above */
2616e2d5ebdSBob Moore 
2626e2d5ebdSBob Moore #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00	/* 7 bits, physical address size */
2636e2d5ebdSBob Moore #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000	/* 7 bits, virtual address size */
2646e2d5ebdSBob Moore #define ACPI_IVRS_ATS_RESERVED      0x00400000	/* ATS address translation range reserved */
2656e2d5ebdSBob Moore 
2666e2d5ebdSBob Moore /* IVRS subtable header */
2676e2d5ebdSBob Moore 
2686e2d5ebdSBob Moore struct acpi_ivrs_header {
2696e2d5ebdSBob Moore 	u8 type;		/* Subtable type */
2706e2d5ebdSBob Moore 	u8 flags;
2716e2d5ebdSBob Moore 	u16 length;		/* Subtable length */
2726e2d5ebdSBob Moore 	u16 device_id;		/* ID of IOMMU */
2736e2d5ebdSBob Moore };
2746e2d5ebdSBob Moore 
2756e2d5ebdSBob Moore /* Values for subtable Type above */
2766e2d5ebdSBob Moore 
2776e2d5ebdSBob Moore enum acpi_ivrs_type {
2781f6239caSMichał Żygowski 	ACPI_IVRS_TYPE_HARDWARE1 = 0x10,
2791f6239caSMichał Żygowski 	ACPI_IVRS_TYPE_HARDWARE2 = 0x11,
2806e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY1 = 0x20,
2816e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY2 = 0x21,
2826e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_MEMORY3 = 0x22
2836e2d5ebdSBob Moore };
2846e2d5ebdSBob Moore 
2856e2d5ebdSBob Moore /* Masks for Flags field above for IVHD subtable */
2866e2d5ebdSBob Moore 
2876e2d5ebdSBob Moore #define ACPI_IVHD_TT_ENABLE         (1)
2886e2d5ebdSBob Moore #define ACPI_IVHD_PASS_PW           (1<<1)
2896e2d5ebdSBob Moore #define ACPI_IVHD_RES_PASS_PW       (1<<2)
2906e2d5ebdSBob Moore #define ACPI_IVHD_ISOC              (1<<3)
2916e2d5ebdSBob Moore #define ACPI_IVHD_IOTLB             (1<<4)
2926e2d5ebdSBob Moore 
2936e2d5ebdSBob Moore /* Masks for Flags field above for IVMD subtable */
2946e2d5ebdSBob Moore 
2956e2d5ebdSBob Moore #define ACPI_IVMD_UNITY             (1)
2966e2d5ebdSBob Moore #define ACPI_IVMD_READ              (1<<1)
2976e2d5ebdSBob Moore #define ACPI_IVMD_WRITE             (1<<2)
2986e2d5ebdSBob Moore #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
2996e2d5ebdSBob Moore 
3006e2d5ebdSBob Moore /*
3016e2d5ebdSBob Moore  * IVRS subtables, correspond to Type in struct acpi_ivrs_header
3026e2d5ebdSBob Moore  */
3036e2d5ebdSBob Moore 
3046e2d5ebdSBob Moore /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
3056e2d5ebdSBob Moore 
3061f6239caSMichał Żygowski struct acpi_ivrs_hardware_10 {
3076e2d5ebdSBob Moore 	struct acpi_ivrs_header header;
3086e2d5ebdSBob Moore 	u16 capability_offset;	/* Offset for IOMMU control fields */
3096e2d5ebdSBob Moore 	u64 base_address;	/* IOMMU control registers */
3106e2d5ebdSBob Moore 	u16 pci_segment_group;
3116e2d5ebdSBob Moore 	u16 info;		/* MSI number and unit ID */
3120dc7e795SMichał Żygowski 	u32 feature_reporting;
3136e2d5ebdSBob Moore };
3146e2d5ebdSBob Moore 
3151f6239caSMichał Żygowski /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
3161f6239caSMichał Żygowski 
3171f6239caSMichał Żygowski struct acpi_ivrs_hardware_11 {
3181f6239caSMichał Żygowski 	struct acpi_ivrs_header header;
3191f6239caSMichał Żygowski 	u16 capability_offset;	/* Offset for IOMMU control fields */
3201f6239caSMichał Żygowski 	u64 base_address;	/* IOMMU control registers */
3211f6239caSMichał Żygowski 	u16 pci_segment_group;
3221f6239caSMichał Żygowski 	u16 info;		/* MSI number and unit ID */
3231f6239caSMichał Żygowski 	u32 attributes;
3241f6239caSMichał Żygowski 	u64 efr_register_image;
3251f6239caSMichał Żygowski 	u64 reserved;
3261f6239caSMichał Żygowski };
3271f6239caSMichał Żygowski 
3286e2d5ebdSBob Moore /* Masks for Info field above */
3296e2d5ebdSBob Moore 
3306e2d5ebdSBob Moore #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F	/* 5 bits, MSI message number */
331ba494beeSBob Moore #define ACPI_IVHD_UNIT_ID_MASK      0x1F00	/* 5 bits, unit_ID */
3326e2d5ebdSBob Moore 
3336e2d5ebdSBob Moore /*
3346e2d5ebdSBob Moore  * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
3356e2d5ebdSBob Moore  * Upper two bits of the Type field are the (encoded) length of the structure.
3366e2d5ebdSBob Moore  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
3376e2d5ebdSBob Moore  * are reserved for future use but not defined.
3386e2d5ebdSBob Moore  */
3396e2d5ebdSBob Moore struct acpi_ivrs_de_header {
3406e2d5ebdSBob Moore 	u8 type;
3416e2d5ebdSBob Moore 	u16 id;
3426e2d5ebdSBob Moore 	u8 data_setting;
3436e2d5ebdSBob Moore };
3446e2d5ebdSBob Moore 
3456e2d5ebdSBob Moore /* Length of device entry is in the top two bits of Type field above */
3466e2d5ebdSBob Moore 
3476e2d5ebdSBob Moore #define ACPI_IVHD_ENTRY_LENGTH      0xC0
3486e2d5ebdSBob Moore 
3496e2d5ebdSBob Moore /* Values for device entry Type field above */
3506e2d5ebdSBob Moore 
3516e2d5ebdSBob Moore enum acpi_ivrs_device_entry_type {
3526e2d5ebdSBob Moore 	/* 4-byte device entries, all use struct acpi_ivrs_device4 */
3536e2d5ebdSBob Moore 
3546e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_PAD4 = 0,
3556e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALL = 1,
3566e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_SELECT = 2,
3576e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_START = 3,
3586e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_END = 4,
3596e2d5ebdSBob Moore 
3606e2d5ebdSBob Moore 	/* 8-byte device entries */
3616e2d5ebdSBob Moore 
3626e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_PAD8 = 64,
3636e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_NOT_USED = 65,
3646e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALIAS_SELECT = 66,	/* Uses struct acpi_ivrs_device8a */
3656e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_ALIAS_START = 67,	/* Uses struct acpi_ivrs_device8a */
3666e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_EXT_SELECT = 70,	/* Uses struct acpi_ivrs_device8b */
3676e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_EXT_START = 71,	/* Uses struct acpi_ivrs_device8b */
3686e2d5ebdSBob Moore 	ACPI_IVRS_TYPE_SPECIAL = 72	/* Uses struct acpi_ivrs_device8c */
3696e2d5ebdSBob Moore };
3706e2d5ebdSBob Moore 
3716e2d5ebdSBob Moore /* Values for Data field above */
3726e2d5ebdSBob Moore 
3736e2d5ebdSBob Moore #define ACPI_IVHD_INIT_PASS         (1)
3746e2d5ebdSBob Moore #define ACPI_IVHD_EINT_PASS         (1<<1)
3756e2d5ebdSBob Moore #define ACPI_IVHD_NMI_PASS          (1<<2)
3766e2d5ebdSBob Moore #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
3776e2d5ebdSBob Moore #define ACPI_IVHD_LINT0_PASS        (1<<6)
3786e2d5ebdSBob Moore #define ACPI_IVHD_LINT1_PASS        (1<<7)
3796e2d5ebdSBob Moore 
3806e2d5ebdSBob Moore /* Types 0-4: 4-byte device entry */
3816e2d5ebdSBob Moore 
3826e2d5ebdSBob Moore struct acpi_ivrs_device4 {
3836e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
3846e2d5ebdSBob Moore };
3856e2d5ebdSBob Moore 
3866e2d5ebdSBob Moore /* Types 66-67: 8-byte device entry */
3876e2d5ebdSBob Moore 
3886e2d5ebdSBob Moore struct acpi_ivrs_device8a {
3896e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
3906e2d5ebdSBob Moore 	u8 reserved1;
3916e2d5ebdSBob Moore 	u16 used_id;
3926e2d5ebdSBob Moore 	u8 reserved2;
3936e2d5ebdSBob Moore };
3946e2d5ebdSBob Moore 
3956e2d5ebdSBob Moore /* Types 70-71: 8-byte device entry */
3966e2d5ebdSBob Moore 
3976e2d5ebdSBob Moore struct acpi_ivrs_device8b {
3986e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
3996e2d5ebdSBob Moore 	u32 extended_data;
4006e2d5ebdSBob Moore };
4016e2d5ebdSBob Moore 
4026e2d5ebdSBob Moore /* Values for extended_data above */
4036e2d5ebdSBob Moore 
4046e2d5ebdSBob Moore #define ACPI_IVHD_ATS_DISABLED      (1<<31)
4056e2d5ebdSBob Moore 
4066e2d5ebdSBob Moore /* Type 72: 8-byte device entry */
4076e2d5ebdSBob Moore 
4086e2d5ebdSBob Moore struct acpi_ivrs_device8c {
4096e2d5ebdSBob Moore 	struct acpi_ivrs_de_header header;
4106e2d5ebdSBob Moore 	u8 handle;
4116e2d5ebdSBob Moore 	u16 used_id;
4126e2d5ebdSBob Moore 	u8 variety;
4136e2d5ebdSBob Moore };
4146e2d5ebdSBob Moore 
4156e2d5ebdSBob Moore /* Values for Variety field above */
4166e2d5ebdSBob Moore 
4176e2d5ebdSBob Moore #define ACPI_IVHD_IOAPIC            1
4186e2d5ebdSBob Moore #define ACPI_IVHD_HPET              2
4196e2d5ebdSBob Moore 
4206e2d5ebdSBob Moore /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
4216e2d5ebdSBob Moore 
4226e2d5ebdSBob Moore struct acpi_ivrs_memory {
4236e2d5ebdSBob Moore 	struct acpi_ivrs_header header;
4246e2d5ebdSBob Moore 	u16 aux_data;
4256e2d5ebdSBob Moore 	u64 reserved;
4266e2d5ebdSBob Moore 	u64 start_address;
4276e2d5ebdSBob Moore 	u64 memory_length;
4286e2d5ebdSBob Moore };
4296e2d5ebdSBob Moore 
4306e2d5ebdSBob Moore /*******************************************************************************
4316e2d5ebdSBob Moore  *
432d36d4e30SBob Moore  * LPIT - Low Power Idle Table
433d36d4e30SBob Moore  *
4349ab8cf1bSBob Moore  * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
435d36d4e30SBob Moore  *
436d36d4e30SBob Moore  ******************************************************************************/
437d36d4e30SBob Moore 
438d36d4e30SBob Moore struct acpi_table_lpit {
439d36d4e30SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
440d36d4e30SBob Moore };
441d36d4e30SBob Moore 
442d36d4e30SBob Moore /* LPIT subtable header */
443d36d4e30SBob Moore 
444d36d4e30SBob Moore struct acpi_lpit_header {
445d36d4e30SBob Moore 	u32 type;		/* Subtable type */
446d36d4e30SBob Moore 	u32 length;		/* Subtable length */
447d36d4e30SBob Moore 	u16 unique_id;
448d36d4e30SBob Moore 	u16 reserved;
449d36d4e30SBob Moore 	u32 flags;
450d36d4e30SBob Moore };
451d36d4e30SBob Moore 
452d36d4e30SBob Moore /* Values for subtable Type above */
453d36d4e30SBob Moore 
454d36d4e30SBob Moore enum acpi_lpit_type {
455d36d4e30SBob Moore 	ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
4569ab8cf1bSBob Moore 	ACPI_LPIT_TYPE_RESERVED = 0x01	/* 1 and above are reserved */
457d36d4e30SBob Moore };
458d36d4e30SBob Moore 
459d36d4e30SBob Moore /* Masks for Flags field above  */
460d36d4e30SBob Moore 
461d36d4e30SBob Moore #define ACPI_LPIT_STATE_DISABLED    (1)
462d36d4e30SBob Moore #define ACPI_LPIT_NO_COUNTER        (1<<1)
463d36d4e30SBob Moore 
464d36d4e30SBob Moore /*
465d36d4e30SBob Moore  * LPIT subtables, correspond to Type in struct acpi_lpit_header
466d36d4e30SBob Moore  */
467d36d4e30SBob Moore 
468d36d4e30SBob Moore /* 0x00: Native C-state instruction based LPI structure */
469d36d4e30SBob Moore 
470d36d4e30SBob Moore struct acpi_lpit_native {
471d36d4e30SBob Moore 	struct acpi_lpit_header header;
472d36d4e30SBob Moore 	struct acpi_generic_address entry_trigger;
473d36d4e30SBob Moore 	u32 residency;
474d36d4e30SBob Moore 	u32 latency;
475d36d4e30SBob Moore 	struct acpi_generic_address residency_counter;
476d36d4e30SBob Moore 	u64 counter_frequency;
477d36d4e30SBob Moore };
478d36d4e30SBob Moore 
479d36d4e30SBob Moore /*******************************************************************************
480d36d4e30SBob Moore  *
481e62f8227SErik Schmauss  * MADT - Multiple APIC Description Table
482e62f8227SErik Schmauss  *        Version 3
483e62f8227SErik Schmauss  *
484e62f8227SErik Schmauss  ******************************************************************************/
485e62f8227SErik Schmauss 
486e62f8227SErik Schmauss struct acpi_table_madt {
487e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
488e62f8227SErik Schmauss 	u32 address;		/* Physical address of local APIC */
489e62f8227SErik Schmauss 	u32 flags;
490e62f8227SErik Schmauss };
491e62f8227SErik Schmauss 
492e62f8227SErik Schmauss /* Masks for Flags field above */
493e62f8227SErik Schmauss 
494e62f8227SErik Schmauss #define ACPI_MADT_PCAT_COMPAT       (1)	/* 00: System also has dual 8259s */
495e62f8227SErik Schmauss 
496e62f8227SErik Schmauss /* Values for PCATCompat flag */
497e62f8227SErik Schmauss 
498e62f8227SErik Schmauss #define ACPI_MADT_DUAL_PIC          1
499e62f8227SErik Schmauss #define ACPI_MADT_MULTIPLE_APIC     0
500e62f8227SErik Schmauss 
501e62f8227SErik Schmauss /* Values for MADT subtable type in struct acpi_subtable_header */
502e62f8227SErik Schmauss 
503e62f8227SErik Schmauss enum acpi_madt_type {
504e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC = 0,
505e62f8227SErik Schmauss 	ACPI_MADT_TYPE_IO_APIC = 1,
506e62f8227SErik Schmauss 	ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
507e62f8227SErik Schmauss 	ACPI_MADT_TYPE_NMI_SOURCE = 3,
508e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
509e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
510e62f8227SErik Schmauss 	ACPI_MADT_TYPE_IO_SAPIC = 6,
511e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
512e62f8227SErik Schmauss 	ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
513e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
514e62f8227SErik Schmauss 	ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
515e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
516e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
517e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
518e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
519e62f8227SErik Schmauss 	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
520e62f8227SErik Schmauss 	ACPI_MADT_TYPE_RESERVED = 16	/* 16 and greater are reserved */
521e62f8227SErik Schmauss };
522e62f8227SErik Schmauss 
523e62f8227SErik Schmauss /*
524e62f8227SErik Schmauss  * MADT Subtables, correspond to Type in struct acpi_subtable_header
525e62f8227SErik Schmauss  */
526e62f8227SErik Schmauss 
527e62f8227SErik Schmauss /* 0: Processor Local APIC */
528e62f8227SErik Schmauss 
529e62f8227SErik Schmauss struct acpi_madt_local_apic {
530e62f8227SErik Schmauss 	struct acpi_subtable_header header;
531e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
532e62f8227SErik Schmauss 	u8 id;			/* Processor's local APIC id */
533e62f8227SErik Schmauss 	u32 lapic_flags;
534e62f8227SErik Schmauss };
535e62f8227SErik Schmauss 
536e62f8227SErik Schmauss /* 1: IO APIC */
537e62f8227SErik Schmauss 
538e62f8227SErik Schmauss struct acpi_madt_io_apic {
539e62f8227SErik Schmauss 	struct acpi_subtable_header header;
540e62f8227SErik Schmauss 	u8 id;			/* I/O APIC ID */
541e62f8227SErik Schmauss 	u8 reserved;		/* reserved - must be zero */
542e62f8227SErik Schmauss 	u32 address;		/* APIC physical address */
543e62f8227SErik Schmauss 	u32 global_irq_base;	/* Global system interrupt where INTI lines start */
544e62f8227SErik Schmauss };
545e62f8227SErik Schmauss 
546e62f8227SErik Schmauss /* 2: Interrupt Override */
547e62f8227SErik Schmauss 
548e62f8227SErik Schmauss struct acpi_madt_interrupt_override {
549e62f8227SErik Schmauss 	struct acpi_subtable_header header;
550e62f8227SErik Schmauss 	u8 bus;			/* 0 - ISA */
551e62f8227SErik Schmauss 	u8 source_irq;		/* Interrupt source (IRQ) */
552e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
553e62f8227SErik Schmauss 	u16 inti_flags;
554e62f8227SErik Schmauss };
555e62f8227SErik Schmauss 
556e62f8227SErik Schmauss /* 3: NMI Source */
557e62f8227SErik Schmauss 
558e62f8227SErik Schmauss struct acpi_madt_nmi_source {
559e62f8227SErik Schmauss 	struct acpi_subtable_header header;
560e62f8227SErik Schmauss 	u16 inti_flags;
561e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
562e62f8227SErik Schmauss };
563e62f8227SErik Schmauss 
564e62f8227SErik Schmauss /* 4: Local APIC NMI */
565e62f8227SErik Schmauss 
566e62f8227SErik Schmauss struct acpi_madt_local_apic_nmi {
567e62f8227SErik Schmauss 	struct acpi_subtable_header header;
568e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
569e62f8227SErik Schmauss 	u16 inti_flags;
570e62f8227SErik Schmauss 	u8 lint;		/* LINTn to which NMI is connected */
571e62f8227SErik Schmauss };
572e62f8227SErik Schmauss 
573e62f8227SErik Schmauss /* 5: Address Override */
574e62f8227SErik Schmauss 
575e62f8227SErik Schmauss struct acpi_madt_local_apic_override {
576e62f8227SErik Schmauss 	struct acpi_subtable_header header;
577e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
578e62f8227SErik Schmauss 	u64 address;		/* APIC physical address */
579e62f8227SErik Schmauss };
580e62f8227SErik Schmauss 
581e62f8227SErik Schmauss /* 6: I/O Sapic */
582e62f8227SErik Schmauss 
583e62f8227SErik Schmauss struct acpi_madt_io_sapic {
584e62f8227SErik Schmauss 	struct acpi_subtable_header header;
585e62f8227SErik Schmauss 	u8 id;			/* I/O SAPIC ID */
586e62f8227SErik Schmauss 	u8 reserved;		/* Reserved, must be zero */
587e62f8227SErik Schmauss 	u32 global_irq_base;	/* Global interrupt for SAPIC start */
588e62f8227SErik Schmauss 	u64 address;		/* SAPIC physical address */
589e62f8227SErik Schmauss };
590e62f8227SErik Schmauss 
591e62f8227SErik Schmauss /* 7: Local Sapic */
592e62f8227SErik Schmauss 
593e62f8227SErik Schmauss struct acpi_madt_local_sapic {
594e62f8227SErik Schmauss 	struct acpi_subtable_header header;
595e62f8227SErik Schmauss 	u8 processor_id;	/* ACPI processor id */
596e62f8227SErik Schmauss 	u8 id;			/* SAPIC ID */
597e62f8227SErik Schmauss 	u8 eid;			/* SAPIC EID */
598e62f8227SErik Schmauss 	u8 reserved[3];		/* Reserved, must be zero */
599e62f8227SErik Schmauss 	u32 lapic_flags;
600e62f8227SErik Schmauss 	u32 uid;		/* Numeric UID - ACPI 3.0 */
601e62f8227SErik Schmauss 	char uid_string[1];	/* String UID  - ACPI 3.0 */
602e62f8227SErik Schmauss };
603e62f8227SErik Schmauss 
604e62f8227SErik Schmauss /* 8: Platform Interrupt Source */
605e62f8227SErik Schmauss 
606e62f8227SErik Schmauss struct acpi_madt_interrupt_source {
607e62f8227SErik Schmauss 	struct acpi_subtable_header header;
608e62f8227SErik Schmauss 	u16 inti_flags;
609e62f8227SErik Schmauss 	u8 type;		/* 1=PMI, 2=INIT, 3=corrected */
610e62f8227SErik Schmauss 	u8 id;			/* Processor ID */
611e62f8227SErik Schmauss 	u8 eid;			/* Processor EID */
612e62f8227SErik Schmauss 	u8 io_sapic_vector;	/* Vector value for PMI interrupts */
613e62f8227SErik Schmauss 	u32 global_irq;		/* Global system interrupt */
614e62f8227SErik Schmauss 	u32 flags;		/* Interrupt Source Flags */
615e62f8227SErik Schmauss };
616e62f8227SErik Schmauss 
617e62f8227SErik Schmauss /* Masks for Flags field above */
618e62f8227SErik Schmauss 
619e62f8227SErik Schmauss #define ACPI_MADT_CPEI_OVERRIDE     (1)
620e62f8227SErik Schmauss 
621e62f8227SErik Schmauss /* 9: Processor Local X2APIC (ACPI 4.0) */
622e62f8227SErik Schmauss 
623e62f8227SErik Schmauss struct acpi_madt_local_x2apic {
624e62f8227SErik Schmauss 	struct acpi_subtable_header header;
625e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
626e62f8227SErik Schmauss 	u32 local_apic_id;	/* Processor x2APIC ID  */
627e62f8227SErik Schmauss 	u32 lapic_flags;
628e62f8227SErik Schmauss 	u32 uid;		/* ACPI processor UID */
629e62f8227SErik Schmauss };
630e62f8227SErik Schmauss 
631e62f8227SErik Schmauss /* 10: Local X2APIC NMI (ACPI 4.0) */
632e62f8227SErik Schmauss 
633e62f8227SErik Schmauss struct acpi_madt_local_x2apic_nmi {
634e62f8227SErik Schmauss 	struct acpi_subtable_header header;
635e62f8227SErik Schmauss 	u16 inti_flags;
636e62f8227SErik Schmauss 	u32 uid;		/* ACPI processor UID */
637e62f8227SErik Schmauss 	u8 lint;		/* LINTn to which NMI is connected */
638e62f8227SErik Schmauss 	u8 reserved[3];		/* reserved - must be zero */
639e62f8227SErik Schmauss };
640e62f8227SErik Schmauss 
641e646e0a5SErik Schmauss /* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */
642e62f8227SErik Schmauss 
643e62f8227SErik Schmauss struct acpi_madt_generic_interrupt {
644e62f8227SErik Schmauss 	struct acpi_subtable_header header;
645e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
646e62f8227SErik Schmauss 	u32 cpu_interface_number;
647e62f8227SErik Schmauss 	u32 uid;
648e62f8227SErik Schmauss 	u32 flags;
649e62f8227SErik Schmauss 	u32 parking_version;
650e62f8227SErik Schmauss 	u32 performance_interrupt;
651e62f8227SErik Schmauss 	u64 parked_address;
652e62f8227SErik Schmauss 	u64 base_address;
653e62f8227SErik Schmauss 	u64 gicv_base_address;
654e62f8227SErik Schmauss 	u64 gich_base_address;
655e62f8227SErik Schmauss 	u32 vgic_interrupt;
656e62f8227SErik Schmauss 	u64 gicr_base_address;
657e62f8227SErik Schmauss 	u64 arm_mpidr;
658e62f8227SErik Schmauss 	u8 efficiency_class;
659e646e0a5SErik Schmauss 	u8 reserved2[1];
660e646e0a5SErik Schmauss 	u16 spe_interrupt;	/* ACPI 6.3 */
661e62f8227SErik Schmauss };
662e62f8227SErik Schmauss 
663e62f8227SErik Schmauss /* Masks for Flags field above */
664e62f8227SErik Schmauss 
665e62f8227SErik Schmauss /* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
666e62f8227SErik Schmauss #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)	/* 01: Performance Interrupt Mode */
667e62f8227SErik Schmauss #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)	/* 02: VGIC Maintenance Interrupt mode */
668e62f8227SErik Schmauss 
669e62f8227SErik Schmauss /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
670e62f8227SErik Schmauss 
671e62f8227SErik Schmauss struct acpi_madt_generic_distributor {
672e62f8227SErik Schmauss 	struct acpi_subtable_header header;
673e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
674e62f8227SErik Schmauss 	u32 gic_id;
675e62f8227SErik Schmauss 	u64 base_address;
676e62f8227SErik Schmauss 	u32 global_irq_base;
677e62f8227SErik Schmauss 	u8 version;
678e62f8227SErik Schmauss 	u8 reserved2[3];	/* reserved - must be zero */
679e62f8227SErik Schmauss };
680e62f8227SErik Schmauss 
681e62f8227SErik Schmauss /* Values for Version field above */
682e62f8227SErik Schmauss 
683e62f8227SErik Schmauss enum acpi_madt_gic_version {
684e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_NONE = 0,
685e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V1 = 1,
686e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V2 = 2,
687e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V3 = 3,
688e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_V4 = 4,
689e62f8227SErik Schmauss 	ACPI_MADT_GIC_VERSION_RESERVED = 5	/* 5 and greater are reserved */
690e62f8227SErik Schmauss };
691e62f8227SErik Schmauss 
692e62f8227SErik Schmauss /* 13: Generic MSI Frame (ACPI 5.1) */
693e62f8227SErik Schmauss 
694e62f8227SErik Schmauss struct acpi_madt_generic_msi_frame {
695e62f8227SErik Schmauss 	struct acpi_subtable_header header;
696e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
697e62f8227SErik Schmauss 	u32 msi_frame_id;
698e62f8227SErik Schmauss 	u64 base_address;
699e62f8227SErik Schmauss 	u32 flags;
700e62f8227SErik Schmauss 	u16 spi_count;
701e62f8227SErik Schmauss 	u16 spi_base;
702e62f8227SErik Schmauss };
703e62f8227SErik Schmauss 
704e62f8227SErik Schmauss /* Masks for Flags field above */
705e62f8227SErik Schmauss 
706e62f8227SErik Schmauss #define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
707e62f8227SErik Schmauss 
708e62f8227SErik Schmauss /* 14: Generic Redistributor (ACPI 5.1) */
709e62f8227SErik Schmauss 
710e62f8227SErik Schmauss struct acpi_madt_generic_redistributor {
711e62f8227SErik Schmauss 	struct acpi_subtable_header header;
712e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
713e62f8227SErik Schmauss 	u64 base_address;
714e62f8227SErik Schmauss 	u32 length;
715e62f8227SErik Schmauss };
716e62f8227SErik Schmauss 
717e62f8227SErik Schmauss /* 15: Generic Translator (ACPI 6.0) */
718e62f8227SErik Schmauss 
719e62f8227SErik Schmauss struct acpi_madt_generic_translator {
720e62f8227SErik Schmauss 	struct acpi_subtable_header header;
721e62f8227SErik Schmauss 	u16 reserved;		/* reserved - must be zero */
722e62f8227SErik Schmauss 	u32 translation_id;
723e62f8227SErik Schmauss 	u64 base_address;
724e62f8227SErik Schmauss 	u32 reserved2;
725e62f8227SErik Schmauss };
726e62f8227SErik Schmauss 
727e62f8227SErik Schmauss /*
728e62f8227SErik Schmauss  * Common flags fields for MADT subtables
729e62f8227SErik Schmauss  */
730e62f8227SErik Schmauss 
731e62f8227SErik Schmauss /* MADT Local APIC flags */
732e62f8227SErik Schmauss 
733e62f8227SErik Schmauss #define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if set */
734e62f8227SErik Schmauss 
735e62f8227SErik Schmauss /* MADT MPS INTI flags (inti_flags) */
736e62f8227SErik Schmauss 
737e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_MASK     (3)	/* 00-01: Polarity of APIC I/O input signals */
738e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_MASK      (3<<2)	/* 02-03: Trigger mode of APIC input signals */
739e62f8227SErik Schmauss 
740e62f8227SErik Schmauss /* Values for MPS INTI flags */
741e62f8227SErik Schmauss 
742e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_CONFORMS       0
743e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
744e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_RESERVED       2
745e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
746e62f8227SErik Schmauss 
747e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_CONFORMS        (0)
748e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
749e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
750e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
751e62f8227SErik Schmauss 
752e62f8227SErik Schmauss /*******************************************************************************
753e62f8227SErik Schmauss  *
7541a49b72cSBob Moore  * MCFG - PCI Memory Mapped Configuration table and subtable
7556e2d5ebdSBob Moore  *        Version 1
7566e2d5ebdSBob Moore  *
7576e2d5ebdSBob Moore  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
758b24aad44SBob Moore  *
759b24aad44SBob Moore  ******************************************************************************/
760b24aad44SBob Moore 
761b24aad44SBob Moore struct acpi_table_mcfg {
762b24aad44SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
763b24aad44SBob Moore 	u8 reserved[8];
764b24aad44SBob Moore };
765b24aad44SBob Moore 
766b24aad44SBob Moore /* Subtable */
767b24aad44SBob Moore 
768b24aad44SBob Moore struct acpi_mcfg_allocation {
769b24aad44SBob Moore 	u64 address;		/* Base address, processor-relative */
770b24aad44SBob Moore 	u16 pci_segment;	/* PCI segment group number */
771b24aad44SBob Moore 	u8 start_bus_number;	/* Starting PCI Bus number */
772b24aad44SBob Moore 	u8 end_bus_number;	/* Final PCI Bus number */
773b24aad44SBob Moore 	u32 reserved;
774b24aad44SBob Moore };
775b24aad44SBob Moore 
776b24aad44SBob Moore /*******************************************************************************
777b24aad44SBob Moore  *
7780e264f0bSBob Moore  * MCHI - Management Controller Host Interface Table
7790e264f0bSBob Moore  *        Version 1
7800e264f0bSBob Moore  *
7810e264f0bSBob Moore  * Conforms to "Management Component Transport Protocol (MCTP) Host
7820e264f0bSBob Moore  * Interface Specification", Revision 1.0.0a, October 13, 2009
7830e264f0bSBob Moore  *
7840e264f0bSBob Moore  ******************************************************************************/
7850e264f0bSBob Moore 
7860e264f0bSBob Moore struct acpi_table_mchi {
7870e264f0bSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
7880e264f0bSBob Moore 	u8 interface_type;
7890e264f0bSBob Moore 	u8 protocol;
7900e264f0bSBob Moore 	u64 protocol_data;
7910e264f0bSBob Moore 	u8 interrupt_type;
7920e264f0bSBob Moore 	u8 gpe;
7930e264f0bSBob Moore 	u8 pci_device_flag;
7940e264f0bSBob Moore 	u32 global_interrupt;
7950e264f0bSBob Moore 	struct acpi_generic_address control_register;
7960e264f0bSBob Moore 	u8 pci_segment;
7970e264f0bSBob Moore 	u8 pci_bus;
7980e264f0bSBob Moore 	u8 pci_device;
7990e264f0bSBob Moore 	u8 pci_function;
8000e264f0bSBob Moore };
8010e264f0bSBob Moore 
8020e264f0bSBob Moore /*******************************************************************************
8030e264f0bSBob Moore  *
804e62f8227SErik Schmauss  * MPST - Memory Power State Table (ACPI 5.0)
805e62f8227SErik Schmauss  *        Version 1
806e62f8227SErik Schmauss  *
807e62f8227SErik Schmauss  ******************************************************************************/
808e62f8227SErik Schmauss 
809e62f8227SErik Schmauss #define ACPI_MPST_CHANNEL_INFO \
810e62f8227SErik Schmauss 	u8                              channel_id; \
811e62f8227SErik Schmauss 	u8                              reserved1[3]; \
812e62f8227SErik Schmauss 	u16                             power_node_count; \
813e62f8227SErik Schmauss 	u16                             reserved2;
814e62f8227SErik Schmauss 
815e62f8227SErik Schmauss /* Main table */
816e62f8227SErik Schmauss 
817e62f8227SErik Schmauss struct acpi_table_mpst {
818e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
819e62f8227SErik Schmauss 	 ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
820e62f8227SErik Schmauss };
821e62f8227SErik Schmauss 
822e62f8227SErik Schmauss /* Memory Platform Communication Channel Info */
823e62f8227SErik Schmauss 
824e62f8227SErik Schmauss struct acpi_mpst_channel {
825e62f8227SErik Schmauss 	ACPI_MPST_CHANNEL_INFO	/* Platform Communication Channel */
826e62f8227SErik Schmauss };
827e62f8227SErik Schmauss 
828e62f8227SErik Schmauss /* Memory Power Node Structure */
829e62f8227SErik Schmauss 
830e62f8227SErik Schmauss struct acpi_mpst_power_node {
831e62f8227SErik Schmauss 	u8 flags;
832e62f8227SErik Schmauss 	u8 reserved1;
833e62f8227SErik Schmauss 	u16 node_id;
834e62f8227SErik Schmauss 	u32 length;
835e62f8227SErik Schmauss 	u64 range_address;
836e62f8227SErik Schmauss 	u64 range_length;
837e62f8227SErik Schmauss 	u32 num_power_states;
838e62f8227SErik Schmauss 	u32 num_physical_components;
839e62f8227SErik Schmauss };
840e62f8227SErik Schmauss 
841e62f8227SErik Schmauss /* Values for Flags field above */
842e62f8227SErik Schmauss 
843e62f8227SErik Schmauss #define ACPI_MPST_ENABLED               1
844e62f8227SErik Schmauss #define ACPI_MPST_POWER_MANAGED         2
845e62f8227SErik Schmauss #define ACPI_MPST_HOT_PLUG_CAPABLE      4
846e62f8227SErik Schmauss 
847e62f8227SErik Schmauss /* Memory Power State Structure (follows POWER_NODE above) */
848e62f8227SErik Schmauss 
849e62f8227SErik Schmauss struct acpi_mpst_power_state {
850e62f8227SErik Schmauss 	u8 power_state;
851e62f8227SErik Schmauss 	u8 info_index;
852e62f8227SErik Schmauss };
853e62f8227SErik Schmauss 
854e62f8227SErik Schmauss /* Physical Component ID Structure (follows POWER_STATE above) */
855e62f8227SErik Schmauss 
856e62f8227SErik Schmauss struct acpi_mpst_component {
857e62f8227SErik Schmauss 	u16 component_id;
858e62f8227SErik Schmauss };
859e62f8227SErik Schmauss 
860e62f8227SErik Schmauss /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
861e62f8227SErik Schmauss 
862e62f8227SErik Schmauss struct acpi_mpst_data_hdr {
863e62f8227SErik Schmauss 	u16 characteristics_count;
864e62f8227SErik Schmauss 	u16 reserved;
865e62f8227SErik Schmauss };
866e62f8227SErik Schmauss 
867e62f8227SErik Schmauss struct acpi_mpst_power_data {
868e62f8227SErik Schmauss 	u8 structure_id;
869e62f8227SErik Schmauss 	u8 flags;
870e62f8227SErik Schmauss 	u16 reserved1;
871e62f8227SErik Schmauss 	u32 average_power;
872e62f8227SErik Schmauss 	u32 power_saving;
873e62f8227SErik Schmauss 	u64 exit_latency;
874e62f8227SErik Schmauss 	u64 reserved2;
875e62f8227SErik Schmauss };
876e62f8227SErik Schmauss 
877e62f8227SErik Schmauss /* Values for Flags field above */
878e62f8227SErik Schmauss 
879e62f8227SErik Schmauss #define ACPI_MPST_PRESERVE              1
880e62f8227SErik Schmauss #define ACPI_MPST_AUTOENTRY             2
881e62f8227SErik Schmauss #define ACPI_MPST_AUTOEXIT              4
882e62f8227SErik Schmauss 
883e62f8227SErik Schmauss /* Shared Memory Region (not part of an ACPI table) */
884e62f8227SErik Schmauss 
885e62f8227SErik Schmauss struct acpi_mpst_shared {
886e62f8227SErik Schmauss 	u32 signature;
887e62f8227SErik Schmauss 	u16 pcc_command;
888e62f8227SErik Schmauss 	u16 pcc_status;
889e62f8227SErik Schmauss 	u32 command_register;
890e62f8227SErik Schmauss 	u32 status_register;
891e62f8227SErik Schmauss 	u32 power_state_id;
892e62f8227SErik Schmauss 	u32 power_node_id;
893e62f8227SErik Schmauss 	u64 energy_consumed;
894e62f8227SErik Schmauss 	u64 average_power;
895e62f8227SErik Schmauss };
896e62f8227SErik Schmauss 
897e62f8227SErik Schmauss /*******************************************************************************
898e62f8227SErik Schmauss  *
899e62f8227SErik Schmauss  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
900e62f8227SErik Schmauss  *        Version 1
901e62f8227SErik Schmauss  *
902e62f8227SErik Schmauss  ******************************************************************************/
903e62f8227SErik Schmauss 
904e62f8227SErik Schmauss struct acpi_table_msct {
905e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
906e62f8227SErik Schmauss 	u32 proximity_offset;	/* Location of proximity info struct(s) */
907e62f8227SErik Schmauss 	u32 max_proximity_domains;	/* Max number of proximity domains */
908e62f8227SErik Schmauss 	u32 max_clock_domains;	/* Max number of clock domains */
909e62f8227SErik Schmauss 	u64 max_address;	/* Max physical address in system */
910e62f8227SErik Schmauss };
911e62f8227SErik Schmauss 
912e62f8227SErik Schmauss /* subtable - Maximum Proximity Domain Information. Version 1 */
913e62f8227SErik Schmauss 
914e62f8227SErik Schmauss struct acpi_msct_proximity {
915e62f8227SErik Schmauss 	u8 revision;
916e62f8227SErik Schmauss 	u8 length;
917e62f8227SErik Schmauss 	u32 range_start;	/* Start of domain range */
918e62f8227SErik Schmauss 	u32 range_end;		/* End of domain range */
919e62f8227SErik Schmauss 	u32 processor_capacity;
920e62f8227SErik Schmauss 	u64 memory_capacity;	/* In bytes */
921e62f8227SErik Schmauss };
922e62f8227SErik Schmauss 
923e62f8227SErik Schmauss /*******************************************************************************
924e62f8227SErik Schmauss  *
9255132f2faSBob Moore  * MSDM - Microsoft Data Management table
9265132f2faSBob Moore  *
9275132f2faSBob Moore  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
9285132f2faSBob Moore  * November 29, 2011. Copyright 2011 Microsoft
9295132f2faSBob Moore  *
9305132f2faSBob Moore  ******************************************************************************/
9315132f2faSBob Moore 
9325132f2faSBob Moore /* Basic MSDM table is only the common ACPI header */
9335132f2faSBob Moore 
9345132f2faSBob Moore struct acpi_table_msdm {
9355132f2faSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
9365132f2faSBob Moore };
9375132f2faSBob Moore 
9385132f2faSBob Moore /*******************************************************************************
9395132f2faSBob Moore  *
94098b5c993SLv Zheng  * MTMR - MID Timer Table
94198b5c993SLv Zheng  *        Version 1
94298b5c993SLv Zheng  *
94398b5c993SLv Zheng  * Conforms to "Simple Firmware Interface Specification",
94498b5c993SLv Zheng  * Draft 0.8.2, Oct 19, 2010
94598b5c993SLv Zheng  * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
94698b5c993SLv Zheng  *
94798b5c993SLv Zheng  ******************************************************************************/
94898b5c993SLv Zheng 
94998b5c993SLv Zheng struct acpi_table_mtmr {
95098b5c993SLv Zheng 	struct acpi_table_header header;	/* Common ACPI table header */
95198b5c993SLv Zheng };
95298b5c993SLv Zheng 
95398b5c993SLv Zheng /* MTMR entry */
95498b5c993SLv Zheng 
95598b5c993SLv Zheng struct acpi_mtmr_entry {
95698b5c993SLv Zheng 	struct acpi_generic_address physical_address;
95798b5c993SLv Zheng 	u32 frequency;
95898b5c993SLv Zheng 	u32 irq;
95998b5c993SLv Zheng };
96098b5c993SLv Zheng 
96198b5c993SLv Zheng /*******************************************************************************
96298b5c993SLv Zheng  *
963e62f8227SErik Schmauss  * NFIT - NVDIMM Interface Table (ACPI 6.0+)
964e62f8227SErik Schmauss  *        Version 1
965e62f8227SErik Schmauss  *
966e62f8227SErik Schmauss  ******************************************************************************/
967e62f8227SErik Schmauss 
968e62f8227SErik Schmauss struct acpi_table_nfit {
969e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
970e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
971e62f8227SErik Schmauss };
972e62f8227SErik Schmauss 
973e62f8227SErik Schmauss /* Subtable header for NFIT */
974e62f8227SErik Schmauss 
975e62f8227SErik Schmauss struct acpi_nfit_header {
976e62f8227SErik Schmauss 	u16 type;
977e62f8227SErik Schmauss 	u16 length;
978e62f8227SErik Schmauss };
979e62f8227SErik Schmauss 
980e62f8227SErik Schmauss /* Values for subtable type in struct acpi_nfit_header */
981e62f8227SErik Schmauss 
982e62f8227SErik Schmauss enum acpi_nfit_type {
983e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
984e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_MEMORY_MAP = 1,
985e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_INTERLEAVE = 2,
986e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_SMBIOS = 3,
987e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_CONTROL_REGION = 4,
988e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_DATA_REGION = 5,
989e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
990e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_CAPABILITIES = 7,
991e62f8227SErik Schmauss 	ACPI_NFIT_TYPE_RESERVED = 8	/* 8 and greater are reserved */
992e62f8227SErik Schmauss };
993e62f8227SErik Schmauss 
994e62f8227SErik Schmauss /*
995e62f8227SErik Schmauss  * NFIT Subtables
996e62f8227SErik Schmauss  */
997e62f8227SErik Schmauss 
998e62f8227SErik Schmauss /* 0: System Physical Address Range Structure */
999e62f8227SErik Schmauss 
1000e62f8227SErik Schmauss struct acpi_nfit_system_address {
1001e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1002e62f8227SErik Schmauss 	u16 range_index;
1003e62f8227SErik Schmauss 	u16 flags;
1004e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
1005e62f8227SErik Schmauss 	u32 proximity_domain;
1006e62f8227SErik Schmauss 	u8 range_guid[16];
1007e62f8227SErik Schmauss 	u64 address;
1008e62f8227SErik Schmauss 	u64 length;
1009e62f8227SErik Schmauss 	u64 memory_mapping;
1010e62f8227SErik Schmauss };
1011e62f8227SErik Schmauss 
1012e62f8227SErik Schmauss /* Flags */
1013e62f8227SErik Schmauss 
1014e62f8227SErik Schmauss #define ACPI_NFIT_ADD_ONLINE_ONLY       (1)	/* 00: Add/Online Operation Only */
1015e62f8227SErik Schmauss #define ACPI_NFIT_PROXIMITY_VALID       (1<<1)	/* 01: Proximity Domain Valid */
1016e62f8227SErik Schmauss 
1017e62f8227SErik Schmauss /* Range Type GUIDs appear in the include/acuuid.h file */
1018e62f8227SErik Schmauss 
1019e62f8227SErik Schmauss /* 1: Memory Device to System Address Range Map Structure */
1020e62f8227SErik Schmauss 
1021e62f8227SErik Schmauss struct acpi_nfit_memory_map {
1022e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1023e62f8227SErik Schmauss 	u32 device_handle;
1024e62f8227SErik Schmauss 	u16 physical_id;
1025e62f8227SErik Schmauss 	u16 region_id;
1026e62f8227SErik Schmauss 	u16 range_index;
1027e62f8227SErik Schmauss 	u16 region_index;
1028e62f8227SErik Schmauss 	u64 region_size;
1029e62f8227SErik Schmauss 	u64 region_offset;
1030e62f8227SErik Schmauss 	u64 address;
1031e62f8227SErik Schmauss 	u16 interleave_index;
1032e62f8227SErik Schmauss 	u16 interleave_ways;
1033e62f8227SErik Schmauss 	u16 flags;
1034e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
1035e62f8227SErik Schmauss };
1036e62f8227SErik Schmauss 
1037e62f8227SErik Schmauss /* Flags */
1038e62f8227SErik Schmauss 
1039e62f8227SErik Schmauss #define ACPI_NFIT_MEM_SAVE_FAILED       (1)	/* 00: Last SAVE to Memory Device failed */
1040e62f8227SErik Schmauss #define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)	/* 01: Last RESTORE from Memory Device failed */
1041e62f8227SErik Schmauss #define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)	/* 02: Platform flush failed */
1042e62f8227SErik Schmauss #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device is not armed */
1043e62f8227SErik Schmauss #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device observed SMART/health events */
1044e62f8227SErik Schmauss #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health events enabled */
1045e62f8227SErik Schmauss #define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to SPA failed */
1046e62f8227SErik Schmauss 
1047e62f8227SErik Schmauss /* 2: Interleave Structure */
1048e62f8227SErik Schmauss 
1049e62f8227SErik Schmauss struct acpi_nfit_interleave {
1050e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1051e62f8227SErik Schmauss 	u16 interleave_index;
1052e62f8227SErik Schmauss 	u16 reserved;		/* Reserved, must be zero */
1053e62f8227SErik Schmauss 	u32 line_count;
1054e62f8227SErik Schmauss 	u32 line_size;
1055e62f8227SErik Schmauss 	u32 line_offset[1];	/* Variable length */
1056e62f8227SErik Schmauss };
1057e62f8227SErik Schmauss 
1058e62f8227SErik Schmauss /* 3: SMBIOS Management Information Structure */
1059e62f8227SErik Schmauss 
1060e62f8227SErik Schmauss struct acpi_nfit_smbios {
1061e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1062e62f8227SErik Schmauss 	u32 reserved;		/* Reserved, must be zero */
1063e62f8227SErik Schmauss 	u8 data[1];		/* Variable length */
1064e62f8227SErik Schmauss };
1065e62f8227SErik Schmauss 
1066e62f8227SErik Schmauss /* 4: NVDIMM Control Region Structure */
1067e62f8227SErik Schmauss 
1068e62f8227SErik Schmauss struct acpi_nfit_control_region {
1069e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1070e62f8227SErik Schmauss 	u16 region_index;
1071e62f8227SErik Schmauss 	u16 vendor_id;
1072e62f8227SErik Schmauss 	u16 device_id;
1073e62f8227SErik Schmauss 	u16 revision_id;
1074e62f8227SErik Schmauss 	u16 subsystem_vendor_id;
1075e62f8227SErik Schmauss 	u16 subsystem_device_id;
1076e62f8227SErik Schmauss 	u16 subsystem_revision_id;
1077e62f8227SErik Schmauss 	u8 valid_fields;
1078e62f8227SErik Schmauss 	u8 manufacturing_location;
1079e62f8227SErik Schmauss 	u16 manufacturing_date;
1080e62f8227SErik Schmauss 	u8 reserved[2];		/* Reserved, must be zero */
1081e62f8227SErik Schmauss 	u32 serial_number;
1082e62f8227SErik Schmauss 	u16 code;
1083e62f8227SErik Schmauss 	u16 windows;
1084e62f8227SErik Schmauss 	u64 window_size;
1085e62f8227SErik Schmauss 	u64 command_offset;
1086e62f8227SErik Schmauss 	u64 command_size;
1087e62f8227SErik Schmauss 	u64 status_offset;
1088e62f8227SErik Schmauss 	u64 status_size;
1089e62f8227SErik Schmauss 	u16 flags;
1090e62f8227SErik Schmauss 	u8 reserved1[6];	/* Reserved, must be zero */
1091e62f8227SErik Schmauss };
1092e62f8227SErik Schmauss 
1093e62f8227SErik Schmauss /* Flags */
1094e62f8227SErik Schmauss 
1095e62f8227SErik Schmauss #define ACPI_NFIT_CONTROL_BUFFERED          (1)	/* Block Data Windows implementation is buffered */
1096e62f8227SErik Schmauss 
1097e62f8227SErik Schmauss /* valid_fields bits */
1098e62f8227SErik Schmauss 
1099e62f8227SErik Schmauss #define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)	/* Manufacturing fields are valid */
1100e62f8227SErik Schmauss 
1101e62f8227SErik Schmauss /* 5: NVDIMM Block Data Window Region Structure */
1102e62f8227SErik Schmauss 
1103e62f8227SErik Schmauss struct acpi_nfit_data_region {
1104e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1105e62f8227SErik Schmauss 	u16 region_index;
1106e62f8227SErik Schmauss 	u16 windows;
1107e62f8227SErik Schmauss 	u64 offset;
1108e62f8227SErik Schmauss 	u64 size;
1109e62f8227SErik Schmauss 	u64 capacity;
1110e62f8227SErik Schmauss 	u64 start_address;
1111e62f8227SErik Schmauss };
1112e62f8227SErik Schmauss 
1113e62f8227SErik Schmauss /* 6: Flush Hint Address Structure */
1114e62f8227SErik Schmauss 
1115e62f8227SErik Schmauss struct acpi_nfit_flush_address {
1116e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1117e62f8227SErik Schmauss 	u32 device_handle;
1118e62f8227SErik Schmauss 	u16 hint_count;
1119e62f8227SErik Schmauss 	u8 reserved[6];		/* Reserved, must be zero */
1120e62f8227SErik Schmauss 	u64 hint_address[1];	/* Variable length */
1121e62f8227SErik Schmauss };
1122e62f8227SErik Schmauss 
1123e62f8227SErik Schmauss /* 7: Platform Capabilities Structure */
1124e62f8227SErik Schmauss 
1125e62f8227SErik Schmauss struct acpi_nfit_capabilities {
1126e62f8227SErik Schmauss 	struct acpi_nfit_header header;
1127e62f8227SErik Schmauss 	u8 highest_capability;
1128e62f8227SErik Schmauss 	u8 reserved[3];		/* Reserved, must be zero */
1129e62f8227SErik Schmauss 	u32 capabilities;
1130e62f8227SErik Schmauss 	u32 reserved2;
1131e62f8227SErik Schmauss };
1132e62f8227SErik Schmauss 
1133e62f8227SErik Schmauss /* Capabilities Flags */
1134e62f8227SErik Schmauss 
1135e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH       (1)	/* 00: Cache Flush to NVDIMM capable */
1136e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_MEM_FLUSH         (1<<1)	/* 01: Memory Flush to NVDIMM capable */
1137e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING     (1<<2)	/* 02: Memory Mirroring capable */
1138e62f8227SErik Schmauss 
1139e62f8227SErik Schmauss /*
1140e62f8227SErik Schmauss  * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
1141e62f8227SErik Schmauss  */
1142e62f8227SErik Schmauss struct nfit_device_handle {
1143e62f8227SErik Schmauss 	u32 handle;
1144e62f8227SErik Schmauss };
1145e62f8227SErik Schmauss 
1146e62f8227SErik Schmauss /* Device handle construction and extraction macros */
1147e62f8227SErik Schmauss 
1148e62f8227SErik Schmauss #define ACPI_NFIT_DIMM_NUMBER_MASK              0x0000000F
1149e62f8227SErik Schmauss #define ACPI_NFIT_CHANNEL_NUMBER_MASK           0x000000F0
1150e62f8227SErik Schmauss #define ACPI_NFIT_MEMORY_ID_MASK                0x00000F00
1151e62f8227SErik Schmauss #define ACPI_NFIT_SOCKET_ID_MASK                0x0000F000
1152e62f8227SErik Schmauss #define ACPI_NFIT_NODE_ID_MASK                  0x0FFF0000
1153e62f8227SErik Schmauss 
1154e62f8227SErik Schmauss #define ACPI_NFIT_DIMM_NUMBER_OFFSET            0
1155e62f8227SErik Schmauss #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET         4
1156e62f8227SErik Schmauss #define ACPI_NFIT_MEMORY_ID_OFFSET              8
1157e62f8227SErik Schmauss #define ACPI_NFIT_SOCKET_ID_OFFSET              12
1158e62f8227SErik Schmauss #define ACPI_NFIT_NODE_ID_OFFSET                16
1159e62f8227SErik Schmauss 
1160e62f8227SErik Schmauss /* Macro to construct a NFIT/NVDIMM device handle */
1161e62f8227SErik Schmauss 
1162e62f8227SErik Schmauss #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
1163e62f8227SErik Schmauss 	((dimm)                                         | \
1164e62f8227SErik Schmauss 	((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET)  | \
1165e62f8227SErik Schmauss 	((memory)  << ACPI_NFIT_MEMORY_ID_OFFSET)       | \
1166e62f8227SErik Schmauss 	((socket)  << ACPI_NFIT_SOCKET_ID_OFFSET)       | \
1167e62f8227SErik Schmauss 	((node)    << ACPI_NFIT_NODE_ID_OFFSET))
1168e62f8227SErik Schmauss 
1169e62f8227SErik Schmauss /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
1170e62f8227SErik Schmauss 
1171e62f8227SErik Schmauss #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
1172e62f8227SErik Schmauss 	((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
1173e62f8227SErik Schmauss 
1174e62f8227SErik Schmauss #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
1175e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
1176e62f8227SErik Schmauss 
1177e62f8227SErik Schmauss #define ACPI_NFIT_GET_MEMORY_ID(handle) \
1178e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_MEMORY_ID_MASK)      >> ACPI_NFIT_MEMORY_ID_OFFSET)
1179e62f8227SErik Schmauss 
1180e62f8227SErik Schmauss #define ACPI_NFIT_GET_SOCKET_ID(handle) \
1181e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_SOCKET_ID_MASK)      >> ACPI_NFIT_SOCKET_ID_OFFSET)
1182e62f8227SErik Schmauss 
1183e62f8227SErik Schmauss #define ACPI_NFIT_GET_NODE_ID(handle) \
1184e62f8227SErik Schmauss 	(((handle) & ACPI_NFIT_NODE_ID_MASK)        >> ACPI_NFIT_NODE_ID_OFFSET)
1185e62f8227SErik Schmauss 
1186e62f8227SErik Schmauss /*******************************************************************************
1187e62f8227SErik Schmauss  *
1188e62f8227SErik Schmauss  * PCCT - Platform Communications Channel Table (ACPI 5.0)
1189e62f8227SErik Schmauss  *        Version 2 (ACPI 6.2)
1190e62f8227SErik Schmauss  *
1191e62f8227SErik Schmauss  ******************************************************************************/
1192e62f8227SErik Schmauss 
1193e62f8227SErik Schmauss struct acpi_table_pcct {
1194e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1195e62f8227SErik Schmauss 	u32 flags;
1196e62f8227SErik Schmauss 	u64 reserved;
1197e62f8227SErik Schmauss };
1198e62f8227SErik Schmauss 
1199e62f8227SErik Schmauss /* Values for Flags field above */
1200e62f8227SErik Schmauss 
1201e62f8227SErik Schmauss #define ACPI_PCCT_DOORBELL              1
1202e62f8227SErik Schmauss 
1203e62f8227SErik Schmauss /* Values for subtable type in struct acpi_subtable_header */
1204e62f8227SErik Schmauss 
1205e62f8227SErik Schmauss enum acpi_pcct_type {
1206e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
1207e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
1208e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2,	/* ACPI 6.1 */
1209e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3,	/* ACPI 6.2 */
1210e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4,	/* ACPI 6.2 */
1211e62f8227SErik Schmauss 	ACPI_PCCT_TYPE_RESERVED = 5	/* 5 and greater are reserved */
1212e62f8227SErik Schmauss };
1213e62f8227SErik Schmauss 
1214e62f8227SErik Schmauss /*
1215e62f8227SErik Schmauss  * PCCT Subtables, correspond to Type in struct acpi_subtable_header
1216e62f8227SErik Schmauss  */
1217e62f8227SErik Schmauss 
1218e62f8227SErik Schmauss /* 0: Generic Communications Subspace */
1219e62f8227SErik Schmauss 
1220e62f8227SErik Schmauss struct acpi_pcct_subspace {
1221e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1222e62f8227SErik Schmauss 	u8 reserved[6];
1223e62f8227SErik Schmauss 	u64 base_address;
1224e62f8227SErik Schmauss 	u64 length;
1225e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1226e62f8227SErik Schmauss 	u64 preserve_mask;
1227e62f8227SErik Schmauss 	u64 write_mask;
1228e62f8227SErik Schmauss 	u32 latency;
1229e62f8227SErik Schmauss 	u32 max_access_rate;
1230e62f8227SErik Schmauss 	u16 min_turnaround_time;
1231e62f8227SErik Schmauss };
1232e62f8227SErik Schmauss 
1233e62f8227SErik Schmauss /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
1234e62f8227SErik Schmauss 
1235e62f8227SErik Schmauss struct acpi_pcct_hw_reduced {
1236e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1237e62f8227SErik Schmauss 	u32 platform_interrupt;
1238e62f8227SErik Schmauss 	u8 flags;
1239e62f8227SErik Schmauss 	u8 reserved;
1240e62f8227SErik Schmauss 	u64 base_address;
1241e62f8227SErik Schmauss 	u64 length;
1242e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1243e62f8227SErik Schmauss 	u64 preserve_mask;
1244e62f8227SErik Schmauss 	u64 write_mask;
1245e62f8227SErik Schmauss 	u32 latency;
1246e62f8227SErik Schmauss 	u32 max_access_rate;
1247e62f8227SErik Schmauss 	u16 min_turnaround_time;
1248e62f8227SErik Schmauss };
1249e62f8227SErik Schmauss 
1250e62f8227SErik Schmauss /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
1251e62f8227SErik Schmauss 
1252e62f8227SErik Schmauss struct acpi_pcct_hw_reduced_type2 {
1253e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1254e62f8227SErik Schmauss 	u32 platform_interrupt;
1255e62f8227SErik Schmauss 	u8 flags;
1256e62f8227SErik Schmauss 	u8 reserved;
1257e62f8227SErik Schmauss 	u64 base_address;
1258e62f8227SErik Schmauss 	u64 length;
1259e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1260e62f8227SErik Schmauss 	u64 preserve_mask;
1261e62f8227SErik Schmauss 	u64 write_mask;
1262e62f8227SErik Schmauss 	u32 latency;
1263e62f8227SErik Schmauss 	u32 max_access_rate;
1264e62f8227SErik Schmauss 	u16 min_turnaround_time;
1265e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
1266e62f8227SErik Schmauss 	u64 ack_preserve_mask;
1267e62f8227SErik Schmauss 	u64 ack_write_mask;
1268e62f8227SErik Schmauss };
1269e62f8227SErik Schmauss 
1270e62f8227SErik Schmauss /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
1271e62f8227SErik Schmauss 
1272e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_master {
1273e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1274e62f8227SErik Schmauss 	u32 platform_interrupt;
1275e62f8227SErik Schmauss 	u8 flags;
1276e62f8227SErik Schmauss 	u8 reserved1;
1277e62f8227SErik Schmauss 	u64 base_address;
1278e62f8227SErik Schmauss 	u32 length;
1279e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1280e62f8227SErik Schmauss 	u64 preserve_mask;
1281e62f8227SErik Schmauss 	u64 write_mask;
1282e62f8227SErik Schmauss 	u32 latency;
1283e62f8227SErik Schmauss 	u32 max_access_rate;
1284e62f8227SErik Schmauss 	u32 min_turnaround_time;
1285e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
1286e62f8227SErik Schmauss 	u64 ack_preserve_mask;
1287e62f8227SErik Schmauss 	u64 ack_set_mask;
1288e62f8227SErik Schmauss 	u64 reserved2;
1289e62f8227SErik Schmauss 	struct acpi_generic_address cmd_complete_register;
1290e62f8227SErik Schmauss 	u64 cmd_complete_mask;
1291e62f8227SErik Schmauss 	struct acpi_generic_address cmd_update_register;
1292e62f8227SErik Schmauss 	u64 cmd_update_preserve_mask;
1293e62f8227SErik Schmauss 	u64 cmd_update_set_mask;
1294e62f8227SErik Schmauss 	struct acpi_generic_address error_status_register;
1295e62f8227SErik Schmauss 	u64 error_status_mask;
1296e62f8227SErik Schmauss };
1297e62f8227SErik Schmauss 
1298e62f8227SErik Schmauss /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
1299e62f8227SErik Schmauss 
1300e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_slave {
1301e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1302e62f8227SErik Schmauss 	u32 platform_interrupt;
1303e62f8227SErik Schmauss 	u8 flags;
1304e62f8227SErik Schmauss 	u8 reserved1;
1305e62f8227SErik Schmauss 	u64 base_address;
1306e62f8227SErik Schmauss 	u32 length;
1307e62f8227SErik Schmauss 	struct acpi_generic_address doorbell_register;
1308e62f8227SErik Schmauss 	u64 preserve_mask;
1309e62f8227SErik Schmauss 	u64 write_mask;
1310e62f8227SErik Schmauss 	u32 latency;
1311e62f8227SErik Schmauss 	u32 max_access_rate;
1312e62f8227SErik Schmauss 	u32 min_turnaround_time;
1313e62f8227SErik Schmauss 	struct acpi_generic_address platform_ack_register;
1314e62f8227SErik Schmauss 	u64 ack_preserve_mask;
1315e62f8227SErik Schmauss 	u64 ack_set_mask;
1316e62f8227SErik Schmauss 	u64 reserved2;
1317e62f8227SErik Schmauss 	struct acpi_generic_address cmd_complete_register;
1318e62f8227SErik Schmauss 	u64 cmd_complete_mask;
1319e62f8227SErik Schmauss 	struct acpi_generic_address cmd_update_register;
1320e62f8227SErik Schmauss 	u64 cmd_update_preserve_mask;
1321e62f8227SErik Schmauss 	u64 cmd_update_set_mask;
1322e62f8227SErik Schmauss 	struct acpi_generic_address error_status_register;
1323e62f8227SErik Schmauss 	u64 error_status_mask;
1324e62f8227SErik Schmauss };
1325e62f8227SErik Schmauss 
1326e62f8227SErik Schmauss /* Values for doorbell flags above */
1327e62f8227SErik Schmauss 
1328e62f8227SErik Schmauss #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
1329e62f8227SErik Schmauss #define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
1330e62f8227SErik Schmauss 
1331e62f8227SErik Schmauss /*
1332e62f8227SErik Schmauss  * PCC memory structures (not part of the ACPI table)
1333e62f8227SErik Schmauss  */
1334e62f8227SErik Schmauss 
1335e62f8227SErik Schmauss /* Shared Memory Region */
1336e62f8227SErik Schmauss 
1337e62f8227SErik Schmauss struct acpi_pcct_shared_memory {
1338e62f8227SErik Schmauss 	u32 signature;
1339e62f8227SErik Schmauss 	u16 command;
1340e62f8227SErik Schmauss 	u16 status;
1341e62f8227SErik Schmauss };
1342e62f8227SErik Schmauss 
1343e62f8227SErik Schmauss /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
1344e62f8227SErik Schmauss 
1345e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_shared_memory {
1346e62f8227SErik Schmauss 	u32 signature;
1347e62f8227SErik Schmauss 	u32 flags;
1348e62f8227SErik Schmauss 	u32 length;
1349e62f8227SErik Schmauss 	u32 command;
1350e62f8227SErik Schmauss };
1351e62f8227SErik Schmauss 
1352e62f8227SErik Schmauss /*******************************************************************************
1353e62f8227SErik Schmauss  *
1354e62f8227SErik Schmauss  * PDTT - Platform Debug Trigger Table (ACPI 6.2)
1355e62f8227SErik Schmauss  *        Version 0
1356e62f8227SErik Schmauss  *
1357e62f8227SErik Schmauss  ******************************************************************************/
1358e62f8227SErik Schmauss 
1359e62f8227SErik Schmauss struct acpi_table_pdtt {
1360e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1361e62f8227SErik Schmauss 	u8 trigger_count;
1362e62f8227SErik Schmauss 	u8 reserved[3];
1363e62f8227SErik Schmauss 	u32 array_offset;
1364e62f8227SErik Schmauss };
1365e62f8227SErik Schmauss 
1366e62f8227SErik Schmauss /*
1367e62f8227SErik Schmauss  * PDTT Communication Channel Identifier Structure.
1368e62f8227SErik Schmauss  * The number of these structures is defined by trigger_count above,
1369e62f8227SErik Schmauss  * starting at array_offset.
1370e62f8227SErik Schmauss  */
1371e62f8227SErik Schmauss struct acpi_pdtt_channel {
1372e62f8227SErik Schmauss 	u8 subchannel_id;
1373e62f8227SErik Schmauss 	u8 flags;
1374e62f8227SErik Schmauss };
1375e62f8227SErik Schmauss 
1376e62f8227SErik Schmauss /* Flags for above */
1377e62f8227SErik Schmauss 
1378e62f8227SErik Schmauss #define ACPI_PDTT_RUNTIME_TRIGGER           (1)
1379e62f8227SErik Schmauss #define ACPI_PDTT_WAIT_COMPLETION           (1<<1)
1380f00175d0SErik Schmauss #define ACPI_PDTT_TRIGGER_ORDER             (1<<2)
1381e62f8227SErik Schmauss 
1382e62f8227SErik Schmauss /*******************************************************************************
1383e62f8227SErik Schmauss  *
1384e62f8227SErik Schmauss  * PMTT - Platform Memory Topology Table (ACPI 5.0)
1385e62f8227SErik Schmauss  *        Version 1
1386e62f8227SErik Schmauss  *
1387e62f8227SErik Schmauss  ******************************************************************************/
1388e62f8227SErik Schmauss 
1389e62f8227SErik Schmauss struct acpi_table_pmtt {
1390e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1391e62f8227SErik Schmauss 	u32 reserved;
1392e62f8227SErik Schmauss };
1393e62f8227SErik Schmauss 
1394e62f8227SErik Schmauss /* Common header for PMTT subtables that follow main table */
1395e62f8227SErik Schmauss 
1396e62f8227SErik Schmauss struct acpi_pmtt_header {
1397e62f8227SErik Schmauss 	u8 type;
1398e62f8227SErik Schmauss 	u8 reserved1;
1399e62f8227SErik Schmauss 	u16 length;
1400e62f8227SErik Schmauss 	u16 flags;
1401e62f8227SErik Schmauss 	u16 reserved2;
1402e62f8227SErik Schmauss };
1403e62f8227SErik Schmauss 
1404e62f8227SErik Schmauss /* Values for Type field above */
1405e62f8227SErik Schmauss 
1406e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_SOCKET           0
1407e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_CONTROLLER       1
1408e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_DIMM             2
1409e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_RESERVED         3	/* 0x03-0xFF are reserved */
1410e62f8227SErik Schmauss 
1411e62f8227SErik Schmauss /* Values for Flags field above */
1412e62f8227SErik Schmauss 
1413e62f8227SErik Schmauss #define ACPI_PMTT_TOP_LEVEL             0x0001
1414e62f8227SErik Schmauss #define ACPI_PMTT_PHYSICAL              0x0002
1415e62f8227SErik Schmauss #define ACPI_PMTT_MEMORY_TYPE           0x000C
1416e62f8227SErik Schmauss 
1417e62f8227SErik Schmauss /*
1418e62f8227SErik Schmauss  * PMTT subtables, correspond to Type in struct acpi_pmtt_header
1419e62f8227SErik Schmauss  */
1420e62f8227SErik Schmauss 
1421e62f8227SErik Schmauss /* 0: Socket Structure */
1422e62f8227SErik Schmauss 
1423e62f8227SErik Schmauss struct acpi_pmtt_socket {
1424e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
1425e62f8227SErik Schmauss 	u16 socket_id;
1426e62f8227SErik Schmauss 	u16 reserved;
1427e62f8227SErik Schmauss };
1428e62f8227SErik Schmauss 
1429e62f8227SErik Schmauss /* 1: Memory Controller subtable */
1430e62f8227SErik Schmauss 
1431e62f8227SErik Schmauss struct acpi_pmtt_controller {
1432e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
1433e62f8227SErik Schmauss 	u32 read_latency;
1434e62f8227SErik Schmauss 	u32 write_latency;
1435e62f8227SErik Schmauss 	u32 read_bandwidth;
1436e62f8227SErik Schmauss 	u32 write_bandwidth;
1437e62f8227SErik Schmauss 	u16 access_width;
1438e62f8227SErik Schmauss 	u16 alignment;
1439e62f8227SErik Schmauss 	u16 reserved;
1440e62f8227SErik Schmauss 	u16 domain_count;
1441e62f8227SErik Schmauss };
1442e62f8227SErik Schmauss 
1443e62f8227SErik Schmauss /* 1a: Proximity Domain substructure */
1444e62f8227SErik Schmauss 
1445e62f8227SErik Schmauss struct acpi_pmtt_domain {
1446e62f8227SErik Schmauss 	u32 proximity_domain;
1447e62f8227SErik Schmauss };
1448e62f8227SErik Schmauss 
1449e62f8227SErik Schmauss /* 2: Physical Component Identifier (DIMM) */
1450e62f8227SErik Schmauss 
1451e62f8227SErik Schmauss struct acpi_pmtt_physical_component {
1452e62f8227SErik Schmauss 	struct acpi_pmtt_header header;
1453e62f8227SErik Schmauss 	u16 component_id;
1454e62f8227SErik Schmauss 	u16 reserved;
1455e62f8227SErik Schmauss 	u32 memory_size;
1456e62f8227SErik Schmauss 	u32 bios_handle;
1457e62f8227SErik Schmauss };
1458e62f8227SErik Schmauss 
1459e62f8227SErik Schmauss /*******************************************************************************
1460e62f8227SErik Schmauss  *
1461e62f8227SErik Schmauss  * PPTT - Processor Properties Topology Table (ACPI 6.2)
1462e62f8227SErik Schmauss  *        Version 1
1463e62f8227SErik Schmauss  *
1464e62f8227SErik Schmauss  ******************************************************************************/
1465e62f8227SErik Schmauss 
1466e62f8227SErik Schmauss struct acpi_table_pptt {
1467e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1468e62f8227SErik Schmauss };
1469e62f8227SErik Schmauss 
1470e62f8227SErik Schmauss /* Values for Type field above */
1471e62f8227SErik Schmauss 
1472e62f8227SErik Schmauss enum acpi_pptt_type {
1473e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_PROCESSOR = 0,
1474e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_CACHE = 1,
1475e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_ID = 2,
1476e62f8227SErik Schmauss 	ACPI_PPTT_TYPE_RESERVED = 3
1477e62f8227SErik Schmauss };
1478e62f8227SErik Schmauss 
1479e62f8227SErik Schmauss /* 0: Processor Hierarchy Node Structure */
1480e62f8227SErik Schmauss 
1481e62f8227SErik Schmauss struct acpi_pptt_processor {
1482e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1483e62f8227SErik Schmauss 	u16 reserved;
1484e62f8227SErik Schmauss 	u32 flags;
1485e62f8227SErik Schmauss 	u32 parent;
1486e62f8227SErik Schmauss 	u32 acpi_processor_id;
1487e62f8227SErik Schmauss 	u32 number_of_priv_resources;
1488e62f8227SErik Schmauss };
1489e62f8227SErik Schmauss 
1490e62f8227SErik Schmauss /* Flags */
1491e62f8227SErik Schmauss 
1492b5eab512SErik Schmauss #define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
1493b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1<<1)
1494b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1<<2)	/* ACPI 6.3 */
1495b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_LEAF_NODE            (1<<3)	/* ACPI 6.3 */
1496b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_IDENTICAL            (1<<4)	/* ACPI 6.3 */
1497e62f8227SErik Schmauss 
1498e62f8227SErik Schmauss /* 1: Cache Type Structure */
1499e62f8227SErik Schmauss 
1500e62f8227SErik Schmauss struct acpi_pptt_cache {
1501e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1502e62f8227SErik Schmauss 	u16 reserved;
1503e62f8227SErik Schmauss 	u32 flags;
1504e62f8227SErik Schmauss 	u32 next_level_of_cache;
1505e62f8227SErik Schmauss 	u32 size;
1506e62f8227SErik Schmauss 	u32 number_of_sets;
1507e62f8227SErik Schmauss 	u8 associativity;
1508e62f8227SErik Schmauss 	u8 attributes;
1509e62f8227SErik Schmauss 	u16 line_size;
1510e62f8227SErik Schmauss };
1511e62f8227SErik Schmauss 
1512e62f8227SErik Schmauss /* Flags */
1513e62f8227SErik Schmauss 
1514e62f8227SErik Schmauss #define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)	/* Physical property valid */
1515e62f8227SErik Schmauss #define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)	/* Number of sets valid */
1516e62f8227SErik Schmauss #define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)	/* Associativity valid */
1517e62f8227SErik Schmauss #define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)	/* Allocation type valid */
1518e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)	/* Cache type valid */
1519e62f8227SErik Schmauss #define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)	/* Write policy valid */
1520e62f8227SErik Schmauss #define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)	/* Line size valid */
1521e62f8227SErik Schmauss 
1522e62f8227SErik Schmauss /* Masks for Attributes */
1523e62f8227SErik Schmauss 
1524e62f8227SErik Schmauss #define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)	/* Allocation type */
1525e62f8227SErik Schmauss #define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)	/* Cache type */
1526e62f8227SErik Schmauss #define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)	/* Write policy */
1527e62f8227SErik Schmauss 
1528e62f8227SErik Schmauss /* Attributes describing cache */
1529e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)	/* Cache line is allocated on read */
1530e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)	/* Cache line is allocated on write */
1531e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)	/* Cache line is allocated on read and write */
1532e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)	/* Alternate representation of above */
1533e62f8227SErik Schmauss 
1534e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)	/* Data cache */
1535e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)	/* Instruction cache */
1536e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)	/* Unified I & D cache */
1537e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)	/* Alternate representation of above */
1538e62f8227SErik Schmauss 
1539e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_POLICY_WB           (0x0)	/* Cache is write back */
1540e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)	/* Cache is write through */
1541e62f8227SErik Schmauss 
1542e62f8227SErik Schmauss /* 2: ID Structure */
1543e62f8227SErik Schmauss 
1544e62f8227SErik Schmauss struct acpi_pptt_id {
1545e62f8227SErik Schmauss 	struct acpi_subtable_header header;
1546e62f8227SErik Schmauss 	u16 reserved;
1547e62f8227SErik Schmauss 	u32 vendor_id;
1548e62f8227SErik Schmauss 	u64 level1_id;
1549e62f8227SErik Schmauss 	u64 level2_id;
1550e62f8227SErik Schmauss 	u16 major_rev;
1551e62f8227SErik Schmauss 	u16 minor_rev;
1552e62f8227SErik Schmauss 	u16 spin_rev;
1553e62f8227SErik Schmauss };
1554e62f8227SErik Schmauss 
1555e62f8227SErik Schmauss /*******************************************************************************
1556e62f8227SErik Schmauss  *
1557e62f8227SErik Schmauss  * RASF - RAS Feature Table (ACPI 5.0)
1558e62f8227SErik Schmauss  *        Version 1
1559e62f8227SErik Schmauss  *
1560e62f8227SErik Schmauss  ******************************************************************************/
1561e62f8227SErik Schmauss 
1562e62f8227SErik Schmauss struct acpi_table_rasf {
1563e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1564e62f8227SErik Schmauss 	u8 channel_id[12];
1565e62f8227SErik Schmauss };
1566e62f8227SErik Schmauss 
1567e62f8227SErik Schmauss /* RASF Platform Communication Channel Shared Memory Region */
1568e62f8227SErik Schmauss 
1569e62f8227SErik Schmauss struct acpi_rasf_shared_memory {
1570e62f8227SErik Schmauss 	u32 signature;
1571e62f8227SErik Schmauss 	u16 command;
1572e62f8227SErik Schmauss 	u16 status;
1573e62f8227SErik Schmauss 	u16 version;
1574e62f8227SErik Schmauss 	u8 capabilities[16];
1575e62f8227SErik Schmauss 	u8 set_capabilities[16];
1576e62f8227SErik Schmauss 	u16 num_parameter_blocks;
1577e62f8227SErik Schmauss 	u32 set_capabilities_status;
1578e62f8227SErik Schmauss };
1579e62f8227SErik Schmauss 
1580e62f8227SErik Schmauss /* RASF Parameter Block Structure Header */
1581e62f8227SErik Schmauss 
1582e62f8227SErik Schmauss struct acpi_rasf_parameter_block {
1583e62f8227SErik Schmauss 	u16 type;
1584e62f8227SErik Schmauss 	u16 version;
1585e62f8227SErik Schmauss 	u16 length;
1586e62f8227SErik Schmauss };
1587e62f8227SErik Schmauss 
1588e62f8227SErik Schmauss /* RASF Parameter Block Structure for PATROL_SCRUB */
1589e62f8227SErik Schmauss 
1590e62f8227SErik Schmauss struct acpi_rasf_patrol_scrub_parameter {
1591e62f8227SErik Schmauss 	struct acpi_rasf_parameter_block header;
1592e62f8227SErik Schmauss 	u16 patrol_scrub_command;
1593e62f8227SErik Schmauss 	u64 requested_address_range[2];
1594e62f8227SErik Schmauss 	u64 actual_address_range[2];
1595e62f8227SErik Schmauss 	u16 flags;
1596e62f8227SErik Schmauss 	u8 requested_speed;
1597e62f8227SErik Schmauss };
1598e62f8227SErik Schmauss 
1599e62f8227SErik Schmauss /* Masks for Flags and Speed fields above */
1600e62f8227SErik Schmauss 
1601e62f8227SErik Schmauss #define ACPI_RASF_SCRUBBER_RUNNING      1
1602e62f8227SErik Schmauss #define ACPI_RASF_SPEED                 (7<<1)
1603e62f8227SErik Schmauss #define ACPI_RASF_SPEED_SLOW            (0<<1)
1604e62f8227SErik Schmauss #define ACPI_RASF_SPEED_MEDIUM          (4<<1)
1605e62f8227SErik Schmauss #define ACPI_RASF_SPEED_FAST            (7<<1)
1606e62f8227SErik Schmauss 
1607e62f8227SErik Schmauss /* Channel Commands */
1608e62f8227SErik Schmauss 
1609e62f8227SErik Schmauss enum acpi_rasf_commands {
1610e62f8227SErik Schmauss 	ACPI_RASF_EXECUTE_RASF_COMMAND = 1
1611e62f8227SErik Schmauss };
1612e62f8227SErik Schmauss 
1613e62f8227SErik Schmauss /* Platform RAS Capabilities */
1614e62f8227SErik Schmauss 
1615e62f8227SErik Schmauss enum acpi_rasf_capabiliities {
1616e62f8227SErik Schmauss 	ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
1617e62f8227SErik Schmauss 	ACPI_SW_PATROL_SCRUB_EXPOSED = 1
1618e62f8227SErik Schmauss };
1619e62f8227SErik Schmauss 
1620e62f8227SErik Schmauss /* Patrol Scrub Commands */
1621e62f8227SErik Schmauss 
1622e62f8227SErik Schmauss enum acpi_rasf_patrol_scrub_commands {
1623e62f8227SErik Schmauss 	ACPI_RASF_GET_PATROL_PARAMETERS = 1,
1624e62f8227SErik Schmauss 	ACPI_RASF_START_PATROL_SCRUBBER = 2,
1625e62f8227SErik Schmauss 	ACPI_RASF_STOP_PATROL_SCRUBBER = 3
1626e62f8227SErik Schmauss };
1627e62f8227SErik Schmauss 
1628e62f8227SErik Schmauss /* Channel Command flags */
1629e62f8227SErik Schmauss 
1630e62f8227SErik Schmauss #define ACPI_RASF_GENERATE_SCI          (1<<15)
1631e62f8227SErik Schmauss 
1632e62f8227SErik Schmauss /* Status values */
1633e62f8227SErik Schmauss 
1634e62f8227SErik Schmauss enum acpi_rasf_status {
1635e62f8227SErik Schmauss 	ACPI_RASF_SUCCESS = 0,
1636e62f8227SErik Schmauss 	ACPI_RASF_NOT_VALID = 1,
1637e62f8227SErik Schmauss 	ACPI_RASF_NOT_SUPPORTED = 2,
1638e62f8227SErik Schmauss 	ACPI_RASF_BUSY = 3,
1639e62f8227SErik Schmauss 	ACPI_RASF_FAILED = 4,
1640e62f8227SErik Schmauss 	ACPI_RASF_ABORTED = 5,
1641e62f8227SErik Schmauss 	ACPI_RASF_INVALID_DATA = 6
1642e62f8227SErik Schmauss };
1643e62f8227SErik Schmauss 
1644e62f8227SErik Schmauss /* Status flags */
1645e62f8227SErik Schmauss 
1646e62f8227SErik Schmauss #define ACPI_RASF_COMMAND_COMPLETE      (1)
1647e62f8227SErik Schmauss #define ACPI_RASF_SCI_DOORBELL          (1<<1)
1648e62f8227SErik Schmauss #define ACPI_RASF_ERROR                 (1<<2)
1649e62f8227SErik Schmauss #define ACPI_RASF_STATUS                (0x1F<<3)
1650e62f8227SErik Schmauss 
1651e62f8227SErik Schmauss /*******************************************************************************
1652e62f8227SErik Schmauss  *
1653e62f8227SErik Schmauss  * SBST - Smart Battery Specification Table
1654e62f8227SErik Schmauss  *        Version 1
1655e62f8227SErik Schmauss  *
1656e62f8227SErik Schmauss  ******************************************************************************/
1657e62f8227SErik Schmauss 
1658e62f8227SErik Schmauss struct acpi_table_sbst {
1659e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1660e62f8227SErik Schmauss 	u32 warning_level;
1661e62f8227SErik Schmauss 	u32 low_level;
1662e62f8227SErik Schmauss 	u32 critical_level;
1663e62f8227SErik Schmauss };
1664e62f8227SErik Schmauss 
1665e62f8227SErik Schmauss /*******************************************************************************
1666e62f8227SErik Schmauss  *
16673bd38469SJames Morse  * SDEI - Software Delegated Exception Interface Descriptor Table
16683bd38469SJames Morse  *
16693bd38469SJames Morse  * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
16703bd38469SJames Morse  * May 8th, 2017. Copyright 2017 ARM Ltd.
16713bd38469SJames Morse  *
16723bd38469SJames Morse  ******************************************************************************/
16733bd38469SJames Morse 
16743bd38469SJames Morse struct acpi_table_sdei {
16753bd38469SJames Morse 	struct acpi_table_header header;	/* Common ACPI table header */
16763bd38469SJames Morse };
16773bd38469SJames Morse 
16783bd38469SJames Morse /*******************************************************************************
16793bd38469SJames Morse  *
1680e62f8227SErik Schmauss  * SDEV - Secure Devices Table (ACPI 6.2)
1681e62f8227SErik Schmauss  *        Version 1
16825cf4d733SBob Moore  *
16835cf4d733SBob Moore  ******************************************************************************/
16845cf4d733SBob Moore 
1685e62f8227SErik Schmauss struct acpi_table_sdev {
16865cf4d733SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
16875cf4d733SBob Moore };
16885cf4d733SBob Moore 
1689e62f8227SErik Schmauss struct acpi_sdev_header {
1690e62f8227SErik Schmauss 	u8 type;
1691e62f8227SErik Schmauss 	u8 flags;
1692e62f8227SErik Schmauss 	u16 length;
1693b24aad44SBob Moore };
1694b24aad44SBob Moore 
1695e62f8227SErik Schmauss /* Values for subtable type above */
16966e2d5ebdSBob Moore 
1697e62f8227SErik Schmauss enum acpi_sdev_type {
1698e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
1699e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
1700e62f8227SErik Schmauss 	ACPI_SDEV_TYPE_RESERVED = 2	/* 2 and greater are reserved */
17016e2d5ebdSBob Moore };
17026e2d5ebdSBob Moore 
1703e62f8227SErik Schmauss /* Values for flags above */
17046e2d5ebdSBob Moore 
1705e62f8227SErik Schmauss #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS    (1)
170615a61aa1SBob Moore 
170715a61aa1SBob Moore /*
1708e62f8227SErik Schmauss  * SDEV subtables
170915a61aa1SBob Moore  */
171015a61aa1SBob Moore 
1711e62f8227SErik Schmauss /* 0: Namespace Device Based Secure Device Structure */
1712e62f8227SErik Schmauss 
1713e62f8227SErik Schmauss struct acpi_sdev_namespace {
1714e62f8227SErik Schmauss 	struct acpi_sdev_header header;
1715e62f8227SErik Schmauss 	u16 device_id_offset;
1716e62f8227SErik Schmauss 	u16 device_id_length;
1717e62f8227SErik Schmauss 	u16 vendor_data_offset;
1718e62f8227SErik Schmauss 	u16 vendor_data_length;
1719b24aad44SBob Moore };
1720b24aad44SBob Moore 
1721e62f8227SErik Schmauss /* 1: PCIe Endpoint Device Based Device Structure */
1722e62f8227SErik Schmauss 
1723e62f8227SErik Schmauss struct acpi_sdev_pcie {
1724e62f8227SErik Schmauss 	struct acpi_sdev_header header;
1725e62f8227SErik Schmauss 	u16 segment;
1726e62f8227SErik Schmauss 	u16 start_bus;
1727e62f8227SErik Schmauss 	u16 path_offset;
1728e62f8227SErik Schmauss 	u16 path_length;
1729e62f8227SErik Schmauss 	u16 vendor_data_offset;
1730e62f8227SErik Schmauss 	u16 vendor_data_length;
1731e62f8227SErik Schmauss };
1732e62f8227SErik Schmauss 
1733e62f8227SErik Schmauss /* 1a: PCIe Endpoint path entry */
1734e62f8227SErik Schmauss 
1735e62f8227SErik Schmauss struct acpi_sdev_pcie_path {
17369005694eSBob Moore 	u8 device;
17379005694eSBob Moore 	u8 function;
17389005694eSBob Moore };
17399005694eSBob Moore 
17406e596084SRobert Moore /* Reset to default packing */
17416e596084SRobert Moore 
17426e596084SRobert Moore #pragma pack()
1743b24aad44SBob Moore 
1744b24aad44SBob Moore #endif				/* __ACTBL2_H__ */
1745