xref: /minix3/minix/drivers/power/acpi/include/actbl1.h (revision 29492bb71c7148a089a5afafa0c99409161218df)
1433d6423SLionel Sambuc /******************************************************************************
2433d6423SLionel Sambuc  *
3433d6423SLionel Sambuc  * Name: actbl1.h - Additional ACPI table definitions
4433d6423SLionel Sambuc  *
5433d6423SLionel Sambuc  *****************************************************************************/
6433d6423SLionel Sambuc 
7*29492bb7SDavid van Moolenbroek /*
8*29492bb7SDavid van Moolenbroek  * Copyright (C) 2000 - 2014, Intel Corp.
9433d6423SLionel Sambuc  * All rights reserved.
10433d6423SLionel Sambuc  *
11*29492bb7SDavid van Moolenbroek  * Redistribution and use in source and binary forms, with or without
12*29492bb7SDavid van Moolenbroek  * modification, are permitted provided that the following conditions
13*29492bb7SDavid van Moolenbroek  * are met:
14*29492bb7SDavid van Moolenbroek  * 1. Redistributions of source code must retain the above copyright
15*29492bb7SDavid van Moolenbroek  *    notice, this list of conditions, and the following disclaimer,
16*29492bb7SDavid van Moolenbroek  *    without modification.
17*29492bb7SDavid van Moolenbroek  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18*29492bb7SDavid van Moolenbroek  *    substantially similar to the "NO WARRANTY" disclaimer below
19*29492bb7SDavid van Moolenbroek  *    ("Disclaimer") and any redistribution must be conditioned upon
20*29492bb7SDavid van Moolenbroek  *    including a substantially similar Disclaimer requirement for further
21*29492bb7SDavid van Moolenbroek  *    binary redistribution.
22*29492bb7SDavid van Moolenbroek  * 3. Neither the names of the above-listed copyright holders nor the names
23*29492bb7SDavid van Moolenbroek  *    of any contributors may be used to endorse or promote products derived
24*29492bb7SDavid van Moolenbroek  *    from this software without specific prior written permission.
25433d6423SLionel Sambuc  *
26*29492bb7SDavid van Moolenbroek  * Alternatively, this software may be distributed under the terms of the
27*29492bb7SDavid van Moolenbroek  * GNU General Public License ("GPL") version 2 as published by the Free
28*29492bb7SDavid van Moolenbroek  * Software Foundation.
29433d6423SLionel Sambuc  *
30*29492bb7SDavid van Moolenbroek  * NO WARRANTY
31*29492bb7SDavid van Moolenbroek  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32*29492bb7SDavid van Moolenbroek  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33*29492bb7SDavid van Moolenbroek  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34*29492bb7SDavid van Moolenbroek  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35*29492bb7SDavid van Moolenbroek  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*29492bb7SDavid van Moolenbroek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*29492bb7SDavid van Moolenbroek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*29492bb7SDavid van Moolenbroek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*29492bb7SDavid van Moolenbroek  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40*29492bb7SDavid van Moolenbroek  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*29492bb7SDavid van Moolenbroek  * POSSIBILITY OF SUCH DAMAGES.
42*29492bb7SDavid van Moolenbroek  */
43433d6423SLionel Sambuc 
44433d6423SLionel Sambuc #ifndef __ACTBL1_H__
45433d6423SLionel Sambuc #define __ACTBL1_H__
46433d6423SLionel Sambuc 
47433d6423SLionel Sambuc 
48433d6423SLionel Sambuc /*******************************************************************************
49433d6423SLionel Sambuc  *
50433d6423SLionel Sambuc  * Additional ACPI Tables (1)
51433d6423SLionel Sambuc  *
52433d6423SLionel Sambuc  * These tables are not consumed directly by the ACPICA subsystem, but are
53433d6423SLionel Sambuc  * included here to support device drivers and the AML disassembler.
54433d6423SLionel Sambuc  *
55433d6423SLionel Sambuc  * The tables in this file are fully defined within the ACPI specification.
56433d6423SLionel Sambuc  *
57433d6423SLionel Sambuc  ******************************************************************************/
58433d6423SLionel Sambuc 
59433d6423SLionel Sambuc 
60433d6423SLionel Sambuc /*
61433d6423SLionel Sambuc  * Values for description table header signatures for tables defined in this
62433d6423SLionel Sambuc  * file. Useful because they make it more difficult to inadvertently type in
63433d6423SLionel Sambuc  * the wrong signature.
64433d6423SLionel Sambuc  */
65433d6423SLionel Sambuc #define ACPI_SIG_BERT           "BERT"      /* Boot Error Record Table */
66433d6423SLionel Sambuc #define ACPI_SIG_CPEP           "CPEP"      /* Corrected Platform Error Polling table */
67433d6423SLionel Sambuc #define ACPI_SIG_ECDT           "ECDT"      /* Embedded Controller Boot Resources Table */
68433d6423SLionel Sambuc #define ACPI_SIG_EINJ           "EINJ"      /* Error Injection table */
69433d6423SLionel Sambuc #define ACPI_SIG_ERST           "ERST"      /* Error Record Serialization Table */
70433d6423SLionel Sambuc #define ACPI_SIG_HEST           "HEST"      /* Hardware Error Source Table */
71433d6423SLionel Sambuc #define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
72433d6423SLionel Sambuc #define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
73433d6423SLionel Sambuc #define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
74433d6423SLionel Sambuc #define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
75433d6423SLionel Sambuc #define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
76433d6423SLionel Sambuc 
77433d6423SLionel Sambuc 
78433d6423SLionel Sambuc /*
79433d6423SLionel Sambuc  * All tables must be byte-packed to match the ACPI specification, since
80433d6423SLionel Sambuc  * the tables are provided by the system BIOS.
81433d6423SLionel Sambuc  */
82433d6423SLionel Sambuc #pragma pack(1)
83433d6423SLionel Sambuc 
84433d6423SLionel Sambuc /*
85*29492bb7SDavid van Moolenbroek  * Note: C bitfields are not used for this reason:
86*29492bb7SDavid van Moolenbroek  *
87*29492bb7SDavid van Moolenbroek  * "Bitfields are great and easy to read, but unfortunately the C language
88*29492bb7SDavid van Moolenbroek  * does not specify the layout of bitfields in memory, which means they are
89*29492bb7SDavid van Moolenbroek  * essentially useless for dealing with packed data in on-disk formats or
90*29492bb7SDavid van Moolenbroek  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
91*29492bb7SDavid van Moolenbroek  * this decision was a design error in C. Ritchie could have picked an order
92*29492bb7SDavid van Moolenbroek  * and stuck with it." Norman Ramsey.
93*29492bb7SDavid van Moolenbroek  * See http://stackoverflow.com/a/1053662/41661
94433d6423SLionel Sambuc  */
95433d6423SLionel Sambuc 
96433d6423SLionel Sambuc 
97433d6423SLionel Sambuc /*******************************************************************************
98433d6423SLionel Sambuc  *
99433d6423SLionel Sambuc  * Common subtable headers
100433d6423SLionel Sambuc  *
101433d6423SLionel Sambuc  ******************************************************************************/
102433d6423SLionel Sambuc 
103433d6423SLionel Sambuc /* Generic subtable header (used in MADT, SRAT, etc.) */
104433d6423SLionel Sambuc 
105433d6423SLionel Sambuc typedef struct acpi_subtable_header
106433d6423SLionel Sambuc {
107433d6423SLionel Sambuc     UINT8                   Type;
108433d6423SLionel Sambuc     UINT8                   Length;
109433d6423SLionel Sambuc 
110433d6423SLionel Sambuc } ACPI_SUBTABLE_HEADER;
111433d6423SLionel Sambuc 
112433d6423SLionel Sambuc 
113433d6423SLionel Sambuc /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
114433d6423SLionel Sambuc 
115433d6423SLionel Sambuc typedef struct acpi_whea_header
116433d6423SLionel Sambuc {
117433d6423SLionel Sambuc     UINT8                   Action;
118433d6423SLionel Sambuc     UINT8                   Instruction;
119433d6423SLionel Sambuc     UINT8                   Flags;
120433d6423SLionel Sambuc     UINT8                   Reserved;
121433d6423SLionel Sambuc     ACPI_GENERIC_ADDRESS    RegisterRegion;
122433d6423SLionel Sambuc     UINT64                  Value;              /* Value used with Read/Write register */
123433d6423SLionel Sambuc     UINT64                  Mask;               /* Bitmask required for this register instruction */
124433d6423SLionel Sambuc 
125433d6423SLionel Sambuc } ACPI_WHEA_HEADER;
126433d6423SLionel Sambuc 
127433d6423SLionel Sambuc 
128433d6423SLionel Sambuc /*******************************************************************************
129433d6423SLionel Sambuc  *
130433d6423SLionel Sambuc  * BERT - Boot Error Record Table (ACPI 4.0)
131433d6423SLionel Sambuc  *        Version 1
132433d6423SLionel Sambuc  *
133433d6423SLionel Sambuc  ******************************************************************************/
134433d6423SLionel Sambuc 
135433d6423SLionel Sambuc typedef struct acpi_table_bert
136433d6423SLionel Sambuc {
137433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
138433d6423SLionel Sambuc     UINT32                  RegionLength;       /* Length of the boot error region */
139*29492bb7SDavid van Moolenbroek     UINT64                  Address;            /* Physical address of the error region */
140433d6423SLionel Sambuc 
141433d6423SLionel Sambuc } ACPI_TABLE_BERT;
142433d6423SLionel Sambuc 
143433d6423SLionel Sambuc 
144433d6423SLionel Sambuc /* Boot Error Region (not a subtable, pointed to by Address field above) */
145433d6423SLionel Sambuc 
146433d6423SLionel Sambuc typedef struct acpi_bert_region
147433d6423SLionel Sambuc {
148433d6423SLionel Sambuc     UINT32                  BlockStatus;        /* Type of error information */
149433d6423SLionel Sambuc     UINT32                  RawDataOffset;      /* Offset to raw error data */
150433d6423SLionel Sambuc     UINT32                  RawDataLength;      /* Length of raw error data */
151433d6423SLionel Sambuc     UINT32                  DataLength;         /* Length of generic error data */
152433d6423SLionel Sambuc     UINT32                  ErrorSeverity;      /* Severity code */
153433d6423SLionel Sambuc 
154433d6423SLionel Sambuc } ACPI_BERT_REGION;
155433d6423SLionel Sambuc 
156433d6423SLionel Sambuc /* Values for BlockStatus flags above */
157433d6423SLionel Sambuc 
158433d6423SLionel Sambuc #define ACPI_BERT_UNCORRECTABLE             (1)
159433d6423SLionel Sambuc #define ACPI_BERT_CORRECTABLE               (1<<1)
160433d6423SLionel Sambuc #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
161433d6423SLionel Sambuc #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
162433d6423SLionel Sambuc #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
163433d6423SLionel Sambuc 
164433d6423SLionel Sambuc /* Values for ErrorSeverity above */
165433d6423SLionel Sambuc 
166433d6423SLionel Sambuc enum AcpiBertErrorSeverity
167433d6423SLionel Sambuc {
168433d6423SLionel Sambuc     ACPI_BERT_ERROR_CORRECTABLE     = 0,
169433d6423SLionel Sambuc     ACPI_BERT_ERROR_FATAL           = 1,
170433d6423SLionel Sambuc     ACPI_BERT_ERROR_CORRECTED       = 2,
171433d6423SLionel Sambuc     ACPI_BERT_ERROR_NONE            = 3,
172433d6423SLionel Sambuc     ACPI_BERT_ERROR_RESERVED        = 4     /* 4 and greater are reserved */
173433d6423SLionel Sambuc };
174433d6423SLionel Sambuc 
175433d6423SLionel Sambuc /*
176433d6423SLionel Sambuc  * Note: The generic error data that follows the ErrorSeverity field above
177433d6423SLionel Sambuc  * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below
178433d6423SLionel Sambuc  */
179433d6423SLionel Sambuc 
180433d6423SLionel Sambuc 
181433d6423SLionel Sambuc /*******************************************************************************
182433d6423SLionel Sambuc  *
183433d6423SLionel Sambuc  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
184433d6423SLionel Sambuc  *        Version 1
185433d6423SLionel Sambuc  *
186433d6423SLionel Sambuc  ******************************************************************************/
187433d6423SLionel Sambuc 
188433d6423SLionel Sambuc typedef struct acpi_table_cpep
189433d6423SLionel Sambuc {
190433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
191433d6423SLionel Sambuc     UINT64                  Reserved;
192433d6423SLionel Sambuc 
193433d6423SLionel Sambuc } ACPI_TABLE_CPEP;
194433d6423SLionel Sambuc 
195433d6423SLionel Sambuc 
196433d6423SLionel Sambuc /* Subtable */
197433d6423SLionel Sambuc 
198433d6423SLionel Sambuc typedef struct acpi_cpep_polling
199433d6423SLionel Sambuc {
200433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
201433d6423SLionel Sambuc     UINT8                   Id;                 /* Processor ID */
202433d6423SLionel Sambuc     UINT8                   Eid;                /* Processor EID */
203433d6423SLionel Sambuc     UINT32                  Interval;           /* Polling interval (msec) */
204433d6423SLionel Sambuc 
205433d6423SLionel Sambuc } ACPI_CPEP_POLLING;
206433d6423SLionel Sambuc 
207433d6423SLionel Sambuc 
208433d6423SLionel Sambuc /*******************************************************************************
209433d6423SLionel Sambuc  *
210433d6423SLionel Sambuc  * ECDT - Embedded Controller Boot Resources Table
211433d6423SLionel Sambuc  *        Version 1
212433d6423SLionel Sambuc  *
213433d6423SLionel Sambuc  ******************************************************************************/
214433d6423SLionel Sambuc 
215433d6423SLionel Sambuc typedef struct acpi_table_ecdt
216433d6423SLionel Sambuc {
217433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
218433d6423SLionel Sambuc     ACPI_GENERIC_ADDRESS    Control;            /* Address of EC command/status register */
219433d6423SLionel Sambuc     ACPI_GENERIC_ADDRESS    Data;               /* Address of EC data register */
220433d6423SLionel Sambuc     UINT32                  Uid;                /* Unique ID - must be same as the EC _UID method */
221433d6423SLionel Sambuc     UINT8                   Gpe;                /* The GPE for the EC */
222433d6423SLionel Sambuc     UINT8                   Id[1];              /* Full namepath of the EC in the ACPI namespace */
223433d6423SLionel Sambuc 
224433d6423SLionel Sambuc } ACPI_TABLE_ECDT;
225433d6423SLionel Sambuc 
226433d6423SLionel Sambuc 
227433d6423SLionel Sambuc /*******************************************************************************
228433d6423SLionel Sambuc  *
229433d6423SLionel Sambuc  * EINJ - Error Injection Table (ACPI 4.0)
230433d6423SLionel Sambuc  *        Version 1
231433d6423SLionel Sambuc  *
232433d6423SLionel Sambuc  ******************************************************************************/
233433d6423SLionel Sambuc 
234433d6423SLionel Sambuc typedef struct acpi_table_einj
235433d6423SLionel Sambuc {
236433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
237433d6423SLionel Sambuc     UINT32                  HeaderLength;
238433d6423SLionel Sambuc     UINT8                   Flags;
239433d6423SLionel Sambuc     UINT8                   Reserved[3];
240433d6423SLionel Sambuc     UINT32                  Entries;
241433d6423SLionel Sambuc 
242433d6423SLionel Sambuc } ACPI_TABLE_EINJ;
243433d6423SLionel Sambuc 
244433d6423SLionel Sambuc 
245433d6423SLionel Sambuc /* EINJ Injection Instruction Entries (actions) */
246433d6423SLionel Sambuc 
247433d6423SLionel Sambuc typedef struct acpi_einj_entry
248433d6423SLionel Sambuc {
249433d6423SLionel Sambuc     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
250433d6423SLionel Sambuc 
251433d6423SLionel Sambuc } ACPI_EINJ_ENTRY;
252433d6423SLionel Sambuc 
253433d6423SLionel Sambuc /* Masks for Flags field above */
254433d6423SLionel Sambuc 
255433d6423SLionel Sambuc #define ACPI_EINJ_PRESERVE          (1)
256433d6423SLionel Sambuc 
257433d6423SLionel Sambuc /* Values for Action field above */
258433d6423SLionel Sambuc 
259433d6423SLionel Sambuc enum AcpiEinjActions
260433d6423SLionel Sambuc {
261433d6423SLionel Sambuc     ACPI_EINJ_BEGIN_OPERATION               = 0,
262433d6423SLionel Sambuc     ACPI_EINJ_GET_TRIGGER_TABLE             = 1,
263433d6423SLionel Sambuc     ACPI_EINJ_SET_ERROR_TYPE                = 2,
264433d6423SLionel Sambuc     ACPI_EINJ_GET_ERROR_TYPE                = 3,
265433d6423SLionel Sambuc     ACPI_EINJ_END_OPERATION                 = 4,
266433d6423SLionel Sambuc     ACPI_EINJ_EXECUTE_OPERATION             = 5,
267433d6423SLionel Sambuc     ACPI_EINJ_CHECK_BUSY_STATUS             = 6,
268433d6423SLionel Sambuc     ACPI_EINJ_GET_COMMAND_STATUS            = 7,
269*29492bb7SDavid van Moolenbroek     ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
270*29492bb7SDavid van Moolenbroek     ACPI_EINJ_ACTION_RESERVED               = 9,     /* 9 and greater are reserved */
271433d6423SLionel Sambuc     ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
272433d6423SLionel Sambuc };
273433d6423SLionel Sambuc 
274433d6423SLionel Sambuc /* Values for Instruction field above */
275433d6423SLionel Sambuc 
276433d6423SLionel Sambuc enum AcpiEinjInstructions
277433d6423SLionel Sambuc {
278433d6423SLionel Sambuc     ACPI_EINJ_READ_REGISTER         = 0,
279433d6423SLionel Sambuc     ACPI_EINJ_READ_REGISTER_VALUE   = 1,
280433d6423SLionel Sambuc     ACPI_EINJ_WRITE_REGISTER        = 2,
281433d6423SLionel Sambuc     ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
282433d6423SLionel Sambuc     ACPI_EINJ_NOOP                  = 4,
283*29492bb7SDavid van Moolenbroek     ACPI_EINJ_FLUSH_CACHELINE       = 5,
284*29492bb7SDavid van Moolenbroek     ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
285433d6423SLionel Sambuc };
286433d6423SLionel Sambuc 
287*29492bb7SDavid van Moolenbroek typedef struct acpi_einj_error_type_with_addr
288*29492bb7SDavid van Moolenbroek {
289*29492bb7SDavid van Moolenbroek     UINT32                  ErrorType;
290*29492bb7SDavid van Moolenbroek     UINT32                  VendorStructOffset;
291*29492bb7SDavid van Moolenbroek     UINT32                  Flags;
292*29492bb7SDavid van Moolenbroek     UINT32                  ApicId;
293*29492bb7SDavid van Moolenbroek     UINT64                  Address;
294*29492bb7SDavid van Moolenbroek     UINT64                  Range;
295*29492bb7SDavid van Moolenbroek     UINT32                  PcieId;
296*29492bb7SDavid van Moolenbroek 
297*29492bb7SDavid van Moolenbroek } ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
298*29492bb7SDavid van Moolenbroek 
299*29492bb7SDavid van Moolenbroek typedef struct acpi_einj_vendor
300*29492bb7SDavid van Moolenbroek {
301*29492bb7SDavid van Moolenbroek     UINT32                  Length;
302*29492bb7SDavid van Moolenbroek     UINT32                  PcieId;
303*29492bb7SDavid van Moolenbroek     UINT16                  VendorId;
304*29492bb7SDavid van Moolenbroek     UINT16                  DeviceId;
305*29492bb7SDavid van Moolenbroek     UINT8                   RevisionId;
306*29492bb7SDavid van Moolenbroek     UINT8                   Reserved[3];
307*29492bb7SDavid van Moolenbroek 
308*29492bb7SDavid van Moolenbroek } ACPI_EINJ_VENDOR;
309*29492bb7SDavid van Moolenbroek 
310433d6423SLionel Sambuc 
311433d6423SLionel Sambuc /* EINJ Trigger Error Action Table */
312433d6423SLionel Sambuc 
313433d6423SLionel Sambuc typedef struct acpi_einj_trigger
314433d6423SLionel Sambuc {
315433d6423SLionel Sambuc     UINT32                  HeaderSize;
316433d6423SLionel Sambuc     UINT32                  Revision;
317433d6423SLionel Sambuc     UINT32                  TableSize;
318433d6423SLionel Sambuc     UINT32                  EntryCount;
319433d6423SLionel Sambuc 
320433d6423SLionel Sambuc } ACPI_EINJ_TRIGGER;
321433d6423SLionel Sambuc 
322433d6423SLionel Sambuc /* Command status return values */
323433d6423SLionel Sambuc 
324433d6423SLionel Sambuc enum AcpiEinjCommandStatus
325433d6423SLionel Sambuc {
326433d6423SLionel Sambuc     ACPI_EINJ_SUCCESS               = 0,
327433d6423SLionel Sambuc     ACPI_EINJ_FAILURE               = 1,
328433d6423SLionel Sambuc     ACPI_EINJ_INVALID_ACCESS        = 2,
329433d6423SLionel Sambuc     ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
330433d6423SLionel Sambuc };
331433d6423SLionel Sambuc 
332433d6423SLionel Sambuc 
333433d6423SLionel Sambuc /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
334433d6423SLionel Sambuc 
335433d6423SLionel Sambuc #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
336433d6423SLionel Sambuc #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
337433d6423SLionel Sambuc #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
338433d6423SLionel Sambuc #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
339433d6423SLionel Sambuc #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
340433d6423SLionel Sambuc #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
341433d6423SLionel Sambuc #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
342433d6423SLionel Sambuc #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
343433d6423SLionel Sambuc #define ACPI_EINJ_PCIX_FATAL                (1<<8)
344433d6423SLionel Sambuc #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
345433d6423SLionel Sambuc #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
346433d6423SLionel Sambuc #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
347*29492bb7SDavid van Moolenbroek #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
348433d6423SLionel Sambuc 
349433d6423SLionel Sambuc 
350433d6423SLionel Sambuc /*******************************************************************************
351433d6423SLionel Sambuc  *
352433d6423SLionel Sambuc  * ERST - Error Record Serialization Table (ACPI 4.0)
353433d6423SLionel Sambuc  *        Version 1
354433d6423SLionel Sambuc  *
355433d6423SLionel Sambuc  ******************************************************************************/
356433d6423SLionel Sambuc 
357433d6423SLionel Sambuc typedef struct acpi_table_erst
358433d6423SLionel Sambuc {
359433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
360433d6423SLionel Sambuc     UINT32                  HeaderLength;
361433d6423SLionel Sambuc     UINT32                  Reserved;
362433d6423SLionel Sambuc     UINT32                  Entries;
363433d6423SLionel Sambuc 
364433d6423SLionel Sambuc } ACPI_TABLE_ERST;
365433d6423SLionel Sambuc 
366433d6423SLionel Sambuc 
367433d6423SLionel Sambuc /* ERST Serialization Entries (actions) */
368433d6423SLionel Sambuc 
369433d6423SLionel Sambuc typedef struct acpi_erst_entry
370433d6423SLionel Sambuc {
371433d6423SLionel Sambuc     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
372433d6423SLionel Sambuc 
373433d6423SLionel Sambuc } ACPI_ERST_ENTRY;
374433d6423SLionel Sambuc 
375433d6423SLionel Sambuc /* Masks for Flags field above */
376433d6423SLionel Sambuc 
377433d6423SLionel Sambuc #define ACPI_ERST_PRESERVE          (1)
378433d6423SLionel Sambuc 
379433d6423SLionel Sambuc /* Values for Action field above */
380433d6423SLionel Sambuc 
381433d6423SLionel Sambuc enum AcpiErstActions
382433d6423SLionel Sambuc {
383433d6423SLionel Sambuc     ACPI_ERST_BEGIN_WRITE           = 0,
384433d6423SLionel Sambuc     ACPI_ERST_BEGIN_READ            = 1,
385433d6423SLionel Sambuc     ACPI_ERST_BEGIN_CLEAR           = 2,
386433d6423SLionel Sambuc     ACPI_ERST_END                   = 3,
387433d6423SLionel Sambuc     ACPI_ERST_SET_RECORD_OFFSET     = 4,
388433d6423SLionel Sambuc     ACPI_ERST_EXECUTE_OPERATION     = 5,
389433d6423SLionel Sambuc     ACPI_ERST_CHECK_BUSY_STATUS     = 6,
390433d6423SLionel Sambuc     ACPI_ERST_GET_COMMAND_STATUS    = 7,
391433d6423SLionel Sambuc     ACPI_ERST_GET_RECORD_ID         = 8,
392433d6423SLionel Sambuc     ACPI_ERST_SET_RECORD_ID         = 9,
393433d6423SLionel Sambuc     ACPI_ERST_GET_RECORD_COUNT      = 10,
394433d6423SLionel Sambuc     ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
395433d6423SLionel Sambuc     ACPI_ERST_NOT_USED              = 12,
396433d6423SLionel Sambuc     ACPI_ERST_GET_ERROR_RANGE       = 13,
397433d6423SLionel Sambuc     ACPI_ERST_GET_ERROR_LENGTH      = 14,
398433d6423SLionel Sambuc     ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
399433d6423SLionel Sambuc     ACPI_ERST_ACTION_RESERVED       = 16    /* 16 and greater are reserved */
400433d6423SLionel Sambuc };
401433d6423SLionel Sambuc 
402433d6423SLionel Sambuc /* Values for Instruction field above */
403433d6423SLionel Sambuc 
404433d6423SLionel Sambuc enum AcpiErstInstructions
405433d6423SLionel Sambuc {
406433d6423SLionel Sambuc     ACPI_ERST_READ_REGISTER         = 0,
407433d6423SLionel Sambuc     ACPI_ERST_READ_REGISTER_VALUE   = 1,
408433d6423SLionel Sambuc     ACPI_ERST_WRITE_REGISTER        = 2,
409433d6423SLionel Sambuc     ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
410433d6423SLionel Sambuc     ACPI_ERST_NOOP                  = 4,
411433d6423SLionel Sambuc     ACPI_ERST_LOAD_VAR1             = 5,
412433d6423SLionel Sambuc     ACPI_ERST_LOAD_VAR2             = 6,
413433d6423SLionel Sambuc     ACPI_ERST_STORE_VAR1            = 7,
414433d6423SLionel Sambuc     ACPI_ERST_ADD                   = 8,
415433d6423SLionel Sambuc     ACPI_ERST_SUBTRACT              = 9,
416433d6423SLionel Sambuc     ACPI_ERST_ADD_VALUE             = 10,
417433d6423SLionel Sambuc     ACPI_ERST_SUBTRACT_VALUE        = 11,
418433d6423SLionel Sambuc     ACPI_ERST_STALL                 = 12,
419433d6423SLionel Sambuc     ACPI_ERST_STALL_WHILE_TRUE      = 13,
420433d6423SLionel Sambuc     ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
421433d6423SLionel Sambuc     ACPI_ERST_GOTO                  = 15,
422433d6423SLionel Sambuc     ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
423433d6423SLionel Sambuc     ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
424433d6423SLionel Sambuc     ACPI_ERST_MOVE_DATA             = 18,
425433d6423SLionel Sambuc     ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
426433d6423SLionel Sambuc };
427433d6423SLionel Sambuc 
428433d6423SLionel Sambuc /* Command status return values */
429433d6423SLionel Sambuc 
430433d6423SLionel Sambuc enum AcpiErstCommandStatus
431433d6423SLionel Sambuc {
432433d6423SLionel Sambuc     ACPI_ERST_SUCESS                = 0,
433433d6423SLionel Sambuc     ACPI_ERST_NO_SPACE              = 1,
434433d6423SLionel Sambuc     ACPI_ERST_NOT_AVAILABLE         = 2,
435433d6423SLionel Sambuc     ACPI_ERST_FAILURE               = 3,
436433d6423SLionel Sambuc     ACPI_ERST_RECORD_EMPTY          = 4,
437433d6423SLionel Sambuc     ACPI_ERST_NOT_FOUND             = 5,
438433d6423SLionel Sambuc     ACPI_ERST_STATUS_RESERVED       = 6     /* 6 and greater are reserved */
439433d6423SLionel Sambuc };
440433d6423SLionel Sambuc 
441433d6423SLionel Sambuc 
442433d6423SLionel Sambuc /* Error Record Serialization Information */
443433d6423SLionel Sambuc 
444433d6423SLionel Sambuc typedef struct acpi_erst_info
445433d6423SLionel Sambuc {
446433d6423SLionel Sambuc     UINT16                  Signature;          /* Should be "ER" */
447433d6423SLionel Sambuc     UINT8                   Data[48];
448433d6423SLionel Sambuc 
449433d6423SLionel Sambuc } ACPI_ERST_INFO;
450433d6423SLionel Sambuc 
451433d6423SLionel Sambuc 
452433d6423SLionel Sambuc /*******************************************************************************
453433d6423SLionel Sambuc  *
454433d6423SLionel Sambuc  * HEST - Hardware Error Source Table (ACPI 4.0)
455433d6423SLionel Sambuc  *        Version 1
456433d6423SLionel Sambuc  *
457433d6423SLionel Sambuc  ******************************************************************************/
458433d6423SLionel Sambuc 
459433d6423SLionel Sambuc typedef struct acpi_table_hest
460433d6423SLionel Sambuc {
461433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
462433d6423SLionel Sambuc     UINT32                  ErrorSourceCount;
463433d6423SLionel Sambuc 
464433d6423SLionel Sambuc } ACPI_TABLE_HEST;
465433d6423SLionel Sambuc 
466433d6423SLionel Sambuc 
467433d6423SLionel Sambuc /* HEST subtable header */
468433d6423SLionel Sambuc 
469433d6423SLionel Sambuc typedef struct acpi_hest_header
470433d6423SLionel Sambuc {
471433d6423SLionel Sambuc     UINT16                  Type;
472433d6423SLionel Sambuc     UINT16                  SourceId;
473433d6423SLionel Sambuc 
474433d6423SLionel Sambuc } ACPI_HEST_HEADER;
475433d6423SLionel Sambuc 
476433d6423SLionel Sambuc 
477433d6423SLionel Sambuc /* Values for Type field above for subtables */
478433d6423SLionel Sambuc 
479433d6423SLionel Sambuc enum AcpiHestTypes
480433d6423SLionel Sambuc {
481433d6423SLionel Sambuc     ACPI_HEST_TYPE_IA32_CHECK           = 0,
482433d6423SLionel Sambuc     ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
483433d6423SLionel Sambuc     ACPI_HEST_TYPE_IA32_NMI             = 2,
484433d6423SLionel Sambuc     ACPI_HEST_TYPE_NOT_USED3            = 3,
485433d6423SLionel Sambuc     ACPI_HEST_TYPE_NOT_USED4            = 4,
486433d6423SLionel Sambuc     ACPI_HEST_TYPE_NOT_USED5            = 5,
487433d6423SLionel Sambuc     ACPI_HEST_TYPE_AER_ROOT_PORT        = 6,
488433d6423SLionel Sambuc     ACPI_HEST_TYPE_AER_ENDPOINT         = 7,
489433d6423SLionel Sambuc     ACPI_HEST_TYPE_AER_BRIDGE           = 8,
490433d6423SLionel Sambuc     ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
491433d6423SLionel Sambuc     ACPI_HEST_TYPE_RESERVED             = 10    /* 10 and greater are reserved */
492433d6423SLionel Sambuc };
493433d6423SLionel Sambuc 
494433d6423SLionel Sambuc 
495433d6423SLionel Sambuc /*
496433d6423SLionel Sambuc  * HEST substructures contained in subtables
497433d6423SLionel Sambuc  */
498433d6423SLionel Sambuc 
499433d6423SLionel Sambuc /*
500433d6423SLionel Sambuc  * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
501433d6423SLionel Sambuc  * ACPI_HEST_IA_CORRECTED structures.
502433d6423SLionel Sambuc  */
503433d6423SLionel Sambuc typedef struct acpi_hest_ia_error_bank
504433d6423SLionel Sambuc {
505433d6423SLionel Sambuc     UINT8                   BankNumber;
506433d6423SLionel Sambuc     UINT8                   ClearStatusOnInit;
507433d6423SLionel Sambuc     UINT8                   StatusFormat;
508433d6423SLionel Sambuc     UINT8                   Reserved;
509433d6423SLionel Sambuc     UINT32                  ControlRegister;
510433d6423SLionel Sambuc     UINT64                  ControlData;
511433d6423SLionel Sambuc     UINT32                  StatusRegister;
512433d6423SLionel Sambuc     UINT32                  AddressRegister;
513433d6423SLionel Sambuc     UINT32                  MiscRegister;
514433d6423SLionel Sambuc 
515433d6423SLionel Sambuc } ACPI_HEST_IA_ERROR_BANK;
516433d6423SLionel Sambuc 
517433d6423SLionel Sambuc 
518433d6423SLionel Sambuc /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
519433d6423SLionel Sambuc 
520433d6423SLionel Sambuc typedef struct acpi_hest_aer_common
521433d6423SLionel Sambuc {
522433d6423SLionel Sambuc     UINT16                  Reserved1;
523433d6423SLionel Sambuc     UINT8                   Flags;
524433d6423SLionel Sambuc     UINT8                   Enabled;
525433d6423SLionel Sambuc     UINT32                  RecordsToPreallocate;
526433d6423SLionel Sambuc     UINT32                  MaxSectionsPerRecord;
527*29492bb7SDavid van Moolenbroek     UINT32                  Bus;                    /* Bus and Segment numbers */
528433d6423SLionel Sambuc     UINT16                  Device;
529433d6423SLionel Sambuc     UINT16                  Function;
530433d6423SLionel Sambuc     UINT16                  DeviceControl;
531433d6423SLionel Sambuc     UINT16                  Reserved2;
532433d6423SLionel Sambuc     UINT32                  UncorrectableMask;
533433d6423SLionel Sambuc     UINT32                  UncorrectableSeverity;
534433d6423SLionel Sambuc     UINT32                  CorrectableMask;
535433d6423SLionel Sambuc     UINT32                  AdvancedCapabilities;
536433d6423SLionel Sambuc 
537433d6423SLionel Sambuc } ACPI_HEST_AER_COMMON;
538433d6423SLionel Sambuc 
539433d6423SLionel Sambuc /* Masks for HEST Flags fields */
540433d6423SLionel Sambuc 
541433d6423SLionel Sambuc #define ACPI_HEST_FIRMWARE_FIRST        (1)
542433d6423SLionel Sambuc #define ACPI_HEST_GLOBAL                (1<<1)
543433d6423SLionel Sambuc 
544*29492bb7SDavid van Moolenbroek /*
545*29492bb7SDavid van Moolenbroek  * Macros to access the bus/segment numbers in Bus field above:
546*29492bb7SDavid van Moolenbroek  *  Bus number is encoded in bits 7:0
547*29492bb7SDavid van Moolenbroek  *  Segment number is encoded in bits 23:8
548*29492bb7SDavid van Moolenbroek  */
549*29492bb7SDavid van Moolenbroek #define ACPI_HEST_BUS(Bus)              ((Bus) & 0xFF)
550*29492bb7SDavid van Moolenbroek #define ACPI_HEST_SEGMENT(Bus)          (((Bus) >> 8) & 0xFFFF)
551*29492bb7SDavid van Moolenbroek 
552433d6423SLionel Sambuc 
553433d6423SLionel Sambuc /* Hardware Error Notification */
554433d6423SLionel Sambuc 
555433d6423SLionel Sambuc typedef struct acpi_hest_notify
556433d6423SLionel Sambuc {
557433d6423SLionel Sambuc     UINT8                   Type;
558433d6423SLionel Sambuc     UINT8                   Length;
559433d6423SLionel Sambuc     UINT16                  ConfigWriteEnable;
560433d6423SLionel Sambuc     UINT32                  PollInterval;
561433d6423SLionel Sambuc     UINT32                  Vector;
562433d6423SLionel Sambuc     UINT32                  PollingThresholdValue;
563433d6423SLionel Sambuc     UINT32                  PollingThresholdWindow;
564433d6423SLionel Sambuc     UINT32                  ErrorThresholdValue;
565433d6423SLionel Sambuc     UINT32                  ErrorThresholdWindow;
566433d6423SLionel Sambuc 
567433d6423SLionel Sambuc } ACPI_HEST_NOTIFY;
568433d6423SLionel Sambuc 
569433d6423SLionel Sambuc /* Values for Notify Type field above */
570433d6423SLionel Sambuc 
571433d6423SLionel Sambuc enum AcpiHestNotifyTypes
572433d6423SLionel Sambuc {
573433d6423SLionel Sambuc     ACPI_HEST_NOTIFY_POLLED     = 0,
574433d6423SLionel Sambuc     ACPI_HEST_NOTIFY_EXTERNAL   = 1,
575433d6423SLionel Sambuc     ACPI_HEST_NOTIFY_LOCAL      = 2,
576433d6423SLionel Sambuc     ACPI_HEST_NOTIFY_SCI        = 3,
577433d6423SLionel Sambuc     ACPI_HEST_NOTIFY_NMI        = 4,
578*29492bb7SDavid van Moolenbroek     ACPI_HEST_NOTIFY_CMCI       = 5,    /* ACPI 5.0 */
579*29492bb7SDavid van Moolenbroek     ACPI_HEST_NOTIFY_MCE        = 6,    /* ACPI 5.0 */
580*29492bb7SDavid van Moolenbroek     ACPI_HEST_NOTIFY_RESERVED   = 7     /* 7 and greater are reserved */
581433d6423SLionel Sambuc };
582433d6423SLionel Sambuc 
583433d6423SLionel Sambuc /* Values for ConfigWriteEnable bitfield above */
584433d6423SLionel Sambuc 
585433d6423SLionel Sambuc #define ACPI_HEST_TYPE                  (1)
586433d6423SLionel Sambuc #define ACPI_HEST_POLL_INTERVAL         (1<<1)
587433d6423SLionel Sambuc #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
588433d6423SLionel Sambuc #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
589433d6423SLionel Sambuc #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
590433d6423SLionel Sambuc #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
591433d6423SLionel Sambuc 
592433d6423SLionel Sambuc 
593433d6423SLionel Sambuc /*
594433d6423SLionel Sambuc  * HEST subtables
595433d6423SLionel Sambuc  */
596433d6423SLionel Sambuc 
597433d6423SLionel Sambuc /* 0: IA32 Machine Check Exception */
598433d6423SLionel Sambuc 
599433d6423SLionel Sambuc typedef struct acpi_hest_ia_machine_check
600433d6423SLionel Sambuc {
601433d6423SLionel Sambuc     ACPI_HEST_HEADER        Header;
602433d6423SLionel Sambuc     UINT16                  Reserved1;
603433d6423SLionel Sambuc     UINT8                   Flags;
604433d6423SLionel Sambuc     UINT8                   Enabled;
605433d6423SLionel Sambuc     UINT32                  RecordsToPreallocate;
606433d6423SLionel Sambuc     UINT32                  MaxSectionsPerRecord;
607433d6423SLionel Sambuc     UINT64                  GlobalCapabilityData;
608433d6423SLionel Sambuc     UINT64                  GlobalControlData;
609433d6423SLionel Sambuc     UINT8                   NumHardwareBanks;
610433d6423SLionel Sambuc     UINT8                   Reserved3[7];
611433d6423SLionel Sambuc 
612433d6423SLionel Sambuc } ACPI_HEST_IA_MACHINE_CHECK;
613433d6423SLionel Sambuc 
614433d6423SLionel Sambuc 
615433d6423SLionel Sambuc /* 1: IA32 Corrected Machine Check */
616433d6423SLionel Sambuc 
617433d6423SLionel Sambuc typedef struct acpi_hest_ia_corrected
618433d6423SLionel Sambuc {
619433d6423SLionel Sambuc     ACPI_HEST_HEADER        Header;
620433d6423SLionel Sambuc     UINT16                  Reserved1;
621433d6423SLionel Sambuc     UINT8                   Flags;
622433d6423SLionel Sambuc     UINT8                   Enabled;
623433d6423SLionel Sambuc     UINT32                  RecordsToPreallocate;
624433d6423SLionel Sambuc     UINT32                  MaxSectionsPerRecord;
625433d6423SLionel Sambuc     ACPI_HEST_NOTIFY        Notify;
626433d6423SLionel Sambuc     UINT8                   NumHardwareBanks;
627433d6423SLionel Sambuc     UINT8                   Reserved2[3];
628433d6423SLionel Sambuc 
629433d6423SLionel Sambuc } ACPI_HEST_IA_CORRECTED;
630433d6423SLionel Sambuc 
631433d6423SLionel Sambuc 
632433d6423SLionel Sambuc /* 2: IA32 Non-Maskable Interrupt */
633433d6423SLionel Sambuc 
634433d6423SLionel Sambuc typedef struct acpi_hest_ia_nmi
635433d6423SLionel Sambuc {
636433d6423SLionel Sambuc     ACPI_HEST_HEADER        Header;
637433d6423SLionel Sambuc     UINT32                  Reserved;
638433d6423SLionel Sambuc     UINT32                  RecordsToPreallocate;
639433d6423SLionel Sambuc     UINT32                  MaxSectionsPerRecord;
640433d6423SLionel Sambuc     UINT32                  MaxRawDataLength;
641433d6423SLionel Sambuc 
642433d6423SLionel Sambuc } ACPI_HEST_IA_NMI;
643433d6423SLionel Sambuc 
644433d6423SLionel Sambuc 
645433d6423SLionel Sambuc /* 3,4,5: Not used */
646433d6423SLionel Sambuc 
647433d6423SLionel Sambuc /* 6: PCI Express Root Port AER */
648433d6423SLionel Sambuc 
649433d6423SLionel Sambuc typedef struct acpi_hest_aer_root
650433d6423SLionel Sambuc {
651433d6423SLionel Sambuc     ACPI_HEST_HEADER        Header;
652433d6423SLionel Sambuc     ACPI_HEST_AER_COMMON    Aer;
653433d6423SLionel Sambuc     UINT32                  RootErrorCommand;
654433d6423SLionel Sambuc 
655433d6423SLionel Sambuc } ACPI_HEST_AER_ROOT;
656433d6423SLionel Sambuc 
657433d6423SLionel Sambuc 
658433d6423SLionel Sambuc /* 7: PCI Express AER (AER Endpoint) */
659433d6423SLionel Sambuc 
660433d6423SLionel Sambuc typedef struct acpi_hest_aer
661433d6423SLionel Sambuc {
662433d6423SLionel Sambuc     ACPI_HEST_HEADER        Header;
663433d6423SLionel Sambuc     ACPI_HEST_AER_COMMON    Aer;
664433d6423SLionel Sambuc 
665433d6423SLionel Sambuc } ACPI_HEST_AER;
666433d6423SLionel Sambuc 
667433d6423SLionel Sambuc 
668433d6423SLionel Sambuc /* 8: PCI Express/PCI-X Bridge AER */
669433d6423SLionel Sambuc 
670433d6423SLionel Sambuc typedef struct acpi_hest_aer_bridge
671433d6423SLionel Sambuc {
672433d6423SLionel Sambuc     ACPI_HEST_HEADER        Header;
673433d6423SLionel Sambuc     ACPI_HEST_AER_COMMON    Aer;
674433d6423SLionel Sambuc     UINT32                  UncorrectableMask2;
675433d6423SLionel Sambuc     UINT32                  UncorrectableSeverity2;
676433d6423SLionel Sambuc     UINT32                  AdvancedCapabilities2;
677433d6423SLionel Sambuc 
678433d6423SLionel Sambuc } ACPI_HEST_AER_BRIDGE;
679433d6423SLionel Sambuc 
680433d6423SLionel Sambuc 
681433d6423SLionel Sambuc /* 9: Generic Hardware Error Source */
682433d6423SLionel Sambuc 
683433d6423SLionel Sambuc typedef struct acpi_hest_generic
684433d6423SLionel Sambuc {
685433d6423SLionel Sambuc     ACPI_HEST_HEADER        Header;
686433d6423SLionel Sambuc     UINT16                  RelatedSourceId;
687433d6423SLionel Sambuc     UINT8                   Reserved;
688433d6423SLionel Sambuc     UINT8                   Enabled;
689433d6423SLionel Sambuc     UINT32                  RecordsToPreallocate;
690433d6423SLionel Sambuc     UINT32                  MaxSectionsPerRecord;
691433d6423SLionel Sambuc     UINT32                  MaxRawDataLength;
692433d6423SLionel Sambuc     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
693433d6423SLionel Sambuc     ACPI_HEST_NOTIFY        Notify;
694433d6423SLionel Sambuc     UINT32                  ErrorBlockLength;
695433d6423SLionel Sambuc 
696433d6423SLionel Sambuc } ACPI_HEST_GENERIC;
697433d6423SLionel Sambuc 
698433d6423SLionel Sambuc 
699433d6423SLionel Sambuc /* Generic Error Status block */
700433d6423SLionel Sambuc 
701433d6423SLionel Sambuc typedef struct acpi_hest_generic_status
702433d6423SLionel Sambuc {
703433d6423SLionel Sambuc     UINT32                  BlockStatus;
704433d6423SLionel Sambuc     UINT32                  RawDataOffset;
705433d6423SLionel Sambuc     UINT32                  RawDataLength;
706433d6423SLionel Sambuc     UINT32                  DataLength;
707433d6423SLionel Sambuc     UINT32                  ErrorSeverity;
708433d6423SLionel Sambuc 
709433d6423SLionel Sambuc } ACPI_HEST_GENERIC_STATUS;
710433d6423SLionel Sambuc 
711433d6423SLionel Sambuc /* Values for BlockStatus flags above */
712433d6423SLionel Sambuc 
713433d6423SLionel Sambuc #define ACPI_HEST_UNCORRECTABLE             (1)
714433d6423SLionel Sambuc #define ACPI_HEST_CORRECTABLE               (1<<1)
715433d6423SLionel Sambuc #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
716433d6423SLionel Sambuc #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
717433d6423SLionel Sambuc #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
718433d6423SLionel Sambuc 
719433d6423SLionel Sambuc 
720433d6423SLionel Sambuc /* Generic Error Data entry */
721433d6423SLionel Sambuc 
722433d6423SLionel Sambuc typedef struct acpi_hest_generic_data
723433d6423SLionel Sambuc {
724433d6423SLionel Sambuc     UINT8                   SectionType[16];
725433d6423SLionel Sambuc     UINT32                  ErrorSeverity;
726433d6423SLionel Sambuc     UINT16                  Revision;
727433d6423SLionel Sambuc     UINT8                   ValidationBits;
728433d6423SLionel Sambuc     UINT8                   Flags;
729433d6423SLionel Sambuc     UINT32                  ErrorDataLength;
730433d6423SLionel Sambuc     UINT8                   FruId[16];
731433d6423SLionel Sambuc     UINT8                   FruText[20];
732433d6423SLionel Sambuc 
733433d6423SLionel Sambuc } ACPI_HEST_GENERIC_DATA;
734433d6423SLionel Sambuc 
735433d6423SLionel Sambuc 
736433d6423SLionel Sambuc /*******************************************************************************
737433d6423SLionel Sambuc  *
738433d6423SLionel Sambuc  * MADT - Multiple APIC Description Table
739433d6423SLionel Sambuc  *        Version 3
740433d6423SLionel Sambuc  *
741433d6423SLionel Sambuc  ******************************************************************************/
742433d6423SLionel Sambuc 
743433d6423SLionel Sambuc typedef struct acpi_table_madt
744433d6423SLionel Sambuc {
745433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
746433d6423SLionel Sambuc     UINT32                  Address;            /* Physical address of local APIC */
747433d6423SLionel Sambuc     UINT32                  Flags;
748433d6423SLionel Sambuc 
749433d6423SLionel Sambuc } ACPI_TABLE_MADT;
750433d6423SLionel Sambuc 
751433d6423SLionel Sambuc /* Masks for Flags field above */
752433d6423SLionel Sambuc 
753433d6423SLionel Sambuc #define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
754433d6423SLionel Sambuc 
755433d6423SLionel Sambuc /* Values for PCATCompat flag */
756433d6423SLionel Sambuc 
757433d6423SLionel Sambuc #define ACPI_MADT_DUAL_PIC          0
758433d6423SLionel Sambuc #define ACPI_MADT_MULTIPLE_APIC     1
759433d6423SLionel Sambuc 
760433d6423SLionel Sambuc 
761433d6423SLionel Sambuc /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
762433d6423SLionel Sambuc 
763433d6423SLionel Sambuc enum AcpiMadtType
764433d6423SLionel Sambuc {
765433d6423SLionel Sambuc     ACPI_MADT_TYPE_LOCAL_APIC               = 0,
766433d6423SLionel Sambuc     ACPI_MADT_TYPE_IO_APIC                  = 1,
767433d6423SLionel Sambuc     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
768433d6423SLionel Sambuc     ACPI_MADT_TYPE_NMI_SOURCE               = 3,
769433d6423SLionel Sambuc     ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
770433d6423SLionel Sambuc     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
771433d6423SLionel Sambuc     ACPI_MADT_TYPE_IO_SAPIC                 = 6,
772433d6423SLionel Sambuc     ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
773433d6423SLionel Sambuc     ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
774433d6423SLionel Sambuc     ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
775433d6423SLionel Sambuc     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
776*29492bb7SDavid van Moolenbroek     ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
777*29492bb7SDavid van Moolenbroek     ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
778*29492bb7SDavid van Moolenbroek     ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
779*29492bb7SDavid van Moolenbroek     ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
780*29492bb7SDavid van Moolenbroek     ACPI_MADT_TYPE_RESERVED                 = 15    /* 15 and greater are reserved */
781433d6423SLionel Sambuc };
782433d6423SLionel Sambuc 
783433d6423SLionel Sambuc 
784433d6423SLionel Sambuc /*
785*29492bb7SDavid van Moolenbroek  * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
786433d6423SLionel Sambuc  */
787433d6423SLionel Sambuc 
788433d6423SLionel Sambuc /* 0: Processor Local APIC */
789433d6423SLionel Sambuc 
790433d6423SLionel Sambuc typedef struct acpi_madt_local_apic
791433d6423SLionel Sambuc {
792433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
793433d6423SLionel Sambuc     UINT8                   ProcessorId;        /* ACPI processor id */
794433d6423SLionel Sambuc     UINT8                   Id;                 /* Processor's local APIC id */
795433d6423SLionel Sambuc     UINT32                  LapicFlags;
796433d6423SLionel Sambuc 
797433d6423SLionel Sambuc } ACPI_MADT_LOCAL_APIC;
798433d6423SLionel Sambuc 
799433d6423SLionel Sambuc 
800433d6423SLionel Sambuc /* 1: IO APIC */
801433d6423SLionel Sambuc 
802433d6423SLionel Sambuc typedef struct acpi_madt_io_apic
803433d6423SLionel Sambuc {
804433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
805433d6423SLionel Sambuc     UINT8                   Id;                 /* I/O APIC ID */
806433d6423SLionel Sambuc     UINT8                   Reserved;           /* Reserved - must be zero */
807433d6423SLionel Sambuc     UINT32                  Address;            /* APIC physical address */
808433d6423SLionel Sambuc     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
809433d6423SLionel Sambuc 
810433d6423SLionel Sambuc } ACPI_MADT_IO_APIC;
811433d6423SLionel Sambuc 
812433d6423SLionel Sambuc 
813433d6423SLionel Sambuc /* 2: Interrupt Override */
814433d6423SLionel Sambuc 
815433d6423SLionel Sambuc typedef struct acpi_madt_interrupt_override
816433d6423SLionel Sambuc {
817433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
818433d6423SLionel Sambuc     UINT8                   Bus;                /* 0 - ISA */
819433d6423SLionel Sambuc     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
820433d6423SLionel Sambuc     UINT32                  GlobalIrq;          /* Global system interrupt */
821433d6423SLionel Sambuc     UINT16                  IntiFlags;
822433d6423SLionel Sambuc 
823433d6423SLionel Sambuc } ACPI_MADT_INTERRUPT_OVERRIDE;
824433d6423SLionel Sambuc 
825433d6423SLionel Sambuc 
826433d6423SLionel Sambuc /* 3: NMI Source */
827433d6423SLionel Sambuc 
828433d6423SLionel Sambuc typedef struct acpi_madt_nmi_source
829433d6423SLionel Sambuc {
830433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
831433d6423SLionel Sambuc     UINT16                  IntiFlags;
832433d6423SLionel Sambuc     UINT32                  GlobalIrq;          /* Global system interrupt */
833433d6423SLionel Sambuc 
834433d6423SLionel Sambuc } ACPI_MADT_NMI_SOURCE;
835433d6423SLionel Sambuc 
836433d6423SLionel Sambuc 
837433d6423SLionel Sambuc /* 4: Local APIC NMI */
838433d6423SLionel Sambuc 
839433d6423SLionel Sambuc typedef struct acpi_madt_local_apic_nmi
840433d6423SLionel Sambuc {
841433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
842433d6423SLionel Sambuc     UINT8                   ProcessorId;        /* ACPI processor id */
843433d6423SLionel Sambuc     UINT16                  IntiFlags;
844433d6423SLionel Sambuc     UINT8                   Lint;               /* LINTn to which NMI is connected */
845433d6423SLionel Sambuc 
846433d6423SLionel Sambuc } ACPI_MADT_LOCAL_APIC_NMI;
847433d6423SLionel Sambuc 
848433d6423SLionel Sambuc 
849433d6423SLionel Sambuc /* 5: Address Override */
850433d6423SLionel Sambuc 
851433d6423SLionel Sambuc typedef struct acpi_madt_local_apic_override
852433d6423SLionel Sambuc {
853433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
854433d6423SLionel Sambuc     UINT16                  Reserved;           /* Reserved, must be zero */
855433d6423SLionel Sambuc     UINT64                  Address;            /* APIC physical address */
856433d6423SLionel Sambuc 
857433d6423SLionel Sambuc } ACPI_MADT_LOCAL_APIC_OVERRIDE;
858433d6423SLionel Sambuc 
859433d6423SLionel Sambuc 
860433d6423SLionel Sambuc /* 6: I/O Sapic */
861433d6423SLionel Sambuc 
862433d6423SLionel Sambuc typedef struct acpi_madt_io_sapic
863433d6423SLionel Sambuc {
864433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
865433d6423SLionel Sambuc     UINT8                   Id;                 /* I/O SAPIC ID */
866433d6423SLionel Sambuc     UINT8                   Reserved;           /* Reserved, must be zero */
867433d6423SLionel Sambuc     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
868433d6423SLionel Sambuc     UINT64                  Address;            /* SAPIC physical address */
869433d6423SLionel Sambuc 
870433d6423SLionel Sambuc } ACPI_MADT_IO_SAPIC;
871433d6423SLionel Sambuc 
872433d6423SLionel Sambuc 
873433d6423SLionel Sambuc /* 7: Local Sapic */
874433d6423SLionel Sambuc 
875433d6423SLionel Sambuc typedef struct acpi_madt_local_sapic
876433d6423SLionel Sambuc {
877433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
878433d6423SLionel Sambuc     UINT8                   ProcessorId;        /* ACPI processor id */
879433d6423SLionel Sambuc     UINT8                   Id;                 /* SAPIC ID */
880433d6423SLionel Sambuc     UINT8                   Eid;                /* SAPIC EID */
881433d6423SLionel Sambuc     UINT8                   Reserved[3];        /* Reserved, must be zero */
882433d6423SLionel Sambuc     UINT32                  LapicFlags;
883433d6423SLionel Sambuc     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
884433d6423SLionel Sambuc     char                    UidString[1];       /* String UID  - ACPI 3.0 */
885433d6423SLionel Sambuc 
886433d6423SLionel Sambuc } ACPI_MADT_LOCAL_SAPIC;
887433d6423SLionel Sambuc 
888433d6423SLionel Sambuc 
889433d6423SLionel Sambuc /* 8: Platform Interrupt Source */
890433d6423SLionel Sambuc 
891433d6423SLionel Sambuc typedef struct acpi_madt_interrupt_source
892433d6423SLionel Sambuc {
893433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
894433d6423SLionel Sambuc     UINT16                  IntiFlags;
895433d6423SLionel Sambuc     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
896433d6423SLionel Sambuc     UINT8                   Id;                 /* Processor ID */
897433d6423SLionel Sambuc     UINT8                   Eid;                /* Processor EID */
898433d6423SLionel Sambuc     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
899433d6423SLionel Sambuc     UINT32                  GlobalIrq;          /* Global system interrupt */
900433d6423SLionel Sambuc     UINT32                  Flags;              /* Interrupt Source Flags */
901433d6423SLionel Sambuc 
902433d6423SLionel Sambuc } ACPI_MADT_INTERRUPT_SOURCE;
903433d6423SLionel Sambuc 
904433d6423SLionel Sambuc /* Masks for Flags field above */
905433d6423SLionel Sambuc 
906433d6423SLionel Sambuc #define ACPI_MADT_CPEI_OVERRIDE     (1)
907433d6423SLionel Sambuc 
908433d6423SLionel Sambuc 
909433d6423SLionel Sambuc /* 9: Processor Local X2APIC (ACPI 4.0) */
910433d6423SLionel Sambuc 
911433d6423SLionel Sambuc typedef struct acpi_madt_local_x2apic
912433d6423SLionel Sambuc {
913433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
914433d6423SLionel Sambuc     UINT16                  Reserved;           /* Reserved - must be zero */
915433d6423SLionel Sambuc     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
916433d6423SLionel Sambuc     UINT32                  LapicFlags;
917433d6423SLionel Sambuc     UINT32                  Uid;                /* ACPI processor UID */
918433d6423SLionel Sambuc 
919433d6423SLionel Sambuc } ACPI_MADT_LOCAL_X2APIC;
920433d6423SLionel Sambuc 
921433d6423SLionel Sambuc 
922433d6423SLionel Sambuc /* 10: Local X2APIC NMI (ACPI 4.0) */
923433d6423SLionel Sambuc 
924433d6423SLionel Sambuc typedef struct acpi_madt_local_x2apic_nmi
925433d6423SLionel Sambuc {
926433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
927433d6423SLionel Sambuc     UINT16                  IntiFlags;
928433d6423SLionel Sambuc     UINT32                  Uid;                /* ACPI processor UID */
929433d6423SLionel Sambuc     UINT8                   Lint;               /* LINTn to which NMI is connected */
930433d6423SLionel Sambuc     UINT8                   Reserved[3];        /* Reserved - must be zero */
931433d6423SLionel Sambuc 
932433d6423SLionel Sambuc } ACPI_MADT_LOCAL_X2APIC_NMI;
933433d6423SLionel Sambuc 
934433d6423SLionel Sambuc 
935*29492bb7SDavid van Moolenbroek /* 11: Generic Interrupt (ACPI 5.0) */
936*29492bb7SDavid van Moolenbroek 
937*29492bb7SDavid van Moolenbroek typedef struct acpi_madt_generic_interrupt
938*29492bb7SDavid van Moolenbroek {
939*29492bb7SDavid van Moolenbroek     ACPI_SUBTABLE_HEADER    Header;
940*29492bb7SDavid van Moolenbroek     UINT16                  Reserved;           /* Reserved - must be zero */
941*29492bb7SDavid van Moolenbroek     UINT32                  CpuInterfaceNumber;
942*29492bb7SDavid van Moolenbroek     UINT32                  Uid;
943*29492bb7SDavid van Moolenbroek     UINT32                  Flags;
944*29492bb7SDavid van Moolenbroek     UINT32                  ParkingVersion;
945*29492bb7SDavid van Moolenbroek     UINT32                  PerformanceInterrupt;
946*29492bb7SDavid van Moolenbroek     UINT64                  ParkedAddress;
947*29492bb7SDavid van Moolenbroek     UINT64                  BaseAddress;
948*29492bb7SDavid van Moolenbroek     UINT64                  GicvBaseAddress;
949*29492bb7SDavid van Moolenbroek     UINT64                  GichBaseAddress;
950*29492bb7SDavid van Moolenbroek     UINT32                  VgicInterrupt;
951*29492bb7SDavid van Moolenbroek     UINT64                  GicrBaseAddress;
952*29492bb7SDavid van Moolenbroek     UINT64                  ArmMpidr;
953*29492bb7SDavid van Moolenbroek 
954*29492bb7SDavid van Moolenbroek } ACPI_MADT_GENERIC_INTERRUPT;
955*29492bb7SDavid van Moolenbroek 
956*29492bb7SDavid van Moolenbroek /* Masks for Flags field above */
957*29492bb7SDavid van Moolenbroek 
958*29492bb7SDavid van Moolenbroek /* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
959*29492bb7SDavid van Moolenbroek #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
960*29492bb7SDavid van Moolenbroek #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
961*29492bb7SDavid van Moolenbroek 
962*29492bb7SDavid van Moolenbroek 
963*29492bb7SDavid van Moolenbroek /* 12: Generic Distributor (ACPI 5.0) */
964*29492bb7SDavid van Moolenbroek 
965*29492bb7SDavid van Moolenbroek typedef struct acpi_madt_generic_distributor
966*29492bb7SDavid van Moolenbroek {
967*29492bb7SDavid van Moolenbroek     ACPI_SUBTABLE_HEADER    Header;
968*29492bb7SDavid van Moolenbroek     UINT16                  Reserved;           /* Reserved - must be zero */
969*29492bb7SDavid van Moolenbroek     UINT32                  GicId;
970*29492bb7SDavid van Moolenbroek     UINT64                  BaseAddress;
971*29492bb7SDavid van Moolenbroek     UINT32                  GlobalIrqBase;
972*29492bb7SDavid van Moolenbroek     UINT32                  Reserved2;          /* Reserved - must be zero */
973*29492bb7SDavid van Moolenbroek 
974*29492bb7SDavid van Moolenbroek } ACPI_MADT_GENERIC_DISTRIBUTOR;
975*29492bb7SDavid van Moolenbroek 
976*29492bb7SDavid van Moolenbroek 
977*29492bb7SDavid van Moolenbroek /* 13: Generic MSI Frame (ACPI 5.1) */
978*29492bb7SDavid van Moolenbroek 
979*29492bb7SDavid van Moolenbroek typedef struct acpi_madt_generic_msi_frame
980*29492bb7SDavid van Moolenbroek {
981*29492bb7SDavid van Moolenbroek     ACPI_SUBTABLE_HEADER    Header;
982*29492bb7SDavid van Moolenbroek     UINT16                  Reserved;           /* Reserved - must be zero */
983*29492bb7SDavid van Moolenbroek     UINT32                  MsiFrameId;
984*29492bb7SDavid van Moolenbroek     UINT64                  BaseAddress;
985*29492bb7SDavid van Moolenbroek     UINT32                  Flags;
986*29492bb7SDavid van Moolenbroek     UINT16                  SpiCount;
987*29492bb7SDavid van Moolenbroek     UINT16                  SpiBase;
988*29492bb7SDavid van Moolenbroek 
989*29492bb7SDavid van Moolenbroek } ACPI_MADT_GENERIC_MSI_FRAME;
990*29492bb7SDavid van Moolenbroek 
991*29492bb7SDavid van Moolenbroek /* Masks for Flags field above */
992*29492bb7SDavid van Moolenbroek 
993*29492bb7SDavid van Moolenbroek #define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
994*29492bb7SDavid van Moolenbroek 
995*29492bb7SDavid van Moolenbroek 
996*29492bb7SDavid van Moolenbroek /* 14: Generic Redistributor (ACPI 5.1) */
997*29492bb7SDavid van Moolenbroek 
998*29492bb7SDavid van Moolenbroek typedef struct acpi_madt_generic_redistributor
999*29492bb7SDavid van Moolenbroek {
1000*29492bb7SDavid van Moolenbroek     ACPI_SUBTABLE_HEADER    Header;
1001*29492bb7SDavid van Moolenbroek     UINT16                  Reserved;           /* reserved - must be zero */
1002*29492bb7SDavid van Moolenbroek     UINT64                  BaseAddress;
1003*29492bb7SDavid van Moolenbroek     UINT32                  Length;
1004*29492bb7SDavid van Moolenbroek 
1005*29492bb7SDavid van Moolenbroek } ACPI_MADT_GENERIC_REDISTRIBUTOR;
1006*29492bb7SDavid van Moolenbroek 
1007*29492bb7SDavid van Moolenbroek 
1008433d6423SLionel Sambuc /*
1009433d6423SLionel Sambuc  * Common flags fields for MADT subtables
1010433d6423SLionel Sambuc  */
1011433d6423SLionel Sambuc 
1012*29492bb7SDavid van Moolenbroek /* MADT Local APIC flags */
1013433d6423SLionel Sambuc 
1014433d6423SLionel Sambuc #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
1015433d6423SLionel Sambuc 
1016433d6423SLionel Sambuc /* MADT MPS INTI flags (IntiFlags) */
1017433d6423SLionel Sambuc 
1018433d6423SLionel Sambuc #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
1019433d6423SLionel Sambuc #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
1020433d6423SLionel Sambuc 
1021433d6423SLionel Sambuc /* Values for MPS INTI flags */
1022433d6423SLionel Sambuc 
1023433d6423SLionel Sambuc #define ACPI_MADT_POLARITY_CONFORMS       0
1024433d6423SLionel Sambuc #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
1025433d6423SLionel Sambuc #define ACPI_MADT_POLARITY_RESERVED       2
1026433d6423SLionel Sambuc #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
1027433d6423SLionel Sambuc 
1028433d6423SLionel Sambuc #define ACPI_MADT_TRIGGER_CONFORMS        (0)
1029433d6423SLionel Sambuc #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
1030433d6423SLionel Sambuc #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
1031433d6423SLionel Sambuc #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
1032433d6423SLionel Sambuc 
1033433d6423SLionel Sambuc 
1034433d6423SLionel Sambuc /*******************************************************************************
1035433d6423SLionel Sambuc  *
1036433d6423SLionel Sambuc  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
1037433d6423SLionel Sambuc  *        Version 1
1038433d6423SLionel Sambuc  *
1039433d6423SLionel Sambuc  ******************************************************************************/
1040433d6423SLionel Sambuc 
1041433d6423SLionel Sambuc typedef struct acpi_table_msct
1042433d6423SLionel Sambuc {
1043433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1044433d6423SLionel Sambuc     UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
1045433d6423SLionel Sambuc     UINT32                  MaxProximityDomains;/* Max number of proximity domains */
1046433d6423SLionel Sambuc     UINT32                  MaxClockDomains;    /* Max number of clock domains */
1047433d6423SLionel Sambuc     UINT64                  MaxAddress;         /* Max physical address in system */
1048433d6423SLionel Sambuc 
1049433d6423SLionel Sambuc } ACPI_TABLE_MSCT;
1050433d6423SLionel Sambuc 
1051433d6423SLionel Sambuc 
1052433d6423SLionel Sambuc /* Subtable - Maximum Proximity Domain Information. Version 1 */
1053433d6423SLionel Sambuc 
1054433d6423SLionel Sambuc typedef struct acpi_msct_proximity
1055433d6423SLionel Sambuc {
1056433d6423SLionel Sambuc     UINT8                   Revision;
1057433d6423SLionel Sambuc     UINT8                   Length;
1058433d6423SLionel Sambuc     UINT32                  RangeStart;         /* Start of domain range */
1059433d6423SLionel Sambuc     UINT32                  RangeEnd;           /* End of domain range */
1060433d6423SLionel Sambuc     UINT32                  ProcessorCapacity;
1061433d6423SLionel Sambuc     UINT64                  MemoryCapacity;     /* In bytes */
1062433d6423SLionel Sambuc 
1063433d6423SLionel Sambuc } ACPI_MSCT_PROXIMITY;
1064433d6423SLionel Sambuc 
1065433d6423SLionel Sambuc 
1066433d6423SLionel Sambuc /*******************************************************************************
1067433d6423SLionel Sambuc  *
1068433d6423SLionel Sambuc  * SBST - Smart Battery Specification Table
1069433d6423SLionel Sambuc  *        Version 1
1070433d6423SLionel Sambuc  *
1071433d6423SLionel Sambuc  ******************************************************************************/
1072433d6423SLionel Sambuc 
1073433d6423SLionel Sambuc typedef struct acpi_table_sbst
1074433d6423SLionel Sambuc {
1075433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1076433d6423SLionel Sambuc     UINT32                  WarningLevel;
1077433d6423SLionel Sambuc     UINT32                  LowLevel;
1078433d6423SLionel Sambuc     UINT32                  CriticalLevel;
1079433d6423SLionel Sambuc 
1080433d6423SLionel Sambuc } ACPI_TABLE_SBST;
1081433d6423SLionel Sambuc 
1082433d6423SLionel Sambuc 
1083433d6423SLionel Sambuc /*******************************************************************************
1084433d6423SLionel Sambuc  *
1085433d6423SLionel Sambuc  * SLIT - System Locality Distance Information Table
1086433d6423SLionel Sambuc  *        Version 1
1087433d6423SLionel Sambuc  *
1088433d6423SLionel Sambuc  ******************************************************************************/
1089433d6423SLionel Sambuc 
1090433d6423SLionel Sambuc typedef struct acpi_table_slit
1091433d6423SLionel Sambuc {
1092433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1093433d6423SLionel Sambuc     UINT64                  LocalityCount;
1094433d6423SLionel Sambuc     UINT8                   Entry[1];           /* Real size = localities^2 */
1095433d6423SLionel Sambuc 
1096433d6423SLionel Sambuc } ACPI_TABLE_SLIT;
1097433d6423SLionel Sambuc 
1098433d6423SLionel Sambuc 
1099433d6423SLionel Sambuc /*******************************************************************************
1100433d6423SLionel Sambuc  *
1101433d6423SLionel Sambuc  * SRAT - System Resource Affinity Table
1102433d6423SLionel Sambuc  *        Version 3
1103433d6423SLionel Sambuc  *
1104433d6423SLionel Sambuc  ******************************************************************************/
1105433d6423SLionel Sambuc 
1106433d6423SLionel Sambuc typedef struct acpi_table_srat
1107433d6423SLionel Sambuc {
1108433d6423SLionel Sambuc     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1109433d6423SLionel Sambuc     UINT32                  TableRevision;      /* Must be value '1' */
1110433d6423SLionel Sambuc     UINT64                  Reserved;           /* Reserved, must be zero */
1111433d6423SLionel Sambuc 
1112433d6423SLionel Sambuc } ACPI_TABLE_SRAT;
1113433d6423SLionel Sambuc 
1114433d6423SLionel Sambuc /* Values for subtable type in ACPI_SUBTABLE_HEADER */
1115433d6423SLionel Sambuc 
1116433d6423SLionel Sambuc enum AcpiSratType
1117433d6423SLionel Sambuc {
1118433d6423SLionel Sambuc     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
1119433d6423SLionel Sambuc     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
1120433d6423SLionel Sambuc     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
1121*29492bb7SDavid van Moolenbroek     ACPI_SRAT_TYPE_GICC_AFFINITY        = 3,
1122*29492bb7SDavid van Moolenbroek     ACPI_SRAT_TYPE_RESERVED             = 4     /* 4 and greater are reserved */
1123433d6423SLionel Sambuc };
1124433d6423SLionel Sambuc 
1125433d6423SLionel Sambuc /*
1126*29492bb7SDavid van Moolenbroek  * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
1127433d6423SLionel Sambuc  */
1128433d6423SLionel Sambuc 
1129433d6423SLionel Sambuc /* 0: Processor Local APIC/SAPIC Affinity */
1130433d6423SLionel Sambuc 
1131433d6423SLionel Sambuc typedef struct acpi_srat_cpu_affinity
1132433d6423SLionel Sambuc {
1133433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
1134433d6423SLionel Sambuc     UINT8                   ProximityDomainLo;
1135433d6423SLionel Sambuc     UINT8                   ApicId;
1136433d6423SLionel Sambuc     UINT32                  Flags;
1137433d6423SLionel Sambuc     UINT8                   LocalSapicEid;
1138433d6423SLionel Sambuc     UINT8                   ProximityDomainHi[3];
1139*29492bb7SDavid van Moolenbroek     UINT32                  ClockDomain;
1140433d6423SLionel Sambuc 
1141433d6423SLionel Sambuc } ACPI_SRAT_CPU_AFFINITY;
1142433d6423SLionel Sambuc 
1143433d6423SLionel Sambuc /* Flags */
1144433d6423SLionel Sambuc 
1145433d6423SLionel Sambuc #define ACPI_SRAT_CPU_USE_AFFINITY  (1)         /* 00: Use affinity structure */
1146433d6423SLionel Sambuc 
1147433d6423SLionel Sambuc 
1148433d6423SLionel Sambuc /* 1: Memory Affinity */
1149433d6423SLionel Sambuc 
1150433d6423SLionel Sambuc typedef struct acpi_srat_mem_affinity
1151433d6423SLionel Sambuc {
1152433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
1153433d6423SLionel Sambuc     UINT32                  ProximityDomain;
1154433d6423SLionel Sambuc     UINT16                  Reserved;           /* Reserved, must be zero */
1155433d6423SLionel Sambuc     UINT64                  BaseAddress;
1156433d6423SLionel Sambuc     UINT64                  Length;
1157433d6423SLionel Sambuc     UINT32                  Reserved1;
1158433d6423SLionel Sambuc     UINT32                  Flags;
1159433d6423SLionel Sambuc     UINT64                  Reserved2;          /* Reserved, must be zero */
1160433d6423SLionel Sambuc 
1161433d6423SLionel Sambuc } ACPI_SRAT_MEM_AFFINITY;
1162433d6423SLionel Sambuc 
1163433d6423SLionel Sambuc /* Flags */
1164433d6423SLionel Sambuc 
1165433d6423SLionel Sambuc #define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
1166433d6423SLionel Sambuc #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
1167433d6423SLionel Sambuc #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
1168433d6423SLionel Sambuc 
1169433d6423SLionel Sambuc 
1170433d6423SLionel Sambuc /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
1171433d6423SLionel Sambuc 
1172433d6423SLionel Sambuc typedef struct acpi_srat_x2apic_cpu_affinity
1173433d6423SLionel Sambuc {
1174433d6423SLionel Sambuc     ACPI_SUBTABLE_HEADER    Header;
1175433d6423SLionel Sambuc     UINT16                  Reserved;           /* Reserved, must be zero */
1176433d6423SLionel Sambuc     UINT32                  ProximityDomain;
1177433d6423SLionel Sambuc     UINT32                  ApicId;
1178433d6423SLionel Sambuc     UINT32                  Flags;
1179433d6423SLionel Sambuc     UINT32                  ClockDomain;
1180433d6423SLionel Sambuc     UINT32                  Reserved2;
1181433d6423SLionel Sambuc 
1182433d6423SLionel Sambuc } ACPI_SRAT_X2APIC_CPU_AFFINITY;
1183433d6423SLionel Sambuc 
1184433d6423SLionel Sambuc /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
1185433d6423SLionel Sambuc 
1186433d6423SLionel Sambuc #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
1187433d6423SLionel Sambuc 
1188433d6423SLionel Sambuc 
1189*29492bb7SDavid van Moolenbroek /* 3: GICC Affinity (ACPI 5.1) */
1190*29492bb7SDavid van Moolenbroek 
1191*29492bb7SDavid van Moolenbroek typedef struct acpi_srat_gicc_affinity
1192*29492bb7SDavid van Moolenbroek {
1193*29492bb7SDavid van Moolenbroek     ACPI_SUBTABLE_HEADER    Header;
1194*29492bb7SDavid van Moolenbroek     UINT32                  ProximityDomain;
1195*29492bb7SDavid van Moolenbroek     UINT32                  AcpiProcessorUid;
1196*29492bb7SDavid van Moolenbroek     UINT32                  Flags;
1197*29492bb7SDavid van Moolenbroek     UINT32                  ClockDomain;
1198*29492bb7SDavid van Moolenbroek 
1199*29492bb7SDavid van Moolenbroek } ACPI_SRAT_GICC_AFFINITY;
1200*29492bb7SDavid van Moolenbroek 
1201*29492bb7SDavid van Moolenbroek /* Flags for ACPI_SRAT_GICC_AFFINITY */
1202*29492bb7SDavid van Moolenbroek 
1203*29492bb7SDavid van Moolenbroek #define ACPI_SRAT_GICC_ENABLED     (1)         /* 00: Use affinity structure */
1204*29492bb7SDavid van Moolenbroek 
1205433d6423SLionel Sambuc /* Reset to default packing */
1206433d6423SLionel Sambuc 
1207433d6423SLionel Sambuc #pragma pack()
1208433d6423SLionel Sambuc 
1209433d6423SLionel Sambuc #endif /* __ACTBL1_H__ */
1210