blob: 6b8714a428b6d78832b2a876d62482de97c07ad5 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
2 *
Bob Moore793c2382006-03-31 00:00:00 -05003 * Name: actbl1.h - Additional ACPI table definitions
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
5 *****************************************************************************/
6
7/*
Bob Moore7735ca02017-02-08 11:00:08 +08008 * Copyright (C) 2000 - 2017, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * 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
Bob Moore793c2382006-03-31 00:00:00 -050047/*******************************************************************************
48 *
Bob Mooreb24aad42009-07-24 13:30:17 +080049 * Additional ACPI Tables (1)
Bob Moore793c2382006-03-31 00:00:00 -050050 *
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 *
Bob Mooreb24aad42009-07-24 13:30:17 +080054 * The tables in this file are fully defined within the ACPI specification.
55 *
Bob Moore793c2382006-03-31 00:00:00 -050056 ******************************************************************************/
57
58/*
Bob Moore6e2d5eb2009-07-27 10:53:00 +080059 * 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.
Bob Moore793c2382006-03-31 00:00:00 -050062 */
Bob Moore970d9c92008-04-10 19:06:42 +040063#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
Bob Moore793c2382006-03-31 00:00:00 -050064#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
Bob Moore793c2382006-03-31 00:00:00 -050065#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
Bob Moore970d9c92008-04-10 19:06:42 +040066#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
67#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
Lv Zhengfa418dd2017-06-05 16:37:16 +080068#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */
Bob Moore970d9c92008-04-10 19:06:42 +040069#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
Bob Moore793c2382006-03-31 00:00:00 -050070#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
Bob Moore6e2d5eb2009-07-27 10:53:00 +080071#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
Lv Zhengb8355bc2017-06-05 16:38:26 +080072#define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */
Bob Moore793c2382006-03-31 00:00:00 -050073#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
74#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
Bob Moore793c2382006-03-31 00:00:00 -050075#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
Bob Moore04f8e382015-05-21 10:31:58 +080076#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
Bob Moore793c2382006-03-31 00:00:00 -050077
Bob Moore793c2382006-03-31 00:00:00 -050078/*
79 * All tables must be byte-packed to match the ACPI specification, since
80 * the tables are provided by the system BIOS.
81 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#pragma pack(1)
83
84/*
Bob Moorebe030a52012-08-17 13:07:54 +080085 * Note: C bitfields are not used for this reason:
86 *
87 * "Bitfields are great and easy to read, but unfortunately the C language
88 * does not specify the layout of bitfields in memory, which means they are
89 * essentially useless for dealing with packed data in on-disk formats or
90 * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
91 * this decision was a design error in C. Ritchie could have picked an order
92 * and stuck with it." Norman Ramsey.
93 * See http://stackoverflow.com/a/1053662/41661
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 */
Bob Moore793c2382006-03-31 00:00:00 -050095
Bob Moore6e2d5eb2009-07-27 10:53:00 +080096/*******************************************************************************
97 *
98 * Common subtable headers
99 *
100 ******************************************************************************/
101
102/* Generic subtable header (used in MADT, SRAT, etc.) */
Bob Mooref3d2e782007-02-02 19:48:18 +0300103
104struct acpi_subtable_header {
105 u8 type;
106 u8 length;
107};
108
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800109/* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
Bob Moore970d9c92008-04-10 19:06:42 +0400110
111struct acpi_whea_header {
112 u8 action;
113 u8 instruction;
114 u8 flags;
115 u8 reserved;
116 struct acpi_generic_address register_region;
Bob Moore3fa34772008-04-10 19:06:43 +0400117 u64 value; /* Value used with Read/Write register */
118 u64 mask; /* Bitmask required for this register instruction */
Bob Moore970d9c92008-04-10 19:06:42 +0400119};
120
Bob Moore793c2382006-03-31 00:00:00 -0500121/*******************************************************************************
122 *
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800123 * BERT - Boot Error Record Table (ACPI 4.0)
124 * Version 1
Bob Moore970d9c92008-04-10 19:06:42 +0400125 *
126 ******************************************************************************/
127
128struct acpi_table_bert {
129 struct acpi_table_header header; /* Common ACPI table header */
130 u32 region_length; /* Length of the boot error region */
Uwe Kleine-Königb5950762010-11-01 15:38:34 -0400131 u64 address; /* Physical address of the error region */
Bob Moore970d9c92008-04-10 19:06:42 +0400132};
133
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800134/* Boot Error Region (not a subtable, pointed to by Address field above) */
Bob Moore3fa34772008-04-10 19:06:43 +0400135
Bob Moore970d9c92008-04-10 19:06:42 +0400136struct acpi_bert_region {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800137 u32 block_status; /* Type of error information */
138 u32 raw_data_offset; /* Offset to raw error data */
139 u32 raw_data_length; /* Length of raw error data */
140 u32 data_length; /* Length of generic error data */
141 u32 error_severity; /* Severity code */
Bob Moore970d9c92008-04-10 19:06:42 +0400142};
143
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800144/* Values for block_status flags above */
Bob Moore970d9c92008-04-10 19:06:42 +0400145
146#define ACPI_BERT_UNCORRECTABLE (1)
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800147#define ACPI_BERT_CORRECTABLE (1<<1)
148#define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2)
149#define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3)
150#define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
151
152/* Values for error_severity above */
153
154enum acpi_bert_error_severity {
155 ACPI_BERT_ERROR_CORRECTABLE = 0,
156 ACPI_BERT_ERROR_FATAL = 1,
157 ACPI_BERT_ERROR_CORRECTED = 2,
158 ACPI_BERT_ERROR_NONE = 3,
159 ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */
160};
161
162/*
163 * Note: The generic error data that follows the error_severity field above
164 * uses the struct acpi_hest_generic_data defined under the HEST table below
165 */
Bob Moore970d9c92008-04-10 19:06:42 +0400166
167/*******************************************************************************
168 *
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800169 * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
170 * Version 1
Bob Moore793c2382006-03-31 00:00:00 -0500171 *
172 ******************************************************************************/
173
174struct acpi_table_cpep {
Bob Mooref3d2e782007-02-02 19:48:18 +0300175 struct acpi_table_header header; /* Common ACPI table header */
176 u64 reserved;
Bob Moore793c2382006-03-31 00:00:00 -0500177};
178
179/* Subtable */
180
181struct acpi_cpep_polling {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800182 struct acpi_subtable_header header;
Bob Mooref3d2e782007-02-02 19:48:18 +0300183 u8 id; /* Processor ID */
184 u8 eid; /* Processor EID */
185 u32 interval; /* Polling interval (msec) */
Bob Moore793c2382006-03-31 00:00:00 -0500186};
187
188/*******************************************************************************
189 *
Bob Moore793c2382006-03-31 00:00:00 -0500190 * ECDT - Embedded Controller Boot Resources Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800191 * Version 1
Bob Moore793c2382006-03-31 00:00:00 -0500192 *
193 ******************************************************************************/
194
Bob Mooref3d2e782007-02-02 19:48:18 +0300195struct acpi_table_ecdt {
196 struct acpi_table_header header; /* Common ACPI table header */
197 struct acpi_generic_address control; /* Address of EC command/status register */
198 struct acpi_generic_address data; /* Address of EC data register */
Bob Moore793c2382006-03-31 00:00:00 -0500199 u32 uid; /* Unique ID - must be same as the EC _UID method */
Bob Mooref3d2e782007-02-02 19:48:18 +0300200 u8 gpe; /* The GPE for the EC */
201 u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
Bob Moore793c2382006-03-31 00:00:00 -0500202};
203
204/*******************************************************************************
205 *
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800206 * EINJ - Error Injection Table (ACPI 4.0)
207 * Version 1
Bob Moore970d9c92008-04-10 19:06:42 +0400208 *
209 ******************************************************************************/
210
211struct acpi_table_einj {
212 struct acpi_table_header header; /* Common ACPI table header */
213 u32 header_length;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800214 u8 flags;
215 u8 reserved[3];
Bob Moore970d9c92008-04-10 19:06:42 +0400216 u32 entries;
217};
218
219/* EINJ Injection Instruction Entries (actions) */
220
221struct acpi_einj_entry {
222 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
223};
224
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800225/* Masks for Flags field above */
226
227#define ACPI_EINJ_PRESERVE (1)
228
Bob Moore970d9c92008-04-10 19:06:42 +0400229/* Values for Action field above */
230
231enum acpi_einj_actions {
232 ACPI_EINJ_BEGIN_OPERATION = 0,
233 ACPI_EINJ_GET_TRIGGER_TABLE = 1,
234 ACPI_EINJ_SET_ERROR_TYPE = 2,
235 ACPI_EINJ_GET_ERROR_TYPE = 3,
236 ACPI_EINJ_END_OPERATION = 4,
237 ACPI_EINJ_EXECUTE_OPERATION = 5,
238 ACPI_EINJ_CHECK_BUSY_STATUS = 6,
239 ACPI_EINJ_GET_COMMAND_STATUS = 7,
Bob Moorec5bd6532011-11-16 11:04:00 +0800240 ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
Bob Moorea88e0ce2016-03-24 09:39:36 +0800241 ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
242 ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */
Bob Moore970d9c92008-04-10 19:06:42 +0400243 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
244};
245
246/* Values for Instruction field above */
247
248enum acpi_einj_instructions {
249 ACPI_EINJ_READ_REGISTER = 0,
250 ACPI_EINJ_READ_REGISTER_VALUE = 1,
251 ACPI_EINJ_WRITE_REGISTER = 2,
252 ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
253 ACPI_EINJ_NOOP = 4,
Bob Moorec5bd6532011-11-16 11:04:00 +0800254 ACPI_EINJ_FLUSH_CACHELINE = 5,
255 ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
256};
257
258struct acpi_einj_error_type_with_addr {
259 u32 error_type;
260 u32 vendor_struct_offset;
261 u32 flags;
262 u32 apic_id;
263 u64 address;
264 u64 range;
265 u32 pcie_id;
266};
267
268struct acpi_einj_vendor {
269 u32 length;
270 u32 pcie_id;
271 u16 vendor_id;
272 u16 device_id;
273 u8 revision_id;
274 u8 reserved[3];
Bob Moore970d9c92008-04-10 19:06:42 +0400275};
276
Bob Moore3fa34772008-04-10 19:06:43 +0400277/* EINJ Trigger Error Action Table */
278
279struct acpi_einj_trigger {
280 u32 header_size;
281 u32 revision;
282 u32 table_size;
283 u32 entry_count;
284};
285
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800286/* Command status return values */
287
288enum acpi_einj_command_status {
289 ACPI_EINJ_SUCCESS = 0,
290 ACPI_EINJ_FAILURE = 1,
291 ACPI_EINJ_INVALID_ACCESS = 2,
292 ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
293};
294
295/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
296
297#define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
298#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
299#define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
300#define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
301#define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
302#define ACPI_EINJ_MEMORY_FATAL (1<<5)
303#define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
304#define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
305#define ACPI_EINJ_PCIX_FATAL (1<<8)
306#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
307#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
308#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
Bob Moorec5bd6532011-11-16 11:04:00 +0800309#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800310
Bob Moore970d9c92008-04-10 19:06:42 +0400311/*******************************************************************************
312 *
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800313 * ERST - Error Record Serialization Table (ACPI 4.0)
314 * Version 1
Bob Moore970d9c92008-04-10 19:06:42 +0400315 *
316 ******************************************************************************/
317
318struct acpi_table_erst {
319 struct acpi_table_header header; /* Common ACPI table header */
320 u32 header_length;
321 u32 reserved;
322 u32 entries;
323};
324
325/* ERST Serialization Entries (actions) */
326
327struct acpi_erst_entry {
328 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
329};
330
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800331/* Masks for Flags field above */
332
333#define ACPI_ERST_PRESERVE (1)
334
Bob Moore970d9c92008-04-10 19:06:42 +0400335/* Values for Action field above */
336
337enum acpi_erst_actions {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800338 ACPI_ERST_BEGIN_WRITE = 0,
339 ACPI_ERST_BEGIN_READ = 1,
340 ACPI_ERST_BEGIN_CLEAR = 2,
341 ACPI_ERST_END = 3,
Bob Moore970d9c92008-04-10 19:06:42 +0400342 ACPI_ERST_SET_RECORD_OFFSET = 4,
343 ACPI_ERST_EXECUTE_OPERATION = 5,
344 ACPI_ERST_CHECK_BUSY_STATUS = 6,
345 ACPI_ERST_GET_COMMAND_STATUS = 7,
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800346 ACPI_ERST_GET_RECORD_ID = 8,
347 ACPI_ERST_SET_RECORD_ID = 9,
Bob Moore970d9c92008-04-10 19:06:42 +0400348 ACPI_ERST_GET_RECORD_COUNT = 10,
349 ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
350 ACPI_ERST_NOT_USED = 12,
351 ACPI_ERST_GET_ERROR_RANGE = 13,
352 ACPI_ERST_GET_ERROR_LENGTH = 14,
353 ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
Bob Moorea88e0ce2016-03-24 09:39:36 +0800354 ACPI_ERST_EXECUTE_TIMINGS = 16,
355 ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */
Bob Moore970d9c92008-04-10 19:06:42 +0400356};
357
358/* Values for Instruction field above */
359
360enum acpi_erst_instructions {
361 ACPI_ERST_READ_REGISTER = 0,
362 ACPI_ERST_READ_REGISTER_VALUE = 1,
363 ACPI_ERST_WRITE_REGISTER = 2,
364 ACPI_ERST_WRITE_REGISTER_VALUE = 3,
365 ACPI_ERST_NOOP = 4,
366 ACPI_ERST_LOAD_VAR1 = 5,
367 ACPI_ERST_LOAD_VAR2 = 6,
368 ACPI_ERST_STORE_VAR1 = 7,
369 ACPI_ERST_ADD = 8,
370 ACPI_ERST_SUBTRACT = 9,
371 ACPI_ERST_ADD_VALUE = 10,
372 ACPI_ERST_SUBTRACT_VALUE = 11,
373 ACPI_ERST_STALL = 12,
374 ACPI_ERST_STALL_WHILE_TRUE = 13,
375 ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
376 ACPI_ERST_GOTO = 15,
377 ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
378 ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
379 ACPI_ERST_MOVE_DATA = 18,
380 ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
381};
382
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800383/* Command status return values */
384
385enum acpi_erst_command_status {
386 ACPI_ERST_SUCESS = 0,
387 ACPI_ERST_NO_SPACE = 1,
388 ACPI_ERST_NOT_AVAILABLE = 2,
389 ACPI_ERST_FAILURE = 3,
390 ACPI_ERST_RECORD_EMPTY = 4,
391 ACPI_ERST_NOT_FOUND = 5,
392 ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
393};
394
395/* Error Record Serialization Information */
396
397struct acpi_erst_info {
398 u16 signature; /* Should be "ER" */
399 u8 data[48];
400};
401
Bob Moore970d9c92008-04-10 19:06:42 +0400402/*******************************************************************************
403 *
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800404 * HEST - Hardware Error Source Table (ACPI 4.0)
405 * Version 1
Bob Moore970d9c92008-04-10 19:06:42 +0400406 *
407 ******************************************************************************/
408
409struct acpi_table_hest {
410 struct acpi_table_header header; /* Common ACPI table header */
411 u32 error_source_count;
412};
413
Bob Moore3fa34772008-04-10 19:06:43 +0400414/* HEST subtable header */
415
416struct acpi_hest_header {
417 u16 type;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800418 u16 source_id;
Bob Moore3fa34772008-04-10 19:06:43 +0400419};
420
421/* Values for Type field above for subtables */
422
423enum acpi_hest_types {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800424 ACPI_HEST_TYPE_IA32_CHECK = 0,
425 ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
426 ACPI_HEST_TYPE_IA32_NMI = 2,
427 ACPI_HEST_TYPE_NOT_USED3 = 3,
428 ACPI_HEST_TYPE_NOT_USED4 = 4,
429 ACPI_HEST_TYPE_NOT_USED5 = 5,
Bob Moore3fa34772008-04-10 19:06:43 +0400430 ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
431 ACPI_HEST_TYPE_AER_ENDPOINT = 7,
432 ACPI_HEST_TYPE_AER_BRIDGE = 8,
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800433 ACPI_HEST_TYPE_GENERIC_ERROR = 9,
Bob Moore7cd55c72016-03-24 09:38:57 +0800434 ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
Bob Moorec0429332017-06-05 16:38:41 +0800435 ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
436 ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */
Bob Moore3fa34772008-04-10 19:06:43 +0400437};
438
439/*
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800440 * HEST substructures contained in subtables
Bob Moore3fa34772008-04-10 19:06:43 +0400441 */
442
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800443/*
444 * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
445 * struct acpi_hest_ia_corrected structures.
446 */
447struct acpi_hest_ia_error_bank {
Bob Moore3fa34772008-04-10 19:06:43 +0400448 u8 bank_number;
449 u8 clear_status_on_init;
450 u8 status_format;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800451 u8 reserved;
Bob Moore3fa34772008-04-10 19:06:43 +0400452 u32 control_register;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800453 u64 control_data;
Bob Moore3fa34772008-04-10 19:06:43 +0400454 u32 status_register;
455 u32 address_register;
456 u32 misc_register;
457};
458
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800459/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
Bob Moore3fa34772008-04-10 19:06:43 +0400460
461struct acpi_hest_aer_common {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800462 u16 reserved1;
Bob Moore3fa34772008-04-10 19:06:43 +0400463 u8 flags;
464 u8 enabled;
Bob Moorec276e382009-07-27 14:55:02 +0800465 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400466 u32 max_sections_per_record;
Betty Dall4059a312014-01-13 12:17:47 -0700467 u32 bus; /* Bus and Segment numbers */
Bob Moore3fa34772008-04-10 19:06:43 +0400468 u16 device;
469 u16 function;
470 u16 device_control;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800471 u16 reserved2;
Bob Moorec276e382009-07-27 14:55:02 +0800472 u32 uncorrectable_mask;
473 u32 uncorrectable_severity;
474 u32 correctable_mask;
475 u32 advanced_capabilities;
Bob Moore3fa34772008-04-10 19:06:43 +0400476};
477
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800478/* Masks for HEST Flags fields */
479
480#define ACPI_HEST_FIRMWARE_FIRST (1)
481#define ACPI_HEST_GLOBAL (1<<1)
Bob Moore2e166c732017-06-05 16:38:32 +0800482#define ACPI_HEST_GHES_ASSIST (1<<2)
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800483
Betty Dall4059a312014-01-13 12:17:47 -0700484/*
485 * Macros to access the bus/segment numbers in Bus field above:
486 * Bus number is encoded in bits 7:0
487 * Segment number is encoded in bits 23:8
488 */
489#define ACPI_HEST_BUS(bus) ((bus) & 0xFF)
490#define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF)
491
Bob Moore3fa34772008-04-10 19:06:43 +0400492/* Hardware Error Notification */
493
494struct acpi_hest_notify {
495 u8 type;
496 u8 length;
497 u16 config_write_enable;
498 u32 poll_interval;
499 u32 vector;
500 u32 polling_threshold_value;
501 u32 polling_threshold_window;
502 u32 error_threshold_value;
503 u32 error_threshold_window;
504};
505
506/* Values for Notify Type field above */
507
508enum acpi_hest_notify_types {
509 ACPI_HEST_NOTIFY_POLLED = 0,
510 ACPI_HEST_NOTIFY_EXTERNAL = 1,
511 ACPI_HEST_NOTIFY_LOCAL = 2,
512 ACPI_HEST_NOTIFY_SCI = 3,
513 ACPI_HEST_NOTIFY_NMI = 4,
Bob Mooreca4a03142012-08-24 10:25:12 -0700514 ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
515 ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
Bob Moore7cd55c72016-03-24 09:38:57 +0800516 ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
517 ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
518 ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
519 ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
Bob Moore4a8a6052017-06-05 16:38:20 +0800520 ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */
521 ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */
Bob Moore3fa34772008-04-10 19:06:43 +0400522};
523
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800524/* Values for config_write_enable bitfield above */
525
526#define ACPI_HEST_TYPE (1)
527#define ACPI_HEST_POLL_INTERVAL (1<<1)
528#define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
529#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
530#define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
531#define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
532
Bob Moore3fa34772008-04-10 19:06:43 +0400533/*
534 * HEST subtables
Bob Moore3fa34772008-04-10 19:06:43 +0400535 */
536
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800537/* 0: IA32 Machine Check Exception */
Bob Moore3fa34772008-04-10 19:06:43 +0400538
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800539struct acpi_hest_ia_machine_check {
Bob Moore3fa34772008-04-10 19:06:43 +0400540 struct acpi_hest_header header;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800541 u16 reserved1;
Bob Moorec0429332017-06-05 16:38:41 +0800542 u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800543 u8 enabled;
Bob Moorec276e382009-07-27 14:55:02 +0800544 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400545 u32 max_sections_per_record;
546 u64 global_capability_data;
547 u64 global_control_data;
548 u8 num_hardware_banks;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800549 u8 reserved3[7];
Bob Moore3fa34772008-04-10 19:06:43 +0400550};
551
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800552/* 1: IA32 Corrected Machine Check */
Bob Moore3fa34772008-04-10 19:06:43 +0400553
Bob Moore1872bbc2009-08-13 13:31:00 +0800554struct acpi_hest_ia_corrected {
Bob Moore3fa34772008-04-10 19:06:43 +0400555 struct acpi_hest_header header;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800556 u16 reserved1;
Bob Moorec0429332017-06-05 16:38:41 +0800557 u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
Bob Moore3fa34772008-04-10 19:06:43 +0400558 u8 enabled;
Bob Moorec276e382009-07-27 14:55:02 +0800559 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400560 u32 max_sections_per_record;
561 struct acpi_hest_notify notify;
562 u8 num_hardware_banks;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800563 u8 reserved2[3];
Bob Moore3fa34772008-04-10 19:06:43 +0400564};
565
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800566/* 2: IA32 Non-Maskable Interrupt */
Bob Moore3fa34772008-04-10 19:06:43 +0400567
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800568struct acpi_hest_ia_nmi {
Bob Moore3fa34772008-04-10 19:06:43 +0400569 struct acpi_hest_header header;
Bob Moore3fa34772008-04-10 19:06:43 +0400570 u32 reserved;
Bob Moorec276e382009-07-27 14:55:02 +0800571 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400572 u32 max_sections_per_record;
573 u32 max_raw_data_length;
574};
575
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800576/* 3,4,5: Not used */
Bob Moore3fa34772008-04-10 19:06:43 +0400577
578/* 6: PCI Express Root Port AER */
579
580struct acpi_hest_aer_root {
581 struct acpi_hest_header header;
582 struct acpi_hest_aer_common aer;
583 u32 root_error_command;
584};
585
586/* 7: PCI Express AER (AER Endpoint) */
587
588struct acpi_hest_aer {
589 struct acpi_hest_header header;
590 struct acpi_hest_aer_common aer;
591};
592
593/* 8: PCI Express/PCI-X Bridge AER */
594
595struct acpi_hest_aer_bridge {
596 struct acpi_hest_header header;
597 struct acpi_hest_aer_common aer;
Bob Moorec276e382009-07-27 14:55:02 +0800598 u32 uncorrectable_mask2;
599 u32 uncorrectable_severity2;
600 u32 advanced_capabilities2;
Bob Moore3fa34772008-04-10 19:06:43 +0400601};
602
603/* 9: Generic Hardware Error Source */
604
605struct acpi_hest_generic {
606 struct acpi_hest_header header;
Bob Moore3fa34772008-04-10 19:06:43 +0400607 u16 related_source_id;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800608 u8 reserved;
Bob Moore3fa34772008-04-10 19:06:43 +0400609 u8 enabled;
Bob Moorec276e382009-07-27 14:55:02 +0800610 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400611 u32 max_sections_per_record;
612 u32 max_raw_data_length;
613 struct acpi_generic_address error_status_address;
614 struct acpi_hest_notify notify;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800615 u32 error_block_length;
616};
617
Bob Moore7cd55c72016-03-24 09:38:57 +0800618/* 10: Generic Hardware Error Source, version 2 */
619
620struct acpi_hest_generic_v2 {
621 struct acpi_hest_header header;
622 u16 related_source_id;
623 u8 reserved;
624 u8 enabled;
625 u32 records_to_preallocate;
626 u32 max_sections_per_record;
627 u32 max_raw_data_length;
628 struct acpi_generic_address error_status_address;
629 struct acpi_hest_notify notify;
630 u32 error_block_length;
631 struct acpi_generic_address read_ack_register;
632 u64 read_ack_preserve;
633 u64 read_ack_write;
634};
635
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800636/* Generic Error Status block */
637
Lv Zheng0a00fd52014-06-03 16:32:53 +0800638struct acpi_hest_generic_status {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800639 u32 block_status;
640 u32 raw_data_offset;
641 u32 raw_data_length;
642 u32 data_length;
643 u32 error_severity;
644};
645
646/* Values for block_status flags above */
647
Lv Zheng0a00fd52014-06-03 16:32:53 +0800648#define ACPI_HEST_UNCORRECTABLE (1)
649#define ACPI_HEST_CORRECTABLE (1<<1)
650#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
651#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
652#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800653
654/* Generic Error Data entry */
655
Lv Zheng0a00fd52014-06-03 16:32:53 +0800656struct acpi_hest_generic_data {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800657 u8 section_type[16];
658 u32 error_severity;
659 u16 revision;
660 u8 validation_bits;
661 u8 flags;
662 u32 error_data_length;
663 u8 fru_id[16];
664 u8 fru_text[20];
Bob Moore3fa34772008-04-10 19:06:43 +0400665};
Bob Moore970d9c92008-04-10 19:06:42 +0400666
Bob Moore7cd55c72016-03-24 09:38:57 +0800667/* Extension for revision 0x0300 */
668
669struct acpi_hest_generic_data_v300 {
670 u8 section_type[16];
671 u32 error_severity;
672 u16 revision;
673 u8 validation_bits;
674 u8 flags;
675 u32 error_data_length;
676 u8 fru_id[16];
677 u8 fru_text[20];
678 u64 time_stamp;
679};
680
681/* Values for error_severity above */
682
683#define ACPI_HEST_GEN_ERROR_RECOVERABLE 0
684#define ACPI_HEST_GEN_ERROR_FATAL 1
685#define ACPI_HEST_GEN_ERROR_CORRECTED 2
686#define ACPI_HEST_GEN_ERROR_NONE 3
687
688/* Flags for validation_bits above */
689
690#define ACPI_HEST_GEN_VALID_FRU_ID (1)
691#define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1)
692#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
693
Bob Moorec0429332017-06-05 16:38:41 +0800694/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
695
696struct acpi_hest_ia_deferred_check {
697 struct acpi_hest_header header;
698 u16 reserved1;
699 u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
700 u8 enabled;
701 u32 records_to_preallocate;
702 u32 max_sections_per_record;
703 struct acpi_hest_notify notify;
704 u8 num_hardware_banks;
705 u8 reserved2[3];
706};
707
Bob Moore970d9c92008-04-10 19:06:42 +0400708/*******************************************************************************
709 *
Lv Zhengfa418dd2017-06-05 16:37:16 +0800710 * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
711 * Version 1
712 *
713 ******************************************************************************/
714
715struct acpi_table_hmat {
716 struct acpi_table_header header; /* Common ACPI table header */
717 u32 reserved;
718};
719
720/* Values for HMAT structure types */
721
722enum acpi_hmat_type {
723 ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
724 ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
725 ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
726 ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
727};
728
729struct acpi_hmat_structure {
730 u16 type;
731 u16 reserved;
732 u32 length;
733};
734
735/*
736 * HMAT Structures, correspond to Type in struct acpi_hmat_structure
737 */
738
739/* 0: Memory subystem address range */
740
741struct acpi_hmat_address_range {
742 struct acpi_hmat_structure header;
743 u16 flags;
744 u16 reserved1;
745 u32 processor_PD; /* Processor proximity domain */
746 u32 memory_PD; /* Memory proximity domain */
747 u32 reserved2;
748 u64 physical_address_base; /* Physical address range base */
749 u64 physical_address_length; /* Physical address range length */
750};
751
752/* Masks for Flags field above */
753
754#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: processor_PD field is valid */
755#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: memory_PD field is valid */
756#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */
757
758/* 1: System locality latency and bandwidth information */
759
760struct acpi_hmat_locality {
761 struct acpi_hmat_structure header;
762 u8 flags;
763 u8 data_type;
764 u16 reserved1;
765 u32 number_of_initiator_Pds;
766 u32 number_of_target_Pds;
767 u32 reserved2;
768 u64 entry_base_unit;
769};
770
771/* Masks for Flags field above */
772
773#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
774
775/* Values for Memory Hierarchy flag */
776
777#define ACPI_HMAT_MEMORY 0
778#define ACPI_HMAT_LAST_LEVEL_CACHE 1
779#define ACPI_HMAT_1ST_LEVEL_CACHE 2
780#define ACPI_HMAT_2ND_LEVEL_CACHE 3
781#define ACPI_HMAT_3RD_LEVEL_CACHE 4
782
783/* Values for data_type field above */
784
785#define ACPI_HMAT_ACCESS_LATENCY 0
786#define ACPI_HMAT_READ_LATENCY 1
787#define ACPI_HMAT_WRITE_LATENCY 2
788#define ACPI_HMAT_ACCESS_BANDWIDTH 3
789#define ACPI_HMAT_READ_BANDWIDTH 4
790#define ACPI_HMAT_WRITE_BANDWIDTH 5
791
792/* 2: Memory side cache information */
793
794struct acpi_hmat_cache {
795 struct acpi_hmat_structure header;
796 u32 memory_PD;
797 u32 reserved1;
798 u64 cache_size;
799 u32 cache_attributes;
800 u16 reserved2;
801 u16 number_of_SMBIOShandles;
802};
803
804/* Masks for cache_attributes field above */
805
806#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
807#define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
808#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
809#define ACPI_HMAT_WRITE_POLICY (0x0000F000)
810#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)
811
812/* Values for cache associativity flag */
813
814#define ACPI_HMAT_CA_NONE (0)
815#define ACPI_HMAT_CA_DIRECT_MAPPED (1)
816#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)
817
818/* Values for write policy flag */
819
820#define ACPI_HMAT_CP_NONE (0)
821#define ACPI_HMAT_CP_WB (1)
822#define ACPI_HMAT_CP_WT (2)
823
824/*******************************************************************************
825 *
Bob Moore793c2382006-03-31 00:00:00 -0500826 * MADT - Multiple APIC Description Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800827 * Version 3
Bob Moore793c2382006-03-31 00:00:00 -0500828 *
829 ******************************************************************************/
830
Bob Mooref3d2e782007-02-02 19:48:18 +0300831struct acpi_table_madt {
832 struct acpi_table_header header; /* Common ACPI table header */
833 u32 address; /* Physical address of local APIC */
834 u32 flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835};
836
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800837/* Masks for Flags field above */
Bob Moore793c2382006-03-31 00:00:00 -0500838
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800839#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
Bob Moore793c2382006-03-31 00:00:00 -0500840
Bob Mooref3d2e782007-02-02 19:48:18 +0300841/* Values for PCATCompat flag */
Bob Moore793c2382006-03-31 00:00:00 -0500842
Janosch Hildebrandc03baf142017-06-05 16:37:49 +0800843#define ACPI_MADT_DUAL_PIC 1
844#define ACPI_MADT_MULTIPLE_APIC 0
Bob Moore793c2382006-03-31 00:00:00 -0500845
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800846/* Values for MADT subtable type in struct acpi_subtable_header */
Bob Moore793c2382006-03-31 00:00:00 -0500847
Bob Mooref3d2e782007-02-02 19:48:18 +0300848enum acpi_madt_type {
849 ACPI_MADT_TYPE_LOCAL_APIC = 0,
850 ACPI_MADT_TYPE_IO_APIC = 1,
851 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
852 ACPI_MADT_TYPE_NMI_SOURCE = 3,
853 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
854 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
855 ACPI_MADT_TYPE_IO_SAPIC = 6,
856 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
857 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
Bob Moore1d7cc032008-08-04 10:42:47 +0800858 ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
859 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
Bob Moorec5bd6532011-11-16 11:04:00 +0800860 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
861 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
Tomasz Nowickid0c383e2014-07-30 12:21:50 +0800862 ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
863 ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
Bob Moore0cff8dc2015-05-21 10:31:18 +0800864 ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
865 ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
Bob Mooref3d2e782007-02-02 19:48:18 +0300866};
Bob Moore793c2382006-03-31 00:00:00 -0500867
Linus Torvalds1da177e2005-04-16 15:20:36 -0700868/*
Bob Moore1a49b722014-04-30 10:04:28 +0800869 * MADT Subtables, correspond to Type in struct acpi_subtable_header
Linus Torvalds1da177e2005-04-16 15:20:36 -0700870 */
Bob Moore793c2382006-03-31 00:00:00 -0500871
Bob Mooref3d2e782007-02-02 19:48:18 +0300872/* 0: Processor Local APIC */
Bob Moore793c2382006-03-31 00:00:00 -0500873
Bob Mooref3d2e782007-02-02 19:48:18 +0300874struct acpi_madt_local_apic {
875 struct acpi_subtable_header header;
876 u8 processor_id; /* ACPI processor id */
877 u8 id; /* Processor's local APIC id */
878 u32 lapic_flags;
879};
Bob Moore793c2382006-03-31 00:00:00 -0500880
881/* 1: IO APIC */
882
Bob Mooref3d2e782007-02-02 19:48:18 +0300883struct acpi_madt_io_apic {
884 struct acpi_subtable_header header;
885 u8 id; /* I/O APIC ID */
Bob Mooreba494be2012-07-12 09:40:10 +0800886 u8 reserved; /* reserved - must be zero */
Bob Moore793c2382006-03-31 00:00:00 -0500887 u32 address; /* APIC physical address */
Bob Mooref3d2e782007-02-02 19:48:18 +0300888 u32 global_irq_base; /* Global system interrupt where INTI lines start */
Bob Moore793c2382006-03-31 00:00:00 -0500889};
890
891/* 2: Interrupt Override */
892
Bob Mooref3d2e782007-02-02 19:48:18 +0300893struct acpi_madt_interrupt_override {
894 struct acpi_subtable_header header;
895 u8 bus; /* 0 - ISA */
896 u8 source_irq; /* Interrupt source (IRQ) */
897 u32 global_irq; /* Global system interrupt */
898 u16 inti_flags;
899};
Bob Moore793c2382006-03-31 00:00:00 -0500900
Bob Mooref3d2e782007-02-02 19:48:18 +0300901/* 3: NMI Source */
Bob Moore793c2382006-03-31 00:00:00 -0500902
Bob Mooref3d2e782007-02-02 19:48:18 +0300903struct acpi_madt_nmi_source {
904 struct acpi_subtable_header header;
905 u16 inti_flags;
906 u32 global_irq; /* Global system interrupt */
Bob Moore793c2382006-03-31 00:00:00 -0500907};
908
909/* 4: Local APIC NMI */
910
Bob Mooref3d2e782007-02-02 19:48:18 +0300911struct acpi_madt_local_apic_nmi {
912 struct acpi_subtable_header header;
913 u8 processor_id; /* ACPI processor id */
914 u16 inti_flags;
915 u8 lint; /* LINTn to which NMI is connected */
Bob Moore793c2382006-03-31 00:00:00 -0500916};
917
918/* 5: Address Override */
919
Bob Mooref3d2e782007-02-02 19:48:18 +0300920struct acpi_madt_local_apic_override {
921 struct acpi_subtable_header header;
922 u16 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -0500923 u64 address; /* APIC physical address */
924};
925
926/* 6: I/O Sapic */
927
Bob Mooref3d2e782007-02-02 19:48:18 +0300928struct acpi_madt_io_sapic {
929 struct acpi_subtable_header header;
930 u8 id; /* I/O SAPIC ID */
Bob Moore793c2382006-03-31 00:00:00 -0500931 u8 reserved; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +0300932 u32 global_irq_base; /* Global interrupt for SAPIC start */
Bob Moore793c2382006-03-31 00:00:00 -0500933 u64 address; /* SAPIC physical address */
934};
935
936/* 7: Local Sapic */
937
Bob Mooref3d2e782007-02-02 19:48:18 +0300938struct acpi_madt_local_sapic {
939 struct acpi_subtable_header header;
940 u8 processor_id; /* ACPI processor id */
941 u8 id; /* SAPIC ID */
942 u8 eid; /* SAPIC EID */
Bob Moore793c2382006-03-31 00:00:00 -0500943 u8 reserved[3]; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +0300944 u32 lapic_flags;
945 u32 uid; /* Numeric UID - ACPI 3.0 */
946 char uid_string[1]; /* String UID - ACPI 3.0 */
Bob Moore793c2382006-03-31 00:00:00 -0500947};
948
949/* 8: Platform Interrupt Source */
950
Bob Mooref3d2e782007-02-02 19:48:18 +0300951struct acpi_madt_interrupt_source {
952 struct acpi_subtable_header header;
953 u16 inti_flags;
954 u8 type; /* 1=PMI, 2=INIT, 3=corrected */
955 u8 id; /* Processor ID */
956 u8 eid; /* Processor EID */
Bob Moore793c2382006-03-31 00:00:00 -0500957 u8 io_sapic_vector; /* Vector value for PMI interrupts */
Bob Mooref3d2e782007-02-02 19:48:18 +0300958 u32 global_irq; /* Global system interrupt */
Bob Moore793c2382006-03-31 00:00:00 -0500959 u32 flags; /* Interrupt Source Flags */
960};
961
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800962/* Masks for Flags field above */
Bob Mooref3d2e782007-02-02 19:48:18 +0300963
964#define ACPI_MADT_CPEI_OVERRIDE (1)
965
Bob Mooreeb2289b2009-06-24 13:42:00 +0800966/* 9: Processor Local X2APIC (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +0800967
968struct acpi_madt_local_x2apic {
969 struct acpi_subtable_header header;
Lv Zheng75c80442012-12-19 05:36:49 +0000970 u16 reserved; /* reserved - must be zero */
Suresh Siddha786c2212009-03-30 14:05:50 -0800971 u32 local_apic_id; /* Processor x2APIC ID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800972 u32 lapic_flags;
Suresh Siddha786c2212009-03-30 14:05:50 -0800973 u32 uid; /* ACPI processor UID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800974};
975
Bob Mooreeb2289b2009-06-24 13:42:00 +0800976/* 10: Local X2APIC NMI (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +0800977
978struct acpi_madt_local_x2apic_nmi {
979 struct acpi_subtable_header header;
980 u16 inti_flags;
Suresh Siddha786c2212009-03-30 14:05:50 -0800981 u32 uid; /* ACPI processor UID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800982 u8 lint; /* LINTn to which NMI is connected */
Lv Zheng75c80442012-12-19 05:36:49 +0000983 u8 reserved[3]; /* reserved - must be zero */
Bob Moore1d7cc032008-08-04 10:42:47 +0800984};
985
Bob Moore0cff8dc2015-05-21 10:31:18 +0800986/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
Bob Moorec5bd6532011-11-16 11:04:00 +0800987
988struct acpi_madt_generic_interrupt {
989 struct acpi_subtable_header header;
Lv Zheng75c80442012-12-19 05:36:49 +0000990 u16 reserved; /* reserved - must be zero */
Tomasz Nowickid0c383e2014-07-30 12:21:50 +0800991 u32 cpu_interface_number;
Bob Moorec5bd6532011-11-16 11:04:00 +0800992 u32 uid;
993 u32 flags;
994 u32 parking_version;
995 u32 performance_interrupt;
996 u64 parked_address;
997 u64 base_address;
Tomasz Nowickid0c383e2014-07-30 12:21:50 +0800998 u64 gicv_base_address;
999 u64 gich_base_address;
1000 u32 vgic_interrupt;
1001 u64 gicr_base_address;
1002 u64 arm_mpidr;
Bob Moore0cff8dc2015-05-21 10:31:18 +08001003 u8 efficiency_class;
1004 u8 reserved2[3];
Bob Moorec5bd6532011-11-16 11:04:00 +08001005};
1006
Tomasz Nowickid0c383e2014-07-30 12:21:50 +08001007/* Masks for Flags field above */
1008
1009/* ACPI_MADT_ENABLED (1) Processor is usable if set */
1010#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
1011#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
1012
Bob Moore0cff8dc2015-05-21 10:31:18 +08001013/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
Bob Moorec5bd6532011-11-16 11:04:00 +08001014
1015struct acpi_madt_generic_distributor {
1016 struct acpi_subtable_header header;
Bob Mooreba494be2012-07-12 09:40:10 +08001017 u16 reserved; /* reserved - must be zero */
Bob Moorec5bd6532011-11-16 11:04:00 +08001018 u32 gic_id;
1019 u64 base_address;
1020 u32 global_irq_base;
Bob Moore0cff8dc2015-05-21 10:31:18 +08001021 u8 version;
1022 u8 reserved2[3]; /* reserved - must be zero */
Bob Moorec5bd6532011-11-16 11:04:00 +08001023};
1024
Hanjun Guoa8bd0f02015-07-01 14:44:10 +08001025/* Values for Version field above */
1026
1027enum acpi_madt_gic_version {
1028 ACPI_MADT_GIC_VERSION_NONE = 0,
1029 ACPI_MADT_GIC_VERSION_V1 = 1,
1030 ACPI_MADT_GIC_VERSION_V2 = 2,
1031 ACPI_MADT_GIC_VERSION_V3 = 3,
1032 ACPI_MADT_GIC_VERSION_V4 = 4,
1033 ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
1034};
1035
Tomasz Nowickid0c383e2014-07-30 12:21:50 +08001036/* 13: Generic MSI Frame (ACPI 5.1) */
1037
1038struct acpi_madt_generic_msi_frame {
1039 struct acpi_subtable_header header;
1040 u16 reserved; /* reserved - must be zero */
1041 u32 msi_frame_id;
1042 u64 base_address;
1043 u32 flags;
1044 u16 spi_count;
1045 u16 spi_base;
1046};
1047
1048/* Masks for Flags field above */
1049
1050#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
1051
1052/* 14: Generic Redistributor (ACPI 5.1) */
1053
1054struct acpi_madt_generic_redistributor {
1055 struct acpi_subtable_header header;
1056 u16 reserved; /* reserved - must be zero */
1057 u64 base_address;
1058 u32 length;
1059};
1060
Bob Moore0cff8dc2015-05-21 10:31:18 +08001061/* 15: Generic Translator (ACPI 6.0) */
1062
1063struct acpi_madt_generic_translator {
1064 struct acpi_subtable_header header;
1065 u16 reserved; /* reserved - must be zero */
1066 u32 translation_id;
1067 u64 base_address;
1068 u32 reserved2;
1069};
1070
Bob Mooref3d2e782007-02-02 19:48:18 +03001071/*
1072 * Common flags fields for MADT subtables
1073 */
1074
Tomasz Nowickid0c383e2014-07-30 12:21:50 +08001075/* MADT Local APIC flags */
Bob Mooref3d2e782007-02-02 19:48:18 +03001076
1077#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
1078
1079/* MADT MPS INTI flags (inti_flags) */
1080
1081#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
1082#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
1083
1084/* Values for MPS INTI flags */
1085
1086#define ACPI_MADT_POLARITY_CONFORMS 0
1087#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
1088#define ACPI_MADT_POLARITY_RESERVED 2
1089#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
1090
1091#define ACPI_MADT_TRIGGER_CONFORMS (0)
1092#define ACPI_MADT_TRIGGER_EDGE (1<<2)
1093#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
1094#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
1095
Bob Moore793c2382006-03-31 00:00:00 -05001096/*******************************************************************************
1097 *
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001098 * MSCT - Maximum System Characteristics Table (ACPI 4.0)
1099 * Version 1
1100 *
1101 ******************************************************************************/
1102
1103struct acpi_table_msct {
1104 struct acpi_table_header header; /* Common ACPI table header */
1105 u32 proximity_offset; /* Location of proximity info struct(s) */
1106 u32 max_proximity_domains; /* Max number of proximity domains */
1107 u32 max_clock_domains; /* Max number of clock domains */
1108 u64 max_address; /* Max physical address in system */
1109};
1110
Bob Mooreba494be2012-07-12 09:40:10 +08001111/* subtable - Maximum Proximity Domain Information. Version 1 */
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001112
1113struct acpi_msct_proximity {
1114 u8 revision;
1115 u8 length;
1116 u32 range_start; /* Start of domain range */
1117 u32 range_end; /* End of domain range */
1118 u32 processor_capacity;
1119 u64 memory_capacity; /* In bytes */
1120};
1121
1122/*******************************************************************************
1123 *
Bob Moore138a9552016-03-24 09:39:14 +08001124 * NFIT - NVDIMM Interface Table (ACPI 6.0+)
Bob Moore04f8e382015-05-21 10:31:58 +08001125 * Version 1
1126 *
1127 ******************************************************************************/
1128
1129struct acpi_table_nfit {
1130 struct acpi_table_header header; /* Common ACPI table header */
1131 u32 reserved; /* Reserved, must be zero */
1132};
1133
1134/* Subtable header for NFIT */
1135
1136struct acpi_nfit_header {
1137 u16 type;
1138 u16 length;
1139};
1140
1141/* Values for subtable type in struct acpi_nfit_header */
1142
1143enum acpi_nfit_type {
1144 ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
1145 ACPI_NFIT_TYPE_MEMORY_MAP = 1,
1146 ACPI_NFIT_TYPE_INTERLEAVE = 2,
1147 ACPI_NFIT_TYPE_SMBIOS = 3,
1148 ACPI_NFIT_TYPE_CONTROL_REGION = 4,
1149 ACPI_NFIT_TYPE_DATA_REGION = 5,
1150 ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
1151 ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */
1152};
1153
1154/*
1155 * NFIT Subtables
1156 */
1157
1158/* 0: System Physical Address Range Structure */
1159
1160struct acpi_nfit_system_address {
1161 struct acpi_nfit_header header;
1162 u16 range_index;
1163 u16 flags;
1164 u32 reserved; /* Reseved, must be zero */
1165 u32 proximity_domain;
1166 u8 range_guid[16];
1167 u64 address;
1168 u64 length;
1169 u64 memory_mapping;
1170};
1171
1172/* Flags */
1173
1174#define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
1175#define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
1176
1177/* Range Type GUIDs appear in the include/acuuid.h file */
1178
1179/* 1: Memory Device to System Address Range Map Structure */
1180
1181struct acpi_nfit_memory_map {
1182 struct acpi_nfit_header header;
1183 u32 device_handle;
1184 u16 physical_id;
1185 u16 region_id;
1186 u16 range_index;
1187 u16 region_index;
1188 u64 region_size;
1189 u64 region_offset;
1190 u64 address;
1191 u16 interleave_index;
1192 u16 interleave_ways;
1193 u16 flags;
1194 u16 reserved; /* Reserved, must be zero */
1195};
1196
1197/* Flags */
1198
1199#define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
1200#define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
1201#define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
Bob Mooreca321d12015-10-19 10:24:52 +08001202#define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
Bob Moore04f8e382015-05-21 10:31:58 +08001203#define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
1204#define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
Bob Moore138a9552016-03-24 09:39:14 +08001205#define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
Bob Moore04f8e382015-05-21 10:31:58 +08001206
1207/* 2: Interleave Structure */
1208
1209struct acpi_nfit_interleave {
1210 struct acpi_nfit_header header;
1211 u16 interleave_index;
1212 u16 reserved; /* Reserved, must be zero */
1213 u32 line_count;
1214 u32 line_size;
1215 u32 line_offset[1]; /* Variable length */
1216};
1217
1218/* 3: SMBIOS Management Information Structure */
1219
1220struct acpi_nfit_smbios {
1221 struct acpi_nfit_header header;
1222 u32 reserved; /* Reserved, must be zero */
1223 u8 data[1]; /* Variable length */
1224};
1225
1226/* 4: NVDIMM Control Region Structure */
1227
1228struct acpi_nfit_control_region {
1229 struct acpi_nfit_header header;
1230 u16 region_index;
1231 u16 vendor_id;
1232 u16 device_id;
1233 u16 revision_id;
1234 u16 subsystem_vendor_id;
1235 u16 subsystem_device_id;
1236 u16 subsystem_revision_id;
Bob Moore138a9552016-03-24 09:39:14 +08001237 u8 valid_fields;
1238 u8 manufacturing_location;
1239 u16 manufacturing_date;
1240 u8 reserved[2]; /* Reserved, must be zero */
Bob Moore04f8e382015-05-21 10:31:58 +08001241 u32 serial_number;
1242 u16 code;
1243 u16 windows;
1244 u64 window_size;
1245 u64 command_offset;
1246 u64 command_size;
1247 u64 status_offset;
1248 u64 status_size;
1249 u16 flags;
1250 u8 reserved1[6]; /* Reserved, must be zero */
1251};
1252
1253/* Flags */
1254
Bob Moore138a9552016-03-24 09:39:14 +08001255#define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
1256
1257/* valid_fields bits */
1258
1259#define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
Bob Moore04f8e382015-05-21 10:31:58 +08001260
1261/* 5: NVDIMM Block Data Window Region Structure */
1262
1263struct acpi_nfit_data_region {
1264 struct acpi_nfit_header header;
1265 u16 region_index;
1266 u16 windows;
1267 u64 offset;
1268 u64 size;
1269 u64 capacity;
1270 u64 start_address;
1271};
1272
1273/* 6: Flush Hint Address Structure */
1274
1275struct acpi_nfit_flush_address {
1276 struct acpi_nfit_header header;
1277 u32 device_handle;
1278 u16 hint_count;
1279 u8 reserved[6]; /* Reserved, must be zero */
1280 u64 hint_address[1]; /* Variable length */
1281};
1282
1283/*******************************************************************************
1284 *
Lv Zhengb8355bc2017-06-05 16:38:26 +08001285 * PPTT - Processor Properties Topology Table (ACPI 6.2)
1286 * Version 1
1287 *
1288 ******************************************************************************/
1289
1290struct acpi_table_pptt {
1291 struct acpi_table_header header; /* Common ACPI table header */
1292};
1293
1294/* Values for Type field above */
1295
1296enum acpi_pptt_type {
1297 ACPI_PPTT_TYPE_PROCESSOR = 0,
1298 ACPI_PPTT_TYPE_CACHE = 1,
1299 ACPI_PPTT_TYPE_ID = 2,
1300 ACPI_PPTT_TYPE_RESERVED = 3
1301};
1302
1303/* 0: Processor Hierarchy Node Structure */
1304
1305struct acpi_pptt_processor {
1306 struct acpi_subtable_header header;
1307 u16 reserved;
1308 u32 flags;
1309 u32 parent;
1310 u32 acpi_processor_id;
1311 u32 number_of_priv_resources;
1312};
1313
1314/* Flags */
1315
1316#define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */
1317#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */
1318
1319/* 1: Cache Type Structure */
1320
1321struct acpi_pptt_cache {
1322 struct acpi_subtable_header header;
1323 u16 reserved;
1324 u32 flags;
1325 u32 next_level_of_cache;
1326 u32 size;
1327 u32 number_of_sets;
1328 u8 associativity;
1329 u8 attributes;
1330 u16 line_size;
1331};
1332
1333/* Flags */
1334
1335#define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
1336#define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
1337#define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
1338#define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
1339#define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
1340#define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
1341#define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
1342
1343/* Masks for Attributes */
1344
1345#define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
1346#define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
1347#define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
1348
1349/* 2: ID Structure */
1350
1351struct acpi_pptt_id {
1352 struct acpi_subtable_header header;
1353 u16 reserved;
1354 u32 vendor_id;
1355 u64 level1_id;
1356 u64 level2_id;
1357 u16 major_rev;
1358 u16 minor_rev;
1359 u16 spin_rev;
1360};
1361
1362/*******************************************************************************
1363 *
Bob Moore793c2382006-03-31 00:00:00 -05001364 * SBST - Smart Battery Specification Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001365 * Version 1
Bob Moore793c2382006-03-31 00:00:00 -05001366 *
1367 ******************************************************************************/
1368
Bob Mooref3d2e782007-02-02 19:48:18 +03001369struct acpi_table_sbst {
1370 struct acpi_table_header header; /* Common ACPI table header */
1371 u32 warning_level;
Bob Moore793c2382006-03-31 00:00:00 -05001372 u32 low_level;
1373 u32 critical_level;
1374};
1375
1376/*******************************************************************************
1377 *
1378 * SLIT - System Locality Distance Information Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001379 * Version 1
Bob Moore793c2382006-03-31 00:00:00 -05001380 *
1381 ******************************************************************************/
1382
Bob Mooref3d2e782007-02-02 19:48:18 +03001383struct acpi_table_slit {
1384 struct acpi_table_header header; /* Common ACPI table header */
1385 u64 locality_count;
1386 u8 entry[1]; /* Real size = localities^2 */
Bob Moore793c2382006-03-31 00:00:00 -05001387};
1388
1389/*******************************************************************************
1390 *
Bob Moore793c2382006-03-31 00:00:00 -05001391 * SRAT - System Resource Affinity Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001392 * Version 3
Bob Moore793c2382006-03-31 00:00:00 -05001393 *
1394 ******************************************************************************/
1395
Bob Mooref3d2e782007-02-02 19:48:18 +03001396struct acpi_table_srat {
1397 struct acpi_table_header header; /* Common ACPI table header */
1398 u32 table_revision; /* Must be value '1' */
1399 u64 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -05001400};
1401
Bob Mooref3d2e782007-02-02 19:48:18 +03001402/* Values for subtable type in struct acpi_subtable_header */
Bob Moore793c2382006-03-31 00:00:00 -05001403
Bob Mooref3d2e782007-02-02 19:48:18 +03001404enum acpi_srat_type {
1405 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
1406 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
Bob Moore1d7cc032008-08-04 10:42:47 +08001407 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
Hanjun Guo63b8f8c2014-09-02 08:27:12 +08001408 ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
Bob Moorea618c7f2017-06-05 16:38:47 +08001409 ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */
1410 ACPI_SRAT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
Bob Mooref3d2e782007-02-02 19:48:18 +03001411};
Bob Moore793c2382006-03-31 00:00:00 -05001412
Bob Moore1d7cc032008-08-04 10:42:47 +08001413/*
Bob Moore1a49b722014-04-30 10:04:28 +08001414 * SRAT Subtables, correspond to Type in struct acpi_subtable_header
Bob Moore1d7cc032008-08-04 10:42:47 +08001415 */
1416
1417/* 0: Processor Local APIC/SAPIC Affinity */
Bob Moore793c2382006-03-31 00:00:00 -05001418
Bob Mooref3d2e782007-02-02 19:48:18 +03001419struct acpi_srat_cpu_affinity {
1420 struct acpi_subtable_header header;
1421 u8 proximity_domain_lo;
Bob Moore793c2382006-03-31 00:00:00 -05001422 u8 apic_id;
Bob Mooref3d2e782007-02-02 19:48:18 +03001423 u32 flags;
Bob Moore793c2382006-03-31 00:00:00 -05001424 u8 local_sapic_eid;
1425 u8 proximity_domain_hi[3];
Hanjun Guo63b8f8c2014-09-02 08:27:12 +08001426 u32 clock_domain;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001427};
1428
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001429/* Flags */
1430
1431#define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
1432
Bob Moore1d7cc032008-08-04 10:42:47 +08001433/* 1: Memory Affinity */
Bob Mooref3d2e782007-02-02 19:48:18 +03001434
1435struct acpi_srat_mem_affinity {
1436 struct acpi_subtable_header header;
1437 u32 proximity_domain;
1438 u16 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -05001439 u64 base_address;
Bob Mooref3d2e782007-02-02 19:48:18 +03001440 u64 length;
Bob Moore19d0cfe2008-06-10 15:54:40 +08001441 u32 reserved1;
Bob Mooref3d2e782007-02-02 19:48:18 +03001442 u32 flags;
Bob Moore19d0cfe2008-06-10 15:54:40 +08001443 u64 reserved2; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +03001444};
Bob Moore793c2382006-03-31 00:00:00 -05001445
Bob Mooref3d2e782007-02-02 19:48:18 +03001446/* Flags */
Bob Moore793c2382006-03-31 00:00:00 -05001447
Bob Mooref3d2e782007-02-02 19:48:18 +03001448#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
1449#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
1450#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
Bob Moore793c2382006-03-31 00:00:00 -05001451
Bob Mooreeb2289b2009-06-24 13:42:00 +08001452/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +08001453
1454struct acpi_srat_x2apic_cpu_affinity {
1455 struct acpi_subtable_header header;
1456 u16 reserved; /* Reserved, must be zero */
1457 u32 proximity_domain;
1458 u32 apic_id;
1459 u32 flags;
Bob Mooreeb2289b2009-06-24 13:42:00 +08001460 u32 clock_domain;
1461 u32 reserved2;
Bob Moore1d7cc032008-08-04 10:42:47 +08001462};
1463
1464/* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
1465
1466#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
1467
Hanjun Guo63b8f8c2014-09-02 08:27:12 +08001468/* 3: GICC Affinity (ACPI 5.1) */
1469
1470struct acpi_srat_gicc_affinity {
1471 struct acpi_subtable_header header;
1472 u32 proximity_domain;
1473 u32 acpi_processor_uid;
1474 u32 flags;
1475 u32 clock_domain;
1476};
1477
1478/* Flags for struct acpi_srat_gicc_affinity */
1479
1480#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
1481
Bob Moorea618c7f2017-06-05 16:38:47 +08001482/* 4: GCC ITS Affinity (ACPI 6.2) */
1483
1484struct acpi_srat_gic_its_affinity {
1485 struct acpi_subtable_header header;
1486 u32 proximity_domain;
1487 u16 reserved;
1488 u32 its_id;
1489};
1490
Robert Moore6e596082014-03-05 14:12:01 +08001491/* Reset to default packing */
1492
1493#pragma pack()
Linus Torvalds1da177e2005-04-16 15:20:36 -07001494
Len Brown4be44fc2005-08-05 00:44:28 -04001495#endif /* __ACTBL1_H__ */