xref: /openbmc/linux/include/acpi/actbl1.h (revision 95857638)
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  *
6da6f8320SBob Moore  * Copyright (C) 2000 - 2018, 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  */
27e62f8227SErik Schmauss #define ACPI_SIG_ASF            "ASF!"	/* Alert Standard Format table */
28970d9c9eSBob Moore #define ACPI_SIG_BERT           "BERT"	/* Boot Error Record Table */
29e62f8227SErik Schmauss #define ACPI_SIG_BGRT           "BGRT"	/* Boot Graphics Resource Table */
30e62f8227SErik Schmauss #define ACPI_SIG_BOOT           "BOOT"	/* Simple Boot Flag Table */
31793c2388SBob Moore #define ACPI_SIG_CPEP           "CPEP"	/* Corrected Platform Error Polling table */
32e62f8227SErik Schmauss #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resource Table */
33e62f8227SErik Schmauss #define ACPI_SIG_DBG2           "DBG2"	/* Debug Port table type 2 */
34e62f8227SErik Schmauss #define ACPI_SIG_DBGP           "DBGP"	/* Debug Port table */
35e62f8227SErik Schmauss #define ACPI_SIG_DMAR           "DMAR"	/* DMA Remapping table */
36e62f8227SErik Schmauss #define ACPI_SIG_DRTM           "DRTM"	/* Dynamic Root of Trust for Measurement table */
37793c2388SBob Moore #define ACPI_SIG_ECDT           "ECDT"	/* Embedded Controller Boot Resources Table */
38970d9c9eSBob Moore #define ACPI_SIG_EINJ           "EINJ"	/* Error Injection table */
39970d9c9eSBob Moore #define ACPI_SIG_ERST           "ERST"	/* Error Record Serialization Table */
40e62f8227SErik Schmauss #define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance Data Table */
41e62f8227SErik Schmauss #define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer Description Table */
42970d9c9eSBob Moore #define ACPI_SIG_HEST           "HEST"	/* Hardware Error Source Table */
43e62f8227SErik Schmauss #define ACPI_SIG_HMAT           "HMAT"	/* Heterogeneous Memory Attributes Table */
44e62f8227SErik Schmauss #define ACPI_SIG_HPET           "HPET"	/* High Precision Event Timer table */
45e62f8227SErik Schmauss #define ACPI_SIG_IBFT           "IBFT"	/* iSCSI Boot Firmware Table */
46e62f8227SErik Schmauss 
47e62f8227SErik Schmauss #define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
48e62f8227SErik Schmauss #define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
49e62f8227SErik Schmauss 
50e62f8227SErik Schmauss /* Reserved table signatures */
51e62f8227SErik Schmauss 
52e62f8227SErik Schmauss #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
53e62f8227SErik Schmauss #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
54e62f8227SErik Schmauss 
55e62f8227SErik Schmauss /*
56e62f8227SErik Schmauss  * These tables have been seen in the field, but no definition has been found
57e62f8227SErik Schmauss  */
58e62f8227SErik Schmauss #ifdef ACPI_UNDEFINED_TABLES
59e62f8227SErik Schmauss #define ACPI_SIG_ATKG           "ATKG"
60e62f8227SErik Schmauss #define ACPI_SIG_GSCI           "GSCI"	/* GMCH SCI table */
61e62f8227SErik Schmauss #define ACPI_SIG_IEIT           "IEIT"
62e62f8227SErik Schmauss #endif
63793c2388SBob Moore 
64793c2388SBob Moore /*
65793c2388SBob Moore  * All tables must be byte-packed to match the ACPI specification, since
66793c2388SBob Moore  * the tables are provided by the system BIOS.
67793c2388SBob Moore  */
681da177e4SLinus Torvalds #pragma pack(1)
691da177e4SLinus Torvalds 
701da177e4SLinus Torvalds /*
71be030a57SBob Moore  * Note: C bitfields are not used for this reason:
72be030a57SBob Moore  *
73be030a57SBob Moore  * "Bitfields are great and easy to read, but unfortunately the C language
74be030a57SBob Moore  * does not specify the layout of bitfields in memory, which means they are
75be030a57SBob Moore  * essentially useless for dealing with packed data in on-disk formats or
76be030a57SBob Moore  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
77be030a57SBob Moore  * this decision was a design error in C. Ritchie could have picked an order
78be030a57SBob Moore  * and stuck with it." Norman Ramsey.
79be030a57SBob Moore  * See http://stackoverflow.com/a/1053662/41661
801da177e4SLinus Torvalds  */
81793c2388SBob Moore 
826e2d5ebdSBob Moore /*******************************************************************************
836e2d5ebdSBob Moore  *
846e2d5ebdSBob Moore  * Common subtable headers
856e2d5ebdSBob Moore  *
866e2d5ebdSBob Moore  ******************************************************************************/
876e2d5ebdSBob Moore 
886e2d5ebdSBob Moore /* Generic subtable header (used in MADT, SRAT, etc.) */
89f3d2e786SBob Moore 
90f3d2e786SBob Moore struct acpi_subtable_header {
91f3d2e786SBob Moore 	u8 type;
92f3d2e786SBob Moore 	u8 length;
93f3d2e786SBob Moore };
94f3d2e786SBob Moore 
956e2d5ebdSBob Moore /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
96970d9c9eSBob Moore 
97970d9c9eSBob Moore struct acpi_whea_header {
98970d9c9eSBob Moore 	u8 action;
99970d9c9eSBob Moore 	u8 instruction;
100970d9c9eSBob Moore 	u8 flags;
101970d9c9eSBob Moore 	u8 reserved;
102970d9c9eSBob Moore 	struct acpi_generic_address register_region;
1033fa34777SBob Moore 	u64 value;		/* Value used with Read/Write register */
1043fa34777SBob Moore 	u64 mask;		/* Bitmask required for this register instruction */
105970d9c9eSBob Moore };
106970d9c9eSBob Moore 
107793c2388SBob Moore /*******************************************************************************
108793c2388SBob Moore  *
109e62f8227SErik Schmauss  * ASF - Alert Standard Format table (Signature "ASF!")
110e62f8227SErik Schmauss  *       Revision 0x10
111e62f8227SErik Schmauss  *
112e62f8227SErik Schmauss  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
113e62f8227SErik Schmauss  *
114e62f8227SErik Schmauss  ******************************************************************************/
115e62f8227SErik Schmauss 
116e62f8227SErik Schmauss struct acpi_table_asf {
117e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
118e62f8227SErik Schmauss };
119e62f8227SErik Schmauss 
120e62f8227SErik Schmauss /* ASF subtable header */
121e62f8227SErik Schmauss 
122e62f8227SErik Schmauss struct acpi_asf_header {
123e62f8227SErik Schmauss 	u8 type;
124e62f8227SErik Schmauss 	u8 reserved;
125e62f8227SErik Schmauss 	u16 length;
126e62f8227SErik Schmauss };
127e62f8227SErik Schmauss 
128e62f8227SErik Schmauss /* Values for Type field above */
129e62f8227SErik Schmauss 
130e62f8227SErik Schmauss enum acpi_asf_type {
131e62f8227SErik Schmauss 	ACPI_ASF_TYPE_INFO = 0,
132e62f8227SErik Schmauss 	ACPI_ASF_TYPE_ALERT = 1,
133e62f8227SErik Schmauss 	ACPI_ASF_TYPE_CONTROL = 2,
134e62f8227SErik Schmauss 	ACPI_ASF_TYPE_BOOT = 3,
135e62f8227SErik Schmauss 	ACPI_ASF_TYPE_ADDRESS = 4,
136e62f8227SErik Schmauss 	ACPI_ASF_TYPE_RESERVED = 5
137e62f8227SErik Schmauss };
138e62f8227SErik Schmauss 
139e62f8227SErik Schmauss /*
140e62f8227SErik Schmauss  * ASF subtables
141e62f8227SErik Schmauss  */
142e62f8227SErik Schmauss 
143e62f8227SErik Schmauss /* 0: ASF Information */
144e62f8227SErik Schmauss 
145e62f8227SErik Schmauss struct acpi_asf_info {
146e62f8227SErik Schmauss 	struct acpi_asf_header header;
147e62f8227SErik Schmauss 	u8 min_reset_value;
148e62f8227SErik Schmauss 	u8 min_poll_interval;
149e62f8227SErik Schmauss 	u16 system_id;
150e62f8227SErik Schmauss 	u32 mfg_id;
151e62f8227SErik Schmauss 	u8 flags;
152e62f8227SErik Schmauss 	u8 reserved2[3];
153e62f8227SErik Schmauss };
154e62f8227SErik Schmauss 
155e62f8227SErik Schmauss /* Masks for Flags field above */
156e62f8227SErik Schmauss 
157e62f8227SErik Schmauss #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
158e62f8227SErik Schmauss 
159e62f8227SErik Schmauss /* 1: ASF Alerts */
160e62f8227SErik Schmauss 
161e62f8227SErik Schmauss struct acpi_asf_alert {
162e62f8227SErik Schmauss 	struct acpi_asf_header header;
163e62f8227SErik Schmauss 	u8 assert_mask;
164e62f8227SErik Schmauss 	u8 deassert_mask;
165e62f8227SErik Schmauss 	u8 alerts;
166e62f8227SErik Schmauss 	u8 data_length;
167e62f8227SErik Schmauss };
168e62f8227SErik Schmauss 
169e62f8227SErik Schmauss struct acpi_asf_alert_data {
170e62f8227SErik Schmauss 	u8 address;
171e62f8227SErik Schmauss 	u8 command;
172e62f8227SErik Schmauss 	u8 mask;
173e62f8227SErik Schmauss 	u8 value;
174e62f8227SErik Schmauss 	u8 sensor_type;
175e62f8227SErik Schmauss 	u8 type;
176e62f8227SErik Schmauss 	u8 offset;
177e62f8227SErik Schmauss 	u8 source_type;
178e62f8227SErik Schmauss 	u8 severity;
179e62f8227SErik Schmauss 	u8 sensor_number;
180e62f8227SErik Schmauss 	u8 entity;
181e62f8227SErik Schmauss 	u8 instance;
182e62f8227SErik Schmauss };
183e62f8227SErik Schmauss 
184e62f8227SErik Schmauss /* 2: ASF Remote Control */
185e62f8227SErik Schmauss 
186e62f8227SErik Schmauss struct acpi_asf_remote {
187e62f8227SErik Schmauss 	struct acpi_asf_header header;
188e62f8227SErik Schmauss 	u8 controls;
189e62f8227SErik Schmauss 	u8 data_length;
190e62f8227SErik Schmauss 	u16 reserved2;
191e62f8227SErik Schmauss };
192e62f8227SErik Schmauss 
193e62f8227SErik Schmauss struct acpi_asf_control_data {
194e62f8227SErik Schmauss 	u8 function;
195e62f8227SErik Schmauss 	u8 address;
196e62f8227SErik Schmauss 	u8 command;
197e62f8227SErik Schmauss 	u8 value;
198e62f8227SErik Schmauss };
199e62f8227SErik Schmauss 
200e62f8227SErik Schmauss /* 3: ASF RMCP Boot Options */
201e62f8227SErik Schmauss 
202e62f8227SErik Schmauss struct acpi_asf_rmcp {
203e62f8227SErik Schmauss 	struct acpi_asf_header header;
204e62f8227SErik Schmauss 	u8 capabilities[7];
205e62f8227SErik Schmauss 	u8 completion_code;
206e62f8227SErik Schmauss 	u32 enterprise_id;
207e62f8227SErik Schmauss 	u8 command;
208e62f8227SErik Schmauss 	u16 parameter;
209e62f8227SErik Schmauss 	u16 boot_options;
210e62f8227SErik Schmauss 	u16 oem_parameters;
211e62f8227SErik Schmauss };
212e62f8227SErik Schmauss 
213e62f8227SErik Schmauss /* 4: ASF Address */
214e62f8227SErik Schmauss 
215e62f8227SErik Schmauss struct acpi_asf_address {
216e62f8227SErik Schmauss 	struct acpi_asf_header header;
217e62f8227SErik Schmauss 	u8 eprom_address;
218e62f8227SErik Schmauss 	u8 devices;
219e62f8227SErik Schmauss };
220e62f8227SErik Schmauss 
221e62f8227SErik Schmauss /*******************************************************************************
222e62f8227SErik Schmauss  *
2236e2d5ebdSBob Moore  * BERT - Boot Error Record Table (ACPI 4.0)
2246e2d5ebdSBob Moore  *        Version 1
225970d9c9eSBob Moore  *
226970d9c9eSBob Moore  ******************************************************************************/
227970d9c9eSBob Moore 
228970d9c9eSBob Moore struct acpi_table_bert {
229970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
230970d9c9eSBob Moore 	u32 region_length;	/* Length of the boot error region */
231b595076aSUwe Kleine-König 	u64 address;		/* Physical address of the error region */
232970d9c9eSBob Moore };
233970d9c9eSBob Moore 
2346e2d5ebdSBob Moore /* Boot Error Region (not a subtable, pointed to by Address field above) */
2353fa34777SBob Moore 
236970d9c9eSBob Moore struct acpi_bert_region {
2376e2d5ebdSBob Moore 	u32 block_status;	/* Type of error information */
2386e2d5ebdSBob Moore 	u32 raw_data_offset;	/* Offset to raw error data */
2396e2d5ebdSBob Moore 	u32 raw_data_length;	/* Length of raw error data */
2406e2d5ebdSBob Moore 	u32 data_length;	/* Length of generic error data */
2416e2d5ebdSBob Moore 	u32 error_severity;	/* Severity code */
242970d9c9eSBob Moore };
243970d9c9eSBob Moore 
2446e2d5ebdSBob Moore /* Values for block_status flags above */
245970d9c9eSBob Moore 
246970d9c9eSBob Moore #define ACPI_BERT_UNCORRECTABLE             (1)
2476e2d5ebdSBob Moore #define ACPI_BERT_CORRECTABLE               (1<<1)
2486e2d5ebdSBob Moore #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
2496e2d5ebdSBob Moore #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
2506e2d5ebdSBob Moore #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4)	/* 8 bits, error count */
2516e2d5ebdSBob Moore 
2526e2d5ebdSBob Moore /* Values for error_severity above */
2536e2d5ebdSBob Moore 
2546e2d5ebdSBob Moore enum acpi_bert_error_severity {
2556e2d5ebdSBob Moore 	ACPI_BERT_ERROR_CORRECTABLE = 0,
2566e2d5ebdSBob Moore 	ACPI_BERT_ERROR_FATAL = 1,
2576e2d5ebdSBob Moore 	ACPI_BERT_ERROR_CORRECTED = 2,
2586e2d5ebdSBob Moore 	ACPI_BERT_ERROR_NONE = 3,
2596e2d5ebdSBob Moore 	ACPI_BERT_ERROR_RESERVED = 4	/* 4 and greater are reserved */
2606e2d5ebdSBob Moore };
2616e2d5ebdSBob Moore 
2626e2d5ebdSBob Moore /*
2636e2d5ebdSBob Moore  * Note: The generic error data that follows the error_severity field above
2646e2d5ebdSBob Moore  * uses the struct acpi_hest_generic_data defined under the HEST table below
2656e2d5ebdSBob Moore  */
266970d9c9eSBob Moore 
267970d9c9eSBob Moore /*******************************************************************************
268970d9c9eSBob Moore  *
269e62f8227SErik Schmauss  * BGRT - Boot Graphics Resource Table (ACPI 5.0)
270e62f8227SErik Schmauss  *        Version 1
271e62f8227SErik Schmauss  *
272e62f8227SErik Schmauss  ******************************************************************************/
273e62f8227SErik Schmauss 
274e62f8227SErik Schmauss struct acpi_table_bgrt {
275e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
276e62f8227SErik Schmauss 	u16 version;
277e62f8227SErik Schmauss 	u8 status;
278e62f8227SErik Schmauss 	u8 image_type;
279e62f8227SErik Schmauss 	u64 image_address;
280e62f8227SErik Schmauss 	u32 image_offset_x;
281e62f8227SErik Schmauss 	u32 image_offset_y;
282e62f8227SErik Schmauss };
283e62f8227SErik Schmauss 
284e62f8227SErik Schmauss /* Flags for Status field above */
285e62f8227SErik Schmauss 
286e62f8227SErik Schmauss #define ACPI_BGRT_DISPLAYED                 (1)
287e62f8227SErik Schmauss #define ACPI_BGRT_ORIENTATION_OFFSET        (3 << 1)
288e62f8227SErik Schmauss 
289e62f8227SErik Schmauss /*******************************************************************************
290e62f8227SErik Schmauss  *
291e62f8227SErik Schmauss  * BOOT - Simple Boot Flag Table
292e62f8227SErik Schmauss  *        Version 1
293e62f8227SErik Schmauss  *
294e62f8227SErik Schmauss  * Conforms to the "Simple Boot Flag Specification", Version 2.1
295e62f8227SErik Schmauss  *
296e62f8227SErik Schmauss  ******************************************************************************/
297e62f8227SErik Schmauss 
298e62f8227SErik Schmauss struct acpi_table_boot {
299e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
300e62f8227SErik Schmauss 	u8 cmos_index;		/* Index in CMOS RAM for the boot register */
301e62f8227SErik Schmauss 	u8 reserved[3];
302e62f8227SErik Schmauss };
303e62f8227SErik Schmauss 
304e62f8227SErik Schmauss /*******************************************************************************
305e62f8227SErik Schmauss  *
3066e2d5ebdSBob Moore  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
3076e2d5ebdSBob Moore  *        Version 1
308793c2388SBob Moore  *
309793c2388SBob Moore  ******************************************************************************/
310793c2388SBob Moore 
311793c2388SBob Moore struct acpi_table_cpep {
312f3d2e786SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
313f3d2e786SBob Moore 	u64 reserved;
314793c2388SBob Moore };
315793c2388SBob Moore 
316793c2388SBob Moore /* Subtable */
317793c2388SBob Moore 
318793c2388SBob Moore struct acpi_cpep_polling {
3196e2d5ebdSBob Moore 	struct acpi_subtable_header header;
320f3d2e786SBob Moore 	u8 id;			/* Processor ID */
321f3d2e786SBob Moore 	u8 eid;			/* Processor EID */
322f3d2e786SBob Moore 	u32 interval;		/* Polling interval (msec) */
323793c2388SBob Moore };
324793c2388SBob Moore 
325793c2388SBob Moore /*******************************************************************************
326793c2388SBob Moore  *
327e62f8227SErik Schmauss  * CSRT - Core System Resource Table
328e62f8227SErik Schmauss  *        Version 0
329e62f8227SErik Schmauss  *
330e62f8227SErik Schmauss  * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
331e62f8227SErik Schmauss  *
332e62f8227SErik Schmauss  ******************************************************************************/
333e62f8227SErik Schmauss 
334e62f8227SErik Schmauss struct acpi_table_csrt {
335e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
336e62f8227SErik Schmauss };
337e62f8227SErik Schmauss 
338e62f8227SErik Schmauss /* Resource Group subtable */
339e62f8227SErik Schmauss 
340e62f8227SErik Schmauss struct acpi_csrt_group {
341e62f8227SErik Schmauss 	u32 length;
342e62f8227SErik Schmauss 	u32 vendor_id;
343e62f8227SErik Schmauss 	u32 subvendor_id;
344e62f8227SErik Schmauss 	u16 device_id;
345e62f8227SErik Schmauss 	u16 subdevice_id;
346e62f8227SErik Schmauss 	u16 revision;
347e62f8227SErik Schmauss 	u16 reserved;
348e62f8227SErik Schmauss 	u32 shared_info_length;
349e62f8227SErik Schmauss 
350e62f8227SErik Schmauss 	/* Shared data immediately follows (Length = shared_info_length) */
351e62f8227SErik Schmauss };
352e62f8227SErik Schmauss 
353e62f8227SErik Schmauss /* Shared Info subtable */
354e62f8227SErik Schmauss 
355e62f8227SErik Schmauss struct acpi_csrt_shared_info {
356e62f8227SErik Schmauss 	u16 major_version;
357e62f8227SErik Schmauss 	u16 minor_version;
358e62f8227SErik Schmauss 	u32 mmio_base_low;
359e62f8227SErik Schmauss 	u32 mmio_base_high;
360e62f8227SErik Schmauss 	u32 gsi_interrupt;
361e62f8227SErik Schmauss 	u8 interrupt_polarity;
362e62f8227SErik Schmauss 	u8 interrupt_mode;
363e62f8227SErik Schmauss 	u8 num_channels;
364e62f8227SErik Schmauss 	u8 dma_address_width;
365e62f8227SErik Schmauss 	u16 base_request_line;
366e62f8227SErik Schmauss 	u16 num_handshake_signals;
367e62f8227SErik Schmauss 	u32 max_block_size;
368e62f8227SErik Schmauss 
369e62f8227SErik Schmauss 	/* Resource descriptors immediately follow (Length = Group length - shared_info_length) */
370e62f8227SErik Schmauss };
371e62f8227SErik Schmauss 
372e62f8227SErik Schmauss /* Resource Descriptor subtable */
373e62f8227SErik Schmauss 
374e62f8227SErik Schmauss struct acpi_csrt_descriptor {
375e62f8227SErik Schmauss 	u32 length;
376e62f8227SErik Schmauss 	u16 type;
377e62f8227SErik Schmauss 	u16 subtype;
378e62f8227SErik Schmauss 	u32 uid;
379e62f8227SErik Schmauss 
380e62f8227SErik Schmauss 	/* Resource-specific information immediately follows */
381e62f8227SErik Schmauss };
382e62f8227SErik Schmauss 
383e62f8227SErik Schmauss /* Resource Types */
384e62f8227SErik Schmauss 
385e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_INTERRUPT    0x0001
386e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_TIMER        0x0002
387e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_DMA          0x0003
388e62f8227SErik Schmauss 
389e62f8227SErik Schmauss /* Resource Subtypes */
390e62f8227SErik Schmauss 
391e62f8227SErik Schmauss #define ACPI_CSRT_XRUPT_LINE        0x0000
392e62f8227SErik Schmauss #define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
393e62f8227SErik Schmauss #define ACPI_CSRT_TIMER             0x0000
394e62f8227SErik Schmauss #define ACPI_CSRT_DMA_CHANNEL       0x0000
395e62f8227SErik Schmauss #define ACPI_CSRT_DMA_CONTROLLER    0x0001
396e62f8227SErik Schmauss 
397e62f8227SErik Schmauss /*******************************************************************************
398e62f8227SErik Schmauss  *
399e62f8227SErik Schmauss  * DBG2 - Debug Port Table 2
400e62f8227SErik Schmauss  *        Version 0 (Both main table and subtables)
401e62f8227SErik Schmauss  *
402e62f8227SErik Schmauss  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", December 10, 2015
403e62f8227SErik Schmauss  *
404e62f8227SErik Schmauss  ******************************************************************************/
405e62f8227SErik Schmauss 
406e62f8227SErik Schmauss struct acpi_table_dbg2 {
407e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
408e62f8227SErik Schmauss 	u32 info_offset;
409e62f8227SErik Schmauss 	u32 info_count;
410e62f8227SErik Schmauss };
411e62f8227SErik Schmauss 
412e62f8227SErik Schmauss struct acpi_dbg2_header {
413e62f8227SErik Schmauss 	u32 info_offset;
414e62f8227SErik Schmauss 	u32 info_count;
415e62f8227SErik Schmauss };
416e62f8227SErik Schmauss 
417e62f8227SErik Schmauss /* Debug Device Information Subtable */
418e62f8227SErik Schmauss 
419e62f8227SErik Schmauss struct acpi_dbg2_device {
420e62f8227SErik Schmauss 	u8 revision;
421e62f8227SErik Schmauss 	u16 length;
422e62f8227SErik Schmauss 	u8 register_count;	/* Number of base_address registers */
423e62f8227SErik Schmauss 	u16 namepath_length;
424e62f8227SErik Schmauss 	u16 namepath_offset;
425e62f8227SErik Schmauss 	u16 oem_data_length;
426e62f8227SErik Schmauss 	u16 oem_data_offset;
427e62f8227SErik Schmauss 	u16 port_type;
428e62f8227SErik Schmauss 	u16 port_subtype;
429e62f8227SErik Schmauss 	u16 reserved;
430e62f8227SErik Schmauss 	u16 base_address_offset;
431e62f8227SErik Schmauss 	u16 address_size_offset;
432e62f8227SErik Schmauss 	/*
433e62f8227SErik Schmauss 	 * Data that follows:
434e62f8227SErik Schmauss 	 *    base_address (required) - Each in 12-byte Generic Address Structure format.
435e62f8227SErik Schmauss 	 *    address_size (required) - Array of u32 sizes corresponding to each base_address register.
436e62f8227SErik Schmauss 	 *    Namepath    (required) - Null terminated string. Single dot if not supported.
437e62f8227SErik Schmauss 	 *    oem_data    (optional) - Length is oem_data_length.
438e62f8227SErik Schmauss 	 */
439e62f8227SErik Schmauss };
440e62f8227SErik Schmauss 
441e62f8227SErik Schmauss /* Types for port_type field above */
442e62f8227SErik Schmauss 
443e62f8227SErik Schmauss #define ACPI_DBG2_SERIAL_PORT       0x8000
444e62f8227SErik Schmauss #define ACPI_DBG2_1394_PORT         0x8001
445e62f8227SErik Schmauss #define ACPI_DBG2_USB_PORT          0x8002
446e62f8227SErik Schmauss #define ACPI_DBG2_NET_PORT          0x8003
447e62f8227SErik Schmauss 
448e62f8227SErik Schmauss /* Subtypes for port_subtype field above */
449e62f8227SErik Schmauss 
450e62f8227SErik Schmauss #define ACPI_DBG2_16550_COMPATIBLE  0x0000
451e62f8227SErik Schmauss #define ACPI_DBG2_16550_SUBSET      0x0001
452e62f8227SErik Schmauss #define ACPI_DBG2_ARM_PL011         0x0003
453e62f8227SErik Schmauss #define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
454e62f8227SErik Schmauss #define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
455e62f8227SErik Schmauss #define ACPI_DBG2_ARM_DCC           0x000F
456e62f8227SErik Schmauss #define ACPI_DBG2_BCM2835           0x0010
457e62f8227SErik Schmauss 
458e62f8227SErik Schmauss #define ACPI_DBG2_1394_STANDARD     0x0000
459e62f8227SErik Schmauss 
460e62f8227SErik Schmauss #define ACPI_DBG2_USB_XHCI          0x0000
461e62f8227SErik Schmauss #define ACPI_DBG2_USB_EHCI          0x0001
462e62f8227SErik Schmauss 
463e62f8227SErik Schmauss /*******************************************************************************
464e62f8227SErik Schmauss  *
465e62f8227SErik Schmauss  * DBGP - Debug Port table
466e62f8227SErik Schmauss  *        Version 1
467e62f8227SErik Schmauss  *
468e62f8227SErik Schmauss  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
469e62f8227SErik Schmauss  *
470e62f8227SErik Schmauss  ******************************************************************************/
471e62f8227SErik Schmauss 
472e62f8227SErik Schmauss struct acpi_table_dbgp {
473e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
474e62f8227SErik Schmauss 	u8 type;		/* 0=full 16550, 1=subset of 16550 */
475e62f8227SErik Schmauss 	u8 reserved[3];
476e62f8227SErik Schmauss 	struct acpi_generic_address debug_port;
477e62f8227SErik Schmauss };
478e62f8227SErik Schmauss 
479e62f8227SErik Schmauss /*******************************************************************************
480e62f8227SErik Schmauss  *
481e62f8227SErik Schmauss  * DMAR - DMA Remapping table
482e62f8227SErik Schmauss  *        Version 1
483e62f8227SErik Schmauss  *
484e62f8227SErik Schmauss  * Conforms to "Intel Virtualization Technology for Directed I/O",
485e62f8227SErik Schmauss  * Version 2.3, October 2014
486e62f8227SErik Schmauss  *
487e62f8227SErik Schmauss  ******************************************************************************/
488e62f8227SErik Schmauss 
489e62f8227SErik Schmauss struct acpi_table_dmar {
490e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
491e62f8227SErik Schmauss 	u8 width;		/* Host Address Width */
492e62f8227SErik Schmauss 	u8 flags;
493e62f8227SErik Schmauss 	u8 reserved[10];
494e62f8227SErik Schmauss };
495e62f8227SErik Schmauss 
496e62f8227SErik Schmauss /* Masks for Flags field above */
497e62f8227SErik Schmauss 
498e62f8227SErik Schmauss #define ACPI_DMAR_INTR_REMAP        (1)
499e62f8227SErik Schmauss #define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
500e62f8227SErik Schmauss #define ACPI_DMAR_X2APIC_MODE       (1<<2)
501e62f8227SErik Schmauss 
502e62f8227SErik Schmauss /* DMAR subtable header */
503e62f8227SErik Schmauss 
504e62f8227SErik Schmauss struct acpi_dmar_header {
505e62f8227SErik Schmauss 	u16 type;
506e62f8227SErik Schmauss 	u16 length;
507e62f8227SErik Schmauss };
508e62f8227SErik Schmauss 
509e62f8227SErik Schmauss /* Values for subtable type in struct acpi_dmar_header */
510e62f8227SErik Schmauss 
511e62f8227SErik Schmauss enum acpi_dmar_type {
512e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
513e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
514e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_ROOT_ATS = 2,
515e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
516e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_NAMESPACE = 4,
517e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_RESERVED = 5	/* 5 and greater are reserved */
518e62f8227SErik Schmauss };
519e62f8227SErik Schmauss 
520e62f8227SErik Schmauss /* DMAR Device Scope structure */
521e62f8227SErik Schmauss 
522e62f8227SErik Schmauss struct acpi_dmar_device_scope {
523e62f8227SErik Schmauss 	u8 entry_type;
524e62f8227SErik Schmauss 	u8 length;
525e62f8227SErik Schmauss 	u16 reserved;
526e62f8227SErik Schmauss 	u8 enumeration_id;
527e62f8227SErik Schmauss 	u8 bus;
528e62f8227SErik Schmauss };
529e62f8227SErik Schmauss 
530e62f8227SErik Schmauss /* Values for entry_type in struct acpi_dmar_device_scope - device types */
531e62f8227SErik Schmauss 
532e62f8227SErik Schmauss enum acpi_dmar_scope_type {
533e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
534e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
535e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
536e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
537e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_HPET = 4,
538e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
539e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_RESERVED = 6	/* 6 and greater are reserved */
540e62f8227SErik Schmauss };
541e62f8227SErik Schmauss 
542e62f8227SErik Schmauss struct acpi_dmar_pci_path {
543e62f8227SErik Schmauss 	u8 device;
544e62f8227SErik Schmauss 	u8 function;
545e62f8227SErik Schmauss };
546e62f8227SErik Schmauss 
547e62f8227SErik Schmauss /*
548e62f8227SErik Schmauss  * DMAR Subtables, correspond to Type in struct acpi_dmar_header
549e62f8227SErik Schmauss  */
550e62f8227SErik Schmauss 
551e62f8227SErik Schmauss /* 0: Hardware Unit Definition */
552e62f8227SErik Schmauss 
553e62f8227SErik Schmauss struct acpi_dmar_hardware_unit {
554e62f8227SErik Schmauss 	struct acpi_dmar_header header;
555e62f8227SErik Schmauss 	u8 flags;
556e62f8227SErik Schmauss 	u8 reserved;
557e62f8227SErik Schmauss 	u16 segment;
558e62f8227SErik Schmauss 	u64 address;		/* Register Base Address */
559e62f8227SErik Schmauss };
560e62f8227SErik Schmauss 
561e62f8227SErik Schmauss /* Masks for Flags field above */
562e62f8227SErik Schmauss 
563e62f8227SErik Schmauss #define ACPI_DMAR_INCLUDE_ALL       (1)
564e62f8227SErik Schmauss 
565e62f8227SErik Schmauss /* 1: Reserved Memory Defininition */
566e62f8227SErik Schmauss 
567e62f8227SErik Schmauss struct acpi_dmar_reserved_memory {
568e62f8227SErik Schmauss 	struct acpi_dmar_header header;
569e62f8227SErik Schmauss 	u16 reserved;
570e62f8227SErik Schmauss 	u16 segment;
571e62f8227SErik Schmauss 	u64 base_address;	/* 4K aligned base address */
572e62f8227SErik Schmauss 	u64 end_address;	/* 4K aligned limit address */
573e62f8227SErik Schmauss };
574e62f8227SErik Schmauss 
575e62f8227SErik Schmauss /* Masks for Flags field above */
576e62f8227SErik Schmauss 
577e62f8227SErik Schmauss #define ACPI_DMAR_ALLOW_ALL         (1)
578e62f8227SErik Schmauss 
579e62f8227SErik Schmauss /* 2: Root Port ATS Capability Reporting Structure */
580e62f8227SErik Schmauss 
581e62f8227SErik Schmauss struct acpi_dmar_atsr {
582e62f8227SErik Schmauss 	struct acpi_dmar_header header;
583e62f8227SErik Schmauss 	u8 flags;
584e62f8227SErik Schmauss 	u8 reserved;
585e62f8227SErik Schmauss 	u16 segment;
586e62f8227SErik Schmauss };
587e62f8227SErik Schmauss 
588e62f8227SErik Schmauss /* Masks for Flags field above */
589e62f8227SErik Schmauss 
590e62f8227SErik Schmauss #define ACPI_DMAR_ALL_PORTS         (1)
591e62f8227SErik Schmauss 
592e62f8227SErik Schmauss /* 3: Remapping Hardware Static Affinity Structure */
593e62f8227SErik Schmauss 
594e62f8227SErik Schmauss struct acpi_dmar_rhsa {
595e62f8227SErik Schmauss 	struct acpi_dmar_header header;
596e62f8227SErik Schmauss 	u32 reserved;
597e62f8227SErik Schmauss 	u64 base_address;
598e62f8227SErik Schmauss 	u32 proximity_domain;
599e62f8227SErik Schmauss };
600e62f8227SErik Schmauss 
601e62f8227SErik Schmauss /* 4: ACPI Namespace Device Declaration Structure */
602e62f8227SErik Schmauss 
603e62f8227SErik Schmauss struct acpi_dmar_andd {
604e62f8227SErik Schmauss 	struct acpi_dmar_header header;
605e62f8227SErik Schmauss 	u8 reserved[3];
606e62f8227SErik Schmauss 	u8 device_number;
607e62f8227SErik Schmauss 	char device_name[1];
608e62f8227SErik Schmauss };
609e62f8227SErik Schmauss 
610e62f8227SErik Schmauss /*******************************************************************************
611e62f8227SErik Schmauss  *
612e62f8227SErik Schmauss  * DRTM - Dynamic Root of Trust for Measurement table
613e62f8227SErik Schmauss  * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
614e62f8227SErik Schmauss  * Table version 1
615e62f8227SErik Schmauss  *
616e62f8227SErik Schmauss  ******************************************************************************/
617e62f8227SErik Schmauss 
618e62f8227SErik Schmauss struct acpi_table_drtm {
619e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
620e62f8227SErik Schmauss 	u64 entry_base_address;
621e62f8227SErik Schmauss 	u64 entry_length;
622e62f8227SErik Schmauss 	u32 entry_address32;
623e62f8227SErik Schmauss 	u64 entry_address64;
624e62f8227SErik Schmauss 	u64 exit_address;
625e62f8227SErik Schmauss 	u64 log_area_address;
626e62f8227SErik Schmauss 	u32 log_area_length;
627e62f8227SErik Schmauss 	u64 arch_dependent_address;
628e62f8227SErik Schmauss 	u32 flags;
629e62f8227SErik Schmauss };
630e62f8227SErik Schmauss 
631e62f8227SErik Schmauss /* Flag Definitions for above */
632e62f8227SErik Schmauss 
633e62f8227SErik Schmauss #define ACPI_DRTM_ACCESS_ALLOWED            (1)
634e62f8227SErik Schmauss #define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
635e62f8227SErik Schmauss #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
636e62f8227SErik Schmauss #define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
637e62f8227SErik Schmauss 
638e62f8227SErik Schmauss /* 1) Validated Tables List (64-bit addresses) */
639e62f8227SErik Schmauss 
640e62f8227SErik Schmauss struct acpi_drtm_vtable_list {
641e62f8227SErik Schmauss 	u32 validated_table_count;
642e62f8227SErik Schmauss 	u64 validated_tables[1];
643e62f8227SErik Schmauss };
644e62f8227SErik Schmauss 
645e62f8227SErik Schmauss /* 2) Resources List (of Resource Descriptors) */
646e62f8227SErik Schmauss 
647e62f8227SErik Schmauss /* Resource Descriptor */
648e62f8227SErik Schmauss 
649e62f8227SErik Schmauss struct acpi_drtm_resource {
650e62f8227SErik Schmauss 	u8 size[7];
651e62f8227SErik Schmauss 	u8 type;
652e62f8227SErik Schmauss 	u64 address;
653e62f8227SErik Schmauss };
654e62f8227SErik Schmauss 
655e62f8227SErik Schmauss struct acpi_drtm_resource_list {
656e62f8227SErik Schmauss 	u32 resource_count;
657e62f8227SErik Schmauss 	struct acpi_drtm_resource resources[1];
658e62f8227SErik Schmauss };
659e62f8227SErik Schmauss 
660e62f8227SErik Schmauss /* 3) Platform-specific Identifiers List */
661e62f8227SErik Schmauss 
662e62f8227SErik Schmauss struct acpi_drtm_dps_id {
663e62f8227SErik Schmauss 	u32 dps_id_length;
664e62f8227SErik Schmauss 	u8 dps_id[16];
665e62f8227SErik Schmauss };
666e62f8227SErik Schmauss 
667e62f8227SErik Schmauss /*******************************************************************************
668e62f8227SErik Schmauss  *
669793c2388SBob Moore  * ECDT - Embedded Controller Boot Resources Table
6706e2d5ebdSBob Moore  *        Version 1
671793c2388SBob Moore  *
672793c2388SBob Moore  ******************************************************************************/
673793c2388SBob Moore 
674f3d2e786SBob Moore struct acpi_table_ecdt {
675f3d2e786SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
676f3d2e786SBob Moore 	struct acpi_generic_address control;	/* Address of EC command/status register */
677f3d2e786SBob Moore 	struct acpi_generic_address data;	/* Address of EC data register */
678793c2388SBob Moore 	u32 uid;		/* Unique ID - must be same as the EC _UID method */
679f3d2e786SBob Moore 	u8 gpe;			/* The GPE for the EC */
680f3d2e786SBob Moore 	u8 id[1];		/* Full namepath of the EC in the ACPI namespace */
681793c2388SBob Moore };
682793c2388SBob Moore 
683793c2388SBob Moore /*******************************************************************************
684793c2388SBob Moore  *
6856e2d5ebdSBob Moore  * EINJ - Error Injection Table (ACPI 4.0)
6866e2d5ebdSBob Moore  *        Version 1
687970d9c9eSBob Moore  *
688970d9c9eSBob Moore  ******************************************************************************/
689970d9c9eSBob Moore 
690970d9c9eSBob Moore struct acpi_table_einj {
691970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
692970d9c9eSBob Moore 	u32 header_length;
6936e2d5ebdSBob Moore 	u8 flags;
6946e2d5ebdSBob Moore 	u8 reserved[3];
695970d9c9eSBob Moore 	u32 entries;
696970d9c9eSBob Moore };
697970d9c9eSBob Moore 
698970d9c9eSBob Moore /* EINJ Injection Instruction Entries (actions) */
699970d9c9eSBob Moore 
700970d9c9eSBob Moore struct acpi_einj_entry {
701970d9c9eSBob Moore 	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
702970d9c9eSBob Moore };
703970d9c9eSBob Moore 
7046e2d5ebdSBob Moore /* Masks for Flags field above */
7056e2d5ebdSBob Moore 
7066e2d5ebdSBob Moore #define ACPI_EINJ_PRESERVE          (1)
7076e2d5ebdSBob Moore 
708970d9c9eSBob Moore /* Values for Action field above */
709970d9c9eSBob Moore 
710970d9c9eSBob Moore enum acpi_einj_actions {
711970d9c9eSBob Moore 	ACPI_EINJ_BEGIN_OPERATION = 0,
712970d9c9eSBob Moore 	ACPI_EINJ_GET_TRIGGER_TABLE = 1,
713970d9c9eSBob Moore 	ACPI_EINJ_SET_ERROR_TYPE = 2,
714970d9c9eSBob Moore 	ACPI_EINJ_GET_ERROR_TYPE = 3,
715970d9c9eSBob Moore 	ACPI_EINJ_END_OPERATION = 4,
716970d9c9eSBob Moore 	ACPI_EINJ_EXECUTE_OPERATION = 5,
717970d9c9eSBob Moore 	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
718970d9c9eSBob Moore 	ACPI_EINJ_GET_COMMAND_STATUS = 7,
719c5bd6537SBob Moore 	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
720a88e0ce6SBob Moore 	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
721a88e0ce6SBob Moore 	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved */
722970d9c9eSBob Moore 	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
723970d9c9eSBob Moore };
724970d9c9eSBob Moore 
725970d9c9eSBob Moore /* Values for Instruction field above */
726970d9c9eSBob Moore 
727970d9c9eSBob Moore enum acpi_einj_instructions {
728970d9c9eSBob Moore 	ACPI_EINJ_READ_REGISTER = 0,
729970d9c9eSBob Moore 	ACPI_EINJ_READ_REGISTER_VALUE = 1,
730970d9c9eSBob Moore 	ACPI_EINJ_WRITE_REGISTER = 2,
731970d9c9eSBob Moore 	ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
732970d9c9eSBob Moore 	ACPI_EINJ_NOOP = 4,
733c5bd6537SBob Moore 	ACPI_EINJ_FLUSH_CACHELINE = 5,
734c5bd6537SBob Moore 	ACPI_EINJ_INSTRUCTION_RESERVED = 6	/* 6 and greater are reserved */
735c5bd6537SBob Moore };
736c5bd6537SBob Moore 
737c5bd6537SBob Moore struct acpi_einj_error_type_with_addr {
738c5bd6537SBob Moore 	u32 error_type;
739c5bd6537SBob Moore 	u32 vendor_struct_offset;
740c5bd6537SBob Moore 	u32 flags;
741c5bd6537SBob Moore 	u32 apic_id;
742c5bd6537SBob Moore 	u64 address;
743c5bd6537SBob Moore 	u64 range;
744c5bd6537SBob Moore 	u32 pcie_id;
745c5bd6537SBob Moore };
746c5bd6537SBob Moore 
747c5bd6537SBob Moore struct acpi_einj_vendor {
748c5bd6537SBob Moore 	u32 length;
749c5bd6537SBob Moore 	u32 pcie_id;
750c5bd6537SBob Moore 	u16 vendor_id;
751c5bd6537SBob Moore 	u16 device_id;
752c5bd6537SBob Moore 	u8 revision_id;
753c5bd6537SBob Moore 	u8 reserved[3];
754970d9c9eSBob Moore };
755970d9c9eSBob Moore 
7563fa34777SBob Moore /* EINJ Trigger Error Action Table */
7573fa34777SBob Moore 
7583fa34777SBob Moore struct acpi_einj_trigger {
7593fa34777SBob Moore 	u32 header_size;
7603fa34777SBob Moore 	u32 revision;
7613fa34777SBob Moore 	u32 table_size;
7623fa34777SBob Moore 	u32 entry_count;
7633fa34777SBob Moore };
7643fa34777SBob Moore 
7656e2d5ebdSBob Moore /* Command status return values */
7666e2d5ebdSBob Moore 
7676e2d5ebdSBob Moore enum acpi_einj_command_status {
7686e2d5ebdSBob Moore 	ACPI_EINJ_SUCCESS = 0,
7696e2d5ebdSBob Moore 	ACPI_EINJ_FAILURE = 1,
7706e2d5ebdSBob Moore 	ACPI_EINJ_INVALID_ACCESS = 2,
7716e2d5ebdSBob Moore 	ACPI_EINJ_STATUS_RESERVED = 3	/* 3 and greater are reserved */
7726e2d5ebdSBob Moore };
7736e2d5ebdSBob Moore 
7746e2d5ebdSBob Moore /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
7756e2d5ebdSBob Moore 
7766e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
7776e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
7786e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
7796e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
7806e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
7816e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
7826e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
7836e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
7846e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_FATAL                (1<<8)
7856e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
7866e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
7876e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
788c5bd6537SBob Moore #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
7896e2d5ebdSBob Moore 
790970d9c9eSBob Moore /*******************************************************************************
791970d9c9eSBob Moore  *
7926e2d5ebdSBob Moore  * ERST - Error Record Serialization Table (ACPI 4.0)
7936e2d5ebdSBob Moore  *        Version 1
794970d9c9eSBob Moore  *
795970d9c9eSBob Moore  ******************************************************************************/
796970d9c9eSBob Moore 
797970d9c9eSBob Moore struct acpi_table_erst {
798970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
799970d9c9eSBob Moore 	u32 header_length;
800970d9c9eSBob Moore 	u32 reserved;
801970d9c9eSBob Moore 	u32 entries;
802970d9c9eSBob Moore };
803970d9c9eSBob Moore 
804970d9c9eSBob Moore /* ERST Serialization Entries (actions) */
805970d9c9eSBob Moore 
806970d9c9eSBob Moore struct acpi_erst_entry {
807970d9c9eSBob Moore 	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
808970d9c9eSBob Moore };
809970d9c9eSBob Moore 
8106e2d5ebdSBob Moore /* Masks for Flags field above */
8116e2d5ebdSBob Moore 
8126e2d5ebdSBob Moore #define ACPI_ERST_PRESERVE          (1)
8136e2d5ebdSBob Moore 
814970d9c9eSBob Moore /* Values for Action field above */
815970d9c9eSBob Moore 
816970d9c9eSBob Moore enum acpi_erst_actions {
8176e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_WRITE = 0,
8186e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_READ = 1,
8196e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_CLEAR = 2,
8206e2d5ebdSBob Moore 	ACPI_ERST_END = 3,
821970d9c9eSBob Moore 	ACPI_ERST_SET_RECORD_OFFSET = 4,
822970d9c9eSBob Moore 	ACPI_ERST_EXECUTE_OPERATION = 5,
823970d9c9eSBob Moore 	ACPI_ERST_CHECK_BUSY_STATUS = 6,
824970d9c9eSBob Moore 	ACPI_ERST_GET_COMMAND_STATUS = 7,
8256e2d5ebdSBob Moore 	ACPI_ERST_GET_RECORD_ID = 8,
8266e2d5ebdSBob Moore 	ACPI_ERST_SET_RECORD_ID = 9,
827970d9c9eSBob Moore 	ACPI_ERST_GET_RECORD_COUNT = 10,
828970d9c9eSBob Moore 	ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
829970d9c9eSBob Moore 	ACPI_ERST_NOT_USED = 12,
830970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_RANGE = 13,
831970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_LENGTH = 14,
832970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
833a88e0ce6SBob Moore 	ACPI_ERST_EXECUTE_TIMINGS = 16,
834a88e0ce6SBob Moore 	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved */
835970d9c9eSBob Moore };
836970d9c9eSBob Moore 
837970d9c9eSBob Moore /* Values for Instruction field above */
838970d9c9eSBob Moore 
839970d9c9eSBob Moore enum acpi_erst_instructions {
840970d9c9eSBob Moore 	ACPI_ERST_READ_REGISTER = 0,
841970d9c9eSBob Moore 	ACPI_ERST_READ_REGISTER_VALUE = 1,
842970d9c9eSBob Moore 	ACPI_ERST_WRITE_REGISTER = 2,
843970d9c9eSBob Moore 	ACPI_ERST_WRITE_REGISTER_VALUE = 3,
844970d9c9eSBob Moore 	ACPI_ERST_NOOP = 4,
845970d9c9eSBob Moore 	ACPI_ERST_LOAD_VAR1 = 5,
846970d9c9eSBob Moore 	ACPI_ERST_LOAD_VAR2 = 6,
847970d9c9eSBob Moore 	ACPI_ERST_STORE_VAR1 = 7,
848970d9c9eSBob Moore 	ACPI_ERST_ADD = 8,
849970d9c9eSBob Moore 	ACPI_ERST_SUBTRACT = 9,
850970d9c9eSBob Moore 	ACPI_ERST_ADD_VALUE = 10,
851970d9c9eSBob Moore 	ACPI_ERST_SUBTRACT_VALUE = 11,
852970d9c9eSBob Moore 	ACPI_ERST_STALL = 12,
853970d9c9eSBob Moore 	ACPI_ERST_STALL_WHILE_TRUE = 13,
854970d9c9eSBob Moore 	ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
855970d9c9eSBob Moore 	ACPI_ERST_GOTO = 15,
856970d9c9eSBob Moore 	ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
857970d9c9eSBob Moore 	ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
858970d9c9eSBob Moore 	ACPI_ERST_MOVE_DATA = 18,
859970d9c9eSBob Moore 	ACPI_ERST_INSTRUCTION_RESERVED = 19	/* 19 and greater are reserved */
860970d9c9eSBob Moore };
861970d9c9eSBob Moore 
8626e2d5ebdSBob Moore /* Command status return values */
8636e2d5ebdSBob Moore 
8646e2d5ebdSBob Moore enum acpi_erst_command_status {
8656e2d5ebdSBob Moore 	ACPI_ERST_SUCESS = 0,
8666e2d5ebdSBob Moore 	ACPI_ERST_NO_SPACE = 1,
8676e2d5ebdSBob Moore 	ACPI_ERST_NOT_AVAILABLE = 2,
8686e2d5ebdSBob Moore 	ACPI_ERST_FAILURE = 3,
8696e2d5ebdSBob Moore 	ACPI_ERST_RECORD_EMPTY = 4,
8706e2d5ebdSBob Moore 	ACPI_ERST_NOT_FOUND = 5,
8716e2d5ebdSBob Moore 	ACPI_ERST_STATUS_RESERVED = 6	/* 6 and greater are reserved */
8726e2d5ebdSBob Moore };
8736e2d5ebdSBob Moore 
8746e2d5ebdSBob Moore /* Error Record Serialization Information */
8756e2d5ebdSBob Moore 
8766e2d5ebdSBob Moore struct acpi_erst_info {
8776e2d5ebdSBob Moore 	u16 signature;		/* Should be "ER" */
8786e2d5ebdSBob Moore 	u8 data[48];
8796e2d5ebdSBob Moore };
8806e2d5ebdSBob Moore 
881970d9c9eSBob Moore /*******************************************************************************
882970d9c9eSBob Moore  *
883e62f8227SErik Schmauss  * FPDT - Firmware Performance Data Table (ACPI 5.0)
884e62f8227SErik Schmauss  *        Version 1
885e62f8227SErik Schmauss  *
886e62f8227SErik Schmauss  ******************************************************************************/
887e62f8227SErik Schmauss 
888e62f8227SErik Schmauss struct acpi_table_fpdt {
889e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
890e62f8227SErik Schmauss };
891e62f8227SErik Schmauss 
892e62f8227SErik Schmauss /* FPDT subtable header (Performance Record Structure) */
893e62f8227SErik Schmauss 
894e62f8227SErik Schmauss struct acpi_fpdt_header {
895e62f8227SErik Schmauss 	u16 type;
896e62f8227SErik Schmauss 	u8 length;
897e62f8227SErik Schmauss 	u8 revision;
898e62f8227SErik Schmauss };
899e62f8227SErik Schmauss 
900e62f8227SErik Schmauss /* Values for Type field above */
901e62f8227SErik Schmauss 
902e62f8227SErik Schmauss enum acpi_fpdt_type {
903e62f8227SErik Schmauss 	ACPI_FPDT_TYPE_BOOT = 0,
904e62f8227SErik Schmauss 	ACPI_FPDT_TYPE_S3PERF = 1
905e62f8227SErik Schmauss };
906e62f8227SErik Schmauss 
907e62f8227SErik Schmauss /*
908e62f8227SErik Schmauss  * FPDT subtables
909e62f8227SErik Schmauss  */
910e62f8227SErik Schmauss 
911e62f8227SErik Schmauss /* 0: Firmware Basic Boot Performance Record */
912e62f8227SErik Schmauss 
913e62f8227SErik Schmauss struct acpi_fpdt_boot_pointer {
914e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
915e62f8227SErik Schmauss 	u8 reserved[4];
916e62f8227SErik Schmauss 	u64 address;
917e62f8227SErik Schmauss };
918e62f8227SErik Schmauss 
919e62f8227SErik Schmauss /* 1: S3 Performance Table Pointer Record */
920e62f8227SErik Schmauss 
921e62f8227SErik Schmauss struct acpi_fpdt_s3pt_pointer {
922e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
923e62f8227SErik Schmauss 	u8 reserved[4];
924e62f8227SErik Schmauss 	u64 address;
925e62f8227SErik Schmauss };
926e62f8227SErik Schmauss 
927e62f8227SErik Schmauss /*
928e62f8227SErik Schmauss  * S3PT - S3 Performance Table. This table is pointed to by the
929e62f8227SErik Schmauss  * S3 Pointer Record above.
930e62f8227SErik Schmauss  */
931e62f8227SErik Schmauss struct acpi_table_s3pt {
932e62f8227SErik Schmauss 	u8 signature[4];	/* "S3PT" */
933e62f8227SErik Schmauss 	u32 length;
934e62f8227SErik Schmauss };
935e62f8227SErik Schmauss 
936e62f8227SErik Schmauss /*
937e62f8227SErik Schmauss  * S3PT Subtables (Not part of the actual FPDT)
938e62f8227SErik Schmauss  */
939e62f8227SErik Schmauss 
940e62f8227SErik Schmauss /* Values for Type field in S3PT header */
941e62f8227SErik Schmauss 
942e62f8227SErik Schmauss enum acpi_s3pt_type {
943e62f8227SErik Schmauss 	ACPI_S3PT_TYPE_RESUME = 0,
944e62f8227SErik Schmauss 	ACPI_S3PT_TYPE_SUSPEND = 1,
945e62f8227SErik Schmauss 	ACPI_FPDT_BOOT_PERFORMANCE = 2
946e62f8227SErik Schmauss };
947e62f8227SErik Schmauss 
948e62f8227SErik Schmauss struct acpi_s3pt_resume {
949e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
950e62f8227SErik Schmauss 	u32 resume_count;
951e62f8227SErik Schmauss 	u64 full_resume;
952e62f8227SErik Schmauss 	u64 average_resume;
953e62f8227SErik Schmauss };
954e62f8227SErik Schmauss 
955e62f8227SErik Schmauss struct acpi_s3pt_suspend {
956e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
957e62f8227SErik Schmauss 	u64 suspend_start;
958e62f8227SErik Schmauss 	u64 suspend_end;
959e62f8227SErik Schmauss };
960e62f8227SErik Schmauss 
961e62f8227SErik Schmauss /*
962e62f8227SErik Schmauss  * FPDT Boot Performance Record (Not part of the actual FPDT)
963e62f8227SErik Schmauss  */
964e62f8227SErik Schmauss struct acpi_fpdt_boot {
965e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
966e62f8227SErik Schmauss 	u8 reserved[4];
967e62f8227SErik Schmauss 	u64 reset_end;
968e62f8227SErik Schmauss 	u64 load_start;
969e62f8227SErik Schmauss 	u64 startup_start;
970e62f8227SErik Schmauss 	u64 exit_services_entry;
971e62f8227SErik Schmauss 	u64 exit_services_exit;
972e62f8227SErik Schmauss };
973e62f8227SErik Schmauss 
974e62f8227SErik Schmauss /*******************************************************************************
975e62f8227SErik Schmauss  *
976e62f8227SErik Schmauss  * GTDT - Generic Timer Description Table (ACPI 5.1)
977e62f8227SErik Schmauss  *        Version 2
978e62f8227SErik Schmauss  *
979e62f8227SErik Schmauss  ******************************************************************************/
980e62f8227SErik Schmauss 
981e62f8227SErik Schmauss struct acpi_table_gtdt {
982e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
983e62f8227SErik Schmauss 	u64 counter_block_addresss;
984e62f8227SErik Schmauss 	u32 reserved;
985e62f8227SErik Schmauss 	u32 secure_el1_interrupt;
986e62f8227SErik Schmauss 	u32 secure_el1_flags;
987e62f8227SErik Schmauss 	u32 non_secure_el1_interrupt;
988e62f8227SErik Schmauss 	u32 non_secure_el1_flags;
989e62f8227SErik Schmauss 	u32 virtual_timer_interrupt;
990e62f8227SErik Schmauss 	u32 virtual_timer_flags;
991e62f8227SErik Schmauss 	u32 non_secure_el2_interrupt;
992e62f8227SErik Schmauss 	u32 non_secure_el2_flags;
993e62f8227SErik Schmauss 	u64 counter_read_block_address;
994e62f8227SErik Schmauss 	u32 platform_timer_count;
995e62f8227SErik Schmauss 	u32 platform_timer_offset;
996e62f8227SErik Schmauss };
997e62f8227SErik Schmauss 
998e62f8227SErik Schmauss /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
999e62f8227SErik Schmauss 
1000e62f8227SErik Schmauss #define ACPI_GTDT_INTERRUPT_MODE        (1)
1001e62f8227SErik Schmauss #define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
1002e62f8227SErik Schmauss #define ACPI_GTDT_ALWAYS_ON             (1<<2)
1003e62f8227SErik Schmauss 
1004e62f8227SErik Schmauss /* Common GTDT subtable header */
1005e62f8227SErik Schmauss 
1006e62f8227SErik Schmauss struct acpi_gtdt_header {
1007e62f8227SErik Schmauss 	u8 type;
1008e62f8227SErik Schmauss 	u16 length;
1009e62f8227SErik Schmauss };
1010e62f8227SErik Schmauss 
1011e62f8227SErik Schmauss /* Values for GTDT subtable type above */
1012e62f8227SErik Schmauss 
1013e62f8227SErik Schmauss enum acpi_gtdt_type {
1014e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
1015e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_WATCHDOG = 1,
1016e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
1017e62f8227SErik Schmauss };
1018e62f8227SErik Schmauss 
1019e62f8227SErik Schmauss /* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
1020e62f8227SErik Schmauss 
1021e62f8227SErik Schmauss /* 0: Generic Timer Block */
1022e62f8227SErik Schmauss 
1023e62f8227SErik Schmauss struct acpi_gtdt_timer_block {
1024e62f8227SErik Schmauss 	struct acpi_gtdt_header header;
1025e62f8227SErik Schmauss 	u8 reserved;
1026e62f8227SErik Schmauss 	u64 block_address;
1027e62f8227SErik Schmauss 	u32 timer_count;
1028e62f8227SErik Schmauss 	u32 timer_offset;
1029e62f8227SErik Schmauss };
1030e62f8227SErik Schmauss 
1031e62f8227SErik Schmauss /* Timer Sub-Structure, one per timer */
1032e62f8227SErik Schmauss 
1033e62f8227SErik Schmauss struct acpi_gtdt_timer_entry {
1034e62f8227SErik Schmauss 	u8 frame_number;
1035e62f8227SErik Schmauss 	u8 reserved[3];
1036e62f8227SErik Schmauss 	u64 base_address;
1037e62f8227SErik Schmauss 	u64 el0_base_address;
1038e62f8227SErik Schmauss 	u32 timer_interrupt;
1039e62f8227SErik Schmauss 	u32 timer_flags;
1040e62f8227SErik Schmauss 	u32 virtual_timer_interrupt;
1041e62f8227SErik Schmauss 	u32 virtual_timer_flags;
1042e62f8227SErik Schmauss 	u32 common_flags;
1043e62f8227SErik Schmauss };
1044e62f8227SErik Schmauss 
1045e62f8227SErik Schmauss /* Flag Definitions: timer_flags and virtual_timer_flags above */
1046e62f8227SErik Schmauss 
1047e62f8227SErik Schmauss #define ACPI_GTDT_GT_IRQ_MODE               (1)
1048e62f8227SErik Schmauss #define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
1049e62f8227SErik Schmauss 
1050e62f8227SErik Schmauss /* Flag Definitions: common_flags above */
1051e62f8227SErik Schmauss 
1052e62f8227SErik Schmauss #define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
1053e62f8227SErik Schmauss #define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
1054e62f8227SErik Schmauss 
1055e62f8227SErik Schmauss /* 1: SBSA Generic Watchdog Structure */
1056e62f8227SErik Schmauss 
1057e62f8227SErik Schmauss struct acpi_gtdt_watchdog {
1058e62f8227SErik Schmauss 	struct acpi_gtdt_header header;
1059e62f8227SErik Schmauss 	u8 reserved;
1060e62f8227SErik Schmauss 	u64 refresh_frame_address;
1061e62f8227SErik Schmauss 	u64 control_frame_address;
1062e62f8227SErik Schmauss 	u32 timer_interrupt;
1063e62f8227SErik Schmauss 	u32 timer_flags;
1064e62f8227SErik Schmauss };
1065e62f8227SErik Schmauss 
1066e62f8227SErik Schmauss /* Flag Definitions: timer_flags above */
1067e62f8227SErik Schmauss 
1068e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
1069e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
1070e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
1071e62f8227SErik Schmauss 
1072e62f8227SErik Schmauss /*******************************************************************************
1073e62f8227SErik Schmauss  *
10746e2d5ebdSBob Moore  * HEST - Hardware Error Source Table (ACPI 4.0)
10756e2d5ebdSBob Moore  *        Version 1
1076970d9c9eSBob Moore  *
1077970d9c9eSBob Moore  ******************************************************************************/
1078970d9c9eSBob Moore 
1079970d9c9eSBob Moore struct acpi_table_hest {
1080970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1081970d9c9eSBob Moore 	u32 error_source_count;
1082970d9c9eSBob Moore };
1083970d9c9eSBob Moore 
10843fa34777SBob Moore /* HEST subtable header */
10853fa34777SBob Moore 
10863fa34777SBob Moore struct acpi_hest_header {
10873fa34777SBob Moore 	u16 type;
10886e2d5ebdSBob Moore 	u16 source_id;
10893fa34777SBob Moore };
10903fa34777SBob Moore 
10913fa34777SBob Moore /* Values for Type field above for subtables */
10923fa34777SBob Moore 
10933fa34777SBob Moore enum acpi_hest_types {
10946e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_CHECK = 0,
10956e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
10966e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_NMI = 2,
10976e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED3 = 3,
10986e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED4 = 4,
10996e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED5 = 5,
11003fa34777SBob Moore 	ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
11013fa34777SBob Moore 	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
11023fa34777SBob Moore 	ACPI_HEST_TYPE_AER_BRIDGE = 8,
11036e2d5ebdSBob Moore 	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
11047cd55c76SBob Moore 	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
1105c042933dSBob Moore 	ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
1106c042933dSBob Moore 	ACPI_HEST_TYPE_RESERVED = 12	/* 12 and greater are reserved */
11073fa34777SBob Moore };
11083fa34777SBob Moore 
11093fa34777SBob Moore /*
11106e2d5ebdSBob Moore  * HEST substructures contained in subtables
11113fa34777SBob Moore  */
11123fa34777SBob Moore 
11136e2d5ebdSBob Moore /*
11146e2d5ebdSBob Moore  * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
11156e2d5ebdSBob Moore  * struct acpi_hest_ia_corrected structures.
11166e2d5ebdSBob Moore  */
11176e2d5ebdSBob Moore struct acpi_hest_ia_error_bank {
11183fa34777SBob Moore 	u8 bank_number;
11193fa34777SBob Moore 	u8 clear_status_on_init;
11203fa34777SBob Moore 	u8 status_format;
11216e2d5ebdSBob Moore 	u8 reserved;
11223fa34777SBob Moore 	u32 control_register;
11236e2d5ebdSBob Moore 	u64 control_data;
11243fa34777SBob Moore 	u32 status_register;
11253fa34777SBob Moore 	u32 address_register;
11263fa34777SBob Moore 	u32 misc_register;
11273fa34777SBob Moore };
11283fa34777SBob Moore 
11296e2d5ebdSBob Moore /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
11303fa34777SBob Moore 
11313fa34777SBob Moore struct acpi_hest_aer_common {
11326e2d5ebdSBob Moore 	u16 reserved1;
11333fa34777SBob Moore 	u8 flags;
11343fa34777SBob Moore 	u8 enabled;
1135c276e388SBob Moore 	u32 records_to_preallocate;
11363fa34777SBob Moore 	u32 max_sections_per_record;
11374059a310SBetty Dall 	u32 bus;		/* Bus and Segment numbers */
11383fa34777SBob Moore 	u16 device;
11393fa34777SBob Moore 	u16 function;
11403fa34777SBob Moore 	u16 device_control;
11416e2d5ebdSBob Moore 	u16 reserved2;
1142c276e388SBob Moore 	u32 uncorrectable_mask;
1143c276e388SBob Moore 	u32 uncorrectable_severity;
1144c276e388SBob Moore 	u32 correctable_mask;
1145c276e388SBob Moore 	u32 advanced_capabilities;
11463fa34777SBob Moore };
11473fa34777SBob Moore 
11486e2d5ebdSBob Moore /* Masks for HEST Flags fields */
11496e2d5ebdSBob Moore 
11506e2d5ebdSBob Moore #define ACPI_HEST_FIRMWARE_FIRST        (1)
11516e2d5ebdSBob Moore #define ACPI_HEST_GLOBAL                (1<<1)
11522e166c73SBob Moore #define ACPI_HEST_GHES_ASSIST           (1<<2)
11536e2d5ebdSBob Moore 
11544059a310SBetty Dall /*
11554059a310SBetty Dall  * Macros to access the bus/segment numbers in Bus field above:
11564059a310SBetty Dall  *  Bus number is encoded in bits 7:0
11574059a310SBetty Dall  *  Segment number is encoded in bits 23:8
11584059a310SBetty Dall  */
11594059a310SBetty Dall #define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
11604059a310SBetty Dall #define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
11614059a310SBetty Dall 
11623fa34777SBob Moore /* Hardware Error Notification */
11633fa34777SBob Moore 
11643fa34777SBob Moore struct acpi_hest_notify {
11653fa34777SBob Moore 	u8 type;
11663fa34777SBob Moore 	u8 length;
11673fa34777SBob Moore 	u16 config_write_enable;
11683fa34777SBob Moore 	u32 poll_interval;
11693fa34777SBob Moore 	u32 vector;
11703fa34777SBob Moore 	u32 polling_threshold_value;
11713fa34777SBob Moore 	u32 polling_threshold_window;
11723fa34777SBob Moore 	u32 error_threshold_value;
11733fa34777SBob Moore 	u32 error_threshold_window;
11743fa34777SBob Moore };
11753fa34777SBob Moore 
11763fa34777SBob Moore /* Values for Notify Type field above */
11773fa34777SBob Moore 
11783fa34777SBob Moore enum acpi_hest_notify_types {
11793fa34777SBob Moore 	ACPI_HEST_NOTIFY_POLLED = 0,
11803fa34777SBob Moore 	ACPI_HEST_NOTIFY_EXTERNAL = 1,
11813fa34777SBob Moore 	ACPI_HEST_NOTIFY_LOCAL = 2,
11823fa34777SBob Moore 	ACPI_HEST_NOTIFY_SCI = 3,
11833fa34777SBob Moore 	ACPI_HEST_NOTIFY_NMI = 4,
1184ca4a0314SBob Moore 	ACPI_HEST_NOTIFY_CMCI = 5,	/* ACPI 5.0 */
1185ca4a0314SBob Moore 	ACPI_HEST_NOTIFY_MCE = 6,	/* ACPI 5.0 */
11867cd55c76SBob Moore 	ACPI_HEST_NOTIFY_GPIO = 7,	/* ACPI 6.0 */
11877cd55c76SBob Moore 	ACPI_HEST_NOTIFY_SEA = 8,	/* ACPI 6.1 */
11887cd55c76SBob Moore 	ACPI_HEST_NOTIFY_SEI = 9,	/* ACPI 6.1 */
11897cd55c76SBob Moore 	ACPI_HEST_NOTIFY_GSIV = 10,	/* ACPI 6.1 */
11904a8a6058SBob Moore 	ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,	/* ACPI 6.2 */
11914a8a6058SBob Moore 	ACPI_HEST_NOTIFY_RESERVED = 12	/* 12 and greater are reserved */
11923fa34777SBob Moore };
11933fa34777SBob Moore 
11946e2d5ebdSBob Moore /* Values for config_write_enable bitfield above */
11956e2d5ebdSBob Moore 
11966e2d5ebdSBob Moore #define ACPI_HEST_TYPE                  (1)
11976e2d5ebdSBob Moore #define ACPI_HEST_POLL_INTERVAL         (1<<1)
11986e2d5ebdSBob Moore #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
11996e2d5ebdSBob Moore #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
12006e2d5ebdSBob Moore #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
12016e2d5ebdSBob Moore #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
12026e2d5ebdSBob Moore 
12033fa34777SBob Moore /*
12043fa34777SBob Moore  * HEST subtables
12053fa34777SBob Moore  */
12063fa34777SBob Moore 
12076e2d5ebdSBob Moore /* 0: IA32 Machine Check Exception */
12083fa34777SBob Moore 
12096e2d5ebdSBob Moore struct acpi_hest_ia_machine_check {
12103fa34777SBob Moore 	struct acpi_hest_header header;
12116e2d5ebdSBob Moore 	u16 reserved1;
1212c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
12136e2d5ebdSBob Moore 	u8 enabled;
1214c276e388SBob Moore 	u32 records_to_preallocate;
12153fa34777SBob Moore 	u32 max_sections_per_record;
12163fa34777SBob Moore 	u64 global_capability_data;
12173fa34777SBob Moore 	u64 global_control_data;
12183fa34777SBob Moore 	u8 num_hardware_banks;
12196e2d5ebdSBob Moore 	u8 reserved3[7];
12203fa34777SBob Moore };
12213fa34777SBob Moore 
12226e2d5ebdSBob Moore /* 1: IA32 Corrected Machine Check */
12233fa34777SBob Moore 
12241872bbc9SBob Moore struct acpi_hest_ia_corrected {
12253fa34777SBob Moore 	struct acpi_hest_header header;
12266e2d5ebdSBob Moore 	u16 reserved1;
1227c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
12283fa34777SBob Moore 	u8 enabled;
1229c276e388SBob Moore 	u32 records_to_preallocate;
12303fa34777SBob Moore 	u32 max_sections_per_record;
12313fa34777SBob Moore 	struct acpi_hest_notify notify;
12323fa34777SBob Moore 	u8 num_hardware_banks;
12336e2d5ebdSBob Moore 	u8 reserved2[3];
12343fa34777SBob Moore };
12353fa34777SBob Moore 
12366e2d5ebdSBob Moore /* 2: IA32 Non-Maskable Interrupt */
12373fa34777SBob Moore 
12386e2d5ebdSBob Moore struct acpi_hest_ia_nmi {
12393fa34777SBob Moore 	struct acpi_hest_header header;
12403fa34777SBob Moore 	u32 reserved;
1241c276e388SBob Moore 	u32 records_to_preallocate;
12423fa34777SBob Moore 	u32 max_sections_per_record;
12433fa34777SBob Moore 	u32 max_raw_data_length;
12443fa34777SBob Moore };
12453fa34777SBob Moore 
12466e2d5ebdSBob Moore /* 3,4,5: Not used */
12473fa34777SBob Moore 
12483fa34777SBob Moore /* 6: PCI Express Root Port AER */
12493fa34777SBob Moore 
12503fa34777SBob Moore struct acpi_hest_aer_root {
12513fa34777SBob Moore 	struct acpi_hest_header header;
12523fa34777SBob Moore 	struct acpi_hest_aer_common aer;
12533fa34777SBob Moore 	u32 root_error_command;
12543fa34777SBob Moore };
12553fa34777SBob Moore 
12563fa34777SBob Moore /* 7: PCI Express AER (AER Endpoint) */
12573fa34777SBob Moore 
12583fa34777SBob Moore struct acpi_hest_aer {
12593fa34777SBob Moore 	struct acpi_hest_header header;
12603fa34777SBob Moore 	struct acpi_hest_aer_common aer;
12613fa34777SBob Moore };
12623fa34777SBob Moore 
12633fa34777SBob Moore /* 8: PCI Express/PCI-X Bridge AER */
12643fa34777SBob Moore 
12653fa34777SBob Moore struct acpi_hest_aer_bridge {
12663fa34777SBob Moore 	struct acpi_hest_header header;
12673fa34777SBob Moore 	struct acpi_hest_aer_common aer;
1268c276e388SBob Moore 	u32 uncorrectable_mask2;
1269c276e388SBob Moore 	u32 uncorrectable_severity2;
1270c276e388SBob Moore 	u32 advanced_capabilities2;
12713fa34777SBob Moore };
12723fa34777SBob Moore 
12733fa34777SBob Moore /* 9: Generic Hardware Error Source */
12743fa34777SBob Moore 
12753fa34777SBob Moore struct acpi_hest_generic {
12763fa34777SBob Moore 	struct acpi_hest_header header;
12773fa34777SBob Moore 	u16 related_source_id;
12786e2d5ebdSBob Moore 	u8 reserved;
12793fa34777SBob Moore 	u8 enabled;
1280c276e388SBob Moore 	u32 records_to_preallocate;
12813fa34777SBob Moore 	u32 max_sections_per_record;
12823fa34777SBob Moore 	u32 max_raw_data_length;
12833fa34777SBob Moore 	struct acpi_generic_address error_status_address;
12843fa34777SBob Moore 	struct acpi_hest_notify notify;
12856e2d5ebdSBob Moore 	u32 error_block_length;
12866e2d5ebdSBob Moore };
12876e2d5ebdSBob Moore 
12887cd55c76SBob Moore /* 10: Generic Hardware Error Source, version 2 */
12897cd55c76SBob Moore 
12907cd55c76SBob Moore struct acpi_hest_generic_v2 {
12917cd55c76SBob Moore 	struct acpi_hest_header header;
12927cd55c76SBob Moore 	u16 related_source_id;
12937cd55c76SBob Moore 	u8 reserved;
12947cd55c76SBob Moore 	u8 enabled;
12957cd55c76SBob Moore 	u32 records_to_preallocate;
12967cd55c76SBob Moore 	u32 max_sections_per_record;
12977cd55c76SBob Moore 	u32 max_raw_data_length;
12987cd55c76SBob Moore 	struct acpi_generic_address error_status_address;
12997cd55c76SBob Moore 	struct acpi_hest_notify notify;
13007cd55c76SBob Moore 	u32 error_block_length;
13017cd55c76SBob Moore 	struct acpi_generic_address read_ack_register;
13027cd55c76SBob Moore 	u64 read_ack_preserve;
13037cd55c76SBob Moore 	u64 read_ack_write;
13047cd55c76SBob Moore };
13057cd55c76SBob Moore 
13066e2d5ebdSBob Moore /* Generic Error Status block */
13076e2d5ebdSBob Moore 
13080a00fd5eSLv Zheng struct acpi_hest_generic_status {
13096e2d5ebdSBob Moore 	u32 block_status;
13106e2d5ebdSBob Moore 	u32 raw_data_offset;
13116e2d5ebdSBob Moore 	u32 raw_data_length;
13126e2d5ebdSBob Moore 	u32 data_length;
13136e2d5ebdSBob Moore 	u32 error_severity;
13146e2d5ebdSBob Moore };
13156e2d5ebdSBob Moore 
13166e2d5ebdSBob Moore /* Values for block_status flags above */
13176e2d5ebdSBob Moore 
13180a00fd5eSLv Zheng #define ACPI_HEST_UNCORRECTABLE             (1)
13190a00fd5eSLv Zheng #define ACPI_HEST_CORRECTABLE               (1<<1)
13200a00fd5eSLv Zheng #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
13210a00fd5eSLv Zheng #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
13220a00fd5eSLv Zheng #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4)	/* 8 bits, error count */
13236e2d5ebdSBob Moore 
13246e2d5ebdSBob Moore /* Generic Error Data entry */
13256e2d5ebdSBob Moore 
13260a00fd5eSLv Zheng struct acpi_hest_generic_data {
13276e2d5ebdSBob Moore 	u8 section_type[16];
13286e2d5ebdSBob Moore 	u32 error_severity;
13296e2d5ebdSBob Moore 	u16 revision;
13306e2d5ebdSBob Moore 	u8 validation_bits;
13316e2d5ebdSBob Moore 	u8 flags;
13326e2d5ebdSBob Moore 	u32 error_data_length;
13336e2d5ebdSBob Moore 	u8 fru_id[16];
13346e2d5ebdSBob Moore 	u8 fru_text[20];
13353fa34777SBob Moore };
1336970d9c9eSBob Moore 
13377cd55c76SBob Moore /* Extension for revision 0x0300 */
13387cd55c76SBob Moore 
13397cd55c76SBob Moore struct acpi_hest_generic_data_v300 {
13407cd55c76SBob Moore 	u8 section_type[16];
13417cd55c76SBob Moore 	u32 error_severity;
13427cd55c76SBob Moore 	u16 revision;
13437cd55c76SBob Moore 	u8 validation_bits;
13447cd55c76SBob Moore 	u8 flags;
13457cd55c76SBob Moore 	u32 error_data_length;
13467cd55c76SBob Moore 	u8 fru_id[16];
13477cd55c76SBob Moore 	u8 fru_text[20];
13487cd55c76SBob Moore 	u64 time_stamp;
13497cd55c76SBob Moore };
13507cd55c76SBob Moore 
13517cd55c76SBob Moore /* Values for error_severity above */
13527cd55c76SBob Moore 
13537cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
13547cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_FATAL           1
13557cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_CORRECTED       2
13567cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_NONE            3
13577cd55c76SBob Moore 
13587cd55c76SBob Moore /* Flags for validation_bits above */
13597cd55c76SBob Moore 
13607cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_FRU_ID          (1)
13617cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
13627cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
13637cd55c76SBob Moore 
1364c042933dSBob Moore /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
1365c042933dSBob Moore 
1366c042933dSBob Moore struct acpi_hest_ia_deferred_check {
1367c042933dSBob Moore 	struct acpi_hest_header header;
1368c042933dSBob Moore 	u16 reserved1;
1369c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
1370c042933dSBob Moore 	u8 enabled;
1371c042933dSBob Moore 	u32 records_to_preallocate;
1372c042933dSBob Moore 	u32 max_sections_per_record;
1373c042933dSBob Moore 	struct acpi_hest_notify notify;
1374c042933dSBob Moore 	u8 num_hardware_banks;
1375c042933dSBob Moore 	u8 reserved2[3];
1376c042933dSBob Moore };
1377c042933dSBob Moore 
1378970d9c9eSBob Moore /*******************************************************************************
1379970d9c9eSBob Moore  *
1380fa418ddfSLv Zheng  * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
1381fa418ddfSLv Zheng  *        Version 1
1382fa418ddfSLv Zheng  *
1383fa418ddfSLv Zheng  ******************************************************************************/
1384fa418ddfSLv Zheng 
1385fa418ddfSLv Zheng struct acpi_table_hmat {
1386fa418ddfSLv Zheng 	struct acpi_table_header header;	/* Common ACPI table header */
1387fa418ddfSLv Zheng 	u32 reserved;
1388fa418ddfSLv Zheng };
1389fa418ddfSLv Zheng 
1390fa418ddfSLv Zheng /* Values for HMAT structure types */
1391fa418ddfSLv Zheng 
1392fa418ddfSLv Zheng enum acpi_hmat_type {
1393fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_ADDRESS_RANGE = 0,	/* Memory subystem address range */
1394fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_LOCALITY = 1,	/* System locality latency and bandwidth information */
1395fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_CACHE = 2,	/* Memory side cache information */
1396fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_RESERVED = 3	/* 3 and greater are reserved */
1397fa418ddfSLv Zheng };
1398fa418ddfSLv Zheng 
1399fa418ddfSLv Zheng struct acpi_hmat_structure {
1400fa418ddfSLv Zheng 	u16 type;
1401fa418ddfSLv Zheng 	u16 reserved;
1402fa418ddfSLv Zheng 	u32 length;
1403fa418ddfSLv Zheng };
1404fa418ddfSLv Zheng 
1405fa418ddfSLv Zheng /*
1406fa418ddfSLv Zheng  * HMAT Structures, correspond to Type in struct acpi_hmat_structure
1407fa418ddfSLv Zheng  */
1408fa418ddfSLv Zheng 
1409fa418ddfSLv Zheng /* 0: Memory subystem address range */
1410fa418ddfSLv Zheng 
1411fa418ddfSLv Zheng struct acpi_hmat_address_range {
1412fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1413fa418ddfSLv Zheng 	u16 flags;
1414fa418ddfSLv Zheng 	u16 reserved1;
1415fa418ddfSLv Zheng 	u32 processor_PD;	/* Processor proximity domain */
1416fa418ddfSLv Zheng 	u32 memory_PD;		/* Memory proximity domain */
1417fa418ddfSLv Zheng 	u32 reserved2;
1418fa418ddfSLv Zheng 	u64 physical_address_base;	/* Physical address range base */
1419fa418ddfSLv Zheng 	u64 physical_address_length;	/* Physical address range length */
1420fa418ddfSLv Zheng };
1421fa418ddfSLv Zheng 
1422fa418ddfSLv Zheng /* Masks for Flags field above */
1423fa418ddfSLv Zheng 
1424fa418ddfSLv Zheng #define ACPI_HMAT_PROCESSOR_PD_VALID    (1)	/* 1: processor_PD field is valid */
1425fa418ddfSLv Zheng #define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)	/* 1: memory_PD field is valid */
1426fa418ddfSLv Zheng #define ACPI_HMAT_RESERVATION_HINT      (1<<2)	/* 1: Reservation hint */
1427fa418ddfSLv Zheng 
1428fa418ddfSLv Zheng /* 1: System locality latency and bandwidth information */
1429fa418ddfSLv Zheng 
1430fa418ddfSLv Zheng struct acpi_hmat_locality {
1431fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1432fa418ddfSLv Zheng 	u8 flags;
1433fa418ddfSLv Zheng 	u8 data_type;
1434fa418ddfSLv Zheng 	u16 reserved1;
1435fa418ddfSLv Zheng 	u32 number_of_initiator_Pds;
1436fa418ddfSLv Zheng 	u32 number_of_target_Pds;
1437fa418ddfSLv Zheng 	u32 reserved2;
1438fa418ddfSLv Zheng 	u64 entry_base_unit;
1439fa418ddfSLv Zheng };
1440fa418ddfSLv Zheng 
1441fa418ddfSLv Zheng /* Masks for Flags field above */
1442fa418ddfSLv Zheng 
1443fa418ddfSLv Zheng #define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)
1444fa418ddfSLv Zheng 
1445fa418ddfSLv Zheng /* Values for Memory Hierarchy flag */
1446fa418ddfSLv Zheng 
1447fa418ddfSLv Zheng #define ACPI_HMAT_MEMORY            0
1448fa418ddfSLv Zheng #define ACPI_HMAT_LAST_LEVEL_CACHE  1
1449fa418ddfSLv Zheng #define ACPI_HMAT_1ST_LEVEL_CACHE   2
1450fa418ddfSLv Zheng #define ACPI_HMAT_2ND_LEVEL_CACHE   3
1451fa418ddfSLv Zheng #define ACPI_HMAT_3RD_LEVEL_CACHE   4
1452fa418ddfSLv Zheng 
1453fa418ddfSLv Zheng /* Values for data_type field above */
1454fa418ddfSLv Zheng 
1455fa418ddfSLv Zheng #define ACPI_HMAT_ACCESS_LATENCY    0
1456fa418ddfSLv Zheng #define ACPI_HMAT_READ_LATENCY      1
1457fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_LATENCY     2
1458fa418ddfSLv Zheng #define ACPI_HMAT_ACCESS_BANDWIDTH  3
1459fa418ddfSLv Zheng #define ACPI_HMAT_READ_BANDWIDTH    4
1460fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_BANDWIDTH   5
1461fa418ddfSLv Zheng 
1462fa418ddfSLv Zheng /* 2: Memory side cache information */
1463fa418ddfSLv Zheng 
1464fa418ddfSLv Zheng struct acpi_hmat_cache {
1465fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1466fa418ddfSLv Zheng 	u32 memory_PD;
1467fa418ddfSLv Zheng 	u32 reserved1;
1468fa418ddfSLv Zheng 	u64 cache_size;
1469fa418ddfSLv Zheng 	u32 cache_attributes;
1470fa418ddfSLv Zheng 	u16 reserved2;
1471fa418ddfSLv Zheng 	u16 number_of_SMBIOShandles;
1472fa418ddfSLv Zheng };
1473fa418ddfSLv Zheng 
1474fa418ddfSLv Zheng /* Masks for cache_attributes field above */
1475fa418ddfSLv Zheng 
1476fa418ddfSLv Zheng #define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
1477fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
1478fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
1479fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
1480fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
1481fa418ddfSLv Zheng 
1482fa418ddfSLv Zheng /* Values for cache associativity flag */
1483fa418ddfSLv Zheng 
1484fa418ddfSLv Zheng #define ACPI_HMAT_CA_NONE                     (0)
1485fa418ddfSLv Zheng #define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
1486fa418ddfSLv Zheng #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
1487fa418ddfSLv Zheng 
1488fa418ddfSLv Zheng /* Values for write policy flag */
1489fa418ddfSLv Zheng 
1490fa418ddfSLv Zheng #define ACPI_HMAT_CP_NONE   (0)
1491fa418ddfSLv Zheng #define ACPI_HMAT_CP_WB     (1)
1492fa418ddfSLv Zheng #define ACPI_HMAT_CP_WT     (2)
1493fa418ddfSLv Zheng 
1494fa418ddfSLv Zheng /*******************************************************************************
1495fa418ddfSLv Zheng  *
1496e62f8227SErik Schmauss  * HPET - High Precision Event Timer table
14976e2d5ebdSBob Moore  *        Version 1
14986e2d5ebdSBob Moore  *
1499e62f8227SErik Schmauss  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
1500e62f8227SErik Schmauss  * Version 1.0a, October 2004
150104f8e384SBob Moore  *
150204f8e384SBob Moore  ******************************************************************************/
150304f8e384SBob Moore 
1504e62f8227SErik Schmauss struct acpi_table_hpet {
150504f8e384SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1506e62f8227SErik Schmauss 	u32 id;			/* Hardware ID of event timer block */
1507e62f8227SErik Schmauss 	struct acpi_generic_address address;	/* Address of event timer block */
1508e62f8227SErik Schmauss 	u8 sequence;		/* HPET sequence number */
1509e62f8227SErik Schmauss 	u16 minimum_tick;	/* Main counter min tick, periodic mode */
15104c189c9dSBob Moore 	u8 flags;
151181b7cb92SBob Moore };
151281b7cb92SBob Moore 
1513e62f8227SErik Schmauss /* Masks for Flags field above */
151481b7cb92SBob Moore 
1515e62f8227SErik Schmauss #define ACPI_HPET_PAGE_PROTECT_MASK (3)
1516e62f8227SErik Schmauss 
1517e62f8227SErik Schmauss /* Values for Page Protect flags */
1518e62f8227SErik Schmauss 
1519e62f8227SErik Schmauss enum acpi_hpet_page_protect {
1520e62f8227SErik Schmauss 	ACPI_HPET_NO_PAGE_PROTECT = 0,
1521e62f8227SErik Schmauss 	ACPI_HPET_PAGE_PROTECT4 = 1,
1522e62f8227SErik Schmauss 	ACPI_HPET_PAGE_PROTECT64 = 2
1523e62f8227SErik Schmauss };
152481b7cb92SBob Moore 
152581b7cb92SBob Moore /*******************************************************************************
152681b7cb92SBob Moore  *
1527e62f8227SErik Schmauss  * IBFT - Boot Firmware Table
1528b8355bcaSLv Zheng  *        Version 1
1529b8355bcaSLv Zheng  *
1530e62f8227SErik Schmauss  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
1531e62f8227SErik Schmauss  * Specification", Version 1.01, March 1, 2007
1532e62f8227SErik Schmauss  *
1533e62f8227SErik Schmauss  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
1534e62f8227SErik Schmauss  * Therefore, it is not currently supported by the disassembler.
1535e62f8227SErik Schmauss  *
1536b8355bcaSLv Zheng  ******************************************************************************/
1537b8355bcaSLv Zheng 
1538e62f8227SErik Schmauss struct acpi_table_ibft {
1539b8355bcaSLv Zheng 	struct acpi_table_header header;	/* Common ACPI table header */
1540e62f8227SErik Schmauss 	u8 reserved[12];
1541e62f8227SErik Schmauss };
1542e62f8227SErik Schmauss 
1543e62f8227SErik Schmauss /* IBFT common subtable header */
1544e62f8227SErik Schmauss 
1545e62f8227SErik Schmauss struct acpi_ibft_header {
1546e62f8227SErik Schmauss 	u8 type;
1547e62f8227SErik Schmauss 	u8 version;
1548e62f8227SErik Schmauss 	u16 length;
1549e62f8227SErik Schmauss 	u8 index;
1550e62f8227SErik Schmauss 	u8 flags;
1551b8355bcaSLv Zheng };
1552b8355bcaSLv Zheng 
1553b8355bcaSLv Zheng /* Values for Type field above */
1554b8355bcaSLv Zheng 
1555e62f8227SErik Schmauss enum acpi_ibft_type {
1556e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_NOT_USED = 0,
1557e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_CONTROL = 1,
1558e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_INITIATOR = 2,
1559e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_NIC = 3,
1560e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_TARGET = 4,
1561e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_EXTENSIONS = 5,
1562e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_RESERVED = 6	/* 6 and greater are reserved */
1563b8355bcaSLv Zheng };
1564b8355bcaSLv Zheng 
1565e62f8227SErik Schmauss /* IBFT subtables */
1566b8355bcaSLv Zheng 
1567e62f8227SErik Schmauss struct acpi_ibft_control {
1568e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1569e62f8227SErik Schmauss 	u16 extensions;
1570e62f8227SErik Schmauss 	u16 initiator_offset;
1571e62f8227SErik Schmauss 	u16 nic0_offset;
1572e62f8227SErik Schmauss 	u16 target0_offset;
1573e62f8227SErik Schmauss 	u16 nic1_offset;
1574e62f8227SErik Schmauss 	u16 target1_offset;
1575b8355bcaSLv Zheng };
1576b8355bcaSLv Zheng 
1577e62f8227SErik Schmauss struct acpi_ibft_initiator {
1578e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1579e62f8227SErik Schmauss 	u8 sns_server[16];
1580e62f8227SErik Schmauss 	u8 slp_server[16];
1581e62f8227SErik Schmauss 	u8 primary_server[16];
1582e62f8227SErik Schmauss 	u8 secondary_server[16];
1583e62f8227SErik Schmauss 	u16 name_length;
1584e62f8227SErik Schmauss 	u16 name_offset;
1585b8355bcaSLv Zheng };
1586b8355bcaSLv Zheng 
1587e62f8227SErik Schmauss struct acpi_ibft_nic {
1588e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1589e62f8227SErik Schmauss 	u8 ip_address[16];
1590e62f8227SErik Schmauss 	u8 subnet_mask_prefix;
1591e62f8227SErik Schmauss 	u8 origin;
1592e62f8227SErik Schmauss 	u8 gateway[16];
1593e62f8227SErik Schmauss 	u8 primary_dns[16];
1594e62f8227SErik Schmauss 	u8 secondary_dns[16];
1595e62f8227SErik Schmauss 	u8 dhcp[16];
1596e62f8227SErik Schmauss 	u16 vlan;
1597e62f8227SErik Schmauss 	u8 mac_address[6];
1598e62f8227SErik Schmauss 	u16 pci_address;
1599e62f8227SErik Schmauss 	u16 name_length;
1600e62f8227SErik Schmauss 	u16 name_offset;
1601b8355bcaSLv Zheng };
1602b8355bcaSLv Zheng 
1603e62f8227SErik Schmauss struct acpi_ibft_target {
1604e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1605e62f8227SErik Schmauss 	u8 target_ip_address[16];
1606e62f8227SErik Schmauss 	u16 target_ip_socket;
1607e62f8227SErik Schmauss 	u8 target_boot_lun[8];
1608e62f8227SErik Schmauss 	u8 chap_type;
1609e62f8227SErik Schmauss 	u8 nic_association;
1610e62f8227SErik Schmauss 	u16 target_name_length;
1611e62f8227SErik Schmauss 	u16 target_name_offset;
1612e62f8227SErik Schmauss 	u16 chap_name_length;
1613e62f8227SErik Schmauss 	u16 chap_name_offset;
1614e62f8227SErik Schmauss 	u16 chap_secret_length;
1615e62f8227SErik Schmauss 	u16 chap_secret_offset;
1616e62f8227SErik Schmauss 	u16 reverse_chap_name_length;
1617e62f8227SErik Schmauss 	u16 reverse_chap_name_offset;
1618e62f8227SErik Schmauss 	u16 reverse_chap_secret_length;
1619e62f8227SErik Schmauss 	u16 reverse_chap_secret_offset;
1620a618c7f8SBob Moore };
1621a618c7f8SBob Moore 
16226e596084SRobert Moore /* Reset to default packing */
16236e596084SRobert Moore 
16246e596084SRobert Moore #pragma pack()
16251da177e4SLinus Torvalds 
16261da177e4SLinus Torvalds #endif				/* __ACTBL1_H__ */
1627