Merge branch 'acpi-config' into acpica
[linux-2.6-block.git] / include / acpi / actbl1.h
CommitLineData
1da177e4
LT
1/******************************************************************************
2 *
793c2388 3 * Name: actbl1.h - Additional ACPI table definitions
1da177e4
LT
4 *
5 *****************************************************************************/
6
7/*
fbb7a2dc 8 * Copyright (C) 2000 - 2014, Intel Corp.
1da177e4
LT
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACTBL1_H__
45#define __ACTBL1_H__
46
4ac4c5fa
BM
47#pragma pack(push) /* Set default struct packing */
48
793c2388
BM
49/*******************************************************************************
50 *
b24aad44 51 * Additional ACPI Tables (1)
793c2388
BM
52 *
53 * These tables are not consumed directly by the ACPICA subsystem, but are
54 * included here to support device drivers and the AML disassembler.
55 *
b24aad44
BM
56 * The tables in this file are fully defined within the ACPI specification.
57 *
793c2388
BM
58 ******************************************************************************/
59
60/*
6e2d5ebd
BM
61 * Values for description table header signatures for tables defined in this
62 * file. Useful because they make it more difficult to inadvertently type in
63 * the wrong signature.
793c2388 64 */
970d9c9e 65#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
793c2388 66#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
793c2388 67#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
970d9c9e
BM
68#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
69#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
70#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
793c2388 71#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
6e2d5ebd 72#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
793c2388
BM
73#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
74#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
793c2388 75#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
793c2388 76
793c2388
BM
77/*
78 * All tables must be byte-packed to match the ACPI specification, since
79 * the tables are provided by the system BIOS.
80 */
1da177e4
LT
81#pragma pack(1)
82
83/*
be030a57
BM
84 * Note: C bitfields are not used for this reason:
85 *
86 * "Bitfields are great and easy to read, but unfortunately the C language
87 * does not specify the layout of bitfields in memory, which means they are
88 * essentially useless for dealing with packed data in on-disk formats or
89 * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
90 * this decision was a design error in C. Ritchie could have picked an order
91 * and stuck with it." Norman Ramsey.
92 * See http://stackoverflow.com/a/1053662/41661
1da177e4 93 */
793c2388 94
6e2d5ebd
BM
95/*******************************************************************************
96 *
97 * Common subtable headers
98 *
99 ******************************************************************************/
100
101/* Generic subtable header (used in MADT, SRAT, etc.) */
f3d2e786
BM
102
103struct acpi_subtable_header {
104 u8 type;
105 u8 length;
106};
107
6e2d5ebd 108/* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
970d9c9e
BM
109
110struct acpi_whea_header {
111 u8 action;
112 u8 instruction;
113 u8 flags;
114 u8 reserved;
115 struct acpi_generic_address register_region;
3fa34777
BM
116 u64 value; /* Value used with Read/Write register */
117 u64 mask; /* Bitmask required for this register instruction */
970d9c9e
BM
118};
119
970d9c9e
BM
120/*******************************************************************************
121 *
6e2d5ebd
BM
122 * BERT - Boot Error Record Table (ACPI 4.0)
123 * Version 1
970d9c9e
BM
124 *
125 ******************************************************************************/
126
127struct acpi_table_bert {
128 struct acpi_table_header header; /* Common ACPI table header */
129 u32 region_length; /* Length of the boot error region */
b595076a 130 u64 address; /* Physical address of the error region */
970d9c9e
BM
131};
132
6e2d5ebd 133/* Boot Error Region (not a subtable, pointed to by Address field above) */
3fa34777 134
970d9c9e 135struct acpi_bert_region {
6e2d5ebd
BM
136 u32 block_status; /* Type of error information */
137 u32 raw_data_offset; /* Offset to raw error data */
138 u32 raw_data_length; /* Length of raw error data */
139 u32 data_length; /* Length of generic error data */
140 u32 error_severity; /* Severity code */
970d9c9e
BM
141};
142
6e2d5ebd 143/* Values for block_status flags above */
970d9c9e
BM
144
145#define ACPI_BERT_UNCORRECTABLE (1)
6e2d5ebd
BM
146#define ACPI_BERT_CORRECTABLE (1<<1)
147#define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2)
148#define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3)
149#define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
150
151/* Values for error_severity above */
152
153enum acpi_bert_error_severity {
154 ACPI_BERT_ERROR_CORRECTABLE = 0,
155 ACPI_BERT_ERROR_FATAL = 1,
156 ACPI_BERT_ERROR_CORRECTED = 2,
157 ACPI_BERT_ERROR_NONE = 3,
158 ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */
159};
160
161/*
162 * Note: The generic error data that follows the error_severity field above
163 * uses the struct acpi_hest_generic_data defined under the HEST table below
164 */
970d9c9e 165
793c2388
BM
166/*******************************************************************************
167 *
6e2d5ebd
BM
168 * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
169 * Version 1
793c2388
BM
170 *
171 ******************************************************************************/
172
173struct acpi_table_cpep {
f3d2e786
BM
174 struct acpi_table_header header; /* Common ACPI table header */
175 u64 reserved;
793c2388
BM
176};
177
178/* Subtable */
179
180struct acpi_cpep_polling {
6e2d5ebd 181 struct acpi_subtable_header header;
f3d2e786
BM
182 u8 id; /* Processor ID */
183 u8 eid; /* Processor EID */
184 u32 interval; /* Polling interval (msec) */
793c2388
BM
185};
186
793c2388
BM
187/*******************************************************************************
188 *
189 * ECDT - Embedded Controller Boot Resources Table
6e2d5ebd 190 * Version 1
793c2388
BM
191 *
192 ******************************************************************************/
193
f3d2e786
BM
194struct acpi_table_ecdt {
195 struct acpi_table_header header; /* Common ACPI table header */
196 struct acpi_generic_address control; /* Address of EC command/status register */
197 struct acpi_generic_address data; /* Address of EC data register */
793c2388 198 u32 uid; /* Unique ID - must be same as the EC _UID method */
f3d2e786
BM
199 u8 gpe; /* The GPE for the EC */
200 u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
793c2388
BM
201};
202
970d9c9e
BM
203/*******************************************************************************
204 *
6e2d5ebd
BM
205 * EINJ - Error Injection Table (ACPI 4.0)
206 * Version 1
970d9c9e
BM
207 *
208 ******************************************************************************/
209
210struct acpi_table_einj {
211 struct acpi_table_header header; /* Common ACPI table header */
212 u32 header_length;
6e2d5ebd
BM
213 u8 flags;
214 u8 reserved[3];
970d9c9e
BM
215 u32 entries;
216};
217
218/* EINJ Injection Instruction Entries (actions) */
219
220struct acpi_einj_entry {
221 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
222};
223
6e2d5ebd
BM
224/* Masks for Flags field above */
225
226#define ACPI_EINJ_PRESERVE (1)
227
970d9c9e
BM
228/* Values for Action field above */
229
230enum acpi_einj_actions {
231 ACPI_EINJ_BEGIN_OPERATION = 0,
232 ACPI_EINJ_GET_TRIGGER_TABLE = 1,
233 ACPI_EINJ_SET_ERROR_TYPE = 2,
234 ACPI_EINJ_GET_ERROR_TYPE = 3,
235 ACPI_EINJ_END_OPERATION = 4,
236 ACPI_EINJ_EXECUTE_OPERATION = 5,
237 ACPI_EINJ_CHECK_BUSY_STATUS = 6,
238 ACPI_EINJ_GET_COMMAND_STATUS = 7,
c5bd6537
BM
239 ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
240 ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */
970d9c9e
BM
241 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
242};
243
244/* Values for Instruction field above */
245
246enum acpi_einj_instructions {
247 ACPI_EINJ_READ_REGISTER = 0,
248 ACPI_EINJ_READ_REGISTER_VALUE = 1,
249 ACPI_EINJ_WRITE_REGISTER = 2,
250 ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
251 ACPI_EINJ_NOOP = 4,
c5bd6537
BM
252 ACPI_EINJ_FLUSH_CACHELINE = 5,
253 ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
254};
255
256struct acpi_einj_error_type_with_addr {
257 u32 error_type;
258 u32 vendor_struct_offset;
259 u32 flags;
260 u32 apic_id;
261 u64 address;
262 u64 range;
263 u32 pcie_id;
264};
265
266struct acpi_einj_vendor {
267 u32 length;
268 u32 pcie_id;
269 u16 vendor_id;
270 u16 device_id;
271 u8 revision_id;
272 u8 reserved[3];
970d9c9e
BM
273};
274
3fa34777
BM
275/* EINJ Trigger Error Action Table */
276
277struct acpi_einj_trigger {
278 u32 header_size;
279 u32 revision;
280 u32 table_size;
281 u32 entry_count;
282};
283
6e2d5ebd
BM
284/* Command status return values */
285
286enum acpi_einj_command_status {
287 ACPI_EINJ_SUCCESS = 0,
288 ACPI_EINJ_FAILURE = 1,
289 ACPI_EINJ_INVALID_ACCESS = 2,
290 ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
291};
292
293/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
294
295#define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
296#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
297#define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
298#define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
299#define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
300#define ACPI_EINJ_MEMORY_FATAL (1<<5)
301#define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
302#define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
303#define ACPI_EINJ_PCIX_FATAL (1<<8)
304#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
305#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
306#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
c5bd6537 307#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
6e2d5ebd 308
970d9c9e
BM
309/*******************************************************************************
310 *
6e2d5ebd
BM
311 * ERST - Error Record Serialization Table (ACPI 4.0)
312 * Version 1
970d9c9e
BM
313 *
314 ******************************************************************************/
315
316struct acpi_table_erst {
317 struct acpi_table_header header; /* Common ACPI table header */
318 u32 header_length;
319 u32 reserved;
320 u32 entries;
321};
322
323/* ERST Serialization Entries (actions) */
324
325struct acpi_erst_entry {
326 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
327};
328
6e2d5ebd
BM
329/* Masks for Flags field above */
330
331#define ACPI_ERST_PRESERVE (1)
332
970d9c9e
BM
333/* Values for Action field above */
334
335enum acpi_erst_actions {
6e2d5ebd
BM
336 ACPI_ERST_BEGIN_WRITE = 0,
337 ACPI_ERST_BEGIN_READ = 1,
338 ACPI_ERST_BEGIN_CLEAR = 2,
339 ACPI_ERST_END = 3,
970d9c9e
BM
340 ACPI_ERST_SET_RECORD_OFFSET = 4,
341 ACPI_ERST_EXECUTE_OPERATION = 5,
342 ACPI_ERST_CHECK_BUSY_STATUS = 6,
343 ACPI_ERST_GET_COMMAND_STATUS = 7,
6e2d5ebd
BM
344 ACPI_ERST_GET_RECORD_ID = 8,
345 ACPI_ERST_SET_RECORD_ID = 9,
970d9c9e
BM
346 ACPI_ERST_GET_RECORD_COUNT = 10,
347 ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
348 ACPI_ERST_NOT_USED = 12,
349 ACPI_ERST_GET_ERROR_RANGE = 13,
350 ACPI_ERST_GET_ERROR_LENGTH = 14,
351 ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
352 ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */
353};
354
355/* Values for Instruction field above */
356
357enum acpi_erst_instructions {
358 ACPI_ERST_READ_REGISTER = 0,
359 ACPI_ERST_READ_REGISTER_VALUE = 1,
360 ACPI_ERST_WRITE_REGISTER = 2,
361 ACPI_ERST_WRITE_REGISTER_VALUE = 3,
362 ACPI_ERST_NOOP = 4,
363 ACPI_ERST_LOAD_VAR1 = 5,
364 ACPI_ERST_LOAD_VAR2 = 6,
365 ACPI_ERST_STORE_VAR1 = 7,
366 ACPI_ERST_ADD = 8,
367 ACPI_ERST_SUBTRACT = 9,
368 ACPI_ERST_ADD_VALUE = 10,
369 ACPI_ERST_SUBTRACT_VALUE = 11,
370 ACPI_ERST_STALL = 12,
371 ACPI_ERST_STALL_WHILE_TRUE = 13,
372 ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
373 ACPI_ERST_GOTO = 15,
374 ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
375 ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
376 ACPI_ERST_MOVE_DATA = 18,
377 ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
378};
379
6e2d5ebd
BM
380/* Command status return values */
381
382enum acpi_erst_command_status {
383 ACPI_ERST_SUCESS = 0,
384 ACPI_ERST_NO_SPACE = 1,
385 ACPI_ERST_NOT_AVAILABLE = 2,
386 ACPI_ERST_FAILURE = 3,
387 ACPI_ERST_RECORD_EMPTY = 4,
388 ACPI_ERST_NOT_FOUND = 5,
389 ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
390};
391
392/* Error Record Serialization Information */
393
394struct acpi_erst_info {
395 u16 signature; /* Should be "ER" */
396 u8 data[48];
397};
398
970d9c9e
BM
399/*******************************************************************************
400 *
6e2d5ebd
BM
401 * HEST - Hardware Error Source Table (ACPI 4.0)
402 * Version 1
970d9c9e
BM
403 *
404 ******************************************************************************/
405
406struct acpi_table_hest {
407 struct acpi_table_header header; /* Common ACPI table header */
408 u32 error_source_count;
409};
410
3fa34777
BM
411/* HEST subtable header */
412
413struct acpi_hest_header {
414 u16 type;
6e2d5ebd 415 u16 source_id;
3fa34777
BM
416};
417
418/* Values for Type field above for subtables */
419
420enum acpi_hest_types {
6e2d5ebd
BM
421 ACPI_HEST_TYPE_IA32_CHECK = 0,
422 ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
423 ACPI_HEST_TYPE_IA32_NMI = 2,
424 ACPI_HEST_TYPE_NOT_USED3 = 3,
425 ACPI_HEST_TYPE_NOT_USED4 = 4,
426 ACPI_HEST_TYPE_NOT_USED5 = 5,
3fa34777
BM
427 ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
428 ACPI_HEST_TYPE_AER_ENDPOINT = 7,
429 ACPI_HEST_TYPE_AER_BRIDGE = 8,
6e2d5ebd 430 ACPI_HEST_TYPE_GENERIC_ERROR = 9,
3fa34777
BM
431 ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */
432};
433
434/*
6e2d5ebd 435 * HEST substructures contained in subtables
3fa34777
BM
436 */
437
6e2d5ebd
BM
438/*
439 * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
440 * struct acpi_hest_ia_corrected structures.
441 */
442struct acpi_hest_ia_error_bank {
3fa34777
BM
443 u8 bank_number;
444 u8 clear_status_on_init;
445 u8 status_format;
6e2d5ebd 446 u8 reserved;
3fa34777 447 u32 control_register;
6e2d5ebd 448 u64 control_data;
3fa34777
BM
449 u32 status_register;
450 u32 address_register;
451 u32 misc_register;
452};
453
6e2d5ebd 454/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
3fa34777
BM
455
456struct acpi_hest_aer_common {
6e2d5ebd 457 u16 reserved1;
3fa34777
BM
458 u8 flags;
459 u8 enabled;
c276e388 460 u32 records_to_preallocate;
3fa34777 461 u32 max_sections_per_record;
4059a310 462 u32 bus; /* Bus and Segment numbers */
3fa34777
BM
463 u16 device;
464 u16 function;
465 u16 device_control;
6e2d5ebd 466 u16 reserved2;
c276e388
BM
467 u32 uncorrectable_mask;
468 u32 uncorrectable_severity;
469 u32 correctable_mask;
470 u32 advanced_capabilities;
3fa34777
BM
471};
472
6e2d5ebd
BM
473/* Masks for HEST Flags fields */
474
475#define ACPI_HEST_FIRMWARE_FIRST (1)
476#define ACPI_HEST_GLOBAL (1<<1)
477
4059a310
BD
478/*
479 * Macros to access the bus/segment numbers in Bus field above:
480 * Bus number is encoded in bits 7:0
481 * Segment number is encoded in bits 23:8
482 */
483#define ACPI_HEST_BUS(bus) ((bus) & 0xFF)
484#define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF)
485
3fa34777
BM
486/* Hardware Error Notification */
487
488struct acpi_hest_notify {
489 u8 type;
490 u8 length;
491 u16 config_write_enable;
492 u32 poll_interval;
493 u32 vector;
494 u32 polling_threshold_value;
495 u32 polling_threshold_window;
496 u32 error_threshold_value;
497 u32 error_threshold_window;
498};
499
500/* Values for Notify Type field above */
501
502enum acpi_hest_notify_types {
503 ACPI_HEST_NOTIFY_POLLED = 0,
504 ACPI_HEST_NOTIFY_EXTERNAL = 1,
505 ACPI_HEST_NOTIFY_LOCAL = 2,
506 ACPI_HEST_NOTIFY_SCI = 3,
507 ACPI_HEST_NOTIFY_NMI = 4,
ca4a0314
BM
508 ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
509 ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
510 ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */
3fa34777
BM
511};
512
6e2d5ebd
BM
513/* Values for config_write_enable bitfield above */
514
515#define ACPI_HEST_TYPE (1)
516#define ACPI_HEST_POLL_INTERVAL (1<<1)
517#define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
518#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
519#define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
520#define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
521
3fa34777
BM
522/*
523 * HEST subtables
3fa34777
BM
524 */
525
6e2d5ebd 526/* 0: IA32 Machine Check Exception */
3fa34777 527
6e2d5ebd 528struct acpi_hest_ia_machine_check {
3fa34777 529 struct acpi_hest_header header;
6e2d5ebd 530 u16 reserved1;
3fa34777 531 u8 flags;
6e2d5ebd 532 u8 enabled;
c276e388 533 u32 records_to_preallocate;
3fa34777
BM
534 u32 max_sections_per_record;
535 u64 global_capability_data;
536 u64 global_control_data;
537 u8 num_hardware_banks;
6e2d5ebd 538 u8 reserved3[7];
3fa34777
BM
539};
540
6e2d5ebd 541/* 1: IA32 Corrected Machine Check */
3fa34777 542
1872bbc9 543struct acpi_hest_ia_corrected {
3fa34777 544 struct acpi_hest_header header;
6e2d5ebd 545 u16 reserved1;
3fa34777
BM
546 u8 flags;
547 u8 enabled;
c276e388 548 u32 records_to_preallocate;
3fa34777
BM
549 u32 max_sections_per_record;
550 struct acpi_hest_notify notify;
551 u8 num_hardware_banks;
6e2d5ebd 552 u8 reserved2[3];
3fa34777
BM
553};
554
6e2d5ebd 555/* 2: IA32 Non-Maskable Interrupt */
3fa34777 556
6e2d5ebd 557struct acpi_hest_ia_nmi {
3fa34777 558 struct acpi_hest_header header;
3fa34777 559 u32 reserved;
c276e388 560 u32 records_to_preallocate;
3fa34777
BM
561 u32 max_sections_per_record;
562 u32 max_raw_data_length;
563};
564
6e2d5ebd 565/* 3,4,5: Not used */
3fa34777
BM
566
567/* 6: PCI Express Root Port AER */
568
569struct acpi_hest_aer_root {
570 struct acpi_hest_header header;
571 struct acpi_hest_aer_common aer;
572 u32 root_error_command;
573};
574
575/* 7: PCI Express AER (AER Endpoint) */
576
577struct acpi_hest_aer {
578 struct acpi_hest_header header;
579 struct acpi_hest_aer_common aer;
580};
581
582/* 8: PCI Express/PCI-X Bridge AER */
583
584struct acpi_hest_aer_bridge {
585 struct acpi_hest_header header;
586 struct acpi_hest_aer_common aer;
c276e388
BM
587 u32 uncorrectable_mask2;
588 u32 uncorrectable_severity2;
589 u32 advanced_capabilities2;
3fa34777
BM
590};
591
592/* 9: Generic Hardware Error Source */
593
594struct acpi_hest_generic {
595 struct acpi_hest_header header;
3fa34777 596 u16 related_source_id;
6e2d5ebd 597 u8 reserved;
3fa34777 598 u8 enabled;
c276e388 599 u32 records_to_preallocate;
3fa34777
BM
600 u32 max_sections_per_record;
601 u32 max_raw_data_length;
602 struct acpi_generic_address error_status_address;
603 struct acpi_hest_notify notify;
6e2d5ebd
BM
604 u32 error_block_length;
605};
606
607/* Generic Error Status block */
608
88f074f4 609struct acpi_generic_status {
6e2d5ebd
BM
610 u32 block_status;
611 u32 raw_data_offset;
612 u32 raw_data_length;
613 u32 data_length;
614 u32 error_severity;
615};
616
617/* Values for block_status flags above */
618
88f074f4
CG
619#define ACPI_GEN_ERR_UC BIT(0)
620#define ACPI_GEN_ERR_CE BIT(1)
621#define ACPI_GEN_ERR_MULTI_UC BIT(2)
622#define ACPI_GEN_ERR_MULTI_CE BIT(3)
623#define ACPI_GEN_ERR_COUNT_SHIFT (0xFF<<4) /* 8 bits, error count */
6e2d5ebd
BM
624
625/* Generic Error Data entry */
626
88f074f4 627struct acpi_generic_data {
6e2d5ebd
BM
628 u8 section_type[16];
629 u32 error_severity;
630 u16 revision;
631 u8 validation_bits;
632 u8 flags;
633 u32 error_data_length;
634 u8 fru_id[16];
635 u8 fru_text[20];
3fa34777 636};
970d9c9e 637
793c2388
BM
638/*******************************************************************************
639 *
640 * MADT - Multiple APIC Description Table
6e2d5ebd 641 * Version 3
793c2388
BM
642 *
643 ******************************************************************************/
644
f3d2e786
BM
645struct acpi_table_madt {
646 struct acpi_table_header header; /* Common ACPI table header */
647 u32 address; /* Physical address of local APIC */
648 u32 flags;
1da177e4
LT
649};
650
6e2d5ebd 651/* Masks for Flags field above */
793c2388 652
6e2d5ebd 653#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
793c2388 654
f3d2e786 655/* Values for PCATCompat flag */
793c2388 656
f3d2e786
BM
657#define ACPI_MADT_DUAL_PIC 0
658#define ACPI_MADT_MULTIPLE_APIC 1
793c2388 659
6e2d5ebd 660/* Values for MADT subtable type in struct acpi_subtable_header */
793c2388 661
f3d2e786
BM
662enum acpi_madt_type {
663 ACPI_MADT_TYPE_LOCAL_APIC = 0,
664 ACPI_MADT_TYPE_IO_APIC = 1,
665 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
666 ACPI_MADT_TYPE_NMI_SOURCE = 3,
667 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
668 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
669 ACPI_MADT_TYPE_IO_SAPIC = 6,
670 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
671 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
1d7cc030
BM
672 ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
673 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
c5bd6537
BM
674 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
675 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
676 ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
f3d2e786 677};
793c2388 678
1da177e4 679/*
f3d2e786 680 * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
1da177e4 681 */
793c2388 682
f3d2e786 683/* 0: Processor Local APIC */
793c2388 684
f3d2e786
BM
685struct acpi_madt_local_apic {
686 struct acpi_subtable_header header;
687 u8 processor_id; /* ACPI processor id */
688 u8 id; /* Processor's local APIC id */
689 u32 lapic_flags;
690};
793c2388
BM
691
692/* 1: IO APIC */
693
f3d2e786
BM
694struct acpi_madt_io_apic {
695 struct acpi_subtable_header header;
696 u8 id; /* I/O APIC ID */
ba494bee 697 u8 reserved; /* reserved - must be zero */
793c2388 698 u32 address; /* APIC physical address */
f3d2e786 699 u32 global_irq_base; /* Global system interrupt where INTI lines start */
793c2388
BM
700};
701
702/* 2: Interrupt Override */
703
f3d2e786
BM
704struct acpi_madt_interrupt_override {
705 struct acpi_subtable_header header;
706 u8 bus; /* 0 - ISA */
707 u8 source_irq; /* Interrupt source (IRQ) */
708 u32 global_irq; /* Global system interrupt */
709 u16 inti_flags;
710};
793c2388 711
f3d2e786 712/* 3: NMI Source */
793c2388 713
f3d2e786
BM
714struct acpi_madt_nmi_source {
715 struct acpi_subtable_header header;
716 u16 inti_flags;
717 u32 global_irq; /* Global system interrupt */
793c2388
BM
718};
719
720/* 4: Local APIC NMI */
721
f3d2e786
BM
722struct acpi_madt_local_apic_nmi {
723 struct acpi_subtable_header header;
724 u8 processor_id; /* ACPI processor id */
725 u16 inti_flags;
726 u8 lint; /* LINTn to which NMI is connected */
793c2388
BM
727};
728
729/* 5: Address Override */
730
f3d2e786
BM
731struct acpi_madt_local_apic_override {
732 struct acpi_subtable_header header;
733 u16 reserved; /* Reserved, must be zero */
793c2388
BM
734 u64 address; /* APIC physical address */
735};
736
737/* 6: I/O Sapic */
738
f3d2e786
BM
739struct acpi_madt_io_sapic {
740 struct acpi_subtable_header header;
741 u8 id; /* I/O SAPIC ID */
793c2388 742 u8 reserved; /* Reserved, must be zero */
f3d2e786 743 u32 global_irq_base; /* Global interrupt for SAPIC start */
793c2388
BM
744 u64 address; /* SAPIC physical address */
745};
746
747/* 7: Local Sapic */
748
f3d2e786
BM
749struct acpi_madt_local_sapic {
750 struct acpi_subtable_header header;
751 u8 processor_id; /* ACPI processor id */
752 u8 id; /* SAPIC ID */
753 u8 eid; /* SAPIC EID */
793c2388 754 u8 reserved[3]; /* Reserved, must be zero */
f3d2e786
BM
755 u32 lapic_flags;
756 u32 uid; /* Numeric UID - ACPI 3.0 */
757 char uid_string[1]; /* String UID - ACPI 3.0 */
793c2388
BM
758};
759
760/* 8: Platform Interrupt Source */
761
f3d2e786
BM
762struct acpi_madt_interrupt_source {
763 struct acpi_subtable_header header;
764 u16 inti_flags;
765 u8 type; /* 1=PMI, 2=INIT, 3=corrected */
766 u8 id; /* Processor ID */
767 u8 eid; /* Processor EID */
793c2388 768 u8 io_sapic_vector; /* Vector value for PMI interrupts */
f3d2e786 769 u32 global_irq; /* Global system interrupt */
793c2388
BM
770 u32 flags; /* Interrupt Source Flags */
771};
772
6e2d5ebd 773/* Masks for Flags field above */
f3d2e786
BM
774
775#define ACPI_MADT_CPEI_OVERRIDE (1)
776
eb2289ba 777/* 9: Processor Local X2APIC (ACPI 4.0) */
1d7cc030
BM
778
779struct acpi_madt_local_x2apic {
780 struct acpi_subtable_header header;
75c8044f 781 u16 reserved; /* reserved - must be zero */
786c221a 782 u32 local_apic_id; /* Processor x2APIC ID */
1d7cc030 783 u32 lapic_flags;
786c221a 784 u32 uid; /* ACPI processor UID */
1d7cc030
BM
785};
786
eb2289ba 787/* 10: Local X2APIC NMI (ACPI 4.0) */
1d7cc030
BM
788
789struct acpi_madt_local_x2apic_nmi {
790 struct acpi_subtable_header header;
791 u16 inti_flags;
786c221a 792 u32 uid; /* ACPI processor UID */
1d7cc030 793 u8 lint; /* LINTn to which NMI is connected */
75c8044f 794 u8 reserved[3]; /* reserved - must be zero */
1d7cc030
BM
795};
796
c5bd6537
BM
797/* 11: Generic Interrupt (ACPI 5.0) */
798
799struct acpi_madt_generic_interrupt {
800 struct acpi_subtable_header header;
75c8044f 801 u16 reserved; /* reserved - must be zero */
c5bd6537
BM
802 u32 gic_id;
803 u32 uid;
804 u32 flags;
805 u32 parking_version;
806 u32 performance_interrupt;
807 u64 parked_address;
808 u64 base_address;
809};
810
811/* 12: Generic Distributor (ACPI 5.0) */
812
813struct acpi_madt_generic_distributor {
814 struct acpi_subtable_header header;
ba494bee 815 u16 reserved; /* reserved - must be zero */
c5bd6537
BM
816 u32 gic_id;
817 u64 base_address;
818 u32 global_irq_base;
ba494bee 819 u32 reserved2; /* reserved - must be zero */
c5bd6537
BM
820};
821
f3d2e786
BM
822/*
823 * Common flags fields for MADT subtables
824 */
825
c5bd6537 826/* MADT Local APIC flags (lapic_flags) and GIC flags */
f3d2e786
BM
827
828#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
829
830/* MADT MPS INTI flags (inti_flags) */
831
832#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
833#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
834
835/* Values for MPS INTI flags */
836
837#define ACPI_MADT_POLARITY_CONFORMS 0
838#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
839#define ACPI_MADT_POLARITY_RESERVED 2
840#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
841
842#define ACPI_MADT_TRIGGER_CONFORMS (0)
843#define ACPI_MADT_TRIGGER_EDGE (1<<2)
844#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
845#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
846
6e2d5ebd
BM
847/*******************************************************************************
848 *
849 * MSCT - Maximum System Characteristics Table (ACPI 4.0)
850 * Version 1
851 *
852 ******************************************************************************/
853
854struct acpi_table_msct {
855 struct acpi_table_header header; /* Common ACPI table header */
856 u32 proximity_offset; /* Location of proximity info struct(s) */
857 u32 max_proximity_domains; /* Max number of proximity domains */
858 u32 max_clock_domains; /* Max number of clock domains */
859 u64 max_address; /* Max physical address in system */
860};
861
ba494bee 862/* subtable - Maximum Proximity Domain Information. Version 1 */
6e2d5ebd
BM
863
864struct acpi_msct_proximity {
865 u8 revision;
866 u8 length;
867 u32 range_start; /* Start of domain range */
868 u32 range_end; /* End of domain range */
869 u32 processor_capacity;
870 u64 memory_capacity; /* In bytes */
871};
872
793c2388
BM
873/*******************************************************************************
874 *
875 * SBST - Smart Battery Specification Table
6e2d5ebd 876 * Version 1
793c2388
BM
877 *
878 ******************************************************************************/
879
f3d2e786
BM
880struct acpi_table_sbst {
881 struct acpi_table_header header; /* Common ACPI table header */
882 u32 warning_level;
793c2388
BM
883 u32 low_level;
884 u32 critical_level;
885};
886
887/*******************************************************************************
888 *
889 * SLIT - System Locality Distance Information Table
6e2d5ebd 890 * Version 1
793c2388
BM
891 *
892 ******************************************************************************/
893
f3d2e786
BM
894struct acpi_table_slit {
895 struct acpi_table_header header; /* Common ACPI table header */
896 u64 locality_count;
897 u8 entry[1]; /* Real size = localities^2 */
793c2388
BM
898};
899
793c2388
BM
900/*******************************************************************************
901 *
902 * SRAT - System Resource Affinity Table
6e2d5ebd 903 * Version 3
793c2388
BM
904 *
905 ******************************************************************************/
906
f3d2e786
BM
907struct acpi_table_srat {
908 struct acpi_table_header header; /* Common ACPI table header */
909 u32 table_revision; /* Must be value '1' */
910 u64 reserved; /* Reserved, must be zero */
793c2388
BM
911};
912
f3d2e786 913/* Values for subtable type in struct acpi_subtable_header */
793c2388 914
f3d2e786
BM
915enum acpi_srat_type {
916 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
917 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
1d7cc030
BM
918 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
919 ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
f3d2e786 920};
793c2388 921
1d7cc030
BM
922/*
923 * SRAT Sub-tables, correspond to Type in struct acpi_subtable_header
924 */
925
926/* 0: Processor Local APIC/SAPIC Affinity */
793c2388 927
f3d2e786
BM
928struct acpi_srat_cpu_affinity {
929 struct acpi_subtable_header header;
930 u8 proximity_domain_lo;
793c2388 931 u8 apic_id;
f3d2e786 932 u32 flags;
793c2388
BM
933 u8 local_sapic_eid;
934 u8 proximity_domain_hi[3];
f3d2e786 935 u32 reserved; /* Reserved, must be zero */
793c2388
BM
936};
937
6e2d5ebd
BM
938/* Flags */
939
940#define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
941
1d7cc030 942/* 1: Memory Affinity */
f3d2e786
BM
943
944struct acpi_srat_mem_affinity {
945 struct acpi_subtable_header header;
946 u32 proximity_domain;
947 u16 reserved; /* Reserved, must be zero */
793c2388 948 u64 base_address;
f3d2e786 949 u64 length;
19d0cfe9 950 u32 reserved1;
f3d2e786 951 u32 flags;
19d0cfe9 952 u64 reserved2; /* Reserved, must be zero */
f3d2e786
BM
953};
954
955/* Flags */
f9f4601f 956
f3d2e786
BM
957#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
958#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
959#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
f9f4601f 960
eb2289ba 961/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
1d7cc030
BM
962
963struct acpi_srat_x2apic_cpu_affinity {
964 struct acpi_subtable_header header;
965 u16 reserved; /* Reserved, must be zero */
966 u32 proximity_domain;
967 u32 apic_id;
968 u32 flags;
eb2289ba
BM
969 u32 clock_domain;
970 u32 reserved2;
1d7cc030
BM
971};
972
973/* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
974
975#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
976
4ac4c5fa 977#pragma pack(pop) /* Restore original struct packing */
1da177e4 978
4be44fcd 979#endif /* __ACTBL1_H__ */