ACPICA: Tables: Add HMAT table definitions
[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/*
7735ca0e 8 * Copyright (C) 2000 - 2017, 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
793c2388
BM
47/*******************************************************************************
48 *
b24aad44 49 * Additional ACPI Tables (1)
793c2388
BM
50 *
51 * These tables are not consumed directly by the ACPICA subsystem, but are
52 * included here to support device drivers and the AML disassembler.
53 *
b24aad44
BM
54 * The tables in this file are fully defined within the ACPI specification.
55 *
793c2388
BM
56 ******************************************************************************/
57
58/*
6e2d5ebd
BM
59 * Values for description table header signatures for tables defined in this
60 * file. Useful because they make it more difficult to inadvertently type in
61 * the wrong signature.
793c2388 62 */
970d9c9e 63#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
793c2388 64#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
793c2388 65#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
970d9c9e
BM
66#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
67#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
fa418ddf 68#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */
970d9c9e 69#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
793c2388 70#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
6e2d5ebd 71#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
793c2388
BM
72#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
73#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
793c2388 74#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
04f8e384 75#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface 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 239 ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
a88e0ce6
BM
240 ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
241 ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */
970d9c9e
BM
242 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
243};
244
245/* Values for Instruction field above */
246
247enum acpi_einj_instructions {
248 ACPI_EINJ_READ_REGISTER = 0,
249 ACPI_EINJ_READ_REGISTER_VALUE = 1,
250 ACPI_EINJ_WRITE_REGISTER = 2,
251 ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
252 ACPI_EINJ_NOOP = 4,
c5bd6537
BM
253 ACPI_EINJ_FLUSH_CACHELINE = 5,
254 ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
255};
256
257struct acpi_einj_error_type_with_addr {
258 u32 error_type;
259 u32 vendor_struct_offset;
260 u32 flags;
261 u32 apic_id;
262 u64 address;
263 u64 range;
264 u32 pcie_id;
265};
266
267struct acpi_einj_vendor {
268 u32 length;
269 u32 pcie_id;
270 u16 vendor_id;
271 u16 device_id;
272 u8 revision_id;
273 u8 reserved[3];
970d9c9e
BM
274};
275
3fa34777
BM
276/* EINJ Trigger Error Action Table */
277
278struct acpi_einj_trigger {
279 u32 header_size;
280 u32 revision;
281 u32 table_size;
282 u32 entry_count;
283};
284
6e2d5ebd
BM
285/* Command status return values */
286
287enum acpi_einj_command_status {
288 ACPI_EINJ_SUCCESS = 0,
289 ACPI_EINJ_FAILURE = 1,
290 ACPI_EINJ_INVALID_ACCESS = 2,
291 ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
292};
293
294/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
295
296#define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
297#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
298#define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
299#define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
300#define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
301#define ACPI_EINJ_MEMORY_FATAL (1<<5)
302#define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
303#define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
304#define ACPI_EINJ_PCIX_FATAL (1<<8)
305#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
306#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
307#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
c5bd6537 308#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
6e2d5ebd 309
970d9c9e
BM
310/*******************************************************************************
311 *
6e2d5ebd
BM
312 * ERST - Error Record Serialization Table (ACPI 4.0)
313 * Version 1
970d9c9e
BM
314 *
315 ******************************************************************************/
316
317struct acpi_table_erst {
318 struct acpi_table_header header; /* Common ACPI table header */
319 u32 header_length;
320 u32 reserved;
321 u32 entries;
322};
323
324/* ERST Serialization Entries (actions) */
325
326struct acpi_erst_entry {
327 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
328};
329
6e2d5ebd
BM
330/* Masks for Flags field above */
331
332#define ACPI_ERST_PRESERVE (1)
333
970d9c9e
BM
334/* Values for Action field above */
335
336enum acpi_erst_actions {
6e2d5ebd
BM
337 ACPI_ERST_BEGIN_WRITE = 0,
338 ACPI_ERST_BEGIN_READ = 1,
339 ACPI_ERST_BEGIN_CLEAR = 2,
340 ACPI_ERST_END = 3,
970d9c9e
BM
341 ACPI_ERST_SET_RECORD_OFFSET = 4,
342 ACPI_ERST_EXECUTE_OPERATION = 5,
343 ACPI_ERST_CHECK_BUSY_STATUS = 6,
344 ACPI_ERST_GET_COMMAND_STATUS = 7,
6e2d5ebd
BM
345 ACPI_ERST_GET_RECORD_ID = 8,
346 ACPI_ERST_SET_RECORD_ID = 9,
970d9c9e
BM
347 ACPI_ERST_GET_RECORD_COUNT = 10,
348 ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
349 ACPI_ERST_NOT_USED = 12,
350 ACPI_ERST_GET_ERROR_RANGE = 13,
351 ACPI_ERST_GET_ERROR_LENGTH = 14,
352 ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
a88e0ce6
BM
353 ACPI_ERST_EXECUTE_TIMINGS = 16,
354 ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */
970d9c9e
BM
355};
356
357/* Values for Instruction field above */
358
359enum acpi_erst_instructions {
360 ACPI_ERST_READ_REGISTER = 0,
361 ACPI_ERST_READ_REGISTER_VALUE = 1,
362 ACPI_ERST_WRITE_REGISTER = 2,
363 ACPI_ERST_WRITE_REGISTER_VALUE = 3,
364 ACPI_ERST_NOOP = 4,
365 ACPI_ERST_LOAD_VAR1 = 5,
366 ACPI_ERST_LOAD_VAR2 = 6,
367 ACPI_ERST_STORE_VAR1 = 7,
368 ACPI_ERST_ADD = 8,
369 ACPI_ERST_SUBTRACT = 9,
370 ACPI_ERST_ADD_VALUE = 10,
371 ACPI_ERST_SUBTRACT_VALUE = 11,
372 ACPI_ERST_STALL = 12,
373 ACPI_ERST_STALL_WHILE_TRUE = 13,
374 ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
375 ACPI_ERST_GOTO = 15,
376 ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
377 ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
378 ACPI_ERST_MOVE_DATA = 18,
379 ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
380};
381
6e2d5ebd
BM
382/* Command status return values */
383
384enum acpi_erst_command_status {
385 ACPI_ERST_SUCESS = 0,
386 ACPI_ERST_NO_SPACE = 1,
387 ACPI_ERST_NOT_AVAILABLE = 2,
388 ACPI_ERST_FAILURE = 3,
389 ACPI_ERST_RECORD_EMPTY = 4,
390 ACPI_ERST_NOT_FOUND = 5,
391 ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
392};
393
394/* Error Record Serialization Information */
395
396struct acpi_erst_info {
397 u16 signature; /* Should be "ER" */
398 u8 data[48];
399};
400
970d9c9e
BM
401/*******************************************************************************
402 *
6e2d5ebd
BM
403 * HEST - Hardware Error Source Table (ACPI 4.0)
404 * Version 1
970d9c9e
BM
405 *
406 ******************************************************************************/
407
408struct acpi_table_hest {
409 struct acpi_table_header header; /* Common ACPI table header */
410 u32 error_source_count;
411};
412
3fa34777
BM
413/* HEST subtable header */
414
415struct acpi_hest_header {
416 u16 type;
6e2d5ebd 417 u16 source_id;
3fa34777
BM
418};
419
420/* Values for Type field above for subtables */
421
422enum acpi_hest_types {
6e2d5ebd
BM
423 ACPI_HEST_TYPE_IA32_CHECK = 0,
424 ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
425 ACPI_HEST_TYPE_IA32_NMI = 2,
426 ACPI_HEST_TYPE_NOT_USED3 = 3,
427 ACPI_HEST_TYPE_NOT_USED4 = 4,
428 ACPI_HEST_TYPE_NOT_USED5 = 5,
3fa34777
BM
429 ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
430 ACPI_HEST_TYPE_AER_ENDPOINT = 7,
431 ACPI_HEST_TYPE_AER_BRIDGE = 8,
6e2d5ebd 432 ACPI_HEST_TYPE_GENERIC_ERROR = 9,
7cd55c76
BM
433 ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
434 ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */
3fa34777
BM
435};
436
437/*
6e2d5ebd 438 * HEST substructures contained in subtables
3fa34777
BM
439 */
440
6e2d5ebd
BM
441/*
442 * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
443 * struct acpi_hest_ia_corrected structures.
444 */
445struct acpi_hest_ia_error_bank {
3fa34777
BM
446 u8 bank_number;
447 u8 clear_status_on_init;
448 u8 status_format;
6e2d5ebd 449 u8 reserved;
3fa34777 450 u32 control_register;
6e2d5ebd 451 u64 control_data;
3fa34777
BM
452 u32 status_register;
453 u32 address_register;
454 u32 misc_register;
455};
456
6e2d5ebd 457/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
3fa34777
BM
458
459struct acpi_hest_aer_common {
6e2d5ebd 460 u16 reserved1;
3fa34777
BM
461 u8 flags;
462 u8 enabled;
c276e388 463 u32 records_to_preallocate;
3fa34777 464 u32 max_sections_per_record;
4059a310 465 u32 bus; /* Bus and Segment numbers */
3fa34777
BM
466 u16 device;
467 u16 function;
468 u16 device_control;
6e2d5ebd 469 u16 reserved2;
c276e388
BM
470 u32 uncorrectable_mask;
471 u32 uncorrectable_severity;
472 u32 correctable_mask;
473 u32 advanced_capabilities;
3fa34777
BM
474};
475
6e2d5ebd
BM
476/* Masks for HEST Flags fields */
477
478#define ACPI_HEST_FIRMWARE_FIRST (1)
479#define ACPI_HEST_GLOBAL (1<<1)
480
4059a310
BD
481/*
482 * Macros to access the bus/segment numbers in Bus field above:
483 * Bus number is encoded in bits 7:0
484 * Segment number is encoded in bits 23:8
485 */
486#define ACPI_HEST_BUS(bus) ((bus) & 0xFF)
487#define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF)
488
3fa34777
BM
489/* Hardware Error Notification */
490
491struct acpi_hest_notify {
492 u8 type;
493 u8 length;
494 u16 config_write_enable;
495 u32 poll_interval;
496 u32 vector;
497 u32 polling_threshold_value;
498 u32 polling_threshold_window;
499 u32 error_threshold_value;
500 u32 error_threshold_window;
501};
502
503/* Values for Notify Type field above */
504
505enum acpi_hest_notify_types {
506 ACPI_HEST_NOTIFY_POLLED = 0,
507 ACPI_HEST_NOTIFY_EXTERNAL = 1,
508 ACPI_HEST_NOTIFY_LOCAL = 2,
509 ACPI_HEST_NOTIFY_SCI = 3,
510 ACPI_HEST_NOTIFY_NMI = 4,
ca4a0314
BM
511 ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
512 ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
7cd55c76
BM
513 ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
514 ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
515 ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
516 ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
517 ACPI_HEST_NOTIFY_RESERVED = 11 /* 11 and greater are reserved */
3fa34777
BM
518};
519
6e2d5ebd
BM
520/* Values for config_write_enable bitfield above */
521
522#define ACPI_HEST_TYPE (1)
523#define ACPI_HEST_POLL_INTERVAL (1<<1)
524#define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
525#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
526#define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
527#define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
528
3fa34777
BM
529/*
530 * HEST subtables
3fa34777
BM
531 */
532
6e2d5ebd 533/* 0: IA32 Machine Check Exception */
3fa34777 534
6e2d5ebd 535struct acpi_hest_ia_machine_check {
3fa34777 536 struct acpi_hest_header header;
6e2d5ebd 537 u16 reserved1;
3fa34777 538 u8 flags;
6e2d5ebd 539 u8 enabled;
c276e388 540 u32 records_to_preallocate;
3fa34777
BM
541 u32 max_sections_per_record;
542 u64 global_capability_data;
543 u64 global_control_data;
544 u8 num_hardware_banks;
6e2d5ebd 545 u8 reserved3[7];
3fa34777
BM
546};
547
6e2d5ebd 548/* 1: IA32 Corrected Machine Check */
3fa34777 549
1872bbc9 550struct acpi_hest_ia_corrected {
3fa34777 551 struct acpi_hest_header header;
6e2d5ebd 552 u16 reserved1;
3fa34777
BM
553 u8 flags;
554 u8 enabled;
c276e388 555 u32 records_to_preallocate;
3fa34777
BM
556 u32 max_sections_per_record;
557 struct acpi_hest_notify notify;
558 u8 num_hardware_banks;
6e2d5ebd 559 u8 reserved2[3];
3fa34777
BM
560};
561
6e2d5ebd 562/* 2: IA32 Non-Maskable Interrupt */
3fa34777 563
6e2d5ebd 564struct acpi_hest_ia_nmi {
3fa34777 565 struct acpi_hest_header header;
3fa34777 566 u32 reserved;
c276e388 567 u32 records_to_preallocate;
3fa34777
BM
568 u32 max_sections_per_record;
569 u32 max_raw_data_length;
570};
571
6e2d5ebd 572/* 3,4,5: Not used */
3fa34777
BM
573
574/* 6: PCI Express Root Port AER */
575
576struct acpi_hest_aer_root {
577 struct acpi_hest_header header;
578 struct acpi_hest_aer_common aer;
579 u32 root_error_command;
580};
581
582/* 7: PCI Express AER (AER Endpoint) */
583
584struct acpi_hest_aer {
585 struct acpi_hest_header header;
586 struct acpi_hest_aer_common aer;
587};
588
589/* 8: PCI Express/PCI-X Bridge AER */
590
591struct acpi_hest_aer_bridge {
592 struct acpi_hest_header header;
593 struct acpi_hest_aer_common aer;
c276e388
BM
594 u32 uncorrectable_mask2;
595 u32 uncorrectable_severity2;
596 u32 advanced_capabilities2;
3fa34777
BM
597};
598
599/* 9: Generic Hardware Error Source */
600
601struct acpi_hest_generic {
602 struct acpi_hest_header header;
3fa34777 603 u16 related_source_id;
6e2d5ebd 604 u8 reserved;
3fa34777 605 u8 enabled;
c276e388 606 u32 records_to_preallocate;
3fa34777
BM
607 u32 max_sections_per_record;
608 u32 max_raw_data_length;
609 struct acpi_generic_address error_status_address;
610 struct acpi_hest_notify notify;
6e2d5ebd
BM
611 u32 error_block_length;
612};
613
7cd55c76
BM
614/* 10: Generic Hardware Error Source, version 2 */
615
616struct acpi_hest_generic_v2 {
617 struct acpi_hest_header header;
618 u16 related_source_id;
619 u8 reserved;
620 u8 enabled;
621 u32 records_to_preallocate;
622 u32 max_sections_per_record;
623 u32 max_raw_data_length;
624 struct acpi_generic_address error_status_address;
625 struct acpi_hest_notify notify;
626 u32 error_block_length;
627 struct acpi_generic_address read_ack_register;
628 u64 read_ack_preserve;
629 u64 read_ack_write;
630};
631
6e2d5ebd
BM
632/* Generic Error Status block */
633
0a00fd5e 634struct acpi_hest_generic_status {
6e2d5ebd
BM
635 u32 block_status;
636 u32 raw_data_offset;
637 u32 raw_data_length;
638 u32 data_length;
639 u32 error_severity;
640};
641
642/* Values for block_status flags above */
643
0a00fd5e
LZ
644#define ACPI_HEST_UNCORRECTABLE (1)
645#define ACPI_HEST_CORRECTABLE (1<<1)
646#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
647#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
648#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
6e2d5ebd
BM
649
650/* Generic Error Data entry */
651
0a00fd5e 652struct acpi_hest_generic_data {
6e2d5ebd
BM
653 u8 section_type[16];
654 u32 error_severity;
655 u16 revision;
656 u8 validation_bits;
657 u8 flags;
658 u32 error_data_length;
659 u8 fru_id[16];
660 u8 fru_text[20];
3fa34777 661};
970d9c9e 662
7cd55c76
BM
663/* Extension for revision 0x0300 */
664
665struct acpi_hest_generic_data_v300 {
666 u8 section_type[16];
667 u32 error_severity;
668 u16 revision;
669 u8 validation_bits;
670 u8 flags;
671 u32 error_data_length;
672 u8 fru_id[16];
673 u8 fru_text[20];
674 u64 time_stamp;
675};
676
677/* Values for error_severity above */
678
679#define ACPI_HEST_GEN_ERROR_RECOVERABLE 0
680#define ACPI_HEST_GEN_ERROR_FATAL 1
681#define ACPI_HEST_GEN_ERROR_CORRECTED 2
682#define ACPI_HEST_GEN_ERROR_NONE 3
683
684/* Flags for validation_bits above */
685
686#define ACPI_HEST_GEN_VALID_FRU_ID (1)
687#define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1)
688#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
689
fa418ddf
LZ
690/*******************************************************************************
691 *
692 * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
693 * Version 1
694 *
695 ******************************************************************************/
696
697struct acpi_table_hmat {
698 struct acpi_table_header header; /* Common ACPI table header */
699 u32 reserved;
700};
701
702/* Values for HMAT structure types */
703
704enum acpi_hmat_type {
705 ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
706 ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
707 ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
708 ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
709};
710
711struct acpi_hmat_structure {
712 u16 type;
713 u16 reserved;
714 u32 length;
715};
716
717/*
718 * HMAT Structures, correspond to Type in struct acpi_hmat_structure
719 */
720
721/* 0: Memory subystem address range */
722
723struct acpi_hmat_address_range {
724 struct acpi_hmat_structure header;
725 u16 flags;
726 u16 reserved1;
727 u32 processor_PD; /* Processor proximity domain */
728 u32 memory_PD; /* Memory proximity domain */
729 u32 reserved2;
730 u64 physical_address_base; /* Physical address range base */
731 u64 physical_address_length; /* Physical address range length */
732};
733
734/* Masks for Flags field above */
735
736#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: processor_PD field is valid */
737#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: memory_PD field is valid */
738#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */
739
740/* 1: System locality latency and bandwidth information */
741
742struct acpi_hmat_locality {
743 struct acpi_hmat_structure header;
744 u8 flags;
745 u8 data_type;
746 u16 reserved1;
747 u32 number_of_initiator_Pds;
748 u32 number_of_target_Pds;
749 u32 reserved2;
750 u64 entry_base_unit;
751};
752
753/* Masks for Flags field above */
754
755#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
756
757/* Values for Memory Hierarchy flag */
758
759#define ACPI_HMAT_MEMORY 0
760#define ACPI_HMAT_LAST_LEVEL_CACHE 1
761#define ACPI_HMAT_1ST_LEVEL_CACHE 2
762#define ACPI_HMAT_2ND_LEVEL_CACHE 3
763#define ACPI_HMAT_3RD_LEVEL_CACHE 4
764
765/* Values for data_type field above */
766
767#define ACPI_HMAT_ACCESS_LATENCY 0
768#define ACPI_HMAT_READ_LATENCY 1
769#define ACPI_HMAT_WRITE_LATENCY 2
770#define ACPI_HMAT_ACCESS_BANDWIDTH 3
771#define ACPI_HMAT_READ_BANDWIDTH 4
772#define ACPI_HMAT_WRITE_BANDWIDTH 5
773
774/* 2: Memory side cache information */
775
776struct acpi_hmat_cache {
777 struct acpi_hmat_structure header;
778 u32 memory_PD;
779 u32 reserved1;
780 u64 cache_size;
781 u32 cache_attributes;
782 u16 reserved2;
783 u16 number_of_SMBIOShandles;
784};
785
786/* Masks for cache_attributes field above */
787
788#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
789#define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
790#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
791#define ACPI_HMAT_WRITE_POLICY (0x0000F000)
792#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)
793
794/* Values for cache associativity flag */
795
796#define ACPI_HMAT_CA_NONE (0)
797#define ACPI_HMAT_CA_DIRECT_MAPPED (1)
798#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)
799
800/* Values for write policy flag */
801
802#define ACPI_HMAT_CP_NONE (0)
803#define ACPI_HMAT_CP_WB (1)
804#define ACPI_HMAT_CP_WT (2)
805
793c2388
BM
806/*******************************************************************************
807 *
808 * MADT - Multiple APIC Description Table
6e2d5ebd 809 * Version 3
793c2388
BM
810 *
811 ******************************************************************************/
812
f3d2e786
BM
813struct acpi_table_madt {
814 struct acpi_table_header header; /* Common ACPI table header */
815 u32 address; /* Physical address of local APIC */
816 u32 flags;
1da177e4
LT
817};
818
6e2d5ebd 819/* Masks for Flags field above */
793c2388 820
6e2d5ebd 821#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
793c2388 822
f3d2e786 823/* Values for PCATCompat flag */
793c2388 824
f3d2e786
BM
825#define ACPI_MADT_DUAL_PIC 0
826#define ACPI_MADT_MULTIPLE_APIC 1
793c2388 827
6e2d5ebd 828/* Values for MADT subtable type in struct acpi_subtable_header */
793c2388 829
f3d2e786
BM
830enum acpi_madt_type {
831 ACPI_MADT_TYPE_LOCAL_APIC = 0,
832 ACPI_MADT_TYPE_IO_APIC = 1,
833 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
834 ACPI_MADT_TYPE_NMI_SOURCE = 3,
835 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
836 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
837 ACPI_MADT_TYPE_IO_SAPIC = 6,
838 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
839 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
1d7cc030
BM
840 ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
841 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
c5bd6537
BM
842 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
843 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
d0c383e4
TN
844 ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
845 ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
0cff8dc0
BM
846 ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
847 ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
f3d2e786 848};
793c2388 849
1da177e4 850/*
1a49b72c 851 * MADT Subtables, correspond to Type in struct acpi_subtable_header
1da177e4 852 */
793c2388 853
f3d2e786 854/* 0: Processor Local APIC */
793c2388 855
f3d2e786
BM
856struct acpi_madt_local_apic {
857 struct acpi_subtable_header header;
858 u8 processor_id; /* ACPI processor id */
859 u8 id; /* Processor's local APIC id */
860 u32 lapic_flags;
861};
793c2388
BM
862
863/* 1: IO APIC */
864
f3d2e786
BM
865struct acpi_madt_io_apic {
866 struct acpi_subtable_header header;
867 u8 id; /* I/O APIC ID */
ba494bee 868 u8 reserved; /* reserved - must be zero */
793c2388 869 u32 address; /* APIC physical address */
f3d2e786 870 u32 global_irq_base; /* Global system interrupt where INTI lines start */
793c2388
BM
871};
872
873/* 2: Interrupt Override */
874
f3d2e786
BM
875struct acpi_madt_interrupt_override {
876 struct acpi_subtable_header header;
877 u8 bus; /* 0 - ISA */
878 u8 source_irq; /* Interrupt source (IRQ) */
879 u32 global_irq; /* Global system interrupt */
880 u16 inti_flags;
881};
793c2388 882
f3d2e786 883/* 3: NMI Source */
793c2388 884
f3d2e786
BM
885struct acpi_madt_nmi_source {
886 struct acpi_subtable_header header;
887 u16 inti_flags;
888 u32 global_irq; /* Global system interrupt */
793c2388
BM
889};
890
891/* 4: Local APIC NMI */
892
f3d2e786
BM
893struct acpi_madt_local_apic_nmi {
894 struct acpi_subtable_header header;
895 u8 processor_id; /* ACPI processor id */
896 u16 inti_flags;
897 u8 lint; /* LINTn to which NMI is connected */
793c2388
BM
898};
899
900/* 5: Address Override */
901
f3d2e786
BM
902struct acpi_madt_local_apic_override {
903 struct acpi_subtable_header header;
904 u16 reserved; /* Reserved, must be zero */
793c2388
BM
905 u64 address; /* APIC physical address */
906};
907
908/* 6: I/O Sapic */
909
f3d2e786
BM
910struct acpi_madt_io_sapic {
911 struct acpi_subtable_header header;
912 u8 id; /* I/O SAPIC ID */
793c2388 913 u8 reserved; /* Reserved, must be zero */
f3d2e786 914 u32 global_irq_base; /* Global interrupt for SAPIC start */
793c2388
BM
915 u64 address; /* SAPIC physical address */
916};
917
918/* 7: Local Sapic */
919
f3d2e786
BM
920struct acpi_madt_local_sapic {
921 struct acpi_subtable_header header;
922 u8 processor_id; /* ACPI processor id */
923 u8 id; /* SAPIC ID */
924 u8 eid; /* SAPIC EID */
793c2388 925 u8 reserved[3]; /* Reserved, must be zero */
f3d2e786
BM
926 u32 lapic_flags;
927 u32 uid; /* Numeric UID - ACPI 3.0 */
928 char uid_string[1]; /* String UID - ACPI 3.0 */
793c2388
BM
929};
930
931/* 8: Platform Interrupt Source */
932
f3d2e786
BM
933struct acpi_madt_interrupt_source {
934 struct acpi_subtable_header header;
935 u16 inti_flags;
936 u8 type; /* 1=PMI, 2=INIT, 3=corrected */
937 u8 id; /* Processor ID */
938 u8 eid; /* Processor EID */
793c2388 939 u8 io_sapic_vector; /* Vector value for PMI interrupts */
f3d2e786 940 u32 global_irq; /* Global system interrupt */
793c2388
BM
941 u32 flags; /* Interrupt Source Flags */
942};
943
6e2d5ebd 944/* Masks for Flags field above */
f3d2e786
BM
945
946#define ACPI_MADT_CPEI_OVERRIDE (1)
947
eb2289ba 948/* 9: Processor Local X2APIC (ACPI 4.0) */
1d7cc030
BM
949
950struct acpi_madt_local_x2apic {
951 struct acpi_subtable_header header;
75c8044f 952 u16 reserved; /* reserved - must be zero */
786c221a 953 u32 local_apic_id; /* Processor x2APIC ID */
1d7cc030 954 u32 lapic_flags;
786c221a 955 u32 uid; /* ACPI processor UID */
1d7cc030
BM
956};
957
eb2289ba 958/* 10: Local X2APIC NMI (ACPI 4.0) */
1d7cc030
BM
959
960struct acpi_madt_local_x2apic_nmi {
961 struct acpi_subtable_header header;
962 u16 inti_flags;
786c221a 963 u32 uid; /* ACPI processor UID */
1d7cc030 964 u8 lint; /* LINTn to which NMI is connected */
75c8044f 965 u8 reserved[3]; /* reserved - must be zero */
1d7cc030
BM
966};
967
0cff8dc0 968/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
c5bd6537
BM
969
970struct acpi_madt_generic_interrupt {
971 struct acpi_subtable_header header;
75c8044f 972 u16 reserved; /* reserved - must be zero */
d0c383e4 973 u32 cpu_interface_number;
c5bd6537
BM
974 u32 uid;
975 u32 flags;
976 u32 parking_version;
977 u32 performance_interrupt;
978 u64 parked_address;
979 u64 base_address;
d0c383e4
TN
980 u64 gicv_base_address;
981 u64 gich_base_address;
982 u32 vgic_interrupt;
983 u64 gicr_base_address;
984 u64 arm_mpidr;
0cff8dc0
BM
985 u8 efficiency_class;
986 u8 reserved2[3];
c5bd6537
BM
987};
988
d0c383e4
TN
989/* Masks for Flags field above */
990
991/* ACPI_MADT_ENABLED (1) Processor is usable if set */
992#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
993#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
994
0cff8dc0 995/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
c5bd6537
BM
996
997struct acpi_madt_generic_distributor {
998 struct acpi_subtable_header header;
ba494bee 999 u16 reserved; /* reserved - must be zero */
c5bd6537
BM
1000 u32 gic_id;
1001 u64 base_address;
1002 u32 global_irq_base;
0cff8dc0
BM
1003 u8 version;
1004 u8 reserved2[3]; /* reserved - must be zero */
c5bd6537
BM
1005};
1006
a8bd0f07
HG
1007/* Values for Version field above */
1008
1009enum acpi_madt_gic_version {
1010 ACPI_MADT_GIC_VERSION_NONE = 0,
1011 ACPI_MADT_GIC_VERSION_V1 = 1,
1012 ACPI_MADT_GIC_VERSION_V2 = 2,
1013 ACPI_MADT_GIC_VERSION_V3 = 3,
1014 ACPI_MADT_GIC_VERSION_V4 = 4,
1015 ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
1016};
1017
d0c383e4
TN
1018/* 13: Generic MSI Frame (ACPI 5.1) */
1019
1020struct acpi_madt_generic_msi_frame {
1021 struct acpi_subtable_header header;
1022 u16 reserved; /* reserved - must be zero */
1023 u32 msi_frame_id;
1024 u64 base_address;
1025 u32 flags;
1026 u16 spi_count;
1027 u16 spi_base;
1028};
1029
1030/* Masks for Flags field above */
1031
1032#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
1033
1034/* 14: Generic Redistributor (ACPI 5.1) */
1035
1036struct acpi_madt_generic_redistributor {
1037 struct acpi_subtable_header header;
1038 u16 reserved; /* reserved - must be zero */
1039 u64 base_address;
1040 u32 length;
1041};
1042
0cff8dc0
BM
1043/* 15: Generic Translator (ACPI 6.0) */
1044
1045struct acpi_madt_generic_translator {
1046 struct acpi_subtable_header header;
1047 u16 reserved; /* reserved - must be zero */
1048 u32 translation_id;
1049 u64 base_address;
1050 u32 reserved2;
1051};
1052
f3d2e786
BM
1053/*
1054 * Common flags fields for MADT subtables
1055 */
1056
d0c383e4 1057/* MADT Local APIC flags */
f3d2e786
BM
1058
1059#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
1060
1061/* MADT MPS INTI flags (inti_flags) */
1062
1063#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
1064#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
1065
1066/* Values for MPS INTI flags */
1067
1068#define ACPI_MADT_POLARITY_CONFORMS 0
1069#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
1070#define ACPI_MADT_POLARITY_RESERVED 2
1071#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
1072
1073#define ACPI_MADT_TRIGGER_CONFORMS (0)
1074#define ACPI_MADT_TRIGGER_EDGE (1<<2)
1075#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
1076#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
1077
6e2d5ebd
BM
1078/*******************************************************************************
1079 *
1080 * MSCT - Maximum System Characteristics Table (ACPI 4.0)
1081 * Version 1
1082 *
1083 ******************************************************************************/
1084
1085struct acpi_table_msct {
1086 struct acpi_table_header header; /* Common ACPI table header */
1087 u32 proximity_offset; /* Location of proximity info struct(s) */
1088 u32 max_proximity_domains; /* Max number of proximity domains */
1089 u32 max_clock_domains; /* Max number of clock domains */
1090 u64 max_address; /* Max physical address in system */
1091};
1092
ba494bee 1093/* subtable - Maximum Proximity Domain Information. Version 1 */
6e2d5ebd
BM
1094
1095struct acpi_msct_proximity {
1096 u8 revision;
1097 u8 length;
1098 u32 range_start; /* Start of domain range */
1099 u32 range_end; /* End of domain range */
1100 u32 processor_capacity;
1101 u64 memory_capacity; /* In bytes */
1102};
1103
04f8e384
BM
1104/*******************************************************************************
1105 *
138a9554 1106 * NFIT - NVDIMM Interface Table (ACPI 6.0+)
04f8e384
BM
1107 * Version 1
1108 *
1109 ******************************************************************************/
1110
1111struct acpi_table_nfit {
1112 struct acpi_table_header header; /* Common ACPI table header */
1113 u32 reserved; /* Reserved, must be zero */
1114};
1115
1116/* Subtable header for NFIT */
1117
1118struct acpi_nfit_header {
1119 u16 type;
1120 u16 length;
1121};
1122
1123/* Values for subtable type in struct acpi_nfit_header */
1124
1125enum acpi_nfit_type {
1126 ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
1127 ACPI_NFIT_TYPE_MEMORY_MAP = 1,
1128 ACPI_NFIT_TYPE_INTERLEAVE = 2,
1129 ACPI_NFIT_TYPE_SMBIOS = 3,
1130 ACPI_NFIT_TYPE_CONTROL_REGION = 4,
1131 ACPI_NFIT_TYPE_DATA_REGION = 5,
1132 ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
1133 ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */
1134};
1135
1136/*
1137 * NFIT Subtables
1138 */
1139
1140/* 0: System Physical Address Range Structure */
1141
1142struct acpi_nfit_system_address {
1143 struct acpi_nfit_header header;
1144 u16 range_index;
1145 u16 flags;
1146 u32 reserved; /* Reseved, must be zero */
1147 u32 proximity_domain;
1148 u8 range_guid[16];
1149 u64 address;
1150 u64 length;
1151 u64 memory_mapping;
1152};
1153
1154/* Flags */
1155
1156#define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
1157#define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
1158
1159/* Range Type GUIDs appear in the include/acuuid.h file */
1160
1161/* 1: Memory Device to System Address Range Map Structure */
1162
1163struct acpi_nfit_memory_map {
1164 struct acpi_nfit_header header;
1165 u32 device_handle;
1166 u16 physical_id;
1167 u16 region_id;
1168 u16 range_index;
1169 u16 region_index;
1170 u64 region_size;
1171 u64 region_offset;
1172 u64 address;
1173 u16 interleave_index;
1174 u16 interleave_ways;
1175 u16 flags;
1176 u16 reserved; /* Reserved, must be zero */
1177};
1178
1179/* Flags */
1180
1181#define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
1182#define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
1183#define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
ca321d1c 1184#define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
04f8e384
BM
1185#define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
1186#define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
138a9554 1187#define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
04f8e384
BM
1188
1189/* 2: Interleave Structure */
1190
1191struct acpi_nfit_interleave {
1192 struct acpi_nfit_header header;
1193 u16 interleave_index;
1194 u16 reserved; /* Reserved, must be zero */
1195 u32 line_count;
1196 u32 line_size;
1197 u32 line_offset[1]; /* Variable length */
1198};
1199
1200/* 3: SMBIOS Management Information Structure */
1201
1202struct acpi_nfit_smbios {
1203 struct acpi_nfit_header header;
1204 u32 reserved; /* Reserved, must be zero */
1205 u8 data[1]; /* Variable length */
1206};
1207
1208/* 4: NVDIMM Control Region Structure */
1209
1210struct acpi_nfit_control_region {
1211 struct acpi_nfit_header header;
1212 u16 region_index;
1213 u16 vendor_id;
1214 u16 device_id;
1215 u16 revision_id;
1216 u16 subsystem_vendor_id;
1217 u16 subsystem_device_id;
1218 u16 subsystem_revision_id;
138a9554
BM
1219 u8 valid_fields;
1220 u8 manufacturing_location;
1221 u16 manufacturing_date;
1222 u8 reserved[2]; /* Reserved, must be zero */
04f8e384
BM
1223 u32 serial_number;
1224 u16 code;
1225 u16 windows;
1226 u64 window_size;
1227 u64 command_offset;
1228 u64 command_size;
1229 u64 status_offset;
1230 u64 status_size;
1231 u16 flags;
1232 u8 reserved1[6]; /* Reserved, must be zero */
1233};
1234
1235/* Flags */
1236
138a9554
BM
1237#define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
1238
1239/* valid_fields bits */
1240
1241#define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
04f8e384
BM
1242
1243/* 5: NVDIMM Block Data Window Region Structure */
1244
1245struct acpi_nfit_data_region {
1246 struct acpi_nfit_header header;
1247 u16 region_index;
1248 u16 windows;
1249 u64 offset;
1250 u64 size;
1251 u64 capacity;
1252 u64 start_address;
1253};
1254
1255/* 6: Flush Hint Address Structure */
1256
1257struct acpi_nfit_flush_address {
1258 struct acpi_nfit_header header;
1259 u32 device_handle;
1260 u16 hint_count;
1261 u8 reserved[6]; /* Reserved, must be zero */
1262 u64 hint_address[1]; /* Variable length */
1263};
1264
793c2388
BM
1265/*******************************************************************************
1266 *
1267 * SBST - Smart Battery Specification Table
6e2d5ebd 1268 * Version 1
793c2388
BM
1269 *
1270 ******************************************************************************/
1271
f3d2e786
BM
1272struct acpi_table_sbst {
1273 struct acpi_table_header header; /* Common ACPI table header */
1274 u32 warning_level;
793c2388
BM
1275 u32 low_level;
1276 u32 critical_level;
1277};
1278
1279/*******************************************************************************
1280 *
1281 * SLIT - System Locality Distance Information Table
6e2d5ebd 1282 * Version 1
793c2388
BM
1283 *
1284 ******************************************************************************/
1285
f3d2e786
BM
1286struct acpi_table_slit {
1287 struct acpi_table_header header; /* Common ACPI table header */
1288 u64 locality_count;
1289 u8 entry[1]; /* Real size = localities^2 */
793c2388
BM
1290};
1291
793c2388
BM
1292/*******************************************************************************
1293 *
1294 * SRAT - System Resource Affinity Table
6e2d5ebd 1295 * Version 3
793c2388
BM
1296 *
1297 ******************************************************************************/
1298
f3d2e786
BM
1299struct acpi_table_srat {
1300 struct acpi_table_header header; /* Common ACPI table header */
1301 u32 table_revision; /* Must be value '1' */
1302 u64 reserved; /* Reserved, must be zero */
793c2388
BM
1303};
1304
f3d2e786 1305/* Values for subtable type in struct acpi_subtable_header */
793c2388 1306
f3d2e786
BM
1307enum acpi_srat_type {
1308 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
1309 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
1d7cc030 1310 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
63b8f8cd
HG
1311 ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
1312 ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
f3d2e786 1313};
793c2388 1314
1d7cc030 1315/*
1a49b72c 1316 * SRAT Subtables, correspond to Type in struct acpi_subtable_header
1d7cc030
BM
1317 */
1318
1319/* 0: Processor Local APIC/SAPIC Affinity */
793c2388 1320
f3d2e786
BM
1321struct acpi_srat_cpu_affinity {
1322 struct acpi_subtable_header header;
1323 u8 proximity_domain_lo;
793c2388 1324 u8 apic_id;
f3d2e786 1325 u32 flags;
793c2388
BM
1326 u8 local_sapic_eid;
1327 u8 proximity_domain_hi[3];
63b8f8cd 1328 u32 clock_domain;
793c2388
BM
1329};
1330
6e2d5ebd
BM
1331/* Flags */
1332
1333#define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
1334
1d7cc030 1335/* 1: Memory Affinity */
f3d2e786
BM
1336
1337struct acpi_srat_mem_affinity {
1338 struct acpi_subtable_header header;
1339 u32 proximity_domain;
1340 u16 reserved; /* Reserved, must be zero */
793c2388 1341 u64 base_address;
f3d2e786 1342 u64 length;
19d0cfe9 1343 u32 reserved1;
f3d2e786 1344 u32 flags;
19d0cfe9 1345 u64 reserved2; /* Reserved, must be zero */
f3d2e786
BM
1346};
1347
1348/* Flags */
f9f4601f 1349
f3d2e786
BM
1350#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
1351#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
1352#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
f9f4601f 1353
eb2289ba 1354/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
1d7cc030
BM
1355
1356struct acpi_srat_x2apic_cpu_affinity {
1357 struct acpi_subtable_header header;
1358 u16 reserved; /* Reserved, must be zero */
1359 u32 proximity_domain;
1360 u32 apic_id;
1361 u32 flags;
eb2289ba
BM
1362 u32 clock_domain;
1363 u32 reserved2;
1d7cc030
BM
1364};
1365
1366/* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
1367
1368#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
1369
63b8f8cd
HG
1370/* 3: GICC Affinity (ACPI 5.1) */
1371
1372struct acpi_srat_gicc_affinity {
1373 struct acpi_subtable_header header;
1374 u32 proximity_domain;
1375 u32 acpi_processor_uid;
1376 u32 flags;
1377 u32 clock_domain;
1378};
1379
1380/* Flags for struct acpi_srat_gicc_affinity */
1381
1382#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
1383
6e596084
RM
1384/* Reset to default packing */
1385
1386#pragma pack()
1da177e4 1387
4be44fcd 1388#endif /* __ACTBL1_H__ */