xref: /openbmc/linux/include/acpi/actbl1.h (revision 6399878f)
195857638SErik Schmauss /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
21da177e4SLinus Torvalds /******************************************************************************
31da177e4SLinus Torvalds  *
4793c2388SBob Moore  * Name: actbl1.h - Additional ACPI table definitions
51da177e4SLinus Torvalds  *
6612c2932SBob Moore  * Copyright (C) 2000 - 2023, Intel Corp.
71da177e4SLinus Torvalds  *
895857638SErik Schmauss  *****************************************************************************/
91da177e4SLinus Torvalds 
101da177e4SLinus Torvalds #ifndef __ACTBL1_H__
111da177e4SLinus Torvalds #define __ACTBL1_H__
121da177e4SLinus Torvalds 
13793c2388SBob Moore /*******************************************************************************
14793c2388SBob Moore  *
15e62f8227SErik Schmauss  * Additional ACPI Tables
16793c2388SBob Moore  *
17793c2388SBob Moore  * These tables are not consumed directly by the ACPICA subsystem, but are
18793c2388SBob Moore  * included here to support device drivers and the AML disassembler.
19793c2388SBob Moore  *
20793c2388SBob Moore  ******************************************************************************/
21793c2388SBob Moore 
22793c2388SBob 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.
26793c2388SBob Moore  */
27e692fa13SBob Moore #define ACPI_SIG_AEST           "AEST"	/* Arm Error Source Table */
28e62f8227SErik Schmauss #define ACPI_SIG_ASF            "ASF!"	/* Alert Standard Format table */
29f5325cb1SJeremi Piotrowski #define ACPI_SIG_ASPT           "ASPT"	/* AMD Secure Processor Table */
30970d9c9eSBob Moore #define ACPI_SIG_BERT           "BERT"	/* Boot Error Record Table */
31e62f8227SErik Schmauss #define ACPI_SIG_BGRT           "BGRT"	/* Boot Graphics Resource Table */
32e62f8227SErik Schmauss #define ACPI_SIG_BOOT           "BOOT"	/* Simple Boot Flag Table */
337c5eab72SBen Widawsky #define ACPI_SIG_CEDT           "CEDT"	/* CXL Early Discovery Table */
34793c2388SBob Moore #define ACPI_SIG_CPEP           "CPEP"	/* Corrected Platform Error Polling table */
35e62f8227SErik Schmauss #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resource Table */
36e62f8227SErik Schmauss #define ACPI_SIG_DBG2           "DBG2"	/* Debug Port table type 2 */
37e62f8227SErik Schmauss #define ACPI_SIG_DBGP           "DBGP"	/* Debug Port table */
38e62f8227SErik Schmauss #define ACPI_SIG_DMAR           "DMAR"	/* DMA Remapping table */
39e62f8227SErik Schmauss #define ACPI_SIG_DRTM           "DRTM"	/* Dynamic Root of Trust for Measurement table */
40793c2388SBob Moore #define ACPI_SIG_ECDT           "ECDT"	/* Embedded Controller Boot Resources Table */
41970d9c9eSBob Moore #define ACPI_SIG_EINJ           "EINJ"	/* Error Injection table */
42970d9c9eSBob Moore #define ACPI_SIG_ERST           "ERST"	/* Error Record Serialization Table */
43e62f8227SErik Schmauss #define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance Data Table */
44e62f8227SErik Schmauss #define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer Description Table */
45970d9c9eSBob Moore #define ACPI_SIG_HEST           "HEST"	/* Hardware Error Source Table */
46e62f8227SErik Schmauss #define ACPI_SIG_HMAT           "HMAT"	/* Heterogeneous Memory Attributes Table */
47e62f8227SErik Schmauss #define ACPI_SIG_HPET           "HPET"	/* High Precision Event Timer table */
48e62f8227SErik Schmauss #define ACPI_SIG_IBFT           "IBFT"	/* iSCSI Boot Firmware Table */
4951aad1a6SBob Moore #define ACPI_SIG_MSCT           "MSCT"	/* Maximum System Characteristics Table */
50e62f8227SErik Schmauss 
51e62f8227SErik Schmauss #define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
52e62f8227SErik Schmauss #define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
53e62f8227SErik Schmauss 
546ad90f71SStuart Hayes #define ACPI_SIG_NBFT		"NBFT"	/* NVMe Boot Firmware Table */
556ad90f71SStuart Hayes 
56e62f8227SErik Schmauss /* Reserved table signatures */
57e62f8227SErik Schmauss 
58e62f8227SErik Schmauss #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
59e62f8227SErik Schmauss #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
60e62f8227SErik Schmauss 
61e62f8227SErik Schmauss /*
62e62f8227SErik Schmauss  * These tables have been seen in the field, but no definition has been found
63e62f8227SErik Schmauss  */
64e62f8227SErik Schmauss #ifdef ACPI_UNDEFINED_TABLES
65e62f8227SErik Schmauss #define ACPI_SIG_ATKG           "ATKG"
66e62f8227SErik Schmauss #define ACPI_SIG_GSCI           "GSCI"	/* GMCH SCI table */
67e62f8227SErik Schmauss #define ACPI_SIG_IEIT           "IEIT"
68e62f8227SErik Schmauss #endif
69793c2388SBob Moore 
70793c2388SBob Moore /*
71793c2388SBob Moore  * All tables must be byte-packed to match the ACPI specification, since
72793c2388SBob Moore  * the tables are provided by the system BIOS.
73793c2388SBob Moore  */
741da177e4SLinus Torvalds #pragma pack(1)
751da177e4SLinus Torvalds 
761da177e4SLinus Torvalds /*
77be030a57SBob Moore  * Note: C bitfields are not used for this reason:
78be030a57SBob Moore  *
79be030a57SBob Moore  * "Bitfields are great and easy to read, but unfortunately the C language
80be030a57SBob Moore  * does not specify the layout of bitfields in memory, which means they are
81be030a57SBob Moore  * essentially useless for dealing with packed data in on-disk formats or
82be030a57SBob Moore  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
83be030a57SBob Moore  * this decision was a design error in C. Ritchie could have picked an order
84be030a57SBob Moore  * and stuck with it." Norman Ramsey.
85be030a57SBob Moore  * See http://stackoverflow.com/a/1053662/41661
861da177e4SLinus Torvalds  */
87793c2388SBob Moore 
886e2d5ebdSBob Moore /*******************************************************************************
896e2d5ebdSBob Moore  *
906e2d5ebdSBob Moore  * Common subtable headers
916e2d5ebdSBob Moore  *
926e2d5ebdSBob Moore  ******************************************************************************/
936e2d5ebdSBob Moore 
946e2d5ebdSBob Moore /* Generic subtable header (used in MADT, SRAT, etc.) */
95f3d2e786SBob Moore 
96f3d2e786SBob Moore struct acpi_subtable_header {
97f3d2e786SBob Moore 	u8 type;
98f3d2e786SBob Moore 	u8 length;
99f3d2e786SBob Moore };
100f3d2e786SBob Moore 
1016e2d5ebdSBob Moore /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
102970d9c9eSBob Moore 
103970d9c9eSBob Moore struct acpi_whea_header {
104970d9c9eSBob Moore 	u8 action;
105970d9c9eSBob Moore 	u8 instruction;
106970d9c9eSBob Moore 	u8 flags;
107970d9c9eSBob Moore 	u8 reserved;
108970d9c9eSBob Moore 	struct acpi_generic_address register_region;
1093fa34777SBob Moore 	u64 value;		/* Value used with Read/Write register */
1103fa34777SBob Moore 	u64 mask;		/* Bitmask required for this register instruction */
111970d9c9eSBob Moore };
112970d9c9eSBob Moore 
113f5325cb1SJeremi Piotrowski /* https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/acpitabl/ns-acpitabl-aspt_table */
114f5325cb1SJeremi Piotrowski #define ASPT_REVISION_ID 0x01
115f5325cb1SJeremi Piotrowski struct acpi_table_aspt {
116f5325cb1SJeremi Piotrowski 	struct acpi_table_header header;
117f5325cb1SJeremi Piotrowski 	u32 num_entries;
118f5325cb1SJeremi Piotrowski };
119f5325cb1SJeremi Piotrowski 
120f5325cb1SJeremi Piotrowski struct acpi_aspt_header {
121f5325cb1SJeremi Piotrowski 	u16 type;
122f5325cb1SJeremi Piotrowski 	u16 length;
123f5325cb1SJeremi Piotrowski };
124f5325cb1SJeremi Piotrowski 
125f5325cb1SJeremi Piotrowski enum acpi_aspt_type {
126f5325cb1SJeremi Piotrowski 	ACPI_ASPT_TYPE_GLOBAL_REGS = 0,
127f5325cb1SJeremi Piotrowski 	ACPI_ASPT_TYPE_SEV_MBOX_REGS = 1,
128f5325cb1SJeremi Piotrowski 	ACPI_ASPT_TYPE_ACPI_MBOX_REGS = 2,
129f5325cb1SJeremi Piotrowski };
130f5325cb1SJeremi Piotrowski 
131f5325cb1SJeremi Piotrowski /* 0: ASPT Global Registers */
132f5325cb1SJeremi Piotrowski struct acpi_aspt_global_regs {
133f5325cb1SJeremi Piotrowski 	struct acpi_aspt_header header;
134f5325cb1SJeremi Piotrowski 	u32 reserved;
135f5325cb1SJeremi Piotrowski 	u64 feature_reg_addr;
136f5325cb1SJeremi Piotrowski 	u64 irq_en_reg_addr;
137f5325cb1SJeremi Piotrowski 	u64 irq_st_reg_addr;
138f5325cb1SJeremi Piotrowski };
139f5325cb1SJeremi Piotrowski 
140f5325cb1SJeremi Piotrowski /* 1: ASPT SEV Mailbox Registers */
141f5325cb1SJeremi Piotrowski struct acpi_aspt_sev_mbox_regs {
142f5325cb1SJeremi Piotrowski 	struct acpi_aspt_header header;
143f5325cb1SJeremi Piotrowski 	u8 mbox_irq_id;
144f5325cb1SJeremi Piotrowski 	u8 reserved[3];
145f5325cb1SJeremi Piotrowski 	u64 cmd_resp_reg_addr;
146f5325cb1SJeremi Piotrowski 	u64 cmd_buf_lo_reg_addr;
147f5325cb1SJeremi Piotrowski 	u64 cmd_buf_hi_reg_addr;
148f5325cb1SJeremi Piotrowski };
149f5325cb1SJeremi Piotrowski 
150f5325cb1SJeremi Piotrowski /* 2: ASPT ACPI Mailbox Registers */
151f5325cb1SJeremi Piotrowski struct acpi_aspt_acpi_mbox_regs {
152f5325cb1SJeremi Piotrowski 	struct acpi_aspt_header header;
153f5325cb1SJeremi Piotrowski 	u32 reserved1;
154f5325cb1SJeremi Piotrowski 	u64 cmd_resp_reg_addr;
155f5325cb1SJeremi Piotrowski 	u64 reserved2[2];
156f5325cb1SJeremi Piotrowski };
157f5325cb1SJeremi Piotrowski 
158793c2388SBob Moore /*******************************************************************************
159793c2388SBob Moore  *
160e62f8227SErik Schmauss  * ASF - Alert Standard Format table (Signature "ASF!")
161e62f8227SErik Schmauss  *       Revision 0x10
162e62f8227SErik Schmauss  *
163e62f8227SErik Schmauss  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
164e62f8227SErik Schmauss  *
165e62f8227SErik Schmauss  ******************************************************************************/
166e62f8227SErik Schmauss 
167e62f8227SErik Schmauss struct acpi_table_asf {
168e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
169e62f8227SErik Schmauss };
170e62f8227SErik Schmauss 
171e62f8227SErik Schmauss /* ASF subtable header */
172e62f8227SErik Schmauss 
173e62f8227SErik Schmauss struct acpi_asf_header {
174e62f8227SErik Schmauss 	u8 type;
175e62f8227SErik Schmauss 	u8 reserved;
176e62f8227SErik Schmauss 	u16 length;
177e62f8227SErik Schmauss };
178e62f8227SErik Schmauss 
179e62f8227SErik Schmauss /* Values for Type field above */
180e62f8227SErik Schmauss 
181e62f8227SErik Schmauss enum acpi_asf_type {
182e62f8227SErik Schmauss 	ACPI_ASF_TYPE_INFO = 0,
183e62f8227SErik Schmauss 	ACPI_ASF_TYPE_ALERT = 1,
184e62f8227SErik Schmauss 	ACPI_ASF_TYPE_CONTROL = 2,
185e62f8227SErik Schmauss 	ACPI_ASF_TYPE_BOOT = 3,
186e62f8227SErik Schmauss 	ACPI_ASF_TYPE_ADDRESS = 4,
187e62f8227SErik Schmauss 	ACPI_ASF_TYPE_RESERVED = 5
188e62f8227SErik Schmauss };
189e62f8227SErik Schmauss 
190e62f8227SErik Schmauss /*
191e62f8227SErik Schmauss  * ASF subtables
192e62f8227SErik Schmauss  */
193e62f8227SErik Schmauss 
194e62f8227SErik Schmauss /* 0: ASF Information */
195e62f8227SErik Schmauss 
196e62f8227SErik Schmauss struct acpi_asf_info {
197e62f8227SErik Schmauss 	struct acpi_asf_header header;
198e62f8227SErik Schmauss 	u8 min_reset_value;
199e62f8227SErik Schmauss 	u8 min_poll_interval;
200e62f8227SErik Schmauss 	u16 system_id;
201e62f8227SErik Schmauss 	u32 mfg_id;
202e62f8227SErik Schmauss 	u8 flags;
203e62f8227SErik Schmauss 	u8 reserved2[3];
204e62f8227SErik Schmauss };
205e62f8227SErik Schmauss 
206e62f8227SErik Schmauss /* Masks for Flags field above */
207e62f8227SErik Schmauss 
208e62f8227SErik Schmauss #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
209e62f8227SErik Schmauss 
210e62f8227SErik Schmauss /* 1: ASF Alerts */
211e62f8227SErik Schmauss 
212e62f8227SErik Schmauss struct acpi_asf_alert {
213e62f8227SErik Schmauss 	struct acpi_asf_header header;
214e62f8227SErik Schmauss 	u8 assert_mask;
215e62f8227SErik Schmauss 	u8 deassert_mask;
216e62f8227SErik Schmauss 	u8 alerts;
217e62f8227SErik Schmauss 	u8 data_length;
218e62f8227SErik Schmauss };
219e62f8227SErik Schmauss 
220e62f8227SErik Schmauss struct acpi_asf_alert_data {
221e62f8227SErik Schmauss 	u8 address;
222e62f8227SErik Schmauss 	u8 command;
223e62f8227SErik Schmauss 	u8 mask;
224e62f8227SErik Schmauss 	u8 value;
225e62f8227SErik Schmauss 	u8 sensor_type;
226e62f8227SErik Schmauss 	u8 type;
227e62f8227SErik Schmauss 	u8 offset;
228e62f8227SErik Schmauss 	u8 source_type;
229e62f8227SErik Schmauss 	u8 severity;
230e62f8227SErik Schmauss 	u8 sensor_number;
231e62f8227SErik Schmauss 	u8 entity;
232e62f8227SErik Schmauss 	u8 instance;
233e62f8227SErik Schmauss };
234e62f8227SErik Schmauss 
235e62f8227SErik Schmauss /* 2: ASF Remote Control */
236e62f8227SErik Schmauss 
237e62f8227SErik Schmauss struct acpi_asf_remote {
238e62f8227SErik Schmauss 	struct acpi_asf_header header;
239e62f8227SErik Schmauss 	u8 controls;
240e62f8227SErik Schmauss 	u8 data_length;
241e62f8227SErik Schmauss 	u16 reserved2;
242e62f8227SErik Schmauss };
243e62f8227SErik Schmauss 
244e62f8227SErik Schmauss struct acpi_asf_control_data {
245e62f8227SErik Schmauss 	u8 function;
246e62f8227SErik Schmauss 	u8 address;
247e62f8227SErik Schmauss 	u8 command;
248e62f8227SErik Schmauss 	u8 value;
249e62f8227SErik Schmauss };
250e62f8227SErik Schmauss 
251e62f8227SErik Schmauss /* 3: ASF RMCP Boot Options */
252e62f8227SErik Schmauss 
253e62f8227SErik Schmauss struct acpi_asf_rmcp {
254e62f8227SErik Schmauss 	struct acpi_asf_header header;
255e62f8227SErik Schmauss 	u8 capabilities[7];
256e62f8227SErik Schmauss 	u8 completion_code;
257e62f8227SErik Schmauss 	u32 enterprise_id;
258e62f8227SErik Schmauss 	u8 command;
259e62f8227SErik Schmauss 	u16 parameter;
260e62f8227SErik Schmauss 	u16 boot_options;
261e62f8227SErik Schmauss 	u16 oem_parameters;
262e62f8227SErik Schmauss };
263e62f8227SErik Schmauss 
264e62f8227SErik Schmauss /* 4: ASF Address */
265e62f8227SErik Schmauss 
266e62f8227SErik Schmauss struct acpi_asf_address {
267e62f8227SErik Schmauss 	struct acpi_asf_header header;
268e62f8227SErik Schmauss 	u8 eprom_address;
269e62f8227SErik Schmauss 	u8 devices;
270e62f8227SErik Schmauss };
271e62f8227SErik Schmauss 
272e62f8227SErik Schmauss /*******************************************************************************
273e62f8227SErik Schmauss  *
2746e2d5ebdSBob Moore  * BERT - Boot Error Record Table (ACPI 4.0)
2756e2d5ebdSBob Moore  *        Version 1
276970d9c9eSBob Moore  *
277970d9c9eSBob Moore  ******************************************************************************/
278970d9c9eSBob Moore 
279970d9c9eSBob Moore struct acpi_table_bert {
280970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
281970d9c9eSBob Moore 	u32 region_length;	/* Length of the boot error region */
282b595076aSUwe Kleine-König 	u64 address;		/* Physical address of the error region */
283970d9c9eSBob Moore };
284970d9c9eSBob Moore 
2856e2d5ebdSBob Moore /* Boot Error Region (not a subtable, pointed to by Address field above) */
2863fa34777SBob Moore 
287970d9c9eSBob Moore struct acpi_bert_region {
2886e2d5ebdSBob Moore 	u32 block_status;	/* Type of error information */
2896e2d5ebdSBob Moore 	u32 raw_data_offset;	/* Offset to raw error data */
2906e2d5ebdSBob Moore 	u32 raw_data_length;	/* Length of raw error data */
2916e2d5ebdSBob Moore 	u32 data_length;	/* Length of generic error data */
2926e2d5ebdSBob Moore 	u32 error_severity;	/* Severity code */
293970d9c9eSBob Moore };
294970d9c9eSBob Moore 
2956e2d5ebdSBob Moore /* Values for block_status flags above */
296970d9c9eSBob Moore 
297970d9c9eSBob Moore #define ACPI_BERT_UNCORRECTABLE             (1)
2986e2d5ebdSBob Moore #define ACPI_BERT_CORRECTABLE               (1<<1)
2996e2d5ebdSBob Moore #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
3006e2d5ebdSBob Moore #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
3016e2d5ebdSBob Moore #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4)	/* 8 bits, error count */
3026e2d5ebdSBob Moore 
3036e2d5ebdSBob Moore /* Values for error_severity above */
3046e2d5ebdSBob Moore 
3056e2d5ebdSBob Moore enum acpi_bert_error_severity {
3066e2d5ebdSBob Moore 	ACPI_BERT_ERROR_CORRECTABLE = 0,
3076e2d5ebdSBob Moore 	ACPI_BERT_ERROR_FATAL = 1,
3086e2d5ebdSBob Moore 	ACPI_BERT_ERROR_CORRECTED = 2,
3096e2d5ebdSBob Moore 	ACPI_BERT_ERROR_NONE = 3,
3106e2d5ebdSBob Moore 	ACPI_BERT_ERROR_RESERVED = 4	/* 4 and greater are reserved */
3116e2d5ebdSBob Moore };
3126e2d5ebdSBob Moore 
3136e2d5ebdSBob Moore /*
3146e2d5ebdSBob Moore  * Note: The generic error data that follows the error_severity field above
3156e2d5ebdSBob Moore  * uses the struct acpi_hest_generic_data defined under the HEST table below
3166e2d5ebdSBob Moore  */
317970d9c9eSBob Moore 
318970d9c9eSBob Moore /*******************************************************************************
319970d9c9eSBob Moore  *
320e62f8227SErik Schmauss  * BGRT - Boot Graphics Resource Table (ACPI 5.0)
321e62f8227SErik Schmauss  *        Version 1
322e62f8227SErik Schmauss  *
323e62f8227SErik Schmauss  ******************************************************************************/
324e62f8227SErik Schmauss 
325e62f8227SErik Schmauss struct acpi_table_bgrt {
326e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
327e62f8227SErik Schmauss 	u16 version;
328e62f8227SErik Schmauss 	u8 status;
329e62f8227SErik Schmauss 	u8 image_type;
330e62f8227SErik Schmauss 	u64 image_address;
331e62f8227SErik Schmauss 	u32 image_offset_x;
332e62f8227SErik Schmauss 	u32 image_offset_y;
333e62f8227SErik Schmauss };
334e62f8227SErik Schmauss 
335e62f8227SErik Schmauss /* Flags for Status field above */
336e62f8227SErik Schmauss 
337e62f8227SErik Schmauss #define ACPI_BGRT_DISPLAYED                 (1)
338e62f8227SErik Schmauss #define ACPI_BGRT_ORIENTATION_OFFSET        (3 << 1)
339e62f8227SErik Schmauss 
340e62f8227SErik Schmauss /*******************************************************************************
341e62f8227SErik Schmauss  *
342e62f8227SErik Schmauss  * BOOT - Simple Boot Flag Table
343e62f8227SErik Schmauss  *        Version 1
344e62f8227SErik Schmauss  *
345e62f8227SErik Schmauss  * Conforms to the "Simple Boot Flag Specification", Version 2.1
346e62f8227SErik Schmauss  *
347e62f8227SErik Schmauss  ******************************************************************************/
348e62f8227SErik Schmauss 
349e62f8227SErik Schmauss struct acpi_table_boot {
350e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
351e62f8227SErik Schmauss 	u8 cmos_index;		/* Index in CMOS RAM for the boot register */
352e62f8227SErik Schmauss 	u8 reserved[3];
353e62f8227SErik Schmauss };
354e62f8227SErik Schmauss 
355e62f8227SErik Schmauss /*******************************************************************************
356e62f8227SErik Schmauss  *
35751aad1a6SBob Moore  * CDAT - Coherent Device Attribute Table
35851aad1a6SBob Moore  *        Version 1
35951aad1a6SBob Moore  *
36051aad1a6SBob Moore  * Conforms to the "Coherent Device Attribute Table (CDAT) Specification
36151aad1a6SBob Moore  " (Revision 1.01, October 2020.)
36251aad1a6SBob Moore  *
36351aad1a6SBob Moore  ******************************************************************************/
36451aad1a6SBob Moore 
36551aad1a6SBob Moore struct acpi_table_cdat {
36651aad1a6SBob Moore 	u32 length;		/* Length of table in bytes, including this header */
36751aad1a6SBob Moore 	u8 revision;		/* ACPI Specification minor version number */
36851aad1a6SBob Moore 	u8 checksum;		/* To make sum of entire table == 0 */
36951aad1a6SBob Moore 	u8 reserved[6];
37051aad1a6SBob Moore 	u32 sequence;		/* Used to detect runtime CDAT table changes */
37151aad1a6SBob Moore };
37251aad1a6SBob Moore 
37351aad1a6SBob Moore /* CDAT common subtable header */
37451aad1a6SBob Moore 
37551aad1a6SBob Moore struct acpi_cdat_header {
37651aad1a6SBob Moore 	u8 type;
37751aad1a6SBob Moore 	u8 reserved;
37851aad1a6SBob Moore 	u16 length;
37951aad1a6SBob Moore };
38051aad1a6SBob Moore 
38151aad1a6SBob Moore /* Values for Type field above */
38251aad1a6SBob Moore 
38351aad1a6SBob Moore enum acpi_cdat_type {
38451aad1a6SBob Moore 	ACPI_CDAT_TYPE_DSMAS = 0,
38551aad1a6SBob Moore 	ACPI_CDAT_TYPE_DSLBIS = 1,
38651aad1a6SBob Moore 	ACPI_CDAT_TYPE_DSMSCIS = 2,
38751aad1a6SBob Moore 	ACPI_CDAT_TYPE_DSIS = 3,
38851aad1a6SBob Moore 	ACPI_CDAT_TYPE_DSEMTS = 4,
38951aad1a6SBob Moore 	ACPI_CDAT_TYPE_SSLBIS = 5,
39051aad1a6SBob Moore 	ACPI_CDAT_TYPE_RESERVED = 6	/* 6 through 0xFF are reserved */
39151aad1a6SBob Moore };
39251aad1a6SBob Moore 
39351aad1a6SBob Moore /* Subtable 0: Device Scoped Memory Affinity Structure (DSMAS) */
39451aad1a6SBob Moore 
3955a9e358fSLukas Wunner struct acpi_cdat_dsmas {
39651aad1a6SBob Moore 	u8 dsmad_handle;
39751aad1a6SBob Moore 	u8 flags;
39851aad1a6SBob Moore 	u16 reserved;
39951aad1a6SBob Moore 	u64 dpa_base_address;
40051aad1a6SBob Moore 	u64 dpa_length;
40151aad1a6SBob Moore };
40251aad1a6SBob Moore 
40351aad1a6SBob Moore /* Flags for subtable above */
40451aad1a6SBob Moore 
405*6399878fSDave Jiang #define ACPI_CDAT_DSMAS_NON_VOLATILE        (1 << 2)
40651aad1a6SBob Moore 
40751aad1a6SBob Moore /* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */
40851aad1a6SBob Moore 
40951aad1a6SBob Moore struct acpi_cdat_dslbis {
41051aad1a6SBob Moore 	u8 handle;
41151aad1a6SBob Moore 	u8 flags;		/* If Handle matches a DSMAS handle, the definition of this field matches
41251aad1a6SBob Moore 				 * Flags field in HMAT System Locality Latency */
41351aad1a6SBob Moore 	u8 data_type;
41451aad1a6SBob Moore 	u8 reserved;
41551aad1a6SBob Moore 	u64 entry_base_unit;
41651aad1a6SBob Moore 	u16 entry[3];
41751aad1a6SBob Moore 	u16 reserved2;
41851aad1a6SBob Moore };
41951aad1a6SBob Moore 
42051aad1a6SBob Moore /* Subtable 2: Device Scoped Memory Side Cache Information Structure (DSMSCIS) */
42151aad1a6SBob Moore 
42251aad1a6SBob Moore struct acpi_cdat_dsmscis {
42351aad1a6SBob Moore 	u8 dsmas_handle;
42451aad1a6SBob Moore 	u8 reserved[3];
42551aad1a6SBob Moore 	u64 side_cache_size;
42651aad1a6SBob Moore 	u32 cache_attributes;
42751aad1a6SBob Moore };
42851aad1a6SBob Moore 
42951aad1a6SBob Moore /* Subtable 3: Device Scoped Initiator Structure (DSIS) */
43051aad1a6SBob Moore 
43151aad1a6SBob Moore struct acpi_cdat_dsis {
43251aad1a6SBob Moore 	u8 flags;
43351aad1a6SBob Moore 	u8 handle;
43451aad1a6SBob Moore 	u16 reserved;
43551aad1a6SBob Moore };
43651aad1a6SBob Moore 
43751aad1a6SBob Moore /* Flags for above subtable */
43851aad1a6SBob Moore 
43951aad1a6SBob Moore #define ACPI_CDAT_DSIS_MEM_ATTACHED         (1 << 0)
44051aad1a6SBob Moore 
44151aad1a6SBob Moore /* Subtable 4: Device Scoped EFI Memory Type Structure (DSEMTS) */
44251aad1a6SBob Moore 
44351aad1a6SBob Moore struct acpi_cdat_dsemts {
44451aad1a6SBob Moore 	u8 dsmas_handle;
44551aad1a6SBob Moore 	u8 memory_type;
44651aad1a6SBob Moore 	u16 reserved;
44751aad1a6SBob Moore 	u64 dpa_offset;
44851aad1a6SBob Moore 	u64 range_length;
44951aad1a6SBob Moore };
45051aad1a6SBob Moore 
45151aad1a6SBob Moore /* Subtable 5: Switch Scoped Latency and Bandwidth Information Structure (SSLBIS) */
45251aad1a6SBob Moore 
45351aad1a6SBob Moore struct acpi_cdat_sslbis {
45451aad1a6SBob Moore 	u8 data_type;
45551aad1a6SBob Moore 	u8 reserved[3];
45651aad1a6SBob Moore 	u64 entry_base_unit;
45751aad1a6SBob Moore };
45851aad1a6SBob Moore 
45951aad1a6SBob Moore /* Sub-subtable for above, sslbe_entries field */
46051aad1a6SBob Moore 
46151aad1a6SBob Moore struct acpi_cdat_sslbe {
46251aad1a6SBob Moore 	u16 portx_id;
46351aad1a6SBob Moore 	u16 porty_id;
46451aad1a6SBob Moore 	u16 latency_or_bandwidth;
46551aad1a6SBob Moore 	u16 reserved;
46651aad1a6SBob Moore };
46751aad1a6SBob Moore 
46851aad1a6SBob Moore /*******************************************************************************
46951aad1a6SBob Moore  *
4707c5eab72SBen Widawsky  * CEDT - CXL Early Discovery Table
4717c5eab72SBen Widawsky  *        Version 1
4727c5eab72SBen Widawsky  *
47351aad1a6SBob Moore  * Conforms to the "CXL Early Discovery Table" (CXL 2.0, October 2020)
4747c5eab72SBen Widawsky  *
4757c5eab72SBen Widawsky  ******************************************************************************/
4767c5eab72SBen Widawsky 
4777c5eab72SBen Widawsky struct acpi_table_cedt {
4787c5eab72SBen Widawsky 	struct acpi_table_header header;	/* Common ACPI table header */
4797c5eab72SBen Widawsky };
4807c5eab72SBen Widawsky 
4817c5eab72SBen Widawsky /* CEDT subtable header (Performance Record Structure) */
4827c5eab72SBen Widawsky 
4837c5eab72SBen Widawsky struct acpi_cedt_header {
4847c5eab72SBen Widawsky 	u8 type;
4857c5eab72SBen Widawsky 	u8 reserved;
4867c5eab72SBen Widawsky 	u16 length;
4877c5eab72SBen Widawsky };
4887c5eab72SBen Widawsky 
4897c5eab72SBen Widawsky /* Values for Type field above */
4907c5eab72SBen Widawsky 
4917c5eab72SBen Widawsky enum acpi_cedt_type {
4927c5eab72SBen Widawsky 	ACPI_CEDT_TYPE_CHBS = 0,
4934a2c1dcfSAlison Schofield 	ACPI_CEDT_TYPE_CFMWS = 1,
494f350c68eSAlison Schofield 	ACPI_CEDT_TYPE_CXIMS = 2,
495f350c68eSAlison Schofield 	ACPI_CEDT_TYPE_RDPAS = 3,
496f350c68eSAlison Schofield 	ACPI_CEDT_TYPE_RESERVED = 4,
4977c5eab72SBen Widawsky };
4987c5eab72SBen Widawsky 
499160c768eSAlison Schofield /* Values for version field above */
500160c768eSAlison Schofield 
501160c768eSAlison Schofield #define ACPI_CEDT_CHBS_VERSION_CXL11    (0)
502160c768eSAlison Schofield #define ACPI_CEDT_CHBS_VERSION_CXL20    (1)
503160c768eSAlison Schofield 
504160c768eSAlison Schofield /* Values for length field above */
505160c768eSAlison Schofield 
506160c768eSAlison Schofield #define ACPI_CEDT_CHBS_LENGTH_CXL11     (0x2000)
507160c768eSAlison Schofield #define ACPI_CEDT_CHBS_LENGTH_CXL20     (0x10000)
508160c768eSAlison Schofield 
5097c5eab72SBen Widawsky /*
5107c5eab72SBen Widawsky  * CEDT subtables
5117c5eab72SBen Widawsky  */
5127c5eab72SBen Widawsky 
5137c5eab72SBen Widawsky /* 0: CXL Host Bridge Structure */
5147c5eab72SBen Widawsky 
5157c5eab72SBen Widawsky struct acpi_cedt_chbs {
516519c8090SBob Moore 	struct acpi_cedt_header header;
5177c5eab72SBen Widawsky 	u32 uid;
5187c5eab72SBen Widawsky 	u32 cxl_version;
5197c5eab72SBen Widawsky 	u32 reserved;
5207c5eab72SBen Widawsky 	u64 base;
5217c5eab72SBen Widawsky 	u64 length;
5227c5eab72SBen Widawsky };
5237c5eab72SBen Widawsky 
5244a2c1dcfSAlison Schofield /* 1: CXL Fixed Memory Window Structure */
5254a2c1dcfSAlison Schofield 
5264a2c1dcfSAlison Schofield struct acpi_cedt_cfmws {
5274a2c1dcfSAlison Schofield 	struct acpi_cedt_header header;
5284a2c1dcfSAlison Schofield 	u32 reserved1;
5294a2c1dcfSAlison Schofield 	u64 base_hpa;
5304a2c1dcfSAlison Schofield 	u64 window_size;
5314a2c1dcfSAlison Schofield 	u8 interleave_ways;
5324a2c1dcfSAlison Schofield 	u8 interleave_arithmetic;
5334a2c1dcfSAlison Schofield 	u16 reserved2;
5344a2c1dcfSAlison Schofield 	u32 granularity;
5354a2c1dcfSAlison Schofield 	u16 restrictions;
5364a2c1dcfSAlison Schofield 	u16 qtg_id;
5374a2c1dcfSAlison Schofield 	u32 interleave_targets[];
5384a2c1dcfSAlison Schofield };
5394a2c1dcfSAlison Schofield 
540a95d2fb0SLawrence Hileman struct acpi_cedt_cfmws_target_element {
541a95d2fb0SLawrence Hileman 	u32 interleave_target;
542a95d2fb0SLawrence Hileman };
543a95d2fb0SLawrence Hileman 
5444a2c1dcfSAlison Schofield /* Values for Interleave Arithmetic field above */
5454a2c1dcfSAlison Schofield 
5464a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO   (0)
547f350c68eSAlison Schofield #define ACPI_CEDT_CFMWS_ARITHMETIC_XOR      (1)
5484a2c1dcfSAlison Schofield 
5494a2c1dcfSAlison Schofield /* Values for Restrictions field above */
5504a2c1dcfSAlison Schofield 
5514a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_TYPE2      (1)
5524a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_TYPE3      (1<<1)
5534a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE   (1<<2)
5544a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_PMEM       (1<<3)
5554a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_FIXED      (1<<4)
5564a2c1dcfSAlison Schofield 
557f350c68eSAlison Schofield /* 2: CXL XOR Interleave Math Structure */
558f350c68eSAlison Schofield 
559f350c68eSAlison Schofield struct acpi_cedt_cxims {
560f350c68eSAlison Schofield 	struct acpi_cedt_header header;
561f350c68eSAlison Schofield 	u16 reserved1;
562f350c68eSAlison Schofield 	u8 hbig;
563f350c68eSAlison Schofield 	u8 nr_xormaps;
564f350c68eSAlison Schofield 	u64 xormap_list[];
565f350c68eSAlison Schofield };
566f350c68eSAlison Schofield 
567f350c68eSAlison Schofield /* 3: CXL RCEC Downstream Port Association Structure */
568f350c68eSAlison Schofield 
569f350c68eSAlison Schofield struct acpi_cedt_rdpas {
570f350c68eSAlison Schofield 	struct acpi_cedt_header header;
571f350c68eSAlison Schofield 	u8 reserved1;
572f350c68eSAlison Schofield 	u16 length;
573f350c68eSAlison Schofield 	u16 segment;
574f350c68eSAlison Schofield 	u16 bdf;
575f350c68eSAlison Schofield 	u8 protocol;
576f350c68eSAlison Schofield 	u64 address;
577f350c68eSAlison Schofield };
578f350c68eSAlison Schofield 
579f350c68eSAlison Schofield /* Masks for bdf field above */
580f350c68eSAlison Schofield #define ACPI_CEDT_RDPAS_BUS_MASK            0xff00
581f350c68eSAlison Schofield #define ACPI_CEDT_RDPAS_DEVICE_MASK         0x00f8
582f350c68eSAlison Schofield #define ACPI_CEDT_RDPAS_FUNCTION_MASK       0x0007
583f350c68eSAlison Schofield 
584f350c68eSAlison Schofield #define ACPI_CEDT_RDPAS_PROTOCOL_IO        (0)
585f350c68eSAlison Schofield #define ACPI_CEDT_RDPAS_PROTOCOL_CACHEMEM  (1)
586f350c68eSAlison Schofield 
5877c5eab72SBen Widawsky /*******************************************************************************
5887c5eab72SBen Widawsky  *
5896e2d5ebdSBob Moore  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
5906e2d5ebdSBob Moore  *        Version 1
591793c2388SBob Moore  *
592793c2388SBob Moore  ******************************************************************************/
593793c2388SBob Moore 
594793c2388SBob Moore struct acpi_table_cpep {
595f3d2e786SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
596f3d2e786SBob Moore 	u64 reserved;
597793c2388SBob Moore };
598793c2388SBob Moore 
599793c2388SBob Moore /* Subtable */
600793c2388SBob Moore 
601793c2388SBob Moore struct acpi_cpep_polling {
6026e2d5ebdSBob Moore 	struct acpi_subtable_header header;
603f3d2e786SBob Moore 	u8 id;			/* Processor ID */
604f3d2e786SBob Moore 	u8 eid;			/* Processor EID */
605f3d2e786SBob Moore 	u32 interval;		/* Polling interval (msec) */
606793c2388SBob Moore };
607793c2388SBob Moore 
608793c2388SBob Moore /*******************************************************************************
609793c2388SBob Moore  *
610e62f8227SErik Schmauss  * CSRT - Core System Resource Table
611e62f8227SErik Schmauss  *        Version 0
612e62f8227SErik Schmauss  *
613e62f8227SErik Schmauss  * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
614e62f8227SErik Schmauss  *
615e62f8227SErik Schmauss  ******************************************************************************/
616e62f8227SErik Schmauss 
617e62f8227SErik Schmauss struct acpi_table_csrt {
618e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
619e62f8227SErik Schmauss };
620e62f8227SErik Schmauss 
621e62f8227SErik Schmauss /* Resource Group subtable */
622e62f8227SErik Schmauss 
623e62f8227SErik Schmauss struct acpi_csrt_group {
624e62f8227SErik Schmauss 	u32 length;
625e62f8227SErik Schmauss 	u32 vendor_id;
626e62f8227SErik Schmauss 	u32 subvendor_id;
627e62f8227SErik Schmauss 	u16 device_id;
628e62f8227SErik Schmauss 	u16 subdevice_id;
629e62f8227SErik Schmauss 	u16 revision;
630e62f8227SErik Schmauss 	u16 reserved;
631e62f8227SErik Schmauss 	u32 shared_info_length;
632e62f8227SErik Schmauss 
633e62f8227SErik Schmauss 	/* Shared data immediately follows (Length = shared_info_length) */
634e62f8227SErik Schmauss };
635e62f8227SErik Schmauss 
636e62f8227SErik Schmauss /* Shared Info subtable */
637e62f8227SErik Schmauss 
638e62f8227SErik Schmauss struct acpi_csrt_shared_info {
639e62f8227SErik Schmauss 	u16 major_version;
640e62f8227SErik Schmauss 	u16 minor_version;
641e62f8227SErik Schmauss 	u32 mmio_base_low;
642e62f8227SErik Schmauss 	u32 mmio_base_high;
643e62f8227SErik Schmauss 	u32 gsi_interrupt;
644e62f8227SErik Schmauss 	u8 interrupt_polarity;
645e62f8227SErik Schmauss 	u8 interrupt_mode;
646e62f8227SErik Schmauss 	u8 num_channels;
647e62f8227SErik Schmauss 	u8 dma_address_width;
648e62f8227SErik Schmauss 	u16 base_request_line;
649e62f8227SErik Schmauss 	u16 num_handshake_signals;
650e62f8227SErik Schmauss 	u32 max_block_size;
651e62f8227SErik Schmauss 
652e62f8227SErik Schmauss 	/* Resource descriptors immediately follow (Length = Group length - shared_info_length) */
653e62f8227SErik Schmauss };
654e62f8227SErik Schmauss 
655e62f8227SErik Schmauss /* Resource Descriptor subtable */
656e62f8227SErik Schmauss 
657e62f8227SErik Schmauss struct acpi_csrt_descriptor {
658e62f8227SErik Schmauss 	u32 length;
659e62f8227SErik Schmauss 	u16 type;
660e62f8227SErik Schmauss 	u16 subtype;
661e62f8227SErik Schmauss 	u32 uid;
662e62f8227SErik Schmauss 
663e62f8227SErik Schmauss 	/* Resource-specific information immediately follows */
664e62f8227SErik Schmauss };
665e62f8227SErik Schmauss 
666e62f8227SErik Schmauss /* Resource Types */
667e62f8227SErik Schmauss 
668e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_INTERRUPT    0x0001
669e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_TIMER        0x0002
670e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_DMA          0x0003
671e62f8227SErik Schmauss 
672e62f8227SErik Schmauss /* Resource Subtypes */
673e62f8227SErik Schmauss 
674e62f8227SErik Schmauss #define ACPI_CSRT_XRUPT_LINE        0x0000
675e62f8227SErik Schmauss #define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
676e62f8227SErik Schmauss #define ACPI_CSRT_TIMER             0x0000
677e62f8227SErik Schmauss #define ACPI_CSRT_DMA_CHANNEL       0x0000
678e62f8227SErik Schmauss #define ACPI_CSRT_DMA_CONTROLLER    0x0001
679e62f8227SErik Schmauss 
680e62f8227SErik Schmauss /*******************************************************************************
681e62f8227SErik Schmauss  *
682e62f8227SErik Schmauss  * DBG2 - Debug Port Table 2
683e62f8227SErik Schmauss  *        Version 0 (Both main table and subtables)
684e62f8227SErik Schmauss  *
685200950b6SMarcin Wojtas  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", September 21, 2020
686e62f8227SErik Schmauss  *
687e62f8227SErik Schmauss  ******************************************************************************/
688e62f8227SErik Schmauss 
689e62f8227SErik Schmauss struct acpi_table_dbg2 {
690e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
691e62f8227SErik Schmauss 	u32 info_offset;
692e62f8227SErik Schmauss 	u32 info_count;
693e62f8227SErik Schmauss };
694e62f8227SErik Schmauss 
695e62f8227SErik Schmauss struct acpi_dbg2_header {
696e62f8227SErik Schmauss 	u32 info_offset;
697e62f8227SErik Schmauss 	u32 info_count;
698e62f8227SErik Schmauss };
699e62f8227SErik Schmauss 
700e62f8227SErik Schmauss /* Debug Device Information Subtable */
701e62f8227SErik Schmauss 
702e62f8227SErik Schmauss struct acpi_dbg2_device {
703e62f8227SErik Schmauss 	u8 revision;
704e62f8227SErik Schmauss 	u16 length;
705e62f8227SErik Schmauss 	u8 register_count;	/* Number of base_address registers */
706e62f8227SErik Schmauss 	u16 namepath_length;
707e62f8227SErik Schmauss 	u16 namepath_offset;
708e62f8227SErik Schmauss 	u16 oem_data_length;
709e62f8227SErik Schmauss 	u16 oem_data_offset;
710e62f8227SErik Schmauss 	u16 port_type;
711e62f8227SErik Schmauss 	u16 port_subtype;
712e62f8227SErik Schmauss 	u16 reserved;
713e62f8227SErik Schmauss 	u16 base_address_offset;
714e62f8227SErik Schmauss 	u16 address_size_offset;
715e62f8227SErik Schmauss 	/*
716e62f8227SErik Schmauss 	 * Data that follows:
717e62f8227SErik Schmauss 	 *    base_address (required) - Each in 12-byte Generic Address Structure format.
718e62f8227SErik Schmauss 	 *    address_size (required) - Array of u32 sizes corresponding to each base_address register.
719e62f8227SErik Schmauss 	 *    Namepath    (required) - Null terminated string. Single dot if not supported.
720e62f8227SErik Schmauss 	 *    oem_data    (optional) - Length is oem_data_length.
721e62f8227SErik Schmauss 	 */
722e62f8227SErik Schmauss };
723e62f8227SErik Schmauss 
724e62f8227SErik Schmauss /* Types for port_type field above */
725e62f8227SErik Schmauss 
726e62f8227SErik Schmauss #define ACPI_DBG2_SERIAL_PORT       0x8000
727e62f8227SErik Schmauss #define ACPI_DBG2_1394_PORT         0x8001
728e62f8227SErik Schmauss #define ACPI_DBG2_USB_PORT          0x8002
729e62f8227SErik Schmauss #define ACPI_DBG2_NET_PORT          0x8003
730e62f8227SErik Schmauss 
731e62f8227SErik Schmauss /* Subtypes for port_subtype field above */
732e62f8227SErik Schmauss 
733e62f8227SErik Schmauss #define ACPI_DBG2_16550_COMPATIBLE  0x0000
734e62f8227SErik Schmauss #define ACPI_DBG2_16550_SUBSET      0x0001
735200950b6SMarcin Wojtas #define ACPI_DBG2_MAX311XE_SPI      0x0002
736e62f8227SErik Schmauss #define ACPI_DBG2_ARM_PL011         0x0003
737200950b6SMarcin Wojtas #define ACPI_DBG2_MSM8X60           0x0004
738200950b6SMarcin Wojtas #define ACPI_DBG2_16550_NVIDIA      0x0005
739200950b6SMarcin Wojtas #define ACPI_DBG2_TI_OMAP           0x0006
740200950b6SMarcin Wojtas #define ACPI_DBG2_APM88XXXX         0x0008
741200950b6SMarcin Wojtas #define ACPI_DBG2_MSM8974           0x0009
742200950b6SMarcin Wojtas #define ACPI_DBG2_SAM5250           0x000A
743200950b6SMarcin Wojtas #define ACPI_DBG2_INTEL_USIF        0x000B
744200950b6SMarcin Wojtas #define ACPI_DBG2_IMX6              0x000C
745e62f8227SErik Schmauss #define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
746e62f8227SErik Schmauss #define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
747e62f8227SErik Schmauss #define ACPI_DBG2_ARM_DCC           0x000F
748e62f8227SErik Schmauss #define ACPI_DBG2_BCM2835           0x0010
749200950b6SMarcin Wojtas #define ACPI_DBG2_SDM845_1_8432MHZ  0x0011
750200950b6SMarcin Wojtas #define ACPI_DBG2_16550_WITH_GAS    0x0012
751200950b6SMarcin Wojtas #define ACPI_DBG2_SDM845_7_372MHZ   0x0013
752200950b6SMarcin Wojtas #define ACPI_DBG2_INTEL_LPSS        0x0014
753e62f8227SErik Schmauss 
754e62f8227SErik Schmauss #define ACPI_DBG2_1394_STANDARD     0x0000
755e62f8227SErik Schmauss 
756e62f8227SErik Schmauss #define ACPI_DBG2_USB_XHCI          0x0000
757e62f8227SErik Schmauss #define ACPI_DBG2_USB_EHCI          0x0001
758e62f8227SErik Schmauss 
759e62f8227SErik Schmauss /*******************************************************************************
760e62f8227SErik Schmauss  *
761e62f8227SErik Schmauss  * DBGP - Debug Port table
762e62f8227SErik Schmauss  *        Version 1
763e62f8227SErik Schmauss  *
764e62f8227SErik Schmauss  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
765e62f8227SErik Schmauss  *
766e62f8227SErik Schmauss  ******************************************************************************/
767e62f8227SErik Schmauss 
768e62f8227SErik Schmauss struct acpi_table_dbgp {
769e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
770e62f8227SErik Schmauss 	u8 type;		/* 0=full 16550, 1=subset of 16550 */
771e62f8227SErik Schmauss 	u8 reserved[3];
772e62f8227SErik Schmauss 	struct acpi_generic_address debug_port;
773e62f8227SErik Schmauss };
774e62f8227SErik Schmauss 
775e62f8227SErik Schmauss /*******************************************************************************
776e62f8227SErik Schmauss  *
777e62f8227SErik Schmauss  * DMAR - DMA Remapping table
778e62f8227SErik Schmauss  *        Version 1
779e62f8227SErik Schmauss  *
780e62f8227SErik Schmauss  * Conforms to "Intel Virtualization Technology for Directed I/O",
781e62f8227SErik Schmauss  * Version 2.3, October 2014
782e62f8227SErik Schmauss  *
783e62f8227SErik Schmauss  ******************************************************************************/
784e62f8227SErik Schmauss 
785e62f8227SErik Schmauss struct acpi_table_dmar {
786e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
787e62f8227SErik Schmauss 	u8 width;		/* Host Address Width */
788e62f8227SErik Schmauss 	u8 flags;
789e62f8227SErik Schmauss 	u8 reserved[10];
790e62f8227SErik Schmauss };
791e62f8227SErik Schmauss 
792e62f8227SErik Schmauss /* Masks for Flags field above */
793e62f8227SErik Schmauss 
794e62f8227SErik Schmauss #define ACPI_DMAR_INTR_REMAP        (1)
795e62f8227SErik Schmauss #define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
796e62f8227SErik Schmauss #define ACPI_DMAR_X2APIC_MODE       (1<<2)
797e62f8227SErik Schmauss 
798e62f8227SErik Schmauss /* DMAR subtable header */
799e62f8227SErik Schmauss 
800e62f8227SErik Schmauss struct acpi_dmar_header {
801e62f8227SErik Schmauss 	u16 type;
802e62f8227SErik Schmauss 	u16 length;
803e62f8227SErik Schmauss };
804e62f8227SErik Schmauss 
805e62f8227SErik Schmauss /* Values for subtable type in struct acpi_dmar_header */
806e62f8227SErik Schmauss 
807e62f8227SErik Schmauss enum acpi_dmar_type {
808e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
809e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
810e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_ROOT_ATS = 2,
811e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
812e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_NAMESPACE = 4,
81381d3c75bSYian Chen 	ACPI_DMAR_TYPE_SATC = 5,
81481d3c75bSYian Chen 	ACPI_DMAR_TYPE_RESERVED = 6	/* 6 and greater are reserved */
815e62f8227SErik Schmauss };
816e62f8227SErik Schmauss 
817e62f8227SErik Schmauss /* DMAR Device Scope structure */
818e62f8227SErik Schmauss 
819e62f8227SErik Schmauss struct acpi_dmar_device_scope {
820e62f8227SErik Schmauss 	u8 entry_type;
821e62f8227SErik Schmauss 	u8 length;
822e62f8227SErik Schmauss 	u16 reserved;
823e62f8227SErik Schmauss 	u8 enumeration_id;
824e62f8227SErik Schmauss 	u8 bus;
825e62f8227SErik Schmauss };
826e62f8227SErik Schmauss 
827e62f8227SErik Schmauss /* Values for entry_type in struct acpi_dmar_device_scope - device types */
828e62f8227SErik Schmauss 
829e62f8227SErik Schmauss enum acpi_dmar_scope_type {
830e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
831e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
832e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
833e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
834e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_HPET = 4,
835e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
836e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_RESERVED = 6	/* 6 and greater are reserved */
837e62f8227SErik Schmauss };
838e62f8227SErik Schmauss 
839e62f8227SErik Schmauss struct acpi_dmar_pci_path {
840e62f8227SErik Schmauss 	u8 device;
841e62f8227SErik Schmauss 	u8 function;
842e62f8227SErik Schmauss };
843e62f8227SErik Schmauss 
844e62f8227SErik Schmauss /*
845e62f8227SErik Schmauss  * DMAR Subtables, correspond to Type in struct acpi_dmar_header
846e62f8227SErik Schmauss  */
847e62f8227SErik Schmauss 
848e62f8227SErik Schmauss /* 0: Hardware Unit Definition */
849e62f8227SErik Schmauss 
850e62f8227SErik Schmauss struct acpi_dmar_hardware_unit {
851e62f8227SErik Schmauss 	struct acpi_dmar_header header;
852e62f8227SErik Schmauss 	u8 flags;
8534db96bfeSKan Liang 	u8 size;		/* Size of the register set */
854e62f8227SErik Schmauss 	u16 segment;
855e62f8227SErik Schmauss 	u64 address;		/* Register Base Address */
856e62f8227SErik Schmauss };
857e62f8227SErik Schmauss 
858e62f8227SErik Schmauss /* Masks for Flags field above */
859e62f8227SErik Schmauss 
860e62f8227SErik Schmauss #define ACPI_DMAR_INCLUDE_ALL       (1)
861e62f8227SErik Schmauss 
862c163f90cSErik Schmauss /* 1: Reserved Memory Definition */
863e62f8227SErik Schmauss 
864e62f8227SErik Schmauss struct acpi_dmar_reserved_memory {
865e62f8227SErik Schmauss 	struct acpi_dmar_header header;
866e62f8227SErik Schmauss 	u16 reserved;
867e62f8227SErik Schmauss 	u16 segment;
868e62f8227SErik Schmauss 	u64 base_address;	/* 4K aligned base address */
869e62f8227SErik Schmauss 	u64 end_address;	/* 4K aligned limit address */
870e62f8227SErik Schmauss };
871e62f8227SErik Schmauss 
872e62f8227SErik Schmauss /* Masks for Flags field above */
873e62f8227SErik Schmauss 
874e62f8227SErik Schmauss #define ACPI_DMAR_ALLOW_ALL         (1)
875e62f8227SErik Schmauss 
876e62f8227SErik Schmauss /* 2: Root Port ATS Capability Reporting Structure */
877e62f8227SErik Schmauss 
878e62f8227SErik Schmauss struct acpi_dmar_atsr {
879e62f8227SErik Schmauss 	struct acpi_dmar_header header;
880e62f8227SErik Schmauss 	u8 flags;
881e62f8227SErik Schmauss 	u8 reserved;
882e62f8227SErik Schmauss 	u16 segment;
883e62f8227SErik Schmauss };
884e62f8227SErik Schmauss 
885e62f8227SErik Schmauss /* Masks for Flags field above */
886e62f8227SErik Schmauss 
887e62f8227SErik Schmauss #define ACPI_DMAR_ALL_PORTS         (1)
888e62f8227SErik Schmauss 
889e62f8227SErik Schmauss /* 3: Remapping Hardware Static Affinity Structure */
890e62f8227SErik Schmauss 
891e62f8227SErik Schmauss struct acpi_dmar_rhsa {
892e62f8227SErik Schmauss 	struct acpi_dmar_header header;
893e62f8227SErik Schmauss 	u32 reserved;
894e62f8227SErik Schmauss 	u64 base_address;
895e62f8227SErik Schmauss 	u32 proximity_domain;
896e62f8227SErik Schmauss };
897e62f8227SErik Schmauss 
898e62f8227SErik Schmauss /* 4: ACPI Namespace Device Declaration Structure */
899e62f8227SErik Schmauss 
900e62f8227SErik Schmauss struct acpi_dmar_andd {
901e62f8227SErik Schmauss 	struct acpi_dmar_header header;
902e62f8227SErik Schmauss 	u8 reserved[3];
903e62f8227SErik Schmauss 	u8 device_number;
90449bd783eSKees Cook 	union {
90549bd783eSKees Cook 		char __pad;
90649bd783eSKees Cook 		 ACPI_FLEX_ARRAY(char, device_name);
90749bd783eSKees Cook 	};
908e62f8227SErik Schmauss };
909e62f8227SErik Schmauss 
91081d3c75bSYian Chen /* 5: SOC Integrated Address Translation Cache Reporting Structure */
91181d3c75bSYian Chen 
91281d3c75bSYian Chen struct acpi_dmar_satc {
91381d3c75bSYian Chen 	struct acpi_dmar_header header;
91481d3c75bSYian Chen 	u8 flags;
91581d3c75bSYian Chen 	u8 reserved;
91681d3c75bSYian Chen 	u16 segment;
91781d3c75bSYian Chen };
918e62f8227SErik Schmauss /*******************************************************************************
919e62f8227SErik Schmauss  *
920e62f8227SErik Schmauss  * DRTM - Dynamic Root of Trust for Measurement table
921e62f8227SErik Schmauss  * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
922e62f8227SErik Schmauss  * Table version 1
923e62f8227SErik Schmauss  *
924e62f8227SErik Schmauss  ******************************************************************************/
925e62f8227SErik Schmauss 
926e62f8227SErik Schmauss struct acpi_table_drtm {
927e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
928e62f8227SErik Schmauss 	u64 entry_base_address;
929e62f8227SErik Schmauss 	u64 entry_length;
930e62f8227SErik Schmauss 	u32 entry_address32;
931e62f8227SErik Schmauss 	u64 entry_address64;
932e62f8227SErik Schmauss 	u64 exit_address;
933e62f8227SErik Schmauss 	u64 log_area_address;
934e62f8227SErik Schmauss 	u32 log_area_length;
935e62f8227SErik Schmauss 	u64 arch_dependent_address;
936e62f8227SErik Schmauss 	u32 flags;
937e62f8227SErik Schmauss };
938e62f8227SErik Schmauss 
939e62f8227SErik Schmauss /* Flag Definitions for above */
940e62f8227SErik Schmauss 
941e62f8227SErik Schmauss #define ACPI_DRTM_ACCESS_ALLOWED            (1)
942e62f8227SErik Schmauss #define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
943e62f8227SErik Schmauss #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
944e62f8227SErik Schmauss #define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
945e62f8227SErik Schmauss 
946e62f8227SErik Schmauss /* 1) Validated Tables List (64-bit addresses) */
947e62f8227SErik Schmauss 
948e62f8227SErik Schmauss struct acpi_drtm_vtable_list {
949e62f8227SErik Schmauss 	u32 validated_table_count;
95048ff467cSKees Cook 	u64 validated_tables[];
951e62f8227SErik Schmauss };
952e62f8227SErik Schmauss 
953e62f8227SErik Schmauss /* 2) Resources List (of Resource Descriptors) */
954e62f8227SErik Schmauss 
955e62f8227SErik Schmauss /* Resource Descriptor */
956e62f8227SErik Schmauss 
957e62f8227SErik Schmauss struct acpi_drtm_resource {
958e62f8227SErik Schmauss 	u8 size[7];
959e62f8227SErik Schmauss 	u8 type;
960e62f8227SErik Schmauss 	u64 address;
961e62f8227SErik Schmauss };
962e62f8227SErik Schmauss 
963e62f8227SErik Schmauss struct acpi_drtm_resource_list {
964e62f8227SErik Schmauss 	u32 resource_count;
96548ff467cSKees Cook 	struct acpi_drtm_resource resources[];
966e62f8227SErik Schmauss };
967e62f8227SErik Schmauss 
968e62f8227SErik Schmauss /* 3) Platform-specific Identifiers List */
969e62f8227SErik Schmauss 
970e62f8227SErik Schmauss struct acpi_drtm_dps_id {
971e62f8227SErik Schmauss 	u32 dps_id_length;
972e62f8227SErik Schmauss 	u8 dps_id[16];
973e62f8227SErik Schmauss };
974e62f8227SErik Schmauss 
975e62f8227SErik Schmauss /*******************************************************************************
976e62f8227SErik Schmauss  *
977793c2388SBob Moore  * ECDT - Embedded Controller Boot Resources Table
9786e2d5ebdSBob Moore  *        Version 1
979793c2388SBob Moore  *
980793c2388SBob Moore  ******************************************************************************/
981793c2388SBob Moore 
982f3d2e786SBob Moore struct acpi_table_ecdt {
983f3d2e786SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
984f3d2e786SBob Moore 	struct acpi_generic_address control;	/* Address of EC command/status register */
985f3d2e786SBob Moore 	struct acpi_generic_address data;	/* Address of EC data register */
986793c2388SBob Moore 	u32 uid;		/* Unique ID - must be same as the EC _UID method */
987f3d2e786SBob Moore 	u8 gpe;			/* The GPE for the EC */
98848ff467cSKees Cook 	u8 id[];		/* Full namepath of the EC in the ACPI namespace */
989793c2388SBob Moore };
990793c2388SBob Moore 
991793c2388SBob Moore /*******************************************************************************
992793c2388SBob Moore  *
9936e2d5ebdSBob Moore  * EINJ - Error Injection Table (ACPI 4.0)
9946e2d5ebdSBob Moore  *        Version 1
995970d9c9eSBob Moore  *
996970d9c9eSBob Moore  ******************************************************************************/
997970d9c9eSBob Moore 
998970d9c9eSBob Moore struct acpi_table_einj {
999970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1000970d9c9eSBob Moore 	u32 header_length;
10016e2d5ebdSBob Moore 	u8 flags;
10026e2d5ebdSBob Moore 	u8 reserved[3];
1003970d9c9eSBob Moore 	u32 entries;
1004970d9c9eSBob Moore };
1005970d9c9eSBob Moore 
1006970d9c9eSBob Moore /* EINJ Injection Instruction Entries (actions) */
1007970d9c9eSBob Moore 
1008970d9c9eSBob Moore struct acpi_einj_entry {
1009970d9c9eSBob Moore 	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
1010970d9c9eSBob Moore };
1011970d9c9eSBob Moore 
10126e2d5ebdSBob Moore /* Masks for Flags field above */
10136e2d5ebdSBob Moore 
10146e2d5ebdSBob Moore #define ACPI_EINJ_PRESERVE          (1)
10156e2d5ebdSBob Moore 
1016970d9c9eSBob Moore /* Values for Action field above */
1017970d9c9eSBob Moore 
1018970d9c9eSBob Moore enum acpi_einj_actions {
1019970d9c9eSBob Moore 	ACPI_EINJ_BEGIN_OPERATION = 0,
1020970d9c9eSBob Moore 	ACPI_EINJ_GET_TRIGGER_TABLE = 1,
1021970d9c9eSBob Moore 	ACPI_EINJ_SET_ERROR_TYPE = 2,
1022970d9c9eSBob Moore 	ACPI_EINJ_GET_ERROR_TYPE = 3,
1023970d9c9eSBob Moore 	ACPI_EINJ_END_OPERATION = 4,
1024970d9c9eSBob Moore 	ACPI_EINJ_EXECUTE_OPERATION = 5,
1025970d9c9eSBob Moore 	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
1026970d9c9eSBob Moore 	ACPI_EINJ_GET_COMMAND_STATUS = 7,
1027c5bd6537SBob Moore 	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
1028a88e0ce6SBob Moore 	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
1029a88e0ce6SBob Moore 	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved */
1030970d9c9eSBob Moore 	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
1031970d9c9eSBob Moore };
1032970d9c9eSBob Moore 
1033970d9c9eSBob Moore /* Values for Instruction field above */
1034970d9c9eSBob Moore 
1035970d9c9eSBob Moore enum acpi_einj_instructions {
1036970d9c9eSBob Moore 	ACPI_EINJ_READ_REGISTER = 0,
1037970d9c9eSBob Moore 	ACPI_EINJ_READ_REGISTER_VALUE = 1,
1038970d9c9eSBob Moore 	ACPI_EINJ_WRITE_REGISTER = 2,
1039970d9c9eSBob Moore 	ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
1040970d9c9eSBob Moore 	ACPI_EINJ_NOOP = 4,
1041c5bd6537SBob Moore 	ACPI_EINJ_FLUSH_CACHELINE = 5,
1042c5bd6537SBob Moore 	ACPI_EINJ_INSTRUCTION_RESERVED = 6	/* 6 and greater are reserved */
1043c5bd6537SBob Moore };
1044c5bd6537SBob Moore 
1045c5bd6537SBob Moore struct acpi_einj_error_type_with_addr {
1046c5bd6537SBob Moore 	u32 error_type;
1047c5bd6537SBob Moore 	u32 vendor_struct_offset;
1048c5bd6537SBob Moore 	u32 flags;
1049c5bd6537SBob Moore 	u32 apic_id;
1050c5bd6537SBob Moore 	u64 address;
1051c5bd6537SBob Moore 	u64 range;
1052c5bd6537SBob Moore 	u32 pcie_id;
1053c5bd6537SBob Moore };
1054c5bd6537SBob Moore 
1055c5bd6537SBob Moore struct acpi_einj_vendor {
1056c5bd6537SBob Moore 	u32 length;
1057c5bd6537SBob Moore 	u32 pcie_id;
1058c5bd6537SBob Moore 	u16 vendor_id;
1059c5bd6537SBob Moore 	u16 device_id;
1060c5bd6537SBob Moore 	u8 revision_id;
1061c5bd6537SBob Moore 	u8 reserved[3];
1062970d9c9eSBob Moore };
1063970d9c9eSBob Moore 
10643fa34777SBob Moore /* EINJ Trigger Error Action Table */
10653fa34777SBob Moore 
10663fa34777SBob Moore struct acpi_einj_trigger {
10673fa34777SBob Moore 	u32 header_size;
10683fa34777SBob Moore 	u32 revision;
10693fa34777SBob Moore 	u32 table_size;
10703fa34777SBob Moore 	u32 entry_count;
10713fa34777SBob Moore };
10723fa34777SBob Moore 
10736e2d5ebdSBob Moore /* Command status return values */
10746e2d5ebdSBob Moore 
10756e2d5ebdSBob Moore enum acpi_einj_command_status {
10766e2d5ebdSBob Moore 	ACPI_EINJ_SUCCESS = 0,
10776e2d5ebdSBob Moore 	ACPI_EINJ_FAILURE = 1,
10786e2d5ebdSBob Moore 	ACPI_EINJ_INVALID_ACCESS = 2,
10796e2d5ebdSBob Moore 	ACPI_EINJ_STATUS_RESERVED = 3	/* 3 and greater are reserved */
10806e2d5ebdSBob Moore };
10816e2d5ebdSBob Moore 
10826e2d5ebdSBob Moore /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
10836e2d5ebdSBob Moore 
10846e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
10856e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
10866e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
10876e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
10886e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
10896e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
10906e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
10916e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
10926e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_FATAL                (1<<8)
10936e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
10946e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
10956e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
1096c5bd6537SBob Moore #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
10976e2d5ebdSBob Moore 
1098970d9c9eSBob Moore /*******************************************************************************
1099970d9c9eSBob Moore  *
11006e2d5ebdSBob Moore  * ERST - Error Record Serialization Table (ACPI 4.0)
11016e2d5ebdSBob Moore  *        Version 1
1102970d9c9eSBob Moore  *
1103970d9c9eSBob Moore  ******************************************************************************/
1104970d9c9eSBob Moore 
1105970d9c9eSBob Moore struct acpi_table_erst {
1106970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1107970d9c9eSBob Moore 	u32 header_length;
1108970d9c9eSBob Moore 	u32 reserved;
1109970d9c9eSBob Moore 	u32 entries;
1110970d9c9eSBob Moore };
1111970d9c9eSBob Moore 
1112970d9c9eSBob Moore /* ERST Serialization Entries (actions) */
1113970d9c9eSBob Moore 
1114970d9c9eSBob Moore struct acpi_erst_entry {
1115970d9c9eSBob Moore 	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
1116970d9c9eSBob Moore };
1117970d9c9eSBob Moore 
11186e2d5ebdSBob Moore /* Masks for Flags field above */
11196e2d5ebdSBob Moore 
11206e2d5ebdSBob Moore #define ACPI_ERST_PRESERVE          (1)
11216e2d5ebdSBob Moore 
1122970d9c9eSBob Moore /* Values for Action field above */
1123970d9c9eSBob Moore 
1124970d9c9eSBob Moore enum acpi_erst_actions {
11256e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_WRITE = 0,
11266e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_READ = 1,
11276e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_CLEAR = 2,
11286e2d5ebdSBob Moore 	ACPI_ERST_END = 3,
1129970d9c9eSBob Moore 	ACPI_ERST_SET_RECORD_OFFSET = 4,
1130970d9c9eSBob Moore 	ACPI_ERST_EXECUTE_OPERATION = 5,
1131970d9c9eSBob Moore 	ACPI_ERST_CHECK_BUSY_STATUS = 6,
1132970d9c9eSBob Moore 	ACPI_ERST_GET_COMMAND_STATUS = 7,
11336e2d5ebdSBob Moore 	ACPI_ERST_GET_RECORD_ID = 8,
11346e2d5ebdSBob Moore 	ACPI_ERST_SET_RECORD_ID = 9,
1135970d9c9eSBob Moore 	ACPI_ERST_GET_RECORD_COUNT = 10,
1136970d9c9eSBob Moore 	ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
1137970d9c9eSBob Moore 	ACPI_ERST_NOT_USED = 12,
1138970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_RANGE = 13,
1139970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_LENGTH = 14,
1140970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
1141a88e0ce6SBob Moore 	ACPI_ERST_EXECUTE_TIMINGS = 16,
1142a88e0ce6SBob Moore 	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved */
1143970d9c9eSBob Moore };
1144970d9c9eSBob Moore 
1145970d9c9eSBob Moore /* Values for Instruction field above */
1146970d9c9eSBob Moore 
1147970d9c9eSBob Moore enum acpi_erst_instructions {
1148970d9c9eSBob Moore 	ACPI_ERST_READ_REGISTER = 0,
1149970d9c9eSBob Moore 	ACPI_ERST_READ_REGISTER_VALUE = 1,
1150970d9c9eSBob Moore 	ACPI_ERST_WRITE_REGISTER = 2,
1151970d9c9eSBob Moore 	ACPI_ERST_WRITE_REGISTER_VALUE = 3,
1152970d9c9eSBob Moore 	ACPI_ERST_NOOP = 4,
1153970d9c9eSBob Moore 	ACPI_ERST_LOAD_VAR1 = 5,
1154970d9c9eSBob Moore 	ACPI_ERST_LOAD_VAR2 = 6,
1155970d9c9eSBob Moore 	ACPI_ERST_STORE_VAR1 = 7,
1156970d9c9eSBob Moore 	ACPI_ERST_ADD = 8,
1157970d9c9eSBob Moore 	ACPI_ERST_SUBTRACT = 9,
1158970d9c9eSBob Moore 	ACPI_ERST_ADD_VALUE = 10,
1159970d9c9eSBob Moore 	ACPI_ERST_SUBTRACT_VALUE = 11,
1160970d9c9eSBob Moore 	ACPI_ERST_STALL = 12,
1161970d9c9eSBob Moore 	ACPI_ERST_STALL_WHILE_TRUE = 13,
1162970d9c9eSBob Moore 	ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
1163970d9c9eSBob Moore 	ACPI_ERST_GOTO = 15,
1164970d9c9eSBob Moore 	ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
1165970d9c9eSBob Moore 	ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
1166970d9c9eSBob Moore 	ACPI_ERST_MOVE_DATA = 18,
1167970d9c9eSBob Moore 	ACPI_ERST_INSTRUCTION_RESERVED = 19	/* 19 and greater are reserved */
1168970d9c9eSBob Moore };
1169970d9c9eSBob Moore 
11706e2d5ebdSBob Moore /* Command status return values */
11716e2d5ebdSBob Moore 
11726e2d5ebdSBob Moore enum acpi_erst_command_status {
117354a2a15aSBob Moore 	ACPI_ERST_SUCCESS = 0,
11746e2d5ebdSBob Moore 	ACPI_ERST_NO_SPACE = 1,
11756e2d5ebdSBob Moore 	ACPI_ERST_NOT_AVAILABLE = 2,
11766e2d5ebdSBob Moore 	ACPI_ERST_FAILURE = 3,
11776e2d5ebdSBob Moore 	ACPI_ERST_RECORD_EMPTY = 4,
11786e2d5ebdSBob Moore 	ACPI_ERST_NOT_FOUND = 5,
11796e2d5ebdSBob Moore 	ACPI_ERST_STATUS_RESERVED = 6	/* 6 and greater are reserved */
11806e2d5ebdSBob Moore };
11816e2d5ebdSBob Moore 
11826e2d5ebdSBob Moore /* Error Record Serialization Information */
11836e2d5ebdSBob Moore 
11846e2d5ebdSBob Moore struct acpi_erst_info {
11856e2d5ebdSBob Moore 	u16 signature;		/* Should be "ER" */
11866e2d5ebdSBob Moore 	u8 data[48];
11876e2d5ebdSBob Moore };
11886e2d5ebdSBob Moore 
1189970d9c9eSBob Moore /*******************************************************************************
1190970d9c9eSBob Moore  *
1191e62f8227SErik Schmauss  * FPDT - Firmware Performance Data Table (ACPI 5.0)
1192e62f8227SErik Schmauss  *        Version 1
1193e62f8227SErik Schmauss  *
1194e62f8227SErik Schmauss  ******************************************************************************/
1195e62f8227SErik Schmauss 
1196e62f8227SErik Schmauss struct acpi_table_fpdt {
1197e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1198e62f8227SErik Schmauss };
1199e62f8227SErik Schmauss 
1200e62f8227SErik Schmauss /* FPDT subtable header (Performance Record Structure) */
1201e62f8227SErik Schmauss 
1202e62f8227SErik Schmauss struct acpi_fpdt_header {
1203e62f8227SErik Schmauss 	u16 type;
1204e62f8227SErik Schmauss 	u8 length;
1205e62f8227SErik Schmauss 	u8 revision;
1206e62f8227SErik Schmauss };
1207e62f8227SErik Schmauss 
1208e62f8227SErik Schmauss /* Values for Type field above */
1209e62f8227SErik Schmauss 
1210e62f8227SErik Schmauss enum acpi_fpdt_type {
1211e62f8227SErik Schmauss 	ACPI_FPDT_TYPE_BOOT = 0,
1212e62f8227SErik Schmauss 	ACPI_FPDT_TYPE_S3PERF = 1
1213e62f8227SErik Schmauss };
1214e62f8227SErik Schmauss 
1215e62f8227SErik Schmauss /*
1216e62f8227SErik Schmauss  * FPDT subtables
1217e62f8227SErik Schmauss  */
1218e62f8227SErik Schmauss 
1219e62f8227SErik Schmauss /* 0: Firmware Basic Boot Performance Record */
1220e62f8227SErik Schmauss 
1221e62f8227SErik Schmauss struct acpi_fpdt_boot_pointer {
1222e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1223e62f8227SErik Schmauss 	u8 reserved[4];
1224e62f8227SErik Schmauss 	u64 address;
1225e62f8227SErik Schmauss };
1226e62f8227SErik Schmauss 
1227e62f8227SErik Schmauss /* 1: S3 Performance Table Pointer Record */
1228e62f8227SErik Schmauss 
1229e62f8227SErik Schmauss struct acpi_fpdt_s3pt_pointer {
1230e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1231e62f8227SErik Schmauss 	u8 reserved[4];
1232e62f8227SErik Schmauss 	u64 address;
1233e62f8227SErik Schmauss };
1234e62f8227SErik Schmauss 
1235e62f8227SErik Schmauss /*
1236e62f8227SErik Schmauss  * S3PT - S3 Performance Table. This table is pointed to by the
1237e62f8227SErik Schmauss  * S3 Pointer Record above.
1238e62f8227SErik Schmauss  */
1239e62f8227SErik Schmauss struct acpi_table_s3pt {
1240e62f8227SErik Schmauss 	u8 signature[4];	/* "S3PT" */
1241e62f8227SErik Schmauss 	u32 length;
1242e62f8227SErik Schmauss };
1243e62f8227SErik Schmauss 
1244e62f8227SErik Schmauss /*
1245e62f8227SErik Schmauss  * S3PT Subtables (Not part of the actual FPDT)
1246e62f8227SErik Schmauss  */
1247e62f8227SErik Schmauss 
1248e62f8227SErik Schmauss /* Values for Type field in S3PT header */
1249e62f8227SErik Schmauss 
1250e62f8227SErik Schmauss enum acpi_s3pt_type {
1251e62f8227SErik Schmauss 	ACPI_S3PT_TYPE_RESUME = 0,
1252e62f8227SErik Schmauss 	ACPI_S3PT_TYPE_SUSPEND = 1,
1253e62f8227SErik Schmauss 	ACPI_FPDT_BOOT_PERFORMANCE = 2
1254e62f8227SErik Schmauss };
1255e62f8227SErik Schmauss 
1256e62f8227SErik Schmauss struct acpi_s3pt_resume {
1257e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1258e62f8227SErik Schmauss 	u32 resume_count;
1259e62f8227SErik Schmauss 	u64 full_resume;
1260e62f8227SErik Schmauss 	u64 average_resume;
1261e62f8227SErik Schmauss };
1262e62f8227SErik Schmauss 
1263e62f8227SErik Schmauss struct acpi_s3pt_suspend {
1264e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1265e62f8227SErik Schmauss 	u64 suspend_start;
1266e62f8227SErik Schmauss 	u64 suspend_end;
1267e62f8227SErik Schmauss };
1268e62f8227SErik Schmauss 
1269e62f8227SErik Schmauss /*
1270e62f8227SErik Schmauss  * FPDT Boot Performance Record (Not part of the actual FPDT)
1271e62f8227SErik Schmauss  */
1272e62f8227SErik Schmauss struct acpi_fpdt_boot {
1273e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1274e62f8227SErik Schmauss 	u8 reserved[4];
1275e62f8227SErik Schmauss 	u64 reset_end;
1276e62f8227SErik Schmauss 	u64 load_start;
1277e62f8227SErik Schmauss 	u64 startup_start;
1278e62f8227SErik Schmauss 	u64 exit_services_entry;
1279e62f8227SErik Schmauss 	u64 exit_services_exit;
1280e62f8227SErik Schmauss };
1281e62f8227SErik Schmauss 
1282e62f8227SErik Schmauss /*******************************************************************************
1283e62f8227SErik Schmauss  *
1284e62f8227SErik Schmauss  * GTDT - Generic Timer Description Table (ACPI 5.1)
1285e62f8227SErik Schmauss  *        Version 2
1286e62f8227SErik Schmauss  *
1287e62f8227SErik Schmauss  ******************************************************************************/
1288e62f8227SErik Schmauss 
1289e62f8227SErik Schmauss struct acpi_table_gtdt {
1290e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1291e62f8227SErik Schmauss 	u64 counter_block_addresss;
1292e62f8227SErik Schmauss 	u32 reserved;
1293e62f8227SErik Schmauss 	u32 secure_el1_interrupt;
1294e62f8227SErik Schmauss 	u32 secure_el1_flags;
1295e62f8227SErik Schmauss 	u32 non_secure_el1_interrupt;
1296e62f8227SErik Schmauss 	u32 non_secure_el1_flags;
1297e62f8227SErik Schmauss 	u32 virtual_timer_interrupt;
1298e62f8227SErik Schmauss 	u32 virtual_timer_flags;
1299e62f8227SErik Schmauss 	u32 non_secure_el2_interrupt;
1300e62f8227SErik Schmauss 	u32 non_secure_el2_flags;
1301e62f8227SErik Schmauss 	u64 counter_read_block_address;
1302e62f8227SErik Schmauss 	u32 platform_timer_count;
1303e62f8227SErik Schmauss 	u32 platform_timer_offset;
1304e62f8227SErik Schmauss };
1305e62f8227SErik Schmauss 
1306e62f8227SErik Schmauss /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
1307e62f8227SErik Schmauss 
1308e62f8227SErik Schmauss #define ACPI_GTDT_INTERRUPT_MODE        (1)
1309e62f8227SErik Schmauss #define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
1310e62f8227SErik Schmauss #define ACPI_GTDT_ALWAYS_ON             (1<<2)
1311e62f8227SErik Schmauss 
13128f5a14d0SErik Schmauss struct acpi_gtdt_el2 {
13138f5a14d0SErik Schmauss 	u32 virtual_el2_timer_gsiv;
13148f5a14d0SErik Schmauss 	u32 virtual_el2_timer_flags;
13158f5a14d0SErik Schmauss };
13168f5a14d0SErik Schmauss 
1317e62f8227SErik Schmauss /* Common GTDT subtable header */
1318e62f8227SErik Schmauss 
1319e62f8227SErik Schmauss struct acpi_gtdt_header {
1320e62f8227SErik Schmauss 	u8 type;
1321e62f8227SErik Schmauss 	u16 length;
1322e62f8227SErik Schmauss };
1323e62f8227SErik Schmauss 
1324e62f8227SErik Schmauss /* Values for GTDT subtable type above */
1325e62f8227SErik Schmauss 
1326e62f8227SErik Schmauss enum acpi_gtdt_type {
1327e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
1328e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_WATCHDOG = 1,
1329e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
1330e62f8227SErik Schmauss };
1331e62f8227SErik Schmauss 
1332e62f8227SErik Schmauss /* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
1333e62f8227SErik Schmauss 
1334e62f8227SErik Schmauss /* 0: Generic Timer Block */
1335e62f8227SErik Schmauss 
1336e62f8227SErik Schmauss struct acpi_gtdt_timer_block {
1337e62f8227SErik Schmauss 	struct acpi_gtdt_header header;
1338e62f8227SErik Schmauss 	u8 reserved;
1339e62f8227SErik Schmauss 	u64 block_address;
1340e62f8227SErik Schmauss 	u32 timer_count;
1341e62f8227SErik Schmauss 	u32 timer_offset;
1342e62f8227SErik Schmauss };
1343e62f8227SErik Schmauss 
1344e62f8227SErik Schmauss /* Timer Sub-Structure, one per timer */
1345e62f8227SErik Schmauss 
1346e62f8227SErik Schmauss struct acpi_gtdt_timer_entry {
1347e62f8227SErik Schmauss 	u8 frame_number;
1348e62f8227SErik Schmauss 	u8 reserved[3];
1349e62f8227SErik Schmauss 	u64 base_address;
1350e62f8227SErik Schmauss 	u64 el0_base_address;
1351e62f8227SErik Schmauss 	u32 timer_interrupt;
1352e62f8227SErik Schmauss 	u32 timer_flags;
1353e62f8227SErik Schmauss 	u32 virtual_timer_interrupt;
1354e62f8227SErik Schmauss 	u32 virtual_timer_flags;
1355e62f8227SErik Schmauss 	u32 common_flags;
1356e62f8227SErik Schmauss };
1357e62f8227SErik Schmauss 
1358e62f8227SErik Schmauss /* Flag Definitions: timer_flags and virtual_timer_flags above */
1359e62f8227SErik Schmauss 
1360e62f8227SErik Schmauss #define ACPI_GTDT_GT_IRQ_MODE               (1)
1361e62f8227SErik Schmauss #define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
1362e62f8227SErik Schmauss 
1363e62f8227SErik Schmauss /* Flag Definitions: common_flags above */
1364e62f8227SErik Schmauss 
1365e62f8227SErik Schmauss #define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
1366e62f8227SErik Schmauss #define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
1367e62f8227SErik Schmauss 
1368e62f8227SErik Schmauss /* 1: SBSA Generic Watchdog Structure */
1369e62f8227SErik Schmauss 
1370e62f8227SErik Schmauss struct acpi_gtdt_watchdog {
1371e62f8227SErik Schmauss 	struct acpi_gtdt_header header;
1372e62f8227SErik Schmauss 	u8 reserved;
1373e62f8227SErik Schmauss 	u64 refresh_frame_address;
1374e62f8227SErik Schmauss 	u64 control_frame_address;
1375e62f8227SErik Schmauss 	u32 timer_interrupt;
1376e62f8227SErik Schmauss 	u32 timer_flags;
1377e62f8227SErik Schmauss };
1378e62f8227SErik Schmauss 
1379e62f8227SErik Schmauss /* Flag Definitions: timer_flags above */
1380e62f8227SErik Schmauss 
1381e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
1382e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
1383e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
1384e62f8227SErik Schmauss 
1385e62f8227SErik Schmauss /*******************************************************************************
1386e62f8227SErik Schmauss  *
13876e2d5ebdSBob Moore  * HEST - Hardware Error Source Table (ACPI 4.0)
13886e2d5ebdSBob Moore  *        Version 1
1389970d9c9eSBob Moore  *
1390970d9c9eSBob Moore  ******************************************************************************/
1391970d9c9eSBob Moore 
1392970d9c9eSBob Moore struct acpi_table_hest {
1393970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1394970d9c9eSBob Moore 	u32 error_source_count;
1395970d9c9eSBob Moore };
1396970d9c9eSBob Moore 
13973fa34777SBob Moore /* HEST subtable header */
13983fa34777SBob Moore 
13993fa34777SBob Moore struct acpi_hest_header {
14003fa34777SBob Moore 	u16 type;
14016e2d5ebdSBob Moore 	u16 source_id;
14023fa34777SBob Moore };
14033fa34777SBob Moore 
14043fa34777SBob Moore /* Values for Type field above for subtables */
14053fa34777SBob Moore 
14063fa34777SBob Moore enum acpi_hest_types {
14076e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_CHECK = 0,
14086e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
14096e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_NMI = 2,
14106e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED3 = 3,
14116e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED4 = 4,
14126e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED5 = 5,
14133fa34777SBob Moore 	ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
14143fa34777SBob Moore 	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
14153fa34777SBob Moore 	ACPI_HEST_TYPE_AER_BRIDGE = 8,
14166e2d5ebdSBob Moore 	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
14177cd55c76SBob Moore 	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
1418c042933dSBob Moore 	ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
1419c042933dSBob Moore 	ACPI_HEST_TYPE_RESERVED = 12	/* 12 and greater are reserved */
14203fa34777SBob Moore };
14213fa34777SBob Moore 
14223fa34777SBob Moore /*
14236e2d5ebdSBob Moore  * HEST substructures contained in subtables
14243fa34777SBob Moore  */
14253fa34777SBob Moore 
14266e2d5ebdSBob Moore /*
14276e2d5ebdSBob Moore  * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
14286e2d5ebdSBob Moore  * struct acpi_hest_ia_corrected structures.
14296e2d5ebdSBob Moore  */
14306e2d5ebdSBob Moore struct acpi_hest_ia_error_bank {
14313fa34777SBob Moore 	u8 bank_number;
14323fa34777SBob Moore 	u8 clear_status_on_init;
14333fa34777SBob Moore 	u8 status_format;
14346e2d5ebdSBob Moore 	u8 reserved;
14353fa34777SBob Moore 	u32 control_register;
14366e2d5ebdSBob Moore 	u64 control_data;
14373fa34777SBob Moore 	u32 status_register;
14383fa34777SBob Moore 	u32 address_register;
14393fa34777SBob Moore 	u32 misc_register;
14403fa34777SBob Moore };
14413fa34777SBob Moore 
14426e2d5ebdSBob Moore /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
14433fa34777SBob Moore 
14443fa34777SBob Moore struct acpi_hest_aer_common {
14456e2d5ebdSBob Moore 	u16 reserved1;
14463fa34777SBob Moore 	u8 flags;
14473fa34777SBob Moore 	u8 enabled;
1448c276e388SBob Moore 	u32 records_to_preallocate;
14493fa34777SBob Moore 	u32 max_sections_per_record;
14504059a310SBetty Dall 	u32 bus;		/* Bus and Segment numbers */
14513fa34777SBob Moore 	u16 device;
14523fa34777SBob Moore 	u16 function;
14533fa34777SBob Moore 	u16 device_control;
14546e2d5ebdSBob Moore 	u16 reserved2;
1455c276e388SBob Moore 	u32 uncorrectable_mask;
1456c276e388SBob Moore 	u32 uncorrectable_severity;
1457c276e388SBob Moore 	u32 correctable_mask;
1458c276e388SBob Moore 	u32 advanced_capabilities;
14593fa34777SBob Moore };
14603fa34777SBob Moore 
14616e2d5ebdSBob Moore /* Masks for HEST Flags fields */
14626e2d5ebdSBob Moore 
14636e2d5ebdSBob Moore #define ACPI_HEST_FIRMWARE_FIRST        (1)
14646e2d5ebdSBob Moore #define ACPI_HEST_GLOBAL                (1<<1)
14652e166c73SBob Moore #define ACPI_HEST_GHES_ASSIST           (1<<2)
14666e2d5ebdSBob Moore 
14674059a310SBetty Dall /*
14684059a310SBetty Dall  * Macros to access the bus/segment numbers in Bus field above:
14694059a310SBetty Dall  *  Bus number is encoded in bits 7:0
14704059a310SBetty Dall  *  Segment number is encoded in bits 23:8
14714059a310SBetty Dall  */
14724059a310SBetty Dall #define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
14734059a310SBetty Dall #define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
14744059a310SBetty Dall 
14753fa34777SBob Moore /* Hardware Error Notification */
14763fa34777SBob Moore 
14773fa34777SBob Moore struct acpi_hest_notify {
14783fa34777SBob Moore 	u8 type;
14793fa34777SBob Moore 	u8 length;
14803fa34777SBob Moore 	u16 config_write_enable;
14813fa34777SBob Moore 	u32 poll_interval;
14823fa34777SBob Moore 	u32 vector;
14833fa34777SBob Moore 	u32 polling_threshold_value;
14843fa34777SBob Moore 	u32 polling_threshold_window;
14853fa34777SBob Moore 	u32 error_threshold_value;
14863fa34777SBob Moore 	u32 error_threshold_window;
14873fa34777SBob Moore };
14883fa34777SBob Moore 
14893fa34777SBob Moore /* Values for Notify Type field above */
14903fa34777SBob Moore 
14913fa34777SBob Moore enum acpi_hest_notify_types {
14923fa34777SBob Moore 	ACPI_HEST_NOTIFY_POLLED = 0,
14933fa34777SBob Moore 	ACPI_HEST_NOTIFY_EXTERNAL = 1,
14943fa34777SBob Moore 	ACPI_HEST_NOTIFY_LOCAL = 2,
14953fa34777SBob Moore 	ACPI_HEST_NOTIFY_SCI = 3,
14963fa34777SBob Moore 	ACPI_HEST_NOTIFY_NMI = 4,
1497ca4a0314SBob Moore 	ACPI_HEST_NOTIFY_CMCI = 5,	/* ACPI 5.0 */
1498ca4a0314SBob Moore 	ACPI_HEST_NOTIFY_MCE = 6,	/* ACPI 5.0 */
14997cd55c76SBob Moore 	ACPI_HEST_NOTIFY_GPIO = 7,	/* ACPI 6.0 */
15007cd55c76SBob Moore 	ACPI_HEST_NOTIFY_SEA = 8,	/* ACPI 6.1 */
15017cd55c76SBob Moore 	ACPI_HEST_NOTIFY_SEI = 9,	/* ACPI 6.1 */
15027cd55c76SBob Moore 	ACPI_HEST_NOTIFY_GSIV = 10,	/* ACPI 6.1 */
15034a8a6058SBob Moore 	ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,	/* ACPI 6.2 */
15044a8a6058SBob Moore 	ACPI_HEST_NOTIFY_RESERVED = 12	/* 12 and greater are reserved */
15053fa34777SBob Moore };
15063fa34777SBob Moore 
15076e2d5ebdSBob Moore /* Values for config_write_enable bitfield above */
15086e2d5ebdSBob Moore 
15096e2d5ebdSBob Moore #define ACPI_HEST_TYPE                  (1)
15106e2d5ebdSBob Moore #define ACPI_HEST_POLL_INTERVAL         (1<<1)
15116e2d5ebdSBob Moore #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
15126e2d5ebdSBob Moore #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
15136e2d5ebdSBob Moore #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
15146e2d5ebdSBob Moore #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
15156e2d5ebdSBob Moore 
15163fa34777SBob Moore /*
15173fa34777SBob Moore  * HEST subtables
15183fa34777SBob Moore  */
15193fa34777SBob Moore 
15206e2d5ebdSBob Moore /* 0: IA32 Machine Check Exception */
15213fa34777SBob Moore 
15226e2d5ebdSBob Moore struct acpi_hest_ia_machine_check {
15233fa34777SBob Moore 	struct acpi_hest_header header;
15246e2d5ebdSBob Moore 	u16 reserved1;
1525c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
15266e2d5ebdSBob Moore 	u8 enabled;
1527c276e388SBob Moore 	u32 records_to_preallocate;
15283fa34777SBob Moore 	u32 max_sections_per_record;
15293fa34777SBob Moore 	u64 global_capability_data;
15303fa34777SBob Moore 	u64 global_control_data;
15313fa34777SBob Moore 	u8 num_hardware_banks;
15326e2d5ebdSBob Moore 	u8 reserved3[7];
15333fa34777SBob Moore };
15343fa34777SBob Moore 
15356e2d5ebdSBob Moore /* 1: IA32 Corrected Machine Check */
15363fa34777SBob Moore 
15371872bbc9SBob Moore struct acpi_hest_ia_corrected {
15383fa34777SBob Moore 	struct acpi_hest_header header;
15396e2d5ebdSBob Moore 	u16 reserved1;
1540c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
15413fa34777SBob Moore 	u8 enabled;
1542c276e388SBob Moore 	u32 records_to_preallocate;
15433fa34777SBob Moore 	u32 max_sections_per_record;
15443fa34777SBob Moore 	struct acpi_hest_notify notify;
15453fa34777SBob Moore 	u8 num_hardware_banks;
15466e2d5ebdSBob Moore 	u8 reserved2[3];
15473fa34777SBob Moore };
15483fa34777SBob Moore 
15496e2d5ebdSBob Moore /* 2: IA32 Non-Maskable Interrupt */
15503fa34777SBob Moore 
15516e2d5ebdSBob Moore struct acpi_hest_ia_nmi {
15523fa34777SBob Moore 	struct acpi_hest_header header;
15533fa34777SBob Moore 	u32 reserved;
1554c276e388SBob Moore 	u32 records_to_preallocate;
15553fa34777SBob Moore 	u32 max_sections_per_record;
15563fa34777SBob Moore 	u32 max_raw_data_length;
15573fa34777SBob Moore };
15583fa34777SBob Moore 
15596e2d5ebdSBob Moore /* 3,4,5: Not used */
15603fa34777SBob Moore 
15613fa34777SBob Moore /* 6: PCI Express Root Port AER */
15623fa34777SBob Moore 
15633fa34777SBob Moore struct acpi_hest_aer_root {
15643fa34777SBob Moore 	struct acpi_hest_header header;
15653fa34777SBob Moore 	struct acpi_hest_aer_common aer;
15663fa34777SBob Moore 	u32 root_error_command;
15673fa34777SBob Moore };
15683fa34777SBob Moore 
15693fa34777SBob Moore /* 7: PCI Express AER (AER Endpoint) */
15703fa34777SBob Moore 
15713fa34777SBob Moore struct acpi_hest_aer {
15723fa34777SBob Moore 	struct acpi_hest_header header;
15733fa34777SBob Moore 	struct acpi_hest_aer_common aer;
15743fa34777SBob Moore };
15753fa34777SBob Moore 
15763fa34777SBob Moore /* 8: PCI Express/PCI-X Bridge AER */
15773fa34777SBob Moore 
15783fa34777SBob Moore struct acpi_hest_aer_bridge {
15793fa34777SBob Moore 	struct acpi_hest_header header;
15803fa34777SBob Moore 	struct acpi_hest_aer_common aer;
1581c276e388SBob Moore 	u32 uncorrectable_mask2;
1582c276e388SBob Moore 	u32 uncorrectable_severity2;
1583c276e388SBob Moore 	u32 advanced_capabilities2;
15843fa34777SBob Moore };
15853fa34777SBob Moore 
15863fa34777SBob Moore /* 9: Generic Hardware Error Source */
15873fa34777SBob Moore 
15883fa34777SBob Moore struct acpi_hest_generic {
15893fa34777SBob Moore 	struct acpi_hest_header header;
15903fa34777SBob Moore 	u16 related_source_id;
15916e2d5ebdSBob Moore 	u8 reserved;
15923fa34777SBob Moore 	u8 enabled;
1593c276e388SBob Moore 	u32 records_to_preallocate;
15943fa34777SBob Moore 	u32 max_sections_per_record;
15953fa34777SBob Moore 	u32 max_raw_data_length;
15963fa34777SBob Moore 	struct acpi_generic_address error_status_address;
15973fa34777SBob Moore 	struct acpi_hest_notify notify;
15986e2d5ebdSBob Moore 	u32 error_block_length;
15996e2d5ebdSBob Moore };
16006e2d5ebdSBob Moore 
16017cd55c76SBob Moore /* 10: Generic Hardware Error Source, version 2 */
16027cd55c76SBob Moore 
16037cd55c76SBob Moore struct acpi_hest_generic_v2 {
16047cd55c76SBob Moore 	struct acpi_hest_header header;
16057cd55c76SBob Moore 	u16 related_source_id;
16067cd55c76SBob Moore 	u8 reserved;
16077cd55c76SBob Moore 	u8 enabled;
16087cd55c76SBob Moore 	u32 records_to_preallocate;
16097cd55c76SBob Moore 	u32 max_sections_per_record;
16107cd55c76SBob Moore 	u32 max_raw_data_length;
16117cd55c76SBob Moore 	struct acpi_generic_address error_status_address;
16127cd55c76SBob Moore 	struct acpi_hest_notify notify;
16137cd55c76SBob Moore 	u32 error_block_length;
16147cd55c76SBob Moore 	struct acpi_generic_address read_ack_register;
16157cd55c76SBob Moore 	u64 read_ack_preserve;
16167cd55c76SBob Moore 	u64 read_ack_write;
16177cd55c76SBob Moore };
16187cd55c76SBob Moore 
16196e2d5ebdSBob Moore /* Generic Error Status block */
16206e2d5ebdSBob Moore 
16210a00fd5eSLv Zheng struct acpi_hest_generic_status {
16226e2d5ebdSBob Moore 	u32 block_status;
16236e2d5ebdSBob Moore 	u32 raw_data_offset;
16246e2d5ebdSBob Moore 	u32 raw_data_length;
16256e2d5ebdSBob Moore 	u32 data_length;
16266e2d5ebdSBob Moore 	u32 error_severity;
16276e2d5ebdSBob Moore };
16286e2d5ebdSBob Moore 
16296e2d5ebdSBob Moore /* Values for block_status flags above */
16306e2d5ebdSBob Moore 
16310a00fd5eSLv Zheng #define ACPI_HEST_UNCORRECTABLE             (1)
16320a00fd5eSLv Zheng #define ACPI_HEST_CORRECTABLE               (1<<1)
16330a00fd5eSLv Zheng #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
16340a00fd5eSLv Zheng #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
16350a00fd5eSLv Zheng #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4)	/* 8 bits, error count */
16366e2d5ebdSBob Moore 
16376e2d5ebdSBob Moore /* Generic Error Data entry */
16386e2d5ebdSBob Moore 
16390a00fd5eSLv Zheng struct acpi_hest_generic_data {
16406e2d5ebdSBob Moore 	u8 section_type[16];
16416e2d5ebdSBob Moore 	u32 error_severity;
16426e2d5ebdSBob Moore 	u16 revision;
16436e2d5ebdSBob Moore 	u8 validation_bits;
16446e2d5ebdSBob Moore 	u8 flags;
16456e2d5ebdSBob Moore 	u32 error_data_length;
16466e2d5ebdSBob Moore 	u8 fru_id[16];
16476e2d5ebdSBob Moore 	u8 fru_text[20];
16483fa34777SBob Moore };
1649970d9c9eSBob Moore 
16507cd55c76SBob Moore /* Extension for revision 0x0300 */
16517cd55c76SBob Moore 
16527cd55c76SBob Moore struct acpi_hest_generic_data_v300 {
16537cd55c76SBob Moore 	u8 section_type[16];
16547cd55c76SBob Moore 	u32 error_severity;
16557cd55c76SBob Moore 	u16 revision;
16567cd55c76SBob Moore 	u8 validation_bits;
16577cd55c76SBob Moore 	u8 flags;
16587cd55c76SBob Moore 	u32 error_data_length;
16597cd55c76SBob Moore 	u8 fru_id[16];
16607cd55c76SBob Moore 	u8 fru_text[20];
16617cd55c76SBob Moore 	u64 time_stamp;
16627cd55c76SBob Moore };
16637cd55c76SBob Moore 
16647cd55c76SBob Moore /* Values for error_severity above */
16657cd55c76SBob Moore 
16667cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
16677cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_FATAL           1
16687cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_CORRECTED       2
16697cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_NONE            3
16707cd55c76SBob Moore 
16717cd55c76SBob Moore /* Flags for validation_bits above */
16727cd55c76SBob Moore 
16737cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_FRU_ID          (1)
16747cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
16757cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
16767cd55c76SBob Moore 
1677c042933dSBob Moore /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
1678c042933dSBob Moore 
1679c042933dSBob Moore struct acpi_hest_ia_deferred_check {
1680c042933dSBob Moore 	struct acpi_hest_header header;
1681c042933dSBob Moore 	u16 reserved1;
1682c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
1683c042933dSBob Moore 	u8 enabled;
1684c042933dSBob Moore 	u32 records_to_preallocate;
1685c042933dSBob Moore 	u32 max_sections_per_record;
1686c042933dSBob Moore 	struct acpi_hest_notify notify;
1687c042933dSBob Moore 	u8 num_hardware_banks;
1688c042933dSBob Moore 	u8 reserved2[3];
1689c042933dSBob Moore };
1690c042933dSBob Moore 
1691970d9c9eSBob Moore /*******************************************************************************
1692970d9c9eSBob Moore  *
1693fa418ddfSLv Zheng  * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
1694fa418ddfSLv Zheng  *        Version 1
1695fa418ddfSLv Zheng  *
1696fa418ddfSLv Zheng  ******************************************************************************/
1697fa418ddfSLv Zheng 
1698fa418ddfSLv Zheng struct acpi_table_hmat {
1699fa418ddfSLv Zheng 	struct acpi_table_header header;	/* Common ACPI table header */
1700fa418ddfSLv Zheng 	u32 reserved;
1701fa418ddfSLv Zheng };
1702fa418ddfSLv Zheng 
1703fa418ddfSLv Zheng /* Values for HMAT structure types */
1704fa418ddfSLv Zheng 
1705fa418ddfSLv Zheng enum acpi_hmat_type {
170657f5cf6eSAlison Schofield 	ACPI_HMAT_TYPE_PROXIMITY = 0,	/* Memory proximity domain attributes */
1707fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_LOCALITY = 1,	/* System locality latency and bandwidth information */
1708fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_CACHE = 2,	/* Memory side cache information */
1709fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_RESERVED = 3	/* 3 and greater are reserved */
1710fa418ddfSLv Zheng };
1711fa418ddfSLv Zheng 
1712fa418ddfSLv Zheng struct acpi_hmat_structure {
1713fa418ddfSLv Zheng 	u16 type;
1714fa418ddfSLv Zheng 	u16 reserved;
1715fa418ddfSLv Zheng 	u32 length;
1716fa418ddfSLv Zheng };
1717fa418ddfSLv Zheng 
1718fa418ddfSLv Zheng /*
1719fa418ddfSLv Zheng  * HMAT Structures, correspond to Type in struct acpi_hmat_structure
1720fa418ddfSLv Zheng  */
1721fa418ddfSLv Zheng 
17229a8d961fSErik Schmauss /* 0: Memory proximity domain attributes */
1723fa418ddfSLv Zheng 
17249a8d961fSErik Schmauss struct acpi_hmat_proximity_domain {
1725fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1726fa418ddfSLv Zheng 	u16 flags;
1727fa418ddfSLv Zheng 	u16 reserved1;
1728fa418ddfSLv Zheng 	u32 processor_PD;	/* Processor proximity domain */
1729fa418ddfSLv Zheng 	u32 memory_PD;		/* Memory proximity domain */
1730fa418ddfSLv Zheng 	u32 reserved2;
17319a8d961fSErik Schmauss 	u64 reserved3;
17329a8d961fSErik Schmauss 	u64 reserved4;
1733fa418ddfSLv Zheng };
1734fa418ddfSLv Zheng 
1735fa418ddfSLv Zheng /* Masks for Flags field above */
1736fa418ddfSLv Zheng 
1737fa418ddfSLv Zheng #define ACPI_HMAT_PROCESSOR_PD_VALID    (1)	/* 1: processor_PD field is valid */
1738fa418ddfSLv Zheng #define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)	/* 1: memory_PD field is valid */
1739fa418ddfSLv Zheng #define ACPI_HMAT_RESERVATION_HINT      (1<<2)	/* 1: Reservation hint */
1740fa418ddfSLv Zheng 
1741fa418ddfSLv Zheng /* 1: System locality latency and bandwidth information */
1742fa418ddfSLv Zheng 
1743fa418ddfSLv Zheng struct acpi_hmat_locality {
1744fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1745fa418ddfSLv Zheng 	u8 flags;
1746fa418ddfSLv Zheng 	u8 data_type;
1747f1489db6SBob Moore 	u8 min_transfer_size;
1748f1489db6SBob Moore 	u8 reserved1;
1749fa418ddfSLv Zheng 	u32 number_of_initiator_Pds;
1750fa418ddfSLv Zheng 	u32 number_of_target_Pds;
1751fa418ddfSLv Zheng 	u32 reserved2;
1752fa418ddfSLv Zheng 	u64 entry_base_unit;
1753fa418ddfSLv Zheng };
1754fa418ddfSLv Zheng 
1755fa418ddfSLv Zheng /* Masks for Flags field above */
1756fa418ddfSLv Zheng 
1757f1489db6SBob Moore #define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)     /* Bits 0-3 */
1758fa418ddfSLv Zheng 
1759f1489db6SBob Moore /* Values for Memory Hierarchy flags */
1760fa418ddfSLv Zheng 
1761fa418ddfSLv Zheng #define ACPI_HMAT_MEMORY            0
1762fa418ddfSLv Zheng #define ACPI_HMAT_LAST_LEVEL_CACHE  1
1763fa418ddfSLv Zheng #define ACPI_HMAT_1ST_LEVEL_CACHE   2
1764fa418ddfSLv Zheng #define ACPI_HMAT_2ND_LEVEL_CACHE   3
1765fa418ddfSLv Zheng #define ACPI_HMAT_3RD_LEVEL_CACHE   4
1766f1489db6SBob Moore #define ACPI_HMAT_MINIMUM_XFER_SIZE 0x10       /* Bit 4: ACPI 6.4 */
1767f1489db6SBob Moore #define ACPI_HMAT_NON_SEQUENTIAL_XFERS 0x20    /* Bit 5: ACPI 6.4 */
1768f1489db6SBob Moore 
1769fa418ddfSLv Zheng 
1770fa418ddfSLv Zheng /* Values for data_type field above */
1771fa418ddfSLv Zheng 
1772fa418ddfSLv Zheng #define ACPI_HMAT_ACCESS_LATENCY    0
1773fa418ddfSLv Zheng #define ACPI_HMAT_READ_LATENCY      1
1774fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_LATENCY     2
1775fa418ddfSLv Zheng #define ACPI_HMAT_ACCESS_BANDWIDTH  3
1776fa418ddfSLv Zheng #define ACPI_HMAT_READ_BANDWIDTH    4
1777fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_BANDWIDTH   5
1778fa418ddfSLv Zheng 
1779fa418ddfSLv Zheng /* 2: Memory side cache information */
1780fa418ddfSLv Zheng 
1781fa418ddfSLv Zheng struct acpi_hmat_cache {
1782fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1783fa418ddfSLv Zheng 	u32 memory_PD;
1784fa418ddfSLv Zheng 	u32 reserved1;
1785fa418ddfSLv Zheng 	u64 cache_size;
1786fa418ddfSLv Zheng 	u32 cache_attributes;
1787fa418ddfSLv Zheng 	u16 reserved2;
1788fa418ddfSLv Zheng 	u16 number_of_SMBIOShandles;
1789fa418ddfSLv Zheng };
1790fa418ddfSLv Zheng 
1791fa418ddfSLv Zheng /* Masks for cache_attributes field above */
1792fa418ddfSLv Zheng 
1793fa418ddfSLv Zheng #define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
1794fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
1795fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
1796fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
1797fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
1798fa418ddfSLv Zheng 
1799fa418ddfSLv Zheng /* Values for cache associativity flag */
1800fa418ddfSLv Zheng 
1801fa418ddfSLv Zheng #define ACPI_HMAT_CA_NONE                     (0)
1802fa418ddfSLv Zheng #define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
1803fa418ddfSLv Zheng #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
1804fa418ddfSLv Zheng 
1805fa418ddfSLv Zheng /* Values for write policy flag */
1806fa418ddfSLv Zheng 
1807fa418ddfSLv Zheng #define ACPI_HMAT_CP_NONE   (0)
1808fa418ddfSLv Zheng #define ACPI_HMAT_CP_WB     (1)
1809fa418ddfSLv Zheng #define ACPI_HMAT_CP_WT     (2)
1810fa418ddfSLv Zheng 
1811fa418ddfSLv Zheng /*******************************************************************************
1812fa418ddfSLv Zheng  *
1813e62f8227SErik Schmauss  * HPET - High Precision Event Timer table
18146e2d5ebdSBob Moore  *        Version 1
18156e2d5ebdSBob Moore  *
1816e62f8227SErik Schmauss  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
1817e62f8227SErik Schmauss  * Version 1.0a, October 2004
181804f8e384SBob Moore  *
181904f8e384SBob Moore  ******************************************************************************/
182004f8e384SBob Moore 
1821e62f8227SErik Schmauss struct acpi_table_hpet {
182204f8e384SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1823e62f8227SErik Schmauss 	u32 id;			/* Hardware ID of event timer block */
1824e62f8227SErik Schmauss 	struct acpi_generic_address address;	/* Address of event timer block */
1825e62f8227SErik Schmauss 	u8 sequence;		/* HPET sequence number */
1826e62f8227SErik Schmauss 	u16 minimum_tick;	/* Main counter min tick, periodic mode */
18274c189c9dSBob Moore 	u8 flags;
182881b7cb92SBob Moore };
182981b7cb92SBob Moore 
1830e62f8227SErik Schmauss /* Masks for Flags field above */
183181b7cb92SBob Moore 
1832e62f8227SErik Schmauss #define ACPI_HPET_PAGE_PROTECT_MASK (3)
1833e62f8227SErik Schmauss 
1834e62f8227SErik Schmauss /* Values for Page Protect flags */
1835e62f8227SErik Schmauss 
1836e62f8227SErik Schmauss enum acpi_hpet_page_protect {
1837e62f8227SErik Schmauss 	ACPI_HPET_NO_PAGE_PROTECT = 0,
1838e62f8227SErik Schmauss 	ACPI_HPET_PAGE_PROTECT4 = 1,
1839e62f8227SErik Schmauss 	ACPI_HPET_PAGE_PROTECT64 = 2
1840e62f8227SErik Schmauss };
184181b7cb92SBob Moore 
184281b7cb92SBob Moore /*******************************************************************************
184381b7cb92SBob Moore  *
1844e62f8227SErik Schmauss  * IBFT - Boot Firmware Table
1845b8355bcaSLv Zheng  *        Version 1
1846b8355bcaSLv Zheng  *
1847e62f8227SErik Schmauss  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
1848e62f8227SErik Schmauss  * Specification", Version 1.01, March 1, 2007
1849e62f8227SErik Schmauss  *
1850e62f8227SErik Schmauss  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
1851e62f8227SErik Schmauss  * Therefore, it is not currently supported by the disassembler.
1852e62f8227SErik Schmauss  *
1853b8355bcaSLv Zheng  ******************************************************************************/
1854b8355bcaSLv Zheng 
1855e62f8227SErik Schmauss struct acpi_table_ibft {
1856b8355bcaSLv Zheng 	struct acpi_table_header header;	/* Common ACPI table header */
1857e62f8227SErik Schmauss 	u8 reserved[12];
1858e62f8227SErik Schmauss };
1859e62f8227SErik Schmauss 
1860e62f8227SErik Schmauss /* IBFT common subtable header */
1861e62f8227SErik Schmauss 
1862e62f8227SErik Schmauss struct acpi_ibft_header {
1863e62f8227SErik Schmauss 	u8 type;
1864e62f8227SErik Schmauss 	u8 version;
1865e62f8227SErik Schmauss 	u16 length;
1866e62f8227SErik Schmauss 	u8 index;
1867e62f8227SErik Schmauss 	u8 flags;
1868b8355bcaSLv Zheng };
1869b8355bcaSLv Zheng 
1870b8355bcaSLv Zheng /* Values for Type field above */
1871b8355bcaSLv Zheng 
1872e62f8227SErik Schmauss enum acpi_ibft_type {
1873e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_NOT_USED = 0,
1874e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_CONTROL = 1,
1875e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_INITIATOR = 2,
1876e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_NIC = 3,
1877e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_TARGET = 4,
1878e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_EXTENSIONS = 5,
1879e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_RESERVED = 6	/* 6 and greater are reserved */
1880b8355bcaSLv Zheng };
1881b8355bcaSLv Zheng 
1882e62f8227SErik Schmauss /* IBFT subtables */
1883b8355bcaSLv Zheng 
1884e62f8227SErik Schmauss struct acpi_ibft_control {
1885e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1886e62f8227SErik Schmauss 	u16 extensions;
1887e62f8227SErik Schmauss 	u16 initiator_offset;
1888e62f8227SErik Schmauss 	u16 nic0_offset;
1889e62f8227SErik Schmauss 	u16 target0_offset;
1890e62f8227SErik Schmauss 	u16 nic1_offset;
1891e62f8227SErik Schmauss 	u16 target1_offset;
1892b8355bcaSLv Zheng };
1893b8355bcaSLv Zheng 
1894e62f8227SErik Schmauss struct acpi_ibft_initiator {
1895e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1896e62f8227SErik Schmauss 	u8 sns_server[16];
1897e62f8227SErik Schmauss 	u8 slp_server[16];
1898e62f8227SErik Schmauss 	u8 primary_server[16];
1899e62f8227SErik Schmauss 	u8 secondary_server[16];
1900e62f8227SErik Schmauss 	u16 name_length;
1901e62f8227SErik Schmauss 	u16 name_offset;
1902b8355bcaSLv Zheng };
1903b8355bcaSLv Zheng 
1904e62f8227SErik Schmauss struct acpi_ibft_nic {
1905e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1906e62f8227SErik Schmauss 	u8 ip_address[16];
1907e62f8227SErik Schmauss 	u8 subnet_mask_prefix;
1908e62f8227SErik Schmauss 	u8 origin;
1909e62f8227SErik Schmauss 	u8 gateway[16];
1910e62f8227SErik Schmauss 	u8 primary_dns[16];
1911e62f8227SErik Schmauss 	u8 secondary_dns[16];
1912e62f8227SErik Schmauss 	u8 dhcp[16];
1913e62f8227SErik Schmauss 	u16 vlan;
1914e62f8227SErik Schmauss 	u8 mac_address[6];
1915e62f8227SErik Schmauss 	u16 pci_address;
1916e62f8227SErik Schmauss 	u16 name_length;
1917e62f8227SErik Schmauss 	u16 name_offset;
1918b8355bcaSLv Zheng };
1919b8355bcaSLv Zheng 
1920e62f8227SErik Schmauss struct acpi_ibft_target {
1921e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1922e62f8227SErik Schmauss 	u8 target_ip_address[16];
1923e62f8227SErik Schmauss 	u16 target_ip_socket;
1924e62f8227SErik Schmauss 	u8 target_boot_lun[8];
1925e62f8227SErik Schmauss 	u8 chap_type;
1926e62f8227SErik Schmauss 	u8 nic_association;
1927e62f8227SErik Schmauss 	u16 target_name_length;
1928e62f8227SErik Schmauss 	u16 target_name_offset;
1929e62f8227SErik Schmauss 	u16 chap_name_length;
1930e62f8227SErik Schmauss 	u16 chap_name_offset;
1931e62f8227SErik Schmauss 	u16 chap_secret_length;
1932e62f8227SErik Schmauss 	u16 chap_secret_offset;
1933e62f8227SErik Schmauss 	u16 reverse_chap_name_length;
1934e62f8227SErik Schmauss 	u16 reverse_chap_name_offset;
1935e62f8227SErik Schmauss 	u16 reverse_chap_secret_length;
1936e62f8227SErik Schmauss 	u16 reverse_chap_secret_offset;
1937a618c7f8SBob Moore };
1938a618c7f8SBob Moore 
19396e596084SRobert Moore /* Reset to default packing */
19406e596084SRobert Moore 
19416e596084SRobert Moore #pragma pack()
19421da177e4SLinus Torvalds 
19431da177e4SLinus Torvalds #endif				/* __ACTBL1_H__ */
1944