xref: /openbmc/linux/include/acpi/actbl1.h (revision 200950b6)
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  *
64441e55dSBob Moore  * Copyright (C) 2000 - 2021, 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 */
29970d9c9eSBob Moore #define ACPI_SIG_BERT           "BERT"	/* Boot Error Record Table */
30e62f8227SErik Schmauss #define ACPI_SIG_BGRT           "BGRT"	/* Boot Graphics Resource Table */
31e62f8227SErik Schmauss #define ACPI_SIG_BOOT           "BOOT"	/* Simple Boot Flag Table */
327c5eab72SBen Widawsky #define ACPI_SIG_CEDT           "CEDT"	/* CXL Early Discovery Table */
33793c2388SBob Moore #define ACPI_SIG_CPEP           "CPEP"	/* Corrected Platform Error Polling table */
34e62f8227SErik Schmauss #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resource Table */
35e62f8227SErik Schmauss #define ACPI_SIG_DBG2           "DBG2"	/* Debug Port table type 2 */
36e62f8227SErik Schmauss #define ACPI_SIG_DBGP           "DBGP"	/* Debug Port table */
37e62f8227SErik Schmauss #define ACPI_SIG_DMAR           "DMAR"	/* DMA Remapping table */
38e62f8227SErik Schmauss #define ACPI_SIG_DRTM           "DRTM"	/* Dynamic Root of Trust for Measurement table */
39793c2388SBob Moore #define ACPI_SIG_ECDT           "ECDT"	/* Embedded Controller Boot Resources Table */
40970d9c9eSBob Moore #define ACPI_SIG_EINJ           "EINJ"	/* Error Injection table */
41970d9c9eSBob Moore #define ACPI_SIG_ERST           "ERST"	/* Error Record Serialization Table */
42e62f8227SErik Schmauss #define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance Data Table */
43e62f8227SErik Schmauss #define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer Description Table */
44970d9c9eSBob Moore #define ACPI_SIG_HEST           "HEST"	/* Hardware Error Source Table */
45e62f8227SErik Schmauss #define ACPI_SIG_HMAT           "HMAT"	/* Heterogeneous Memory Attributes Table */
46e62f8227SErik Schmauss #define ACPI_SIG_HPET           "HPET"	/* High Precision Event Timer table */
47e62f8227SErik Schmauss #define ACPI_SIG_IBFT           "IBFT"	/* iSCSI Boot Firmware Table */
48e62f8227SErik Schmauss 
49e62f8227SErik Schmauss #define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
50e62f8227SErik Schmauss #define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
51e62f8227SErik Schmauss 
52e62f8227SErik Schmauss /* Reserved table signatures */
53e62f8227SErik Schmauss 
54e62f8227SErik Schmauss #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
55e62f8227SErik Schmauss #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
56e62f8227SErik Schmauss 
57e62f8227SErik Schmauss /*
58e62f8227SErik Schmauss  * These tables have been seen in the field, but no definition has been found
59e62f8227SErik Schmauss  */
60e62f8227SErik Schmauss #ifdef ACPI_UNDEFINED_TABLES
61e62f8227SErik Schmauss #define ACPI_SIG_ATKG           "ATKG"
62e62f8227SErik Schmauss #define ACPI_SIG_GSCI           "GSCI"	/* GMCH SCI table */
63e62f8227SErik Schmauss #define ACPI_SIG_IEIT           "IEIT"
64e62f8227SErik Schmauss #endif
65793c2388SBob Moore 
66793c2388SBob Moore /*
67793c2388SBob Moore  * All tables must be byte-packed to match the ACPI specification, since
68793c2388SBob Moore  * the tables are provided by the system BIOS.
69793c2388SBob Moore  */
701da177e4SLinus Torvalds #pragma pack(1)
711da177e4SLinus Torvalds 
721da177e4SLinus Torvalds /*
73be030a57SBob Moore  * Note: C bitfields are not used for this reason:
74be030a57SBob Moore  *
75be030a57SBob Moore  * "Bitfields are great and easy to read, but unfortunately the C language
76be030a57SBob Moore  * does not specify the layout of bitfields in memory, which means they are
77be030a57SBob Moore  * essentially useless for dealing with packed data in on-disk formats or
78be030a57SBob Moore  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
79be030a57SBob Moore  * this decision was a design error in C. Ritchie could have picked an order
80be030a57SBob Moore  * and stuck with it." Norman Ramsey.
81be030a57SBob Moore  * See http://stackoverflow.com/a/1053662/41661
821da177e4SLinus Torvalds  */
83793c2388SBob Moore 
846e2d5ebdSBob Moore /*******************************************************************************
856e2d5ebdSBob Moore  *
866e2d5ebdSBob Moore  * Common subtable headers
876e2d5ebdSBob Moore  *
886e2d5ebdSBob Moore  ******************************************************************************/
896e2d5ebdSBob Moore 
906e2d5ebdSBob Moore /* Generic subtable header (used in MADT, SRAT, etc.) */
91f3d2e786SBob Moore 
92f3d2e786SBob Moore struct acpi_subtable_header {
93f3d2e786SBob Moore 	u8 type;
94f3d2e786SBob Moore 	u8 length;
95f3d2e786SBob Moore };
96f3d2e786SBob Moore 
976e2d5ebdSBob Moore /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
98970d9c9eSBob Moore 
99970d9c9eSBob Moore struct acpi_whea_header {
100970d9c9eSBob Moore 	u8 action;
101970d9c9eSBob Moore 	u8 instruction;
102970d9c9eSBob Moore 	u8 flags;
103970d9c9eSBob Moore 	u8 reserved;
104970d9c9eSBob Moore 	struct acpi_generic_address register_region;
1053fa34777SBob Moore 	u64 value;		/* Value used with Read/Write register */
1063fa34777SBob Moore 	u64 mask;		/* Bitmask required for this register instruction */
107970d9c9eSBob Moore };
108970d9c9eSBob Moore 
109793c2388SBob Moore /*******************************************************************************
110793c2388SBob Moore  *
111e62f8227SErik Schmauss  * ASF - Alert Standard Format table (Signature "ASF!")
112e62f8227SErik Schmauss  *       Revision 0x10
113e62f8227SErik Schmauss  *
114e62f8227SErik Schmauss  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
115e62f8227SErik Schmauss  *
116e62f8227SErik Schmauss  ******************************************************************************/
117e62f8227SErik Schmauss 
118e62f8227SErik Schmauss struct acpi_table_asf {
119e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
120e62f8227SErik Schmauss };
121e62f8227SErik Schmauss 
122e62f8227SErik Schmauss /* ASF subtable header */
123e62f8227SErik Schmauss 
124e62f8227SErik Schmauss struct acpi_asf_header {
125e62f8227SErik Schmauss 	u8 type;
126e62f8227SErik Schmauss 	u8 reserved;
127e62f8227SErik Schmauss 	u16 length;
128e62f8227SErik Schmauss };
129e62f8227SErik Schmauss 
130e62f8227SErik Schmauss /* Values for Type field above */
131e62f8227SErik Schmauss 
132e62f8227SErik Schmauss enum acpi_asf_type {
133e62f8227SErik Schmauss 	ACPI_ASF_TYPE_INFO = 0,
134e62f8227SErik Schmauss 	ACPI_ASF_TYPE_ALERT = 1,
135e62f8227SErik Schmauss 	ACPI_ASF_TYPE_CONTROL = 2,
136e62f8227SErik Schmauss 	ACPI_ASF_TYPE_BOOT = 3,
137e62f8227SErik Schmauss 	ACPI_ASF_TYPE_ADDRESS = 4,
138e62f8227SErik Schmauss 	ACPI_ASF_TYPE_RESERVED = 5
139e62f8227SErik Schmauss };
140e62f8227SErik Schmauss 
141e62f8227SErik Schmauss /*
142e62f8227SErik Schmauss  * ASF subtables
143e62f8227SErik Schmauss  */
144e62f8227SErik Schmauss 
145e62f8227SErik Schmauss /* 0: ASF Information */
146e62f8227SErik Schmauss 
147e62f8227SErik Schmauss struct acpi_asf_info {
148e62f8227SErik Schmauss 	struct acpi_asf_header header;
149e62f8227SErik Schmauss 	u8 min_reset_value;
150e62f8227SErik Schmauss 	u8 min_poll_interval;
151e62f8227SErik Schmauss 	u16 system_id;
152e62f8227SErik Schmauss 	u32 mfg_id;
153e62f8227SErik Schmauss 	u8 flags;
154e62f8227SErik Schmauss 	u8 reserved2[3];
155e62f8227SErik Schmauss };
156e62f8227SErik Schmauss 
157e62f8227SErik Schmauss /* Masks for Flags field above */
158e62f8227SErik Schmauss 
159e62f8227SErik Schmauss #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
160e62f8227SErik Schmauss 
161e62f8227SErik Schmauss /* 1: ASF Alerts */
162e62f8227SErik Schmauss 
163e62f8227SErik Schmauss struct acpi_asf_alert {
164e62f8227SErik Schmauss 	struct acpi_asf_header header;
165e62f8227SErik Schmauss 	u8 assert_mask;
166e62f8227SErik Schmauss 	u8 deassert_mask;
167e62f8227SErik Schmauss 	u8 alerts;
168e62f8227SErik Schmauss 	u8 data_length;
169e62f8227SErik Schmauss };
170e62f8227SErik Schmauss 
171e62f8227SErik Schmauss struct acpi_asf_alert_data {
172e62f8227SErik Schmauss 	u8 address;
173e62f8227SErik Schmauss 	u8 command;
174e62f8227SErik Schmauss 	u8 mask;
175e62f8227SErik Schmauss 	u8 value;
176e62f8227SErik Schmauss 	u8 sensor_type;
177e62f8227SErik Schmauss 	u8 type;
178e62f8227SErik Schmauss 	u8 offset;
179e62f8227SErik Schmauss 	u8 source_type;
180e62f8227SErik Schmauss 	u8 severity;
181e62f8227SErik Schmauss 	u8 sensor_number;
182e62f8227SErik Schmauss 	u8 entity;
183e62f8227SErik Schmauss 	u8 instance;
184e62f8227SErik Schmauss };
185e62f8227SErik Schmauss 
186e62f8227SErik Schmauss /* 2: ASF Remote Control */
187e62f8227SErik Schmauss 
188e62f8227SErik Schmauss struct acpi_asf_remote {
189e62f8227SErik Schmauss 	struct acpi_asf_header header;
190e62f8227SErik Schmauss 	u8 controls;
191e62f8227SErik Schmauss 	u8 data_length;
192e62f8227SErik Schmauss 	u16 reserved2;
193e62f8227SErik Schmauss };
194e62f8227SErik Schmauss 
195e62f8227SErik Schmauss struct acpi_asf_control_data {
196e62f8227SErik Schmauss 	u8 function;
197e62f8227SErik Schmauss 	u8 address;
198e62f8227SErik Schmauss 	u8 command;
199e62f8227SErik Schmauss 	u8 value;
200e62f8227SErik Schmauss };
201e62f8227SErik Schmauss 
202e62f8227SErik Schmauss /* 3: ASF RMCP Boot Options */
203e62f8227SErik Schmauss 
204e62f8227SErik Schmauss struct acpi_asf_rmcp {
205e62f8227SErik Schmauss 	struct acpi_asf_header header;
206e62f8227SErik Schmauss 	u8 capabilities[7];
207e62f8227SErik Schmauss 	u8 completion_code;
208e62f8227SErik Schmauss 	u32 enterprise_id;
209e62f8227SErik Schmauss 	u8 command;
210e62f8227SErik Schmauss 	u16 parameter;
211e62f8227SErik Schmauss 	u16 boot_options;
212e62f8227SErik Schmauss 	u16 oem_parameters;
213e62f8227SErik Schmauss };
214e62f8227SErik Schmauss 
215e62f8227SErik Schmauss /* 4: ASF Address */
216e62f8227SErik Schmauss 
217e62f8227SErik Schmauss struct acpi_asf_address {
218e62f8227SErik Schmauss 	struct acpi_asf_header header;
219e62f8227SErik Schmauss 	u8 eprom_address;
220e62f8227SErik Schmauss 	u8 devices;
221e62f8227SErik Schmauss };
222e62f8227SErik Schmauss 
223e62f8227SErik Schmauss /*******************************************************************************
224e62f8227SErik Schmauss  *
2256e2d5ebdSBob Moore  * BERT - Boot Error Record Table (ACPI 4.0)
2266e2d5ebdSBob Moore  *        Version 1
227970d9c9eSBob Moore  *
228970d9c9eSBob Moore  ******************************************************************************/
229970d9c9eSBob Moore 
230970d9c9eSBob Moore struct acpi_table_bert {
231970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
232970d9c9eSBob Moore 	u32 region_length;	/* Length of the boot error region */
233b595076aSUwe Kleine-König 	u64 address;		/* Physical address of the error region */
234970d9c9eSBob Moore };
235970d9c9eSBob Moore 
2366e2d5ebdSBob Moore /* Boot Error Region (not a subtable, pointed to by Address field above) */
2373fa34777SBob Moore 
238970d9c9eSBob Moore struct acpi_bert_region {
2396e2d5ebdSBob Moore 	u32 block_status;	/* Type of error information */
2406e2d5ebdSBob Moore 	u32 raw_data_offset;	/* Offset to raw error data */
2416e2d5ebdSBob Moore 	u32 raw_data_length;	/* Length of raw error data */
2426e2d5ebdSBob Moore 	u32 data_length;	/* Length of generic error data */
2436e2d5ebdSBob Moore 	u32 error_severity;	/* Severity code */
244970d9c9eSBob Moore };
245970d9c9eSBob Moore 
2466e2d5ebdSBob Moore /* Values for block_status flags above */
247970d9c9eSBob Moore 
248970d9c9eSBob Moore #define ACPI_BERT_UNCORRECTABLE             (1)
2496e2d5ebdSBob Moore #define ACPI_BERT_CORRECTABLE               (1<<1)
2506e2d5ebdSBob Moore #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
2516e2d5ebdSBob Moore #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
2526e2d5ebdSBob Moore #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4)	/* 8 bits, error count */
2536e2d5ebdSBob Moore 
2546e2d5ebdSBob Moore /* Values for error_severity above */
2556e2d5ebdSBob Moore 
2566e2d5ebdSBob Moore enum acpi_bert_error_severity {
2576e2d5ebdSBob Moore 	ACPI_BERT_ERROR_CORRECTABLE = 0,
2586e2d5ebdSBob Moore 	ACPI_BERT_ERROR_FATAL = 1,
2596e2d5ebdSBob Moore 	ACPI_BERT_ERROR_CORRECTED = 2,
2606e2d5ebdSBob Moore 	ACPI_BERT_ERROR_NONE = 3,
2616e2d5ebdSBob Moore 	ACPI_BERT_ERROR_RESERVED = 4	/* 4 and greater are reserved */
2626e2d5ebdSBob Moore };
2636e2d5ebdSBob Moore 
2646e2d5ebdSBob Moore /*
2656e2d5ebdSBob Moore  * Note: The generic error data that follows the error_severity field above
2666e2d5ebdSBob Moore  * uses the struct acpi_hest_generic_data defined under the HEST table below
2676e2d5ebdSBob Moore  */
268970d9c9eSBob Moore 
269970d9c9eSBob Moore /*******************************************************************************
270970d9c9eSBob Moore  *
271e62f8227SErik Schmauss  * BGRT - Boot Graphics Resource Table (ACPI 5.0)
272e62f8227SErik Schmauss  *        Version 1
273e62f8227SErik Schmauss  *
274e62f8227SErik Schmauss  ******************************************************************************/
275e62f8227SErik Schmauss 
276e62f8227SErik Schmauss struct acpi_table_bgrt {
277e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
278e62f8227SErik Schmauss 	u16 version;
279e62f8227SErik Schmauss 	u8 status;
280e62f8227SErik Schmauss 	u8 image_type;
281e62f8227SErik Schmauss 	u64 image_address;
282e62f8227SErik Schmauss 	u32 image_offset_x;
283e62f8227SErik Schmauss 	u32 image_offset_y;
284e62f8227SErik Schmauss };
285e62f8227SErik Schmauss 
286e62f8227SErik Schmauss /* Flags for Status field above */
287e62f8227SErik Schmauss 
288e62f8227SErik Schmauss #define ACPI_BGRT_DISPLAYED                 (1)
289e62f8227SErik Schmauss #define ACPI_BGRT_ORIENTATION_OFFSET        (3 << 1)
290e62f8227SErik Schmauss 
291e62f8227SErik Schmauss /*******************************************************************************
292e62f8227SErik Schmauss  *
293e62f8227SErik Schmauss  * BOOT - Simple Boot Flag Table
294e62f8227SErik Schmauss  *        Version 1
295e62f8227SErik Schmauss  *
296e62f8227SErik Schmauss  * Conforms to the "Simple Boot Flag Specification", Version 2.1
297e62f8227SErik Schmauss  *
298e62f8227SErik Schmauss  ******************************************************************************/
299e62f8227SErik Schmauss 
300e62f8227SErik Schmauss struct acpi_table_boot {
301e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
302e62f8227SErik Schmauss 	u8 cmos_index;		/* Index in CMOS RAM for the boot register */
303e62f8227SErik Schmauss 	u8 reserved[3];
304e62f8227SErik Schmauss };
305e62f8227SErik Schmauss 
306e62f8227SErik Schmauss /*******************************************************************************
307e62f8227SErik Schmauss  *
3087c5eab72SBen Widawsky  * CEDT - CXL Early Discovery Table
3097c5eab72SBen Widawsky  *        Version 1
3107c5eab72SBen Widawsky  *
3117c5eab72SBen Widawsky  * Conforms to the "CXL Early Discovery Table" (CXL 2.0)
3127c5eab72SBen Widawsky  *
3137c5eab72SBen Widawsky  ******************************************************************************/
3147c5eab72SBen Widawsky 
3157c5eab72SBen Widawsky struct acpi_table_cedt {
3167c5eab72SBen Widawsky 	struct acpi_table_header header;	/* Common ACPI table header */
3177c5eab72SBen Widawsky };
3187c5eab72SBen Widawsky 
3197c5eab72SBen Widawsky /* CEDT subtable header (Performance Record Structure) */
3207c5eab72SBen Widawsky 
3217c5eab72SBen Widawsky struct acpi_cedt_header {
3227c5eab72SBen Widawsky 	u8 type;
3237c5eab72SBen Widawsky 	u8 reserved;
3247c5eab72SBen Widawsky 	u16 length;
3257c5eab72SBen Widawsky };
3267c5eab72SBen Widawsky 
3277c5eab72SBen Widawsky /* Values for Type field above */
3287c5eab72SBen Widawsky 
3297c5eab72SBen Widawsky enum acpi_cedt_type {
3307c5eab72SBen Widawsky 	ACPI_CEDT_TYPE_CHBS = 0,
3314a2c1dcfSAlison Schofield 	ACPI_CEDT_TYPE_CFMWS = 1,
3324a2c1dcfSAlison Schofield 	ACPI_CEDT_TYPE_RESERVED = 2,
3337c5eab72SBen Widawsky };
3347c5eab72SBen Widawsky 
335160c768eSAlison Schofield /* Values for version field above */
336160c768eSAlison Schofield 
337160c768eSAlison Schofield #define ACPI_CEDT_CHBS_VERSION_CXL11    (0)
338160c768eSAlison Schofield #define ACPI_CEDT_CHBS_VERSION_CXL20    (1)
339160c768eSAlison Schofield 
340160c768eSAlison Schofield /* Values for length field above */
341160c768eSAlison Schofield 
342160c768eSAlison Schofield #define ACPI_CEDT_CHBS_LENGTH_CXL11     (0x2000)
343160c768eSAlison Schofield #define ACPI_CEDT_CHBS_LENGTH_CXL20     (0x10000)
344160c768eSAlison Schofield 
3457c5eab72SBen Widawsky /*
3467c5eab72SBen Widawsky  * CEDT subtables
3477c5eab72SBen Widawsky  */
3487c5eab72SBen Widawsky 
3497c5eab72SBen Widawsky /* 0: CXL Host Bridge Structure */
3507c5eab72SBen Widawsky 
3517c5eab72SBen Widawsky struct acpi_cedt_chbs {
352519c8090SBob Moore 	struct acpi_cedt_header header;
3537c5eab72SBen Widawsky 	u32 uid;
3547c5eab72SBen Widawsky 	u32 cxl_version;
3557c5eab72SBen Widawsky 	u32 reserved;
3567c5eab72SBen Widawsky 	u64 base;
3577c5eab72SBen Widawsky 	u64 length;
3587c5eab72SBen Widawsky };
3597c5eab72SBen Widawsky 
3604a2c1dcfSAlison Schofield /* 1: CXL Fixed Memory Window Structure */
3614a2c1dcfSAlison Schofield 
3624a2c1dcfSAlison Schofield struct acpi_cedt_cfmws {
3634a2c1dcfSAlison Schofield 	struct acpi_cedt_header header;
3644a2c1dcfSAlison Schofield 	u32 reserved1;
3654a2c1dcfSAlison Schofield 	u64 base_hpa;
3664a2c1dcfSAlison Schofield 	u64 window_size;
3674a2c1dcfSAlison Schofield 	u8 interleave_ways;
3684a2c1dcfSAlison Schofield 	u8 interleave_arithmetic;
3694a2c1dcfSAlison Schofield 	u16 reserved2;
3704a2c1dcfSAlison Schofield 	u32 granularity;
3714a2c1dcfSAlison Schofield 	u16 restrictions;
3724a2c1dcfSAlison Schofield 	u16 qtg_id;
3734a2c1dcfSAlison Schofield 	u32 interleave_targets[];
3744a2c1dcfSAlison Schofield };
3754a2c1dcfSAlison Schofield 
3764a2c1dcfSAlison Schofield /* Values for Interleave Arithmetic field above */
3774a2c1dcfSAlison Schofield 
3784a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO	(0)
3794a2c1dcfSAlison Schofield 
3804a2c1dcfSAlison Schofield /* Values for Restrictions field above */
3814a2c1dcfSAlison Schofield 
3824a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_TYPE2		(1)
3834a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_TYPE3		(1<<1)
3844a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE	(1<<2)
3854a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_PMEM		(1<<3)
3864a2c1dcfSAlison Schofield #define ACPI_CEDT_CFMWS_RESTRICT_FIXED		(1<<4)
3874a2c1dcfSAlison Schofield 
3887c5eab72SBen Widawsky /*******************************************************************************
3897c5eab72SBen Widawsky  *
3906e2d5ebdSBob Moore  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
3916e2d5ebdSBob Moore  *        Version 1
392793c2388SBob Moore  *
393793c2388SBob Moore  ******************************************************************************/
394793c2388SBob Moore 
395793c2388SBob Moore struct acpi_table_cpep {
396f3d2e786SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
397f3d2e786SBob Moore 	u64 reserved;
398793c2388SBob Moore };
399793c2388SBob Moore 
400793c2388SBob Moore /* Subtable */
401793c2388SBob Moore 
402793c2388SBob Moore struct acpi_cpep_polling {
4036e2d5ebdSBob Moore 	struct acpi_subtable_header header;
404f3d2e786SBob Moore 	u8 id;			/* Processor ID */
405f3d2e786SBob Moore 	u8 eid;			/* Processor EID */
406f3d2e786SBob Moore 	u32 interval;		/* Polling interval (msec) */
407793c2388SBob Moore };
408793c2388SBob Moore 
409793c2388SBob Moore /*******************************************************************************
410793c2388SBob Moore  *
411e62f8227SErik Schmauss  * CSRT - Core System Resource Table
412e62f8227SErik Schmauss  *        Version 0
413e62f8227SErik Schmauss  *
414e62f8227SErik Schmauss  * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
415e62f8227SErik Schmauss  *
416e62f8227SErik Schmauss  ******************************************************************************/
417e62f8227SErik Schmauss 
418e62f8227SErik Schmauss struct acpi_table_csrt {
419e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
420e62f8227SErik Schmauss };
421e62f8227SErik Schmauss 
422e62f8227SErik Schmauss /* Resource Group subtable */
423e62f8227SErik Schmauss 
424e62f8227SErik Schmauss struct acpi_csrt_group {
425e62f8227SErik Schmauss 	u32 length;
426e62f8227SErik Schmauss 	u32 vendor_id;
427e62f8227SErik Schmauss 	u32 subvendor_id;
428e62f8227SErik Schmauss 	u16 device_id;
429e62f8227SErik Schmauss 	u16 subdevice_id;
430e62f8227SErik Schmauss 	u16 revision;
431e62f8227SErik Schmauss 	u16 reserved;
432e62f8227SErik Schmauss 	u32 shared_info_length;
433e62f8227SErik Schmauss 
434e62f8227SErik Schmauss 	/* Shared data immediately follows (Length = shared_info_length) */
435e62f8227SErik Schmauss };
436e62f8227SErik Schmauss 
437e62f8227SErik Schmauss /* Shared Info subtable */
438e62f8227SErik Schmauss 
439e62f8227SErik Schmauss struct acpi_csrt_shared_info {
440e62f8227SErik Schmauss 	u16 major_version;
441e62f8227SErik Schmauss 	u16 minor_version;
442e62f8227SErik Schmauss 	u32 mmio_base_low;
443e62f8227SErik Schmauss 	u32 mmio_base_high;
444e62f8227SErik Schmauss 	u32 gsi_interrupt;
445e62f8227SErik Schmauss 	u8 interrupt_polarity;
446e62f8227SErik Schmauss 	u8 interrupt_mode;
447e62f8227SErik Schmauss 	u8 num_channels;
448e62f8227SErik Schmauss 	u8 dma_address_width;
449e62f8227SErik Schmauss 	u16 base_request_line;
450e62f8227SErik Schmauss 	u16 num_handshake_signals;
451e62f8227SErik Schmauss 	u32 max_block_size;
452e62f8227SErik Schmauss 
453e62f8227SErik Schmauss 	/* Resource descriptors immediately follow (Length = Group length - shared_info_length) */
454e62f8227SErik Schmauss };
455e62f8227SErik Schmauss 
456e62f8227SErik Schmauss /* Resource Descriptor subtable */
457e62f8227SErik Schmauss 
458e62f8227SErik Schmauss struct acpi_csrt_descriptor {
459e62f8227SErik Schmauss 	u32 length;
460e62f8227SErik Schmauss 	u16 type;
461e62f8227SErik Schmauss 	u16 subtype;
462e62f8227SErik Schmauss 	u32 uid;
463e62f8227SErik Schmauss 
464e62f8227SErik Schmauss 	/* Resource-specific information immediately follows */
465e62f8227SErik Schmauss };
466e62f8227SErik Schmauss 
467e62f8227SErik Schmauss /* Resource Types */
468e62f8227SErik Schmauss 
469e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_INTERRUPT    0x0001
470e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_TIMER        0x0002
471e62f8227SErik Schmauss #define ACPI_CSRT_TYPE_DMA          0x0003
472e62f8227SErik Schmauss 
473e62f8227SErik Schmauss /* Resource Subtypes */
474e62f8227SErik Schmauss 
475e62f8227SErik Schmauss #define ACPI_CSRT_XRUPT_LINE        0x0000
476e62f8227SErik Schmauss #define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
477e62f8227SErik Schmauss #define ACPI_CSRT_TIMER             0x0000
478e62f8227SErik Schmauss #define ACPI_CSRT_DMA_CHANNEL       0x0000
479e62f8227SErik Schmauss #define ACPI_CSRT_DMA_CONTROLLER    0x0001
480e62f8227SErik Schmauss 
481e62f8227SErik Schmauss /*******************************************************************************
482e62f8227SErik Schmauss  *
483e62f8227SErik Schmauss  * DBG2 - Debug Port Table 2
484e62f8227SErik Schmauss  *        Version 0 (Both main table and subtables)
485e62f8227SErik Schmauss  *
486*200950b6SMarcin Wojtas  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", September 21, 2020
487e62f8227SErik Schmauss  *
488e62f8227SErik Schmauss  ******************************************************************************/
489e62f8227SErik Schmauss 
490e62f8227SErik Schmauss struct acpi_table_dbg2 {
491e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
492e62f8227SErik Schmauss 	u32 info_offset;
493e62f8227SErik Schmauss 	u32 info_count;
494e62f8227SErik Schmauss };
495e62f8227SErik Schmauss 
496e62f8227SErik Schmauss struct acpi_dbg2_header {
497e62f8227SErik Schmauss 	u32 info_offset;
498e62f8227SErik Schmauss 	u32 info_count;
499e62f8227SErik Schmauss };
500e62f8227SErik Schmauss 
501e62f8227SErik Schmauss /* Debug Device Information Subtable */
502e62f8227SErik Schmauss 
503e62f8227SErik Schmauss struct acpi_dbg2_device {
504e62f8227SErik Schmauss 	u8 revision;
505e62f8227SErik Schmauss 	u16 length;
506e62f8227SErik Schmauss 	u8 register_count;	/* Number of base_address registers */
507e62f8227SErik Schmauss 	u16 namepath_length;
508e62f8227SErik Schmauss 	u16 namepath_offset;
509e62f8227SErik Schmauss 	u16 oem_data_length;
510e62f8227SErik Schmauss 	u16 oem_data_offset;
511e62f8227SErik Schmauss 	u16 port_type;
512e62f8227SErik Schmauss 	u16 port_subtype;
513e62f8227SErik Schmauss 	u16 reserved;
514e62f8227SErik Schmauss 	u16 base_address_offset;
515e62f8227SErik Schmauss 	u16 address_size_offset;
516e62f8227SErik Schmauss 	/*
517e62f8227SErik Schmauss 	 * Data that follows:
518e62f8227SErik Schmauss 	 *    base_address (required) - Each in 12-byte Generic Address Structure format.
519e62f8227SErik Schmauss 	 *    address_size (required) - Array of u32 sizes corresponding to each base_address register.
520e62f8227SErik Schmauss 	 *    Namepath    (required) - Null terminated string. Single dot if not supported.
521e62f8227SErik Schmauss 	 *    oem_data    (optional) - Length is oem_data_length.
522e62f8227SErik Schmauss 	 */
523e62f8227SErik Schmauss };
524e62f8227SErik Schmauss 
525e62f8227SErik Schmauss /* Types for port_type field above */
526e62f8227SErik Schmauss 
527e62f8227SErik Schmauss #define ACPI_DBG2_SERIAL_PORT       0x8000
528e62f8227SErik Schmauss #define ACPI_DBG2_1394_PORT         0x8001
529e62f8227SErik Schmauss #define ACPI_DBG2_USB_PORT          0x8002
530e62f8227SErik Schmauss #define ACPI_DBG2_NET_PORT          0x8003
531e62f8227SErik Schmauss 
532e62f8227SErik Schmauss /* Subtypes for port_subtype field above */
533e62f8227SErik Schmauss 
534e62f8227SErik Schmauss #define ACPI_DBG2_16550_COMPATIBLE  0x0000
535e62f8227SErik Schmauss #define ACPI_DBG2_16550_SUBSET      0x0001
536*200950b6SMarcin Wojtas #define ACPI_DBG2_MAX311XE_SPI      0x0002
537e62f8227SErik Schmauss #define ACPI_DBG2_ARM_PL011         0x0003
538*200950b6SMarcin Wojtas #define ACPI_DBG2_MSM8X60           0x0004
539*200950b6SMarcin Wojtas #define ACPI_DBG2_16550_NVIDIA      0x0005
540*200950b6SMarcin Wojtas #define ACPI_DBG2_TI_OMAP           0x0006
541*200950b6SMarcin Wojtas #define ACPI_DBG2_APM88XXXX         0x0008
542*200950b6SMarcin Wojtas #define ACPI_DBG2_MSM8974           0x0009
543*200950b6SMarcin Wojtas #define ACPI_DBG2_SAM5250           0x000A
544*200950b6SMarcin Wojtas #define ACPI_DBG2_INTEL_USIF        0x000B
545*200950b6SMarcin Wojtas #define ACPI_DBG2_IMX6              0x000C
546e62f8227SErik Schmauss #define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
547e62f8227SErik Schmauss #define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
548e62f8227SErik Schmauss #define ACPI_DBG2_ARM_DCC           0x000F
549e62f8227SErik Schmauss #define ACPI_DBG2_BCM2835           0x0010
550*200950b6SMarcin Wojtas #define ACPI_DBG2_SDM845_1_8432MHZ  0x0011
551*200950b6SMarcin Wojtas #define ACPI_DBG2_16550_WITH_GAS    0x0012
552*200950b6SMarcin Wojtas #define ACPI_DBG2_SDM845_7_372MHZ   0x0013
553*200950b6SMarcin Wojtas #define ACPI_DBG2_INTEL_LPSS        0x0014
554e62f8227SErik Schmauss 
555e62f8227SErik Schmauss #define ACPI_DBG2_1394_STANDARD     0x0000
556e62f8227SErik Schmauss 
557e62f8227SErik Schmauss #define ACPI_DBG2_USB_XHCI          0x0000
558e62f8227SErik Schmauss #define ACPI_DBG2_USB_EHCI          0x0001
559e62f8227SErik Schmauss 
560e62f8227SErik Schmauss /*******************************************************************************
561e62f8227SErik Schmauss  *
562e62f8227SErik Schmauss  * DBGP - Debug Port table
563e62f8227SErik Schmauss  *        Version 1
564e62f8227SErik Schmauss  *
565e62f8227SErik Schmauss  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
566e62f8227SErik Schmauss  *
567e62f8227SErik Schmauss  ******************************************************************************/
568e62f8227SErik Schmauss 
569e62f8227SErik Schmauss struct acpi_table_dbgp {
570e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
571e62f8227SErik Schmauss 	u8 type;		/* 0=full 16550, 1=subset of 16550 */
572e62f8227SErik Schmauss 	u8 reserved[3];
573e62f8227SErik Schmauss 	struct acpi_generic_address debug_port;
574e62f8227SErik Schmauss };
575e62f8227SErik Schmauss 
576e62f8227SErik Schmauss /*******************************************************************************
577e62f8227SErik Schmauss  *
578e62f8227SErik Schmauss  * DMAR - DMA Remapping table
579e62f8227SErik Schmauss  *        Version 1
580e62f8227SErik Schmauss  *
581e62f8227SErik Schmauss  * Conforms to "Intel Virtualization Technology for Directed I/O",
582e62f8227SErik Schmauss  * Version 2.3, October 2014
583e62f8227SErik Schmauss  *
584e62f8227SErik Schmauss  ******************************************************************************/
585e62f8227SErik Schmauss 
586e62f8227SErik Schmauss struct acpi_table_dmar {
587e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
588e62f8227SErik Schmauss 	u8 width;		/* Host Address Width */
589e62f8227SErik Schmauss 	u8 flags;
590e62f8227SErik Schmauss 	u8 reserved[10];
591e62f8227SErik Schmauss };
592e62f8227SErik Schmauss 
593e62f8227SErik Schmauss /* Masks for Flags field above */
594e62f8227SErik Schmauss 
595e62f8227SErik Schmauss #define ACPI_DMAR_INTR_REMAP        (1)
596e62f8227SErik Schmauss #define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
597e62f8227SErik Schmauss #define ACPI_DMAR_X2APIC_MODE       (1<<2)
598e62f8227SErik Schmauss 
599e62f8227SErik Schmauss /* DMAR subtable header */
600e62f8227SErik Schmauss 
601e62f8227SErik Schmauss struct acpi_dmar_header {
602e62f8227SErik Schmauss 	u16 type;
603e62f8227SErik Schmauss 	u16 length;
604e62f8227SErik Schmauss };
605e62f8227SErik Schmauss 
606e62f8227SErik Schmauss /* Values for subtable type in struct acpi_dmar_header */
607e62f8227SErik Schmauss 
608e62f8227SErik Schmauss enum acpi_dmar_type {
609e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
610e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
611e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_ROOT_ATS = 2,
612e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
613e62f8227SErik Schmauss 	ACPI_DMAR_TYPE_NAMESPACE = 4,
61481d3c75bSYian Chen 	ACPI_DMAR_TYPE_SATC = 5,
61581d3c75bSYian Chen 	ACPI_DMAR_TYPE_RESERVED = 6	/* 6 and greater are reserved */
616e62f8227SErik Schmauss };
617e62f8227SErik Schmauss 
618e62f8227SErik Schmauss /* DMAR Device Scope structure */
619e62f8227SErik Schmauss 
620e62f8227SErik Schmauss struct acpi_dmar_device_scope {
621e62f8227SErik Schmauss 	u8 entry_type;
622e62f8227SErik Schmauss 	u8 length;
623e62f8227SErik Schmauss 	u16 reserved;
624e62f8227SErik Schmauss 	u8 enumeration_id;
625e62f8227SErik Schmauss 	u8 bus;
626e62f8227SErik Schmauss };
627e62f8227SErik Schmauss 
628e62f8227SErik Schmauss /* Values for entry_type in struct acpi_dmar_device_scope - device types */
629e62f8227SErik Schmauss 
630e62f8227SErik Schmauss enum acpi_dmar_scope_type {
631e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
632e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
633e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
634e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
635e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_HPET = 4,
636e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
637e62f8227SErik Schmauss 	ACPI_DMAR_SCOPE_TYPE_RESERVED = 6	/* 6 and greater are reserved */
638e62f8227SErik Schmauss };
639e62f8227SErik Schmauss 
640e62f8227SErik Schmauss struct acpi_dmar_pci_path {
641e62f8227SErik Schmauss 	u8 device;
642e62f8227SErik Schmauss 	u8 function;
643e62f8227SErik Schmauss };
644e62f8227SErik Schmauss 
645e62f8227SErik Schmauss /*
646e62f8227SErik Schmauss  * DMAR Subtables, correspond to Type in struct acpi_dmar_header
647e62f8227SErik Schmauss  */
648e62f8227SErik Schmauss 
649e62f8227SErik Schmauss /* 0: Hardware Unit Definition */
650e62f8227SErik Schmauss 
651e62f8227SErik Schmauss struct acpi_dmar_hardware_unit {
652e62f8227SErik Schmauss 	struct acpi_dmar_header header;
653e62f8227SErik Schmauss 	u8 flags;
654e62f8227SErik Schmauss 	u8 reserved;
655e62f8227SErik Schmauss 	u16 segment;
656e62f8227SErik Schmauss 	u64 address;		/* Register Base Address */
657e62f8227SErik Schmauss };
658e62f8227SErik Schmauss 
659e62f8227SErik Schmauss /* Masks for Flags field above */
660e62f8227SErik Schmauss 
661e62f8227SErik Schmauss #define ACPI_DMAR_INCLUDE_ALL       (1)
662e62f8227SErik Schmauss 
663c163f90cSErik Schmauss /* 1: Reserved Memory Definition */
664e62f8227SErik Schmauss 
665e62f8227SErik Schmauss struct acpi_dmar_reserved_memory {
666e62f8227SErik Schmauss 	struct acpi_dmar_header header;
667e62f8227SErik Schmauss 	u16 reserved;
668e62f8227SErik Schmauss 	u16 segment;
669e62f8227SErik Schmauss 	u64 base_address;	/* 4K aligned base address */
670e62f8227SErik Schmauss 	u64 end_address;	/* 4K aligned limit address */
671e62f8227SErik Schmauss };
672e62f8227SErik Schmauss 
673e62f8227SErik Schmauss /* Masks for Flags field above */
674e62f8227SErik Schmauss 
675e62f8227SErik Schmauss #define ACPI_DMAR_ALLOW_ALL         (1)
676e62f8227SErik Schmauss 
677e62f8227SErik Schmauss /* 2: Root Port ATS Capability Reporting Structure */
678e62f8227SErik Schmauss 
679e62f8227SErik Schmauss struct acpi_dmar_atsr {
680e62f8227SErik Schmauss 	struct acpi_dmar_header header;
681e62f8227SErik Schmauss 	u8 flags;
682e62f8227SErik Schmauss 	u8 reserved;
683e62f8227SErik Schmauss 	u16 segment;
684e62f8227SErik Schmauss };
685e62f8227SErik Schmauss 
686e62f8227SErik Schmauss /* Masks for Flags field above */
687e62f8227SErik Schmauss 
688e62f8227SErik Schmauss #define ACPI_DMAR_ALL_PORTS         (1)
689e62f8227SErik Schmauss 
690e62f8227SErik Schmauss /* 3: Remapping Hardware Static Affinity Structure */
691e62f8227SErik Schmauss 
692e62f8227SErik Schmauss struct acpi_dmar_rhsa {
693e62f8227SErik Schmauss 	struct acpi_dmar_header header;
694e62f8227SErik Schmauss 	u32 reserved;
695e62f8227SErik Schmauss 	u64 base_address;
696e62f8227SErik Schmauss 	u32 proximity_domain;
697e62f8227SErik Schmauss };
698e62f8227SErik Schmauss 
699e62f8227SErik Schmauss /* 4: ACPI Namespace Device Declaration Structure */
700e62f8227SErik Schmauss 
701e62f8227SErik Schmauss struct acpi_dmar_andd {
702e62f8227SErik Schmauss 	struct acpi_dmar_header header;
703e62f8227SErik Schmauss 	u8 reserved[3];
704e62f8227SErik Schmauss 	u8 device_number;
705e62f8227SErik Schmauss 	char device_name[1];
706e62f8227SErik Schmauss };
707e62f8227SErik Schmauss 
70881d3c75bSYian Chen /* 5: SOC Integrated Address Translation Cache Reporting Structure */
70981d3c75bSYian Chen 
71081d3c75bSYian Chen struct acpi_dmar_satc {
71181d3c75bSYian Chen 	struct acpi_dmar_header header;
71281d3c75bSYian Chen 	u8 flags;
71381d3c75bSYian Chen 	u8 reserved;
71481d3c75bSYian Chen 	u16 segment;
71581d3c75bSYian Chen };
716e62f8227SErik Schmauss /*******************************************************************************
717e62f8227SErik Schmauss  *
718e62f8227SErik Schmauss  * DRTM - Dynamic Root of Trust for Measurement table
719e62f8227SErik Schmauss  * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
720e62f8227SErik Schmauss  * Table version 1
721e62f8227SErik Schmauss  *
722e62f8227SErik Schmauss  ******************************************************************************/
723e62f8227SErik Schmauss 
724e62f8227SErik Schmauss struct acpi_table_drtm {
725e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
726e62f8227SErik Schmauss 	u64 entry_base_address;
727e62f8227SErik Schmauss 	u64 entry_length;
728e62f8227SErik Schmauss 	u32 entry_address32;
729e62f8227SErik Schmauss 	u64 entry_address64;
730e62f8227SErik Schmauss 	u64 exit_address;
731e62f8227SErik Schmauss 	u64 log_area_address;
732e62f8227SErik Schmauss 	u32 log_area_length;
733e62f8227SErik Schmauss 	u64 arch_dependent_address;
734e62f8227SErik Schmauss 	u32 flags;
735e62f8227SErik Schmauss };
736e62f8227SErik Schmauss 
737e62f8227SErik Schmauss /* Flag Definitions for above */
738e62f8227SErik Schmauss 
739e62f8227SErik Schmauss #define ACPI_DRTM_ACCESS_ALLOWED            (1)
740e62f8227SErik Schmauss #define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
741e62f8227SErik Schmauss #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
742e62f8227SErik Schmauss #define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
743e62f8227SErik Schmauss 
744e62f8227SErik Schmauss /* 1) Validated Tables List (64-bit addresses) */
745e62f8227SErik Schmauss 
746e62f8227SErik Schmauss struct acpi_drtm_vtable_list {
747e62f8227SErik Schmauss 	u32 validated_table_count;
748e62f8227SErik Schmauss 	u64 validated_tables[1];
749e62f8227SErik Schmauss };
750e62f8227SErik Schmauss 
751e62f8227SErik Schmauss /* 2) Resources List (of Resource Descriptors) */
752e62f8227SErik Schmauss 
753e62f8227SErik Schmauss /* Resource Descriptor */
754e62f8227SErik Schmauss 
755e62f8227SErik Schmauss struct acpi_drtm_resource {
756e62f8227SErik Schmauss 	u8 size[7];
757e62f8227SErik Schmauss 	u8 type;
758e62f8227SErik Schmauss 	u64 address;
759e62f8227SErik Schmauss };
760e62f8227SErik Schmauss 
761e62f8227SErik Schmauss struct acpi_drtm_resource_list {
762e62f8227SErik Schmauss 	u32 resource_count;
763e62f8227SErik Schmauss 	struct acpi_drtm_resource resources[1];
764e62f8227SErik Schmauss };
765e62f8227SErik Schmauss 
766e62f8227SErik Schmauss /* 3) Platform-specific Identifiers List */
767e62f8227SErik Schmauss 
768e62f8227SErik Schmauss struct acpi_drtm_dps_id {
769e62f8227SErik Schmauss 	u32 dps_id_length;
770e62f8227SErik Schmauss 	u8 dps_id[16];
771e62f8227SErik Schmauss };
772e62f8227SErik Schmauss 
773e62f8227SErik Schmauss /*******************************************************************************
774e62f8227SErik Schmauss  *
775793c2388SBob Moore  * ECDT - Embedded Controller Boot Resources Table
7766e2d5ebdSBob Moore  *        Version 1
777793c2388SBob Moore  *
778793c2388SBob Moore  ******************************************************************************/
779793c2388SBob Moore 
780f3d2e786SBob Moore struct acpi_table_ecdt {
781f3d2e786SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
782f3d2e786SBob Moore 	struct acpi_generic_address control;	/* Address of EC command/status register */
783f3d2e786SBob Moore 	struct acpi_generic_address data;	/* Address of EC data register */
784793c2388SBob Moore 	u32 uid;		/* Unique ID - must be same as the EC _UID method */
785f3d2e786SBob Moore 	u8 gpe;			/* The GPE for the EC */
786f3d2e786SBob Moore 	u8 id[1];		/* Full namepath of the EC in the ACPI namespace */
787793c2388SBob Moore };
788793c2388SBob Moore 
789793c2388SBob Moore /*******************************************************************************
790793c2388SBob Moore  *
7916e2d5ebdSBob Moore  * EINJ - Error Injection Table (ACPI 4.0)
7926e2d5ebdSBob Moore  *        Version 1
793970d9c9eSBob Moore  *
794970d9c9eSBob Moore  ******************************************************************************/
795970d9c9eSBob Moore 
796970d9c9eSBob Moore struct acpi_table_einj {
797970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
798970d9c9eSBob Moore 	u32 header_length;
7996e2d5ebdSBob Moore 	u8 flags;
8006e2d5ebdSBob Moore 	u8 reserved[3];
801970d9c9eSBob Moore 	u32 entries;
802970d9c9eSBob Moore };
803970d9c9eSBob Moore 
804970d9c9eSBob Moore /* EINJ Injection Instruction Entries (actions) */
805970d9c9eSBob Moore 
806970d9c9eSBob Moore struct acpi_einj_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_EINJ_PRESERVE          (1)
8136e2d5ebdSBob Moore 
814970d9c9eSBob Moore /* Values for Action field above */
815970d9c9eSBob Moore 
816970d9c9eSBob Moore enum acpi_einj_actions {
817970d9c9eSBob Moore 	ACPI_EINJ_BEGIN_OPERATION = 0,
818970d9c9eSBob Moore 	ACPI_EINJ_GET_TRIGGER_TABLE = 1,
819970d9c9eSBob Moore 	ACPI_EINJ_SET_ERROR_TYPE = 2,
820970d9c9eSBob Moore 	ACPI_EINJ_GET_ERROR_TYPE = 3,
821970d9c9eSBob Moore 	ACPI_EINJ_END_OPERATION = 4,
822970d9c9eSBob Moore 	ACPI_EINJ_EXECUTE_OPERATION = 5,
823970d9c9eSBob Moore 	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
824970d9c9eSBob Moore 	ACPI_EINJ_GET_COMMAND_STATUS = 7,
825c5bd6537SBob Moore 	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
826a88e0ce6SBob Moore 	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
827a88e0ce6SBob Moore 	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved */
828970d9c9eSBob Moore 	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
829970d9c9eSBob Moore };
830970d9c9eSBob Moore 
831970d9c9eSBob Moore /* Values for Instruction field above */
832970d9c9eSBob Moore 
833970d9c9eSBob Moore enum acpi_einj_instructions {
834970d9c9eSBob Moore 	ACPI_EINJ_READ_REGISTER = 0,
835970d9c9eSBob Moore 	ACPI_EINJ_READ_REGISTER_VALUE = 1,
836970d9c9eSBob Moore 	ACPI_EINJ_WRITE_REGISTER = 2,
837970d9c9eSBob Moore 	ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
838970d9c9eSBob Moore 	ACPI_EINJ_NOOP = 4,
839c5bd6537SBob Moore 	ACPI_EINJ_FLUSH_CACHELINE = 5,
840c5bd6537SBob Moore 	ACPI_EINJ_INSTRUCTION_RESERVED = 6	/* 6 and greater are reserved */
841c5bd6537SBob Moore };
842c5bd6537SBob Moore 
843c5bd6537SBob Moore struct acpi_einj_error_type_with_addr {
844c5bd6537SBob Moore 	u32 error_type;
845c5bd6537SBob Moore 	u32 vendor_struct_offset;
846c5bd6537SBob Moore 	u32 flags;
847c5bd6537SBob Moore 	u32 apic_id;
848c5bd6537SBob Moore 	u64 address;
849c5bd6537SBob Moore 	u64 range;
850c5bd6537SBob Moore 	u32 pcie_id;
851c5bd6537SBob Moore };
852c5bd6537SBob Moore 
853c5bd6537SBob Moore struct acpi_einj_vendor {
854c5bd6537SBob Moore 	u32 length;
855c5bd6537SBob Moore 	u32 pcie_id;
856c5bd6537SBob Moore 	u16 vendor_id;
857c5bd6537SBob Moore 	u16 device_id;
858c5bd6537SBob Moore 	u8 revision_id;
859c5bd6537SBob Moore 	u8 reserved[3];
860970d9c9eSBob Moore };
861970d9c9eSBob Moore 
8623fa34777SBob Moore /* EINJ Trigger Error Action Table */
8633fa34777SBob Moore 
8643fa34777SBob Moore struct acpi_einj_trigger {
8653fa34777SBob Moore 	u32 header_size;
8663fa34777SBob Moore 	u32 revision;
8673fa34777SBob Moore 	u32 table_size;
8683fa34777SBob Moore 	u32 entry_count;
8693fa34777SBob Moore };
8703fa34777SBob Moore 
8716e2d5ebdSBob Moore /* Command status return values */
8726e2d5ebdSBob Moore 
8736e2d5ebdSBob Moore enum acpi_einj_command_status {
8746e2d5ebdSBob Moore 	ACPI_EINJ_SUCCESS = 0,
8756e2d5ebdSBob Moore 	ACPI_EINJ_FAILURE = 1,
8766e2d5ebdSBob Moore 	ACPI_EINJ_INVALID_ACCESS = 2,
8776e2d5ebdSBob Moore 	ACPI_EINJ_STATUS_RESERVED = 3	/* 3 and greater are reserved */
8786e2d5ebdSBob Moore };
8796e2d5ebdSBob Moore 
8806e2d5ebdSBob Moore /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
8816e2d5ebdSBob Moore 
8826e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
8836e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
8846e2d5ebdSBob Moore #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
8856e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
8866e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
8876e2d5ebdSBob Moore #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
8886e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
8896e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
8906e2d5ebdSBob Moore #define ACPI_EINJ_PCIX_FATAL                (1<<8)
8916e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
8926e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
8936e2d5ebdSBob Moore #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
894c5bd6537SBob Moore #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
8956e2d5ebdSBob Moore 
896970d9c9eSBob Moore /*******************************************************************************
897970d9c9eSBob Moore  *
8986e2d5ebdSBob Moore  * ERST - Error Record Serialization Table (ACPI 4.0)
8996e2d5ebdSBob Moore  *        Version 1
900970d9c9eSBob Moore  *
901970d9c9eSBob Moore  ******************************************************************************/
902970d9c9eSBob Moore 
903970d9c9eSBob Moore struct acpi_table_erst {
904970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
905970d9c9eSBob Moore 	u32 header_length;
906970d9c9eSBob Moore 	u32 reserved;
907970d9c9eSBob Moore 	u32 entries;
908970d9c9eSBob Moore };
909970d9c9eSBob Moore 
910970d9c9eSBob Moore /* ERST Serialization Entries (actions) */
911970d9c9eSBob Moore 
912970d9c9eSBob Moore struct acpi_erst_entry {
913970d9c9eSBob Moore 	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
914970d9c9eSBob Moore };
915970d9c9eSBob Moore 
9166e2d5ebdSBob Moore /* Masks for Flags field above */
9176e2d5ebdSBob Moore 
9186e2d5ebdSBob Moore #define ACPI_ERST_PRESERVE          (1)
9196e2d5ebdSBob Moore 
920970d9c9eSBob Moore /* Values for Action field above */
921970d9c9eSBob Moore 
922970d9c9eSBob Moore enum acpi_erst_actions {
9236e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_WRITE = 0,
9246e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_READ = 1,
9256e2d5ebdSBob Moore 	ACPI_ERST_BEGIN_CLEAR = 2,
9266e2d5ebdSBob Moore 	ACPI_ERST_END = 3,
927970d9c9eSBob Moore 	ACPI_ERST_SET_RECORD_OFFSET = 4,
928970d9c9eSBob Moore 	ACPI_ERST_EXECUTE_OPERATION = 5,
929970d9c9eSBob Moore 	ACPI_ERST_CHECK_BUSY_STATUS = 6,
930970d9c9eSBob Moore 	ACPI_ERST_GET_COMMAND_STATUS = 7,
9316e2d5ebdSBob Moore 	ACPI_ERST_GET_RECORD_ID = 8,
9326e2d5ebdSBob Moore 	ACPI_ERST_SET_RECORD_ID = 9,
933970d9c9eSBob Moore 	ACPI_ERST_GET_RECORD_COUNT = 10,
934970d9c9eSBob Moore 	ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
935970d9c9eSBob Moore 	ACPI_ERST_NOT_USED = 12,
936970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_RANGE = 13,
937970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_LENGTH = 14,
938970d9c9eSBob Moore 	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
939a88e0ce6SBob Moore 	ACPI_ERST_EXECUTE_TIMINGS = 16,
940a88e0ce6SBob Moore 	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved */
941970d9c9eSBob Moore };
942970d9c9eSBob Moore 
943970d9c9eSBob Moore /* Values for Instruction field above */
944970d9c9eSBob Moore 
945970d9c9eSBob Moore enum acpi_erst_instructions {
946970d9c9eSBob Moore 	ACPI_ERST_READ_REGISTER = 0,
947970d9c9eSBob Moore 	ACPI_ERST_READ_REGISTER_VALUE = 1,
948970d9c9eSBob Moore 	ACPI_ERST_WRITE_REGISTER = 2,
949970d9c9eSBob Moore 	ACPI_ERST_WRITE_REGISTER_VALUE = 3,
950970d9c9eSBob Moore 	ACPI_ERST_NOOP = 4,
951970d9c9eSBob Moore 	ACPI_ERST_LOAD_VAR1 = 5,
952970d9c9eSBob Moore 	ACPI_ERST_LOAD_VAR2 = 6,
953970d9c9eSBob Moore 	ACPI_ERST_STORE_VAR1 = 7,
954970d9c9eSBob Moore 	ACPI_ERST_ADD = 8,
955970d9c9eSBob Moore 	ACPI_ERST_SUBTRACT = 9,
956970d9c9eSBob Moore 	ACPI_ERST_ADD_VALUE = 10,
957970d9c9eSBob Moore 	ACPI_ERST_SUBTRACT_VALUE = 11,
958970d9c9eSBob Moore 	ACPI_ERST_STALL = 12,
959970d9c9eSBob Moore 	ACPI_ERST_STALL_WHILE_TRUE = 13,
960970d9c9eSBob Moore 	ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
961970d9c9eSBob Moore 	ACPI_ERST_GOTO = 15,
962970d9c9eSBob Moore 	ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
963970d9c9eSBob Moore 	ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
964970d9c9eSBob Moore 	ACPI_ERST_MOVE_DATA = 18,
965970d9c9eSBob Moore 	ACPI_ERST_INSTRUCTION_RESERVED = 19	/* 19 and greater are reserved */
966970d9c9eSBob Moore };
967970d9c9eSBob Moore 
9686e2d5ebdSBob Moore /* Command status return values */
9696e2d5ebdSBob Moore 
9706e2d5ebdSBob Moore enum acpi_erst_command_status {
97154a2a15aSBob Moore 	ACPI_ERST_SUCCESS = 0,
9726e2d5ebdSBob Moore 	ACPI_ERST_NO_SPACE = 1,
9736e2d5ebdSBob Moore 	ACPI_ERST_NOT_AVAILABLE = 2,
9746e2d5ebdSBob Moore 	ACPI_ERST_FAILURE = 3,
9756e2d5ebdSBob Moore 	ACPI_ERST_RECORD_EMPTY = 4,
9766e2d5ebdSBob Moore 	ACPI_ERST_NOT_FOUND = 5,
9776e2d5ebdSBob Moore 	ACPI_ERST_STATUS_RESERVED = 6	/* 6 and greater are reserved */
9786e2d5ebdSBob Moore };
9796e2d5ebdSBob Moore 
9806e2d5ebdSBob Moore /* Error Record Serialization Information */
9816e2d5ebdSBob Moore 
9826e2d5ebdSBob Moore struct acpi_erst_info {
9836e2d5ebdSBob Moore 	u16 signature;		/* Should be "ER" */
9846e2d5ebdSBob Moore 	u8 data[48];
9856e2d5ebdSBob Moore };
9866e2d5ebdSBob Moore 
987970d9c9eSBob Moore /*******************************************************************************
988970d9c9eSBob Moore  *
989e62f8227SErik Schmauss  * FPDT - Firmware Performance Data Table (ACPI 5.0)
990e62f8227SErik Schmauss  *        Version 1
991e62f8227SErik Schmauss  *
992e62f8227SErik Schmauss  ******************************************************************************/
993e62f8227SErik Schmauss 
994e62f8227SErik Schmauss struct acpi_table_fpdt {
995e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
996e62f8227SErik Schmauss };
997e62f8227SErik Schmauss 
998e62f8227SErik Schmauss /* FPDT subtable header (Performance Record Structure) */
999e62f8227SErik Schmauss 
1000e62f8227SErik Schmauss struct acpi_fpdt_header {
1001e62f8227SErik Schmauss 	u16 type;
1002e62f8227SErik Schmauss 	u8 length;
1003e62f8227SErik Schmauss 	u8 revision;
1004e62f8227SErik Schmauss };
1005e62f8227SErik Schmauss 
1006e62f8227SErik Schmauss /* Values for Type field above */
1007e62f8227SErik Schmauss 
1008e62f8227SErik Schmauss enum acpi_fpdt_type {
1009e62f8227SErik Schmauss 	ACPI_FPDT_TYPE_BOOT = 0,
1010e62f8227SErik Schmauss 	ACPI_FPDT_TYPE_S3PERF = 1
1011e62f8227SErik Schmauss };
1012e62f8227SErik Schmauss 
1013e62f8227SErik Schmauss /*
1014e62f8227SErik Schmauss  * FPDT subtables
1015e62f8227SErik Schmauss  */
1016e62f8227SErik Schmauss 
1017e62f8227SErik Schmauss /* 0: Firmware Basic Boot Performance Record */
1018e62f8227SErik Schmauss 
1019e62f8227SErik Schmauss struct acpi_fpdt_boot_pointer {
1020e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1021e62f8227SErik Schmauss 	u8 reserved[4];
1022e62f8227SErik Schmauss 	u64 address;
1023e62f8227SErik Schmauss };
1024e62f8227SErik Schmauss 
1025e62f8227SErik Schmauss /* 1: S3 Performance Table Pointer Record */
1026e62f8227SErik Schmauss 
1027e62f8227SErik Schmauss struct acpi_fpdt_s3pt_pointer {
1028e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1029e62f8227SErik Schmauss 	u8 reserved[4];
1030e62f8227SErik Schmauss 	u64 address;
1031e62f8227SErik Schmauss };
1032e62f8227SErik Schmauss 
1033e62f8227SErik Schmauss /*
1034e62f8227SErik Schmauss  * S3PT - S3 Performance Table. This table is pointed to by the
1035e62f8227SErik Schmauss  * S3 Pointer Record above.
1036e62f8227SErik Schmauss  */
1037e62f8227SErik Schmauss struct acpi_table_s3pt {
1038e62f8227SErik Schmauss 	u8 signature[4];	/* "S3PT" */
1039e62f8227SErik Schmauss 	u32 length;
1040e62f8227SErik Schmauss };
1041e62f8227SErik Schmauss 
1042e62f8227SErik Schmauss /*
1043e62f8227SErik Schmauss  * S3PT Subtables (Not part of the actual FPDT)
1044e62f8227SErik Schmauss  */
1045e62f8227SErik Schmauss 
1046e62f8227SErik Schmauss /* Values for Type field in S3PT header */
1047e62f8227SErik Schmauss 
1048e62f8227SErik Schmauss enum acpi_s3pt_type {
1049e62f8227SErik Schmauss 	ACPI_S3PT_TYPE_RESUME = 0,
1050e62f8227SErik Schmauss 	ACPI_S3PT_TYPE_SUSPEND = 1,
1051e62f8227SErik Schmauss 	ACPI_FPDT_BOOT_PERFORMANCE = 2
1052e62f8227SErik Schmauss };
1053e62f8227SErik Schmauss 
1054e62f8227SErik Schmauss struct acpi_s3pt_resume {
1055e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1056e62f8227SErik Schmauss 	u32 resume_count;
1057e62f8227SErik Schmauss 	u64 full_resume;
1058e62f8227SErik Schmauss 	u64 average_resume;
1059e62f8227SErik Schmauss };
1060e62f8227SErik Schmauss 
1061e62f8227SErik Schmauss struct acpi_s3pt_suspend {
1062e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1063e62f8227SErik Schmauss 	u64 suspend_start;
1064e62f8227SErik Schmauss 	u64 suspend_end;
1065e62f8227SErik Schmauss };
1066e62f8227SErik Schmauss 
1067e62f8227SErik Schmauss /*
1068e62f8227SErik Schmauss  * FPDT Boot Performance Record (Not part of the actual FPDT)
1069e62f8227SErik Schmauss  */
1070e62f8227SErik Schmauss struct acpi_fpdt_boot {
1071e62f8227SErik Schmauss 	struct acpi_fpdt_header header;
1072e62f8227SErik Schmauss 	u8 reserved[4];
1073e62f8227SErik Schmauss 	u64 reset_end;
1074e62f8227SErik Schmauss 	u64 load_start;
1075e62f8227SErik Schmauss 	u64 startup_start;
1076e62f8227SErik Schmauss 	u64 exit_services_entry;
1077e62f8227SErik Schmauss 	u64 exit_services_exit;
1078e62f8227SErik Schmauss };
1079e62f8227SErik Schmauss 
1080e62f8227SErik Schmauss /*******************************************************************************
1081e62f8227SErik Schmauss  *
1082e62f8227SErik Schmauss  * GTDT - Generic Timer Description Table (ACPI 5.1)
1083e62f8227SErik Schmauss  *        Version 2
1084e62f8227SErik Schmauss  *
1085e62f8227SErik Schmauss  ******************************************************************************/
1086e62f8227SErik Schmauss 
1087e62f8227SErik Schmauss struct acpi_table_gtdt {
1088e62f8227SErik Schmauss 	struct acpi_table_header header;	/* Common ACPI table header */
1089e62f8227SErik Schmauss 	u64 counter_block_addresss;
1090e62f8227SErik Schmauss 	u32 reserved;
1091e62f8227SErik Schmauss 	u32 secure_el1_interrupt;
1092e62f8227SErik Schmauss 	u32 secure_el1_flags;
1093e62f8227SErik Schmauss 	u32 non_secure_el1_interrupt;
1094e62f8227SErik Schmauss 	u32 non_secure_el1_flags;
1095e62f8227SErik Schmauss 	u32 virtual_timer_interrupt;
1096e62f8227SErik Schmauss 	u32 virtual_timer_flags;
1097e62f8227SErik Schmauss 	u32 non_secure_el2_interrupt;
1098e62f8227SErik Schmauss 	u32 non_secure_el2_flags;
1099e62f8227SErik Schmauss 	u64 counter_read_block_address;
1100e62f8227SErik Schmauss 	u32 platform_timer_count;
1101e62f8227SErik Schmauss 	u32 platform_timer_offset;
1102e62f8227SErik Schmauss };
1103e62f8227SErik Schmauss 
1104e62f8227SErik Schmauss /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
1105e62f8227SErik Schmauss 
1106e62f8227SErik Schmauss #define ACPI_GTDT_INTERRUPT_MODE        (1)
1107e62f8227SErik Schmauss #define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
1108e62f8227SErik Schmauss #define ACPI_GTDT_ALWAYS_ON             (1<<2)
1109e62f8227SErik Schmauss 
11108f5a14d0SErik Schmauss struct acpi_gtdt_el2 {
11118f5a14d0SErik Schmauss 	u32 virtual_el2_timer_gsiv;
11128f5a14d0SErik Schmauss 	u32 virtual_el2_timer_flags;
11138f5a14d0SErik Schmauss };
11148f5a14d0SErik Schmauss 
1115e62f8227SErik Schmauss /* Common GTDT subtable header */
1116e62f8227SErik Schmauss 
1117e62f8227SErik Schmauss struct acpi_gtdt_header {
1118e62f8227SErik Schmauss 	u8 type;
1119e62f8227SErik Schmauss 	u16 length;
1120e62f8227SErik Schmauss };
1121e62f8227SErik Schmauss 
1122e62f8227SErik Schmauss /* Values for GTDT subtable type above */
1123e62f8227SErik Schmauss 
1124e62f8227SErik Schmauss enum acpi_gtdt_type {
1125e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
1126e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_WATCHDOG = 1,
1127e62f8227SErik Schmauss 	ACPI_GTDT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
1128e62f8227SErik Schmauss };
1129e62f8227SErik Schmauss 
1130e62f8227SErik Schmauss /* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
1131e62f8227SErik Schmauss 
1132e62f8227SErik Schmauss /* 0: Generic Timer Block */
1133e62f8227SErik Schmauss 
1134e62f8227SErik Schmauss struct acpi_gtdt_timer_block {
1135e62f8227SErik Schmauss 	struct acpi_gtdt_header header;
1136e62f8227SErik Schmauss 	u8 reserved;
1137e62f8227SErik Schmauss 	u64 block_address;
1138e62f8227SErik Schmauss 	u32 timer_count;
1139e62f8227SErik Schmauss 	u32 timer_offset;
1140e62f8227SErik Schmauss };
1141e62f8227SErik Schmauss 
1142e62f8227SErik Schmauss /* Timer Sub-Structure, one per timer */
1143e62f8227SErik Schmauss 
1144e62f8227SErik Schmauss struct acpi_gtdt_timer_entry {
1145e62f8227SErik Schmauss 	u8 frame_number;
1146e62f8227SErik Schmauss 	u8 reserved[3];
1147e62f8227SErik Schmauss 	u64 base_address;
1148e62f8227SErik Schmauss 	u64 el0_base_address;
1149e62f8227SErik Schmauss 	u32 timer_interrupt;
1150e62f8227SErik Schmauss 	u32 timer_flags;
1151e62f8227SErik Schmauss 	u32 virtual_timer_interrupt;
1152e62f8227SErik Schmauss 	u32 virtual_timer_flags;
1153e62f8227SErik Schmauss 	u32 common_flags;
1154e62f8227SErik Schmauss };
1155e62f8227SErik Schmauss 
1156e62f8227SErik Schmauss /* Flag Definitions: timer_flags and virtual_timer_flags above */
1157e62f8227SErik Schmauss 
1158e62f8227SErik Schmauss #define ACPI_GTDT_GT_IRQ_MODE               (1)
1159e62f8227SErik Schmauss #define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
1160e62f8227SErik Schmauss 
1161e62f8227SErik Schmauss /* Flag Definitions: common_flags above */
1162e62f8227SErik Schmauss 
1163e62f8227SErik Schmauss #define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
1164e62f8227SErik Schmauss #define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
1165e62f8227SErik Schmauss 
1166e62f8227SErik Schmauss /* 1: SBSA Generic Watchdog Structure */
1167e62f8227SErik Schmauss 
1168e62f8227SErik Schmauss struct acpi_gtdt_watchdog {
1169e62f8227SErik Schmauss 	struct acpi_gtdt_header header;
1170e62f8227SErik Schmauss 	u8 reserved;
1171e62f8227SErik Schmauss 	u64 refresh_frame_address;
1172e62f8227SErik Schmauss 	u64 control_frame_address;
1173e62f8227SErik Schmauss 	u32 timer_interrupt;
1174e62f8227SErik Schmauss 	u32 timer_flags;
1175e62f8227SErik Schmauss };
1176e62f8227SErik Schmauss 
1177e62f8227SErik Schmauss /* Flag Definitions: timer_flags above */
1178e62f8227SErik Schmauss 
1179e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
1180e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
1181e62f8227SErik Schmauss #define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
1182e62f8227SErik Schmauss 
1183e62f8227SErik Schmauss /*******************************************************************************
1184e62f8227SErik Schmauss  *
11856e2d5ebdSBob Moore  * HEST - Hardware Error Source Table (ACPI 4.0)
11866e2d5ebdSBob Moore  *        Version 1
1187970d9c9eSBob Moore  *
1188970d9c9eSBob Moore  ******************************************************************************/
1189970d9c9eSBob Moore 
1190970d9c9eSBob Moore struct acpi_table_hest {
1191970d9c9eSBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1192970d9c9eSBob Moore 	u32 error_source_count;
1193970d9c9eSBob Moore };
1194970d9c9eSBob Moore 
11953fa34777SBob Moore /* HEST subtable header */
11963fa34777SBob Moore 
11973fa34777SBob Moore struct acpi_hest_header {
11983fa34777SBob Moore 	u16 type;
11996e2d5ebdSBob Moore 	u16 source_id;
12003fa34777SBob Moore };
12013fa34777SBob Moore 
12023fa34777SBob Moore /* Values for Type field above for subtables */
12033fa34777SBob Moore 
12043fa34777SBob Moore enum acpi_hest_types {
12056e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_CHECK = 0,
12066e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
12076e2d5ebdSBob Moore 	ACPI_HEST_TYPE_IA32_NMI = 2,
12086e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED3 = 3,
12096e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED4 = 4,
12106e2d5ebdSBob Moore 	ACPI_HEST_TYPE_NOT_USED5 = 5,
12113fa34777SBob Moore 	ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
12123fa34777SBob Moore 	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
12133fa34777SBob Moore 	ACPI_HEST_TYPE_AER_BRIDGE = 8,
12146e2d5ebdSBob Moore 	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
12157cd55c76SBob Moore 	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
1216c042933dSBob Moore 	ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
1217c042933dSBob Moore 	ACPI_HEST_TYPE_RESERVED = 12	/* 12 and greater are reserved */
12183fa34777SBob Moore };
12193fa34777SBob Moore 
12203fa34777SBob Moore /*
12216e2d5ebdSBob Moore  * HEST substructures contained in subtables
12223fa34777SBob Moore  */
12233fa34777SBob Moore 
12246e2d5ebdSBob Moore /*
12256e2d5ebdSBob Moore  * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
12266e2d5ebdSBob Moore  * struct acpi_hest_ia_corrected structures.
12276e2d5ebdSBob Moore  */
12286e2d5ebdSBob Moore struct acpi_hest_ia_error_bank {
12293fa34777SBob Moore 	u8 bank_number;
12303fa34777SBob Moore 	u8 clear_status_on_init;
12313fa34777SBob Moore 	u8 status_format;
12326e2d5ebdSBob Moore 	u8 reserved;
12333fa34777SBob Moore 	u32 control_register;
12346e2d5ebdSBob Moore 	u64 control_data;
12353fa34777SBob Moore 	u32 status_register;
12363fa34777SBob Moore 	u32 address_register;
12373fa34777SBob Moore 	u32 misc_register;
12383fa34777SBob Moore };
12393fa34777SBob Moore 
12406e2d5ebdSBob Moore /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
12413fa34777SBob Moore 
12423fa34777SBob Moore struct acpi_hest_aer_common {
12436e2d5ebdSBob Moore 	u16 reserved1;
12443fa34777SBob Moore 	u8 flags;
12453fa34777SBob Moore 	u8 enabled;
1246c276e388SBob Moore 	u32 records_to_preallocate;
12473fa34777SBob Moore 	u32 max_sections_per_record;
12484059a310SBetty Dall 	u32 bus;		/* Bus and Segment numbers */
12493fa34777SBob Moore 	u16 device;
12503fa34777SBob Moore 	u16 function;
12513fa34777SBob Moore 	u16 device_control;
12526e2d5ebdSBob Moore 	u16 reserved2;
1253c276e388SBob Moore 	u32 uncorrectable_mask;
1254c276e388SBob Moore 	u32 uncorrectable_severity;
1255c276e388SBob Moore 	u32 correctable_mask;
1256c276e388SBob Moore 	u32 advanced_capabilities;
12573fa34777SBob Moore };
12583fa34777SBob Moore 
12596e2d5ebdSBob Moore /* Masks for HEST Flags fields */
12606e2d5ebdSBob Moore 
12616e2d5ebdSBob Moore #define ACPI_HEST_FIRMWARE_FIRST        (1)
12626e2d5ebdSBob Moore #define ACPI_HEST_GLOBAL                (1<<1)
12632e166c73SBob Moore #define ACPI_HEST_GHES_ASSIST           (1<<2)
12646e2d5ebdSBob Moore 
12654059a310SBetty Dall /*
12664059a310SBetty Dall  * Macros to access the bus/segment numbers in Bus field above:
12674059a310SBetty Dall  *  Bus number is encoded in bits 7:0
12684059a310SBetty Dall  *  Segment number is encoded in bits 23:8
12694059a310SBetty Dall  */
12704059a310SBetty Dall #define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
12714059a310SBetty Dall #define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
12724059a310SBetty Dall 
12733fa34777SBob Moore /* Hardware Error Notification */
12743fa34777SBob Moore 
12753fa34777SBob Moore struct acpi_hest_notify {
12763fa34777SBob Moore 	u8 type;
12773fa34777SBob Moore 	u8 length;
12783fa34777SBob Moore 	u16 config_write_enable;
12793fa34777SBob Moore 	u32 poll_interval;
12803fa34777SBob Moore 	u32 vector;
12813fa34777SBob Moore 	u32 polling_threshold_value;
12823fa34777SBob Moore 	u32 polling_threshold_window;
12833fa34777SBob Moore 	u32 error_threshold_value;
12843fa34777SBob Moore 	u32 error_threshold_window;
12853fa34777SBob Moore };
12863fa34777SBob Moore 
12873fa34777SBob Moore /* Values for Notify Type field above */
12883fa34777SBob Moore 
12893fa34777SBob Moore enum acpi_hest_notify_types {
12903fa34777SBob Moore 	ACPI_HEST_NOTIFY_POLLED = 0,
12913fa34777SBob Moore 	ACPI_HEST_NOTIFY_EXTERNAL = 1,
12923fa34777SBob Moore 	ACPI_HEST_NOTIFY_LOCAL = 2,
12933fa34777SBob Moore 	ACPI_HEST_NOTIFY_SCI = 3,
12943fa34777SBob Moore 	ACPI_HEST_NOTIFY_NMI = 4,
1295ca4a0314SBob Moore 	ACPI_HEST_NOTIFY_CMCI = 5,	/* ACPI 5.0 */
1296ca4a0314SBob Moore 	ACPI_HEST_NOTIFY_MCE = 6,	/* ACPI 5.0 */
12977cd55c76SBob Moore 	ACPI_HEST_NOTIFY_GPIO = 7,	/* ACPI 6.0 */
12987cd55c76SBob Moore 	ACPI_HEST_NOTIFY_SEA = 8,	/* ACPI 6.1 */
12997cd55c76SBob Moore 	ACPI_HEST_NOTIFY_SEI = 9,	/* ACPI 6.1 */
13007cd55c76SBob Moore 	ACPI_HEST_NOTIFY_GSIV = 10,	/* ACPI 6.1 */
13014a8a6058SBob Moore 	ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,	/* ACPI 6.2 */
13024a8a6058SBob Moore 	ACPI_HEST_NOTIFY_RESERVED = 12	/* 12 and greater are reserved */
13033fa34777SBob Moore };
13043fa34777SBob Moore 
13056e2d5ebdSBob Moore /* Values for config_write_enable bitfield above */
13066e2d5ebdSBob Moore 
13076e2d5ebdSBob Moore #define ACPI_HEST_TYPE                  (1)
13086e2d5ebdSBob Moore #define ACPI_HEST_POLL_INTERVAL         (1<<1)
13096e2d5ebdSBob Moore #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
13106e2d5ebdSBob Moore #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
13116e2d5ebdSBob Moore #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
13126e2d5ebdSBob Moore #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
13136e2d5ebdSBob Moore 
13143fa34777SBob Moore /*
13153fa34777SBob Moore  * HEST subtables
13163fa34777SBob Moore  */
13173fa34777SBob Moore 
13186e2d5ebdSBob Moore /* 0: IA32 Machine Check Exception */
13193fa34777SBob Moore 
13206e2d5ebdSBob Moore struct acpi_hest_ia_machine_check {
13213fa34777SBob Moore 	struct acpi_hest_header header;
13226e2d5ebdSBob Moore 	u16 reserved1;
1323c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
13246e2d5ebdSBob Moore 	u8 enabled;
1325c276e388SBob Moore 	u32 records_to_preallocate;
13263fa34777SBob Moore 	u32 max_sections_per_record;
13273fa34777SBob Moore 	u64 global_capability_data;
13283fa34777SBob Moore 	u64 global_control_data;
13293fa34777SBob Moore 	u8 num_hardware_banks;
13306e2d5ebdSBob Moore 	u8 reserved3[7];
13313fa34777SBob Moore };
13323fa34777SBob Moore 
13336e2d5ebdSBob Moore /* 1: IA32 Corrected Machine Check */
13343fa34777SBob Moore 
13351872bbc9SBob Moore struct acpi_hest_ia_corrected {
13363fa34777SBob Moore 	struct acpi_hest_header header;
13376e2d5ebdSBob Moore 	u16 reserved1;
1338c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
13393fa34777SBob Moore 	u8 enabled;
1340c276e388SBob Moore 	u32 records_to_preallocate;
13413fa34777SBob Moore 	u32 max_sections_per_record;
13423fa34777SBob Moore 	struct acpi_hest_notify notify;
13433fa34777SBob Moore 	u8 num_hardware_banks;
13446e2d5ebdSBob Moore 	u8 reserved2[3];
13453fa34777SBob Moore };
13463fa34777SBob Moore 
13476e2d5ebdSBob Moore /* 2: IA32 Non-Maskable Interrupt */
13483fa34777SBob Moore 
13496e2d5ebdSBob Moore struct acpi_hest_ia_nmi {
13503fa34777SBob Moore 	struct acpi_hest_header header;
13513fa34777SBob Moore 	u32 reserved;
1352c276e388SBob Moore 	u32 records_to_preallocate;
13533fa34777SBob Moore 	u32 max_sections_per_record;
13543fa34777SBob Moore 	u32 max_raw_data_length;
13553fa34777SBob Moore };
13563fa34777SBob Moore 
13576e2d5ebdSBob Moore /* 3,4,5: Not used */
13583fa34777SBob Moore 
13593fa34777SBob Moore /* 6: PCI Express Root Port AER */
13603fa34777SBob Moore 
13613fa34777SBob Moore struct acpi_hest_aer_root {
13623fa34777SBob Moore 	struct acpi_hest_header header;
13633fa34777SBob Moore 	struct acpi_hest_aer_common aer;
13643fa34777SBob Moore 	u32 root_error_command;
13653fa34777SBob Moore };
13663fa34777SBob Moore 
13673fa34777SBob Moore /* 7: PCI Express AER (AER Endpoint) */
13683fa34777SBob Moore 
13693fa34777SBob Moore struct acpi_hest_aer {
13703fa34777SBob Moore 	struct acpi_hest_header header;
13713fa34777SBob Moore 	struct acpi_hest_aer_common aer;
13723fa34777SBob Moore };
13733fa34777SBob Moore 
13743fa34777SBob Moore /* 8: PCI Express/PCI-X Bridge AER */
13753fa34777SBob Moore 
13763fa34777SBob Moore struct acpi_hest_aer_bridge {
13773fa34777SBob Moore 	struct acpi_hest_header header;
13783fa34777SBob Moore 	struct acpi_hest_aer_common aer;
1379c276e388SBob Moore 	u32 uncorrectable_mask2;
1380c276e388SBob Moore 	u32 uncorrectable_severity2;
1381c276e388SBob Moore 	u32 advanced_capabilities2;
13823fa34777SBob Moore };
13833fa34777SBob Moore 
13843fa34777SBob Moore /* 9: Generic Hardware Error Source */
13853fa34777SBob Moore 
13863fa34777SBob Moore struct acpi_hest_generic {
13873fa34777SBob Moore 	struct acpi_hest_header header;
13883fa34777SBob Moore 	u16 related_source_id;
13896e2d5ebdSBob Moore 	u8 reserved;
13903fa34777SBob Moore 	u8 enabled;
1391c276e388SBob Moore 	u32 records_to_preallocate;
13923fa34777SBob Moore 	u32 max_sections_per_record;
13933fa34777SBob Moore 	u32 max_raw_data_length;
13943fa34777SBob Moore 	struct acpi_generic_address error_status_address;
13953fa34777SBob Moore 	struct acpi_hest_notify notify;
13966e2d5ebdSBob Moore 	u32 error_block_length;
13976e2d5ebdSBob Moore };
13986e2d5ebdSBob Moore 
13997cd55c76SBob Moore /* 10: Generic Hardware Error Source, version 2 */
14007cd55c76SBob Moore 
14017cd55c76SBob Moore struct acpi_hest_generic_v2 {
14027cd55c76SBob Moore 	struct acpi_hest_header header;
14037cd55c76SBob Moore 	u16 related_source_id;
14047cd55c76SBob Moore 	u8 reserved;
14057cd55c76SBob Moore 	u8 enabled;
14067cd55c76SBob Moore 	u32 records_to_preallocate;
14077cd55c76SBob Moore 	u32 max_sections_per_record;
14087cd55c76SBob Moore 	u32 max_raw_data_length;
14097cd55c76SBob Moore 	struct acpi_generic_address error_status_address;
14107cd55c76SBob Moore 	struct acpi_hest_notify notify;
14117cd55c76SBob Moore 	u32 error_block_length;
14127cd55c76SBob Moore 	struct acpi_generic_address read_ack_register;
14137cd55c76SBob Moore 	u64 read_ack_preserve;
14147cd55c76SBob Moore 	u64 read_ack_write;
14157cd55c76SBob Moore };
14167cd55c76SBob Moore 
14176e2d5ebdSBob Moore /* Generic Error Status block */
14186e2d5ebdSBob Moore 
14190a00fd5eSLv Zheng struct acpi_hest_generic_status {
14206e2d5ebdSBob Moore 	u32 block_status;
14216e2d5ebdSBob Moore 	u32 raw_data_offset;
14226e2d5ebdSBob Moore 	u32 raw_data_length;
14236e2d5ebdSBob Moore 	u32 data_length;
14246e2d5ebdSBob Moore 	u32 error_severity;
14256e2d5ebdSBob Moore };
14266e2d5ebdSBob Moore 
14276e2d5ebdSBob Moore /* Values for block_status flags above */
14286e2d5ebdSBob Moore 
14290a00fd5eSLv Zheng #define ACPI_HEST_UNCORRECTABLE             (1)
14300a00fd5eSLv Zheng #define ACPI_HEST_CORRECTABLE               (1<<1)
14310a00fd5eSLv Zheng #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
14320a00fd5eSLv Zheng #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
14330a00fd5eSLv Zheng #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4)	/* 8 bits, error count */
14346e2d5ebdSBob Moore 
14356e2d5ebdSBob Moore /* Generic Error Data entry */
14366e2d5ebdSBob Moore 
14370a00fd5eSLv Zheng struct acpi_hest_generic_data {
14386e2d5ebdSBob Moore 	u8 section_type[16];
14396e2d5ebdSBob Moore 	u32 error_severity;
14406e2d5ebdSBob Moore 	u16 revision;
14416e2d5ebdSBob Moore 	u8 validation_bits;
14426e2d5ebdSBob Moore 	u8 flags;
14436e2d5ebdSBob Moore 	u32 error_data_length;
14446e2d5ebdSBob Moore 	u8 fru_id[16];
14456e2d5ebdSBob Moore 	u8 fru_text[20];
14463fa34777SBob Moore };
1447970d9c9eSBob Moore 
14487cd55c76SBob Moore /* Extension for revision 0x0300 */
14497cd55c76SBob Moore 
14507cd55c76SBob Moore struct acpi_hest_generic_data_v300 {
14517cd55c76SBob Moore 	u8 section_type[16];
14527cd55c76SBob Moore 	u32 error_severity;
14537cd55c76SBob Moore 	u16 revision;
14547cd55c76SBob Moore 	u8 validation_bits;
14557cd55c76SBob Moore 	u8 flags;
14567cd55c76SBob Moore 	u32 error_data_length;
14577cd55c76SBob Moore 	u8 fru_id[16];
14587cd55c76SBob Moore 	u8 fru_text[20];
14597cd55c76SBob Moore 	u64 time_stamp;
14607cd55c76SBob Moore };
14617cd55c76SBob Moore 
14627cd55c76SBob Moore /* Values for error_severity above */
14637cd55c76SBob Moore 
14647cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
14657cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_FATAL           1
14667cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_CORRECTED       2
14677cd55c76SBob Moore #define ACPI_HEST_GEN_ERROR_NONE            3
14687cd55c76SBob Moore 
14697cd55c76SBob Moore /* Flags for validation_bits above */
14707cd55c76SBob Moore 
14717cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_FRU_ID          (1)
14727cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
14737cd55c76SBob Moore #define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
14747cd55c76SBob Moore 
1475c042933dSBob Moore /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
1476c042933dSBob Moore 
1477c042933dSBob Moore struct acpi_hest_ia_deferred_check {
1478c042933dSBob Moore 	struct acpi_hest_header header;
1479c042933dSBob Moore 	u16 reserved1;
1480c042933dSBob Moore 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
1481c042933dSBob Moore 	u8 enabled;
1482c042933dSBob Moore 	u32 records_to_preallocate;
1483c042933dSBob Moore 	u32 max_sections_per_record;
1484c042933dSBob Moore 	struct acpi_hest_notify notify;
1485c042933dSBob Moore 	u8 num_hardware_banks;
1486c042933dSBob Moore 	u8 reserved2[3];
1487c042933dSBob Moore };
1488c042933dSBob Moore 
1489970d9c9eSBob Moore /*******************************************************************************
1490970d9c9eSBob Moore  *
1491fa418ddfSLv Zheng  * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
1492fa418ddfSLv Zheng  *        Version 1
1493fa418ddfSLv Zheng  *
1494fa418ddfSLv Zheng  ******************************************************************************/
1495fa418ddfSLv Zheng 
1496fa418ddfSLv Zheng struct acpi_table_hmat {
1497fa418ddfSLv Zheng 	struct acpi_table_header header;	/* Common ACPI table header */
1498fa418ddfSLv Zheng 	u32 reserved;
1499fa418ddfSLv Zheng };
1500fa418ddfSLv Zheng 
1501fa418ddfSLv Zheng /* Values for HMAT structure types */
1502fa418ddfSLv Zheng 
1503fa418ddfSLv Zheng enum acpi_hmat_type {
150457f5cf6eSAlison Schofield 	ACPI_HMAT_TYPE_PROXIMITY = 0,	/* Memory proximity domain attributes */
1505fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_LOCALITY = 1,	/* System locality latency and bandwidth information */
1506fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_CACHE = 2,	/* Memory side cache information */
1507fa418ddfSLv Zheng 	ACPI_HMAT_TYPE_RESERVED = 3	/* 3 and greater are reserved */
1508fa418ddfSLv Zheng };
1509fa418ddfSLv Zheng 
1510fa418ddfSLv Zheng struct acpi_hmat_structure {
1511fa418ddfSLv Zheng 	u16 type;
1512fa418ddfSLv Zheng 	u16 reserved;
1513fa418ddfSLv Zheng 	u32 length;
1514fa418ddfSLv Zheng };
1515fa418ddfSLv Zheng 
1516fa418ddfSLv Zheng /*
1517fa418ddfSLv Zheng  * HMAT Structures, correspond to Type in struct acpi_hmat_structure
1518fa418ddfSLv Zheng  */
1519fa418ddfSLv Zheng 
15209a8d961fSErik Schmauss /* 0: Memory proximity domain attributes */
1521fa418ddfSLv Zheng 
15229a8d961fSErik Schmauss struct acpi_hmat_proximity_domain {
1523fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1524fa418ddfSLv Zheng 	u16 flags;
1525fa418ddfSLv Zheng 	u16 reserved1;
1526fa418ddfSLv Zheng 	u32 processor_PD;	/* Processor proximity domain */
1527fa418ddfSLv Zheng 	u32 memory_PD;		/* Memory proximity domain */
1528fa418ddfSLv Zheng 	u32 reserved2;
15299a8d961fSErik Schmauss 	u64 reserved3;
15309a8d961fSErik Schmauss 	u64 reserved4;
1531fa418ddfSLv Zheng };
1532fa418ddfSLv Zheng 
1533fa418ddfSLv Zheng /* Masks for Flags field above */
1534fa418ddfSLv Zheng 
1535fa418ddfSLv Zheng #define ACPI_HMAT_PROCESSOR_PD_VALID    (1)	/* 1: processor_PD field is valid */
1536fa418ddfSLv Zheng #define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)	/* 1: memory_PD field is valid */
1537fa418ddfSLv Zheng #define ACPI_HMAT_RESERVATION_HINT      (1<<2)	/* 1: Reservation hint */
1538fa418ddfSLv Zheng 
1539fa418ddfSLv Zheng /* 1: System locality latency and bandwidth information */
1540fa418ddfSLv Zheng 
1541fa418ddfSLv Zheng struct acpi_hmat_locality {
1542fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1543fa418ddfSLv Zheng 	u8 flags;
1544fa418ddfSLv Zheng 	u8 data_type;
1545f1489db6SBob Moore 	u8 min_transfer_size;
1546f1489db6SBob Moore 	u8 reserved1;
1547fa418ddfSLv Zheng 	u32 number_of_initiator_Pds;
1548fa418ddfSLv Zheng 	u32 number_of_target_Pds;
1549fa418ddfSLv Zheng 	u32 reserved2;
1550fa418ddfSLv Zheng 	u64 entry_base_unit;
1551fa418ddfSLv Zheng };
1552fa418ddfSLv Zheng 
1553fa418ddfSLv Zheng /* Masks for Flags field above */
1554fa418ddfSLv Zheng 
1555f1489db6SBob Moore #define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)     /* Bits 0-3 */
1556fa418ddfSLv Zheng 
1557f1489db6SBob Moore /* Values for Memory Hierarchy flags */
1558fa418ddfSLv Zheng 
1559fa418ddfSLv Zheng #define ACPI_HMAT_MEMORY            0
1560fa418ddfSLv Zheng #define ACPI_HMAT_LAST_LEVEL_CACHE  1
1561fa418ddfSLv Zheng #define ACPI_HMAT_1ST_LEVEL_CACHE   2
1562fa418ddfSLv Zheng #define ACPI_HMAT_2ND_LEVEL_CACHE   3
1563fa418ddfSLv Zheng #define ACPI_HMAT_3RD_LEVEL_CACHE   4
1564f1489db6SBob Moore #define ACPI_HMAT_MINIMUM_XFER_SIZE 0x10       /* Bit 4: ACPI 6.4 */
1565f1489db6SBob Moore #define ACPI_HMAT_NON_SEQUENTIAL_XFERS 0x20    /* Bit 5: ACPI 6.4 */
1566f1489db6SBob Moore 
1567fa418ddfSLv Zheng 
1568fa418ddfSLv Zheng /* Values for data_type field above */
1569fa418ddfSLv Zheng 
1570fa418ddfSLv Zheng #define ACPI_HMAT_ACCESS_LATENCY    0
1571fa418ddfSLv Zheng #define ACPI_HMAT_READ_LATENCY      1
1572fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_LATENCY     2
1573fa418ddfSLv Zheng #define ACPI_HMAT_ACCESS_BANDWIDTH  3
1574fa418ddfSLv Zheng #define ACPI_HMAT_READ_BANDWIDTH    4
1575fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_BANDWIDTH   5
1576fa418ddfSLv Zheng 
1577fa418ddfSLv Zheng /* 2: Memory side cache information */
1578fa418ddfSLv Zheng 
1579fa418ddfSLv Zheng struct acpi_hmat_cache {
1580fa418ddfSLv Zheng 	struct acpi_hmat_structure header;
1581fa418ddfSLv Zheng 	u32 memory_PD;
1582fa418ddfSLv Zheng 	u32 reserved1;
1583fa418ddfSLv Zheng 	u64 cache_size;
1584fa418ddfSLv Zheng 	u32 cache_attributes;
1585fa418ddfSLv Zheng 	u16 reserved2;
1586fa418ddfSLv Zheng 	u16 number_of_SMBIOShandles;
1587fa418ddfSLv Zheng };
1588fa418ddfSLv Zheng 
1589fa418ddfSLv Zheng /* Masks for cache_attributes field above */
1590fa418ddfSLv Zheng 
1591fa418ddfSLv Zheng #define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
1592fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
1593fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
1594fa418ddfSLv Zheng #define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
1595fa418ddfSLv Zheng #define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
1596fa418ddfSLv Zheng 
1597fa418ddfSLv Zheng /* Values for cache associativity flag */
1598fa418ddfSLv Zheng 
1599fa418ddfSLv Zheng #define ACPI_HMAT_CA_NONE                     (0)
1600fa418ddfSLv Zheng #define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
1601fa418ddfSLv Zheng #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
1602fa418ddfSLv Zheng 
1603fa418ddfSLv Zheng /* Values for write policy flag */
1604fa418ddfSLv Zheng 
1605fa418ddfSLv Zheng #define ACPI_HMAT_CP_NONE   (0)
1606fa418ddfSLv Zheng #define ACPI_HMAT_CP_WB     (1)
1607fa418ddfSLv Zheng #define ACPI_HMAT_CP_WT     (2)
1608fa418ddfSLv Zheng 
1609fa418ddfSLv Zheng /*******************************************************************************
1610fa418ddfSLv Zheng  *
1611e62f8227SErik Schmauss  * HPET - High Precision Event Timer table
16126e2d5ebdSBob Moore  *        Version 1
16136e2d5ebdSBob Moore  *
1614e62f8227SErik Schmauss  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
1615e62f8227SErik Schmauss  * Version 1.0a, October 2004
161604f8e384SBob Moore  *
161704f8e384SBob Moore  ******************************************************************************/
161804f8e384SBob Moore 
1619e62f8227SErik Schmauss struct acpi_table_hpet {
162004f8e384SBob Moore 	struct acpi_table_header header;	/* Common ACPI table header */
1621e62f8227SErik Schmauss 	u32 id;			/* Hardware ID of event timer block */
1622e62f8227SErik Schmauss 	struct acpi_generic_address address;	/* Address of event timer block */
1623e62f8227SErik Schmauss 	u8 sequence;		/* HPET sequence number */
1624e62f8227SErik Schmauss 	u16 minimum_tick;	/* Main counter min tick, periodic mode */
16254c189c9dSBob Moore 	u8 flags;
162681b7cb92SBob Moore };
162781b7cb92SBob Moore 
1628e62f8227SErik Schmauss /* Masks for Flags field above */
162981b7cb92SBob Moore 
1630e62f8227SErik Schmauss #define ACPI_HPET_PAGE_PROTECT_MASK (3)
1631e62f8227SErik Schmauss 
1632e62f8227SErik Schmauss /* Values for Page Protect flags */
1633e62f8227SErik Schmauss 
1634e62f8227SErik Schmauss enum acpi_hpet_page_protect {
1635e62f8227SErik Schmauss 	ACPI_HPET_NO_PAGE_PROTECT = 0,
1636e62f8227SErik Schmauss 	ACPI_HPET_PAGE_PROTECT4 = 1,
1637e62f8227SErik Schmauss 	ACPI_HPET_PAGE_PROTECT64 = 2
1638e62f8227SErik Schmauss };
163981b7cb92SBob Moore 
164081b7cb92SBob Moore /*******************************************************************************
164181b7cb92SBob Moore  *
1642e62f8227SErik Schmauss  * IBFT - Boot Firmware Table
1643b8355bcaSLv Zheng  *        Version 1
1644b8355bcaSLv Zheng  *
1645e62f8227SErik Schmauss  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
1646e62f8227SErik Schmauss  * Specification", Version 1.01, March 1, 2007
1647e62f8227SErik Schmauss  *
1648e62f8227SErik Schmauss  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
1649e62f8227SErik Schmauss  * Therefore, it is not currently supported by the disassembler.
1650e62f8227SErik Schmauss  *
1651b8355bcaSLv Zheng  ******************************************************************************/
1652b8355bcaSLv Zheng 
1653e62f8227SErik Schmauss struct acpi_table_ibft {
1654b8355bcaSLv Zheng 	struct acpi_table_header header;	/* Common ACPI table header */
1655e62f8227SErik Schmauss 	u8 reserved[12];
1656e62f8227SErik Schmauss };
1657e62f8227SErik Schmauss 
1658e62f8227SErik Schmauss /* IBFT common subtable header */
1659e62f8227SErik Schmauss 
1660e62f8227SErik Schmauss struct acpi_ibft_header {
1661e62f8227SErik Schmauss 	u8 type;
1662e62f8227SErik Schmauss 	u8 version;
1663e62f8227SErik Schmauss 	u16 length;
1664e62f8227SErik Schmauss 	u8 index;
1665e62f8227SErik Schmauss 	u8 flags;
1666b8355bcaSLv Zheng };
1667b8355bcaSLv Zheng 
1668b8355bcaSLv Zheng /* Values for Type field above */
1669b8355bcaSLv Zheng 
1670e62f8227SErik Schmauss enum acpi_ibft_type {
1671e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_NOT_USED = 0,
1672e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_CONTROL = 1,
1673e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_INITIATOR = 2,
1674e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_NIC = 3,
1675e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_TARGET = 4,
1676e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_EXTENSIONS = 5,
1677e62f8227SErik Schmauss 	ACPI_IBFT_TYPE_RESERVED = 6	/* 6 and greater are reserved */
1678b8355bcaSLv Zheng };
1679b8355bcaSLv Zheng 
1680e62f8227SErik Schmauss /* IBFT subtables */
1681b8355bcaSLv Zheng 
1682e62f8227SErik Schmauss struct acpi_ibft_control {
1683e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1684e62f8227SErik Schmauss 	u16 extensions;
1685e62f8227SErik Schmauss 	u16 initiator_offset;
1686e62f8227SErik Schmauss 	u16 nic0_offset;
1687e62f8227SErik Schmauss 	u16 target0_offset;
1688e62f8227SErik Schmauss 	u16 nic1_offset;
1689e62f8227SErik Schmauss 	u16 target1_offset;
1690b8355bcaSLv Zheng };
1691b8355bcaSLv Zheng 
1692e62f8227SErik Schmauss struct acpi_ibft_initiator {
1693e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1694e62f8227SErik Schmauss 	u8 sns_server[16];
1695e62f8227SErik Schmauss 	u8 slp_server[16];
1696e62f8227SErik Schmauss 	u8 primary_server[16];
1697e62f8227SErik Schmauss 	u8 secondary_server[16];
1698e62f8227SErik Schmauss 	u16 name_length;
1699e62f8227SErik Schmauss 	u16 name_offset;
1700b8355bcaSLv Zheng };
1701b8355bcaSLv Zheng 
1702e62f8227SErik Schmauss struct acpi_ibft_nic {
1703e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1704e62f8227SErik Schmauss 	u8 ip_address[16];
1705e62f8227SErik Schmauss 	u8 subnet_mask_prefix;
1706e62f8227SErik Schmauss 	u8 origin;
1707e62f8227SErik Schmauss 	u8 gateway[16];
1708e62f8227SErik Schmauss 	u8 primary_dns[16];
1709e62f8227SErik Schmauss 	u8 secondary_dns[16];
1710e62f8227SErik Schmauss 	u8 dhcp[16];
1711e62f8227SErik Schmauss 	u16 vlan;
1712e62f8227SErik Schmauss 	u8 mac_address[6];
1713e62f8227SErik Schmauss 	u16 pci_address;
1714e62f8227SErik Schmauss 	u16 name_length;
1715e62f8227SErik Schmauss 	u16 name_offset;
1716b8355bcaSLv Zheng };
1717b8355bcaSLv Zheng 
1718e62f8227SErik Schmauss struct acpi_ibft_target {
1719e62f8227SErik Schmauss 	struct acpi_ibft_header header;
1720e62f8227SErik Schmauss 	u8 target_ip_address[16];
1721e62f8227SErik Schmauss 	u16 target_ip_socket;
1722e62f8227SErik Schmauss 	u8 target_boot_lun[8];
1723e62f8227SErik Schmauss 	u8 chap_type;
1724e62f8227SErik Schmauss 	u8 nic_association;
1725e62f8227SErik Schmauss 	u16 target_name_length;
1726e62f8227SErik Schmauss 	u16 target_name_offset;
1727e62f8227SErik Schmauss 	u16 chap_name_length;
1728e62f8227SErik Schmauss 	u16 chap_name_offset;
1729e62f8227SErik Schmauss 	u16 chap_secret_length;
1730e62f8227SErik Schmauss 	u16 chap_secret_offset;
1731e62f8227SErik Schmauss 	u16 reverse_chap_name_length;
1732e62f8227SErik Schmauss 	u16 reverse_chap_name_offset;
1733e62f8227SErik Schmauss 	u16 reverse_chap_secret_length;
1734e62f8227SErik Schmauss 	u16 reverse_chap_secret_offset;
1735a618c7f8SBob Moore };
1736a618c7f8SBob Moore 
17376e596084SRobert Moore /* Reset to default packing */
17386e596084SRobert Moore 
17396e596084SRobert Moore #pragma pack()
17401da177e4SLinus Torvalds 
17411da177e4SLinus Torvalds #endif				/* __ACTBL1_H__ */
1742