blob: 06731200305e736caae6ef0c124d3efcaa8222a6 [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,
435 ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */
Bob Moore3fa34772008-04-10 19:06:43 +0400436};
437
438/*
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800439 * HEST substructures contained in subtables
Bob Moore3fa34772008-04-10 19:06:43 +0400440 */
441
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800442/*
443 * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
444 * struct acpi_hest_ia_corrected structures.
445 */
446struct acpi_hest_ia_error_bank {
Bob Moore3fa34772008-04-10 19:06:43 +0400447 u8 bank_number;
448 u8 clear_status_on_init;
449 u8 status_format;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800450 u8 reserved;
Bob Moore3fa34772008-04-10 19:06:43 +0400451 u32 control_register;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800452 u64 control_data;
Bob Moore3fa34772008-04-10 19:06:43 +0400453 u32 status_register;
454 u32 address_register;
455 u32 misc_register;
456};
457
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800458/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
Bob Moore3fa34772008-04-10 19:06:43 +0400459
460struct acpi_hest_aer_common {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800461 u16 reserved1;
Bob Moore3fa34772008-04-10 19:06:43 +0400462 u8 flags;
463 u8 enabled;
Bob Moorec276e382009-07-27 14:55:02 +0800464 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400465 u32 max_sections_per_record;
Betty Dall4059a312014-01-13 12:17:47 -0700466 u32 bus; /* Bus and Segment numbers */
Bob Moore3fa34772008-04-10 19:06:43 +0400467 u16 device;
468 u16 function;
469 u16 device_control;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800470 u16 reserved2;
Bob Moorec276e382009-07-27 14:55:02 +0800471 u32 uncorrectable_mask;
472 u32 uncorrectable_severity;
473 u32 correctable_mask;
474 u32 advanced_capabilities;
Bob Moore3fa34772008-04-10 19:06:43 +0400475};
476
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800477/* Masks for HEST Flags fields */
478
479#define ACPI_HEST_FIRMWARE_FIRST (1)
480#define ACPI_HEST_GLOBAL (1<<1)
Bob Moore2e166c732017-06-05 16:38:32 +0800481#define ACPI_HEST_GHES_ASSIST (1<<2)
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800482
Betty Dall4059a312014-01-13 12:17:47 -0700483/*
484 * Macros to access the bus/segment numbers in Bus field above:
485 * Bus number is encoded in bits 7:0
486 * Segment number is encoded in bits 23:8
487 */
488#define ACPI_HEST_BUS(bus) ((bus) & 0xFF)
489#define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF)
490
Bob Moore3fa34772008-04-10 19:06:43 +0400491/* Hardware Error Notification */
492
493struct acpi_hest_notify {
494 u8 type;
495 u8 length;
496 u16 config_write_enable;
497 u32 poll_interval;
498 u32 vector;
499 u32 polling_threshold_value;
500 u32 polling_threshold_window;
501 u32 error_threshold_value;
502 u32 error_threshold_window;
503};
504
505/* Values for Notify Type field above */
506
507enum acpi_hest_notify_types {
508 ACPI_HEST_NOTIFY_POLLED = 0,
509 ACPI_HEST_NOTIFY_EXTERNAL = 1,
510 ACPI_HEST_NOTIFY_LOCAL = 2,
511 ACPI_HEST_NOTIFY_SCI = 3,
512 ACPI_HEST_NOTIFY_NMI = 4,
Bob Mooreca4a03142012-08-24 10:25:12 -0700513 ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
514 ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
Bob Moore7cd55c72016-03-24 09:38:57 +0800515 ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
516 ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
517 ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
518 ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
Bob Moore4a8a6052017-06-05 16:38:20 +0800519 ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */
520 ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */
Bob Moore3fa34772008-04-10 19:06:43 +0400521};
522
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800523/* Values for config_write_enable bitfield above */
524
525#define ACPI_HEST_TYPE (1)
526#define ACPI_HEST_POLL_INTERVAL (1<<1)
527#define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
528#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
529#define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
530#define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
531
Bob Moore3fa34772008-04-10 19:06:43 +0400532/*
533 * HEST subtables
Bob Moore3fa34772008-04-10 19:06:43 +0400534 */
535
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800536/* 0: IA32 Machine Check Exception */
Bob Moore3fa34772008-04-10 19:06:43 +0400537
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800538struct acpi_hest_ia_machine_check {
Bob Moore3fa34772008-04-10 19:06:43 +0400539 struct acpi_hest_header header;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800540 u16 reserved1;
Bob Moore3fa34772008-04-10 19:06:43 +0400541 u8 flags;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800542 u8 enabled;
Bob Moorec276e382009-07-27 14:55:02 +0800543 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400544 u32 max_sections_per_record;
545 u64 global_capability_data;
546 u64 global_control_data;
547 u8 num_hardware_banks;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800548 u8 reserved3[7];
Bob Moore3fa34772008-04-10 19:06:43 +0400549};
550
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800551/* 1: IA32 Corrected Machine Check */
Bob Moore3fa34772008-04-10 19:06:43 +0400552
Bob Moore1872bbc2009-08-13 13:31:00 +0800553struct acpi_hest_ia_corrected {
Bob Moore3fa34772008-04-10 19:06:43 +0400554 struct acpi_hest_header header;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800555 u16 reserved1;
Bob Moore3fa34772008-04-10 19:06:43 +0400556 u8 flags;
557 u8 enabled;
Bob Moorec276e382009-07-27 14:55:02 +0800558 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400559 u32 max_sections_per_record;
560 struct acpi_hest_notify notify;
561 u8 num_hardware_banks;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800562 u8 reserved2[3];
Bob Moore3fa34772008-04-10 19:06:43 +0400563};
564
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800565/* 2: IA32 Non-Maskable Interrupt */
Bob Moore3fa34772008-04-10 19:06:43 +0400566
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800567struct acpi_hest_ia_nmi {
Bob Moore3fa34772008-04-10 19:06:43 +0400568 struct acpi_hest_header header;
Bob Moore3fa34772008-04-10 19:06:43 +0400569 u32 reserved;
Bob Moorec276e382009-07-27 14:55:02 +0800570 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400571 u32 max_sections_per_record;
572 u32 max_raw_data_length;
573};
574
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800575/* 3,4,5: Not used */
Bob Moore3fa34772008-04-10 19:06:43 +0400576
577/* 6: PCI Express Root Port AER */
578
579struct acpi_hest_aer_root {
580 struct acpi_hest_header header;
581 struct acpi_hest_aer_common aer;
582 u32 root_error_command;
583};
584
585/* 7: PCI Express AER (AER Endpoint) */
586
587struct acpi_hest_aer {
588 struct acpi_hest_header header;
589 struct acpi_hest_aer_common aer;
590};
591
592/* 8: PCI Express/PCI-X Bridge AER */
593
594struct acpi_hest_aer_bridge {
595 struct acpi_hest_header header;
596 struct acpi_hest_aer_common aer;
Bob Moorec276e382009-07-27 14:55:02 +0800597 u32 uncorrectable_mask2;
598 u32 uncorrectable_severity2;
599 u32 advanced_capabilities2;
Bob Moore3fa34772008-04-10 19:06:43 +0400600};
601
602/* 9: Generic Hardware Error Source */
603
604struct acpi_hest_generic {
605 struct acpi_hest_header header;
Bob Moore3fa34772008-04-10 19:06:43 +0400606 u16 related_source_id;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800607 u8 reserved;
Bob Moore3fa34772008-04-10 19:06:43 +0400608 u8 enabled;
Bob Moorec276e382009-07-27 14:55:02 +0800609 u32 records_to_preallocate;
Bob Moore3fa34772008-04-10 19:06:43 +0400610 u32 max_sections_per_record;
611 u32 max_raw_data_length;
612 struct acpi_generic_address error_status_address;
613 struct acpi_hest_notify notify;
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800614 u32 error_block_length;
615};
616
Bob Moore7cd55c72016-03-24 09:38:57 +0800617/* 10: Generic Hardware Error Source, version 2 */
618
619struct acpi_hest_generic_v2 {
620 struct acpi_hest_header header;
621 u16 related_source_id;
622 u8 reserved;
623 u8 enabled;
624 u32 records_to_preallocate;
625 u32 max_sections_per_record;
626 u32 max_raw_data_length;
627 struct acpi_generic_address error_status_address;
628 struct acpi_hest_notify notify;
629 u32 error_block_length;
630 struct acpi_generic_address read_ack_register;
631 u64 read_ack_preserve;
632 u64 read_ack_write;
633};
634
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800635/* Generic Error Status block */
636
Lv Zheng0a00fd52014-06-03 16:32:53 +0800637struct acpi_hest_generic_status {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800638 u32 block_status;
639 u32 raw_data_offset;
640 u32 raw_data_length;
641 u32 data_length;
642 u32 error_severity;
643};
644
645/* Values for block_status flags above */
646
Lv Zheng0a00fd52014-06-03 16:32:53 +0800647#define ACPI_HEST_UNCORRECTABLE (1)
648#define ACPI_HEST_CORRECTABLE (1<<1)
649#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
650#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
651#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800652
653/* Generic Error Data entry */
654
Lv Zheng0a00fd52014-06-03 16:32:53 +0800655struct acpi_hest_generic_data {
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800656 u8 section_type[16];
657 u32 error_severity;
658 u16 revision;
659 u8 validation_bits;
660 u8 flags;
661 u32 error_data_length;
662 u8 fru_id[16];
663 u8 fru_text[20];
Bob Moore3fa34772008-04-10 19:06:43 +0400664};
Bob Moore970d9c92008-04-10 19:06:42 +0400665
Bob Moore7cd55c72016-03-24 09:38:57 +0800666/* Extension for revision 0x0300 */
667
668struct acpi_hest_generic_data_v300 {
669 u8 section_type[16];
670 u32 error_severity;
671 u16 revision;
672 u8 validation_bits;
673 u8 flags;
674 u32 error_data_length;
675 u8 fru_id[16];
676 u8 fru_text[20];
677 u64 time_stamp;
678};
679
680/* Values for error_severity above */
681
682#define ACPI_HEST_GEN_ERROR_RECOVERABLE 0
683#define ACPI_HEST_GEN_ERROR_FATAL 1
684#define ACPI_HEST_GEN_ERROR_CORRECTED 2
685#define ACPI_HEST_GEN_ERROR_NONE 3
686
687/* Flags for validation_bits above */
688
689#define ACPI_HEST_GEN_VALID_FRU_ID (1)
690#define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1)
691#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
692
Bob Moore970d9c92008-04-10 19:06:42 +0400693/*******************************************************************************
694 *
Lv Zhengfa418dd2017-06-05 16:37:16 +0800695 * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
696 * Version 1
697 *
698 ******************************************************************************/
699
700struct acpi_table_hmat {
701 struct acpi_table_header header; /* Common ACPI table header */
702 u32 reserved;
703};
704
705/* Values for HMAT structure types */
706
707enum acpi_hmat_type {
708 ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
709 ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
710 ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
711 ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
712};
713
714struct acpi_hmat_structure {
715 u16 type;
716 u16 reserved;
717 u32 length;
718};
719
720/*
721 * HMAT Structures, correspond to Type in struct acpi_hmat_structure
722 */
723
724/* 0: Memory subystem address range */
725
726struct acpi_hmat_address_range {
727 struct acpi_hmat_structure header;
728 u16 flags;
729 u16 reserved1;
730 u32 processor_PD; /* Processor proximity domain */
731 u32 memory_PD; /* Memory proximity domain */
732 u32 reserved2;
733 u64 physical_address_base; /* Physical address range base */
734 u64 physical_address_length; /* Physical address range length */
735};
736
737/* Masks for Flags field above */
738
739#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: processor_PD field is valid */
740#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: memory_PD field is valid */
741#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */
742
743/* 1: System locality latency and bandwidth information */
744
745struct acpi_hmat_locality {
746 struct acpi_hmat_structure header;
747 u8 flags;
748 u8 data_type;
749 u16 reserved1;
750 u32 number_of_initiator_Pds;
751 u32 number_of_target_Pds;
752 u32 reserved2;
753 u64 entry_base_unit;
754};
755
756/* Masks for Flags field above */
757
758#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
759
760/* Values for Memory Hierarchy flag */
761
762#define ACPI_HMAT_MEMORY 0
763#define ACPI_HMAT_LAST_LEVEL_CACHE 1
764#define ACPI_HMAT_1ST_LEVEL_CACHE 2
765#define ACPI_HMAT_2ND_LEVEL_CACHE 3
766#define ACPI_HMAT_3RD_LEVEL_CACHE 4
767
768/* Values for data_type field above */
769
770#define ACPI_HMAT_ACCESS_LATENCY 0
771#define ACPI_HMAT_READ_LATENCY 1
772#define ACPI_HMAT_WRITE_LATENCY 2
773#define ACPI_HMAT_ACCESS_BANDWIDTH 3
774#define ACPI_HMAT_READ_BANDWIDTH 4
775#define ACPI_HMAT_WRITE_BANDWIDTH 5
776
777/* 2: Memory side cache information */
778
779struct acpi_hmat_cache {
780 struct acpi_hmat_structure header;
781 u32 memory_PD;
782 u32 reserved1;
783 u64 cache_size;
784 u32 cache_attributes;
785 u16 reserved2;
786 u16 number_of_SMBIOShandles;
787};
788
789/* Masks for cache_attributes field above */
790
791#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
792#define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
793#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
794#define ACPI_HMAT_WRITE_POLICY (0x0000F000)
795#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)
796
797/* Values for cache associativity flag */
798
799#define ACPI_HMAT_CA_NONE (0)
800#define ACPI_HMAT_CA_DIRECT_MAPPED (1)
801#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)
802
803/* Values for write policy flag */
804
805#define ACPI_HMAT_CP_NONE (0)
806#define ACPI_HMAT_CP_WB (1)
807#define ACPI_HMAT_CP_WT (2)
808
809/*******************************************************************************
810 *
Bob Moore793c2382006-03-31 00:00:00 -0500811 * MADT - Multiple APIC Description Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800812 * Version 3
Bob Moore793c2382006-03-31 00:00:00 -0500813 *
814 ******************************************************************************/
815
Bob Mooref3d2e782007-02-02 19:48:18 +0300816struct acpi_table_madt {
817 struct acpi_table_header header; /* Common ACPI table header */
818 u32 address; /* Physical address of local APIC */
819 u32 flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700820};
821
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800822/* Masks for Flags field above */
Bob Moore793c2382006-03-31 00:00:00 -0500823
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800824#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
Bob Moore793c2382006-03-31 00:00:00 -0500825
Bob Mooref3d2e782007-02-02 19:48:18 +0300826/* Values for PCATCompat flag */
Bob Moore793c2382006-03-31 00:00:00 -0500827
Janosch Hildebrandc03baf142017-06-05 16:37:49 +0800828#define ACPI_MADT_DUAL_PIC 1
829#define ACPI_MADT_MULTIPLE_APIC 0
Bob Moore793c2382006-03-31 00:00:00 -0500830
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800831/* Values for MADT subtable type in struct acpi_subtable_header */
Bob Moore793c2382006-03-31 00:00:00 -0500832
Bob Mooref3d2e782007-02-02 19:48:18 +0300833enum acpi_madt_type {
834 ACPI_MADT_TYPE_LOCAL_APIC = 0,
835 ACPI_MADT_TYPE_IO_APIC = 1,
836 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
837 ACPI_MADT_TYPE_NMI_SOURCE = 3,
838 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
839 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
840 ACPI_MADT_TYPE_IO_SAPIC = 6,
841 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
842 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
Bob Moore1d7cc032008-08-04 10:42:47 +0800843 ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
844 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
Bob Moorec5bd6532011-11-16 11:04:00 +0800845 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
846 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
Tomasz Nowickid0c383e2014-07-30 12:21:50 +0800847 ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
848 ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
Bob Moore0cff8dc2015-05-21 10:31:18 +0800849 ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
850 ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
Bob Mooref3d2e782007-02-02 19:48:18 +0300851};
Bob Moore793c2382006-03-31 00:00:00 -0500852
Linus Torvalds1da177e2005-04-16 15:20:36 -0700853/*
Bob Moore1a49b722014-04-30 10:04:28 +0800854 * MADT Subtables, correspond to Type in struct acpi_subtable_header
Linus Torvalds1da177e2005-04-16 15:20:36 -0700855 */
Bob Moore793c2382006-03-31 00:00:00 -0500856
Bob Mooref3d2e782007-02-02 19:48:18 +0300857/* 0: Processor Local APIC */
Bob Moore793c2382006-03-31 00:00:00 -0500858
Bob Mooref3d2e782007-02-02 19:48:18 +0300859struct acpi_madt_local_apic {
860 struct acpi_subtable_header header;
861 u8 processor_id; /* ACPI processor id */
862 u8 id; /* Processor's local APIC id */
863 u32 lapic_flags;
864};
Bob Moore793c2382006-03-31 00:00:00 -0500865
866/* 1: IO APIC */
867
Bob Mooref3d2e782007-02-02 19:48:18 +0300868struct acpi_madt_io_apic {
869 struct acpi_subtable_header header;
870 u8 id; /* I/O APIC ID */
Bob Mooreba494be2012-07-12 09:40:10 +0800871 u8 reserved; /* reserved - must be zero */
Bob Moore793c2382006-03-31 00:00:00 -0500872 u32 address; /* APIC physical address */
Bob Mooref3d2e782007-02-02 19:48:18 +0300873 u32 global_irq_base; /* Global system interrupt where INTI lines start */
Bob Moore793c2382006-03-31 00:00:00 -0500874};
875
876/* 2: Interrupt Override */
877
Bob Mooref3d2e782007-02-02 19:48:18 +0300878struct acpi_madt_interrupt_override {
879 struct acpi_subtable_header header;
880 u8 bus; /* 0 - ISA */
881 u8 source_irq; /* Interrupt source (IRQ) */
882 u32 global_irq; /* Global system interrupt */
883 u16 inti_flags;
884};
Bob Moore793c2382006-03-31 00:00:00 -0500885
Bob Mooref3d2e782007-02-02 19:48:18 +0300886/* 3: NMI Source */
Bob Moore793c2382006-03-31 00:00:00 -0500887
Bob Mooref3d2e782007-02-02 19:48:18 +0300888struct acpi_madt_nmi_source {
889 struct acpi_subtable_header header;
890 u16 inti_flags;
891 u32 global_irq; /* Global system interrupt */
Bob Moore793c2382006-03-31 00:00:00 -0500892};
893
894/* 4: Local APIC NMI */
895
Bob Mooref3d2e782007-02-02 19:48:18 +0300896struct acpi_madt_local_apic_nmi {
897 struct acpi_subtable_header header;
898 u8 processor_id; /* ACPI processor id */
899 u16 inti_flags;
900 u8 lint; /* LINTn to which NMI is connected */
Bob Moore793c2382006-03-31 00:00:00 -0500901};
902
903/* 5: Address Override */
904
Bob Mooref3d2e782007-02-02 19:48:18 +0300905struct acpi_madt_local_apic_override {
906 struct acpi_subtable_header header;
907 u16 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -0500908 u64 address; /* APIC physical address */
909};
910
911/* 6: I/O Sapic */
912
Bob Mooref3d2e782007-02-02 19:48:18 +0300913struct acpi_madt_io_sapic {
914 struct acpi_subtable_header header;
915 u8 id; /* I/O SAPIC ID */
Bob Moore793c2382006-03-31 00:00:00 -0500916 u8 reserved; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +0300917 u32 global_irq_base; /* Global interrupt for SAPIC start */
Bob Moore793c2382006-03-31 00:00:00 -0500918 u64 address; /* SAPIC physical address */
919};
920
921/* 7: Local Sapic */
922
Bob Mooref3d2e782007-02-02 19:48:18 +0300923struct acpi_madt_local_sapic {
924 struct acpi_subtable_header header;
925 u8 processor_id; /* ACPI processor id */
926 u8 id; /* SAPIC ID */
927 u8 eid; /* SAPIC EID */
Bob Moore793c2382006-03-31 00:00:00 -0500928 u8 reserved[3]; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +0300929 u32 lapic_flags;
930 u32 uid; /* Numeric UID - ACPI 3.0 */
931 char uid_string[1]; /* String UID - ACPI 3.0 */
Bob Moore793c2382006-03-31 00:00:00 -0500932};
933
934/* 8: Platform Interrupt Source */
935
Bob Mooref3d2e782007-02-02 19:48:18 +0300936struct acpi_madt_interrupt_source {
937 struct acpi_subtable_header header;
938 u16 inti_flags;
939 u8 type; /* 1=PMI, 2=INIT, 3=corrected */
940 u8 id; /* Processor ID */
941 u8 eid; /* Processor EID */
Bob Moore793c2382006-03-31 00:00:00 -0500942 u8 io_sapic_vector; /* Vector value for PMI interrupts */
Bob Mooref3d2e782007-02-02 19:48:18 +0300943 u32 global_irq; /* Global system interrupt */
Bob Moore793c2382006-03-31 00:00:00 -0500944 u32 flags; /* Interrupt Source Flags */
945};
946
Bob Moore6e2d5eb2009-07-27 10:53:00 +0800947/* Masks for Flags field above */
Bob Mooref3d2e782007-02-02 19:48:18 +0300948
949#define ACPI_MADT_CPEI_OVERRIDE (1)
950
Bob Mooreeb2289b2009-06-24 13:42:00 +0800951/* 9: Processor Local X2APIC (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +0800952
953struct acpi_madt_local_x2apic {
954 struct acpi_subtable_header header;
Lv Zheng75c80442012-12-19 05:36:49 +0000955 u16 reserved; /* reserved - must be zero */
Suresh Siddha786c2212009-03-30 14:05:50 -0800956 u32 local_apic_id; /* Processor x2APIC ID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800957 u32 lapic_flags;
Suresh Siddha786c2212009-03-30 14:05:50 -0800958 u32 uid; /* ACPI processor UID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800959};
960
Bob Mooreeb2289b2009-06-24 13:42:00 +0800961/* 10: Local X2APIC NMI (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +0800962
963struct acpi_madt_local_x2apic_nmi {
964 struct acpi_subtable_header header;
965 u16 inti_flags;
Suresh Siddha786c2212009-03-30 14:05:50 -0800966 u32 uid; /* ACPI processor UID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800967 u8 lint; /* LINTn to which NMI is connected */
Lv Zheng75c80442012-12-19 05:36:49 +0000968 u8 reserved[3]; /* reserved - must be zero */
Bob Moore1d7cc032008-08-04 10:42:47 +0800969};
970
Bob Moore0cff8dc2015-05-21 10:31:18 +0800971/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
Bob Moorec5bd6532011-11-16 11:04:00 +0800972
973struct acpi_madt_generic_interrupt {
974 struct acpi_subtable_header header;
Lv Zheng75c80442012-12-19 05:36:49 +0000975 u16 reserved; /* reserved - must be zero */
Tomasz Nowickid0c383e2014-07-30 12:21:50 +0800976 u32 cpu_interface_number;
Bob Moorec5bd6532011-11-16 11:04:00 +0800977 u32 uid;
978 u32 flags;
979 u32 parking_version;
980 u32 performance_interrupt;
981 u64 parked_address;
982 u64 base_address;
Tomasz Nowickid0c383e2014-07-30 12:21:50 +0800983 u64 gicv_base_address;
984 u64 gich_base_address;
985 u32 vgic_interrupt;
986 u64 gicr_base_address;
987 u64 arm_mpidr;
Bob Moore0cff8dc2015-05-21 10:31:18 +0800988 u8 efficiency_class;
989 u8 reserved2[3];
Bob Moorec5bd6532011-11-16 11:04:00 +0800990};
991
Tomasz Nowickid0c383e2014-07-30 12:21:50 +0800992/* Masks for Flags field above */
993
994/* ACPI_MADT_ENABLED (1) Processor is usable if set */
995#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
996#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
997
Bob Moore0cff8dc2015-05-21 10:31:18 +0800998/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
Bob Moorec5bd6532011-11-16 11:04:00 +0800999
1000struct acpi_madt_generic_distributor {
1001 struct acpi_subtable_header header;
Bob Mooreba494be2012-07-12 09:40:10 +08001002 u16 reserved; /* reserved - must be zero */
Bob Moorec5bd6532011-11-16 11:04:00 +08001003 u32 gic_id;
1004 u64 base_address;
1005 u32 global_irq_base;
Bob Moore0cff8dc2015-05-21 10:31:18 +08001006 u8 version;
1007 u8 reserved2[3]; /* reserved - must be zero */
Bob Moorec5bd6532011-11-16 11:04:00 +08001008};
1009
Hanjun Guoa8bd0f02015-07-01 14:44:10 +08001010/* Values for Version field above */
1011
1012enum acpi_madt_gic_version {
1013 ACPI_MADT_GIC_VERSION_NONE = 0,
1014 ACPI_MADT_GIC_VERSION_V1 = 1,
1015 ACPI_MADT_GIC_VERSION_V2 = 2,
1016 ACPI_MADT_GIC_VERSION_V3 = 3,
1017 ACPI_MADT_GIC_VERSION_V4 = 4,
1018 ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
1019};
1020
Tomasz Nowickid0c383e2014-07-30 12:21:50 +08001021/* 13: Generic MSI Frame (ACPI 5.1) */
1022
1023struct acpi_madt_generic_msi_frame {
1024 struct acpi_subtable_header header;
1025 u16 reserved; /* reserved - must be zero */
1026 u32 msi_frame_id;
1027 u64 base_address;
1028 u32 flags;
1029 u16 spi_count;
1030 u16 spi_base;
1031};
1032
1033/* Masks for Flags field above */
1034
1035#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
1036
1037/* 14: Generic Redistributor (ACPI 5.1) */
1038
1039struct acpi_madt_generic_redistributor {
1040 struct acpi_subtable_header header;
1041 u16 reserved; /* reserved - must be zero */
1042 u64 base_address;
1043 u32 length;
1044};
1045
Bob Moore0cff8dc2015-05-21 10:31:18 +08001046/* 15: Generic Translator (ACPI 6.0) */
1047
1048struct acpi_madt_generic_translator {
1049 struct acpi_subtable_header header;
1050 u16 reserved; /* reserved - must be zero */
1051 u32 translation_id;
1052 u64 base_address;
1053 u32 reserved2;
1054};
1055
Bob Mooref3d2e782007-02-02 19:48:18 +03001056/*
1057 * Common flags fields for MADT subtables
1058 */
1059
Tomasz Nowickid0c383e2014-07-30 12:21:50 +08001060/* MADT Local APIC flags */
Bob Mooref3d2e782007-02-02 19:48:18 +03001061
1062#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
1063
1064/* MADT MPS INTI flags (inti_flags) */
1065
1066#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
1067#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
1068
1069/* Values for MPS INTI flags */
1070
1071#define ACPI_MADT_POLARITY_CONFORMS 0
1072#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
1073#define ACPI_MADT_POLARITY_RESERVED 2
1074#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
1075
1076#define ACPI_MADT_TRIGGER_CONFORMS (0)
1077#define ACPI_MADT_TRIGGER_EDGE (1<<2)
1078#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
1079#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
1080
Bob Moore793c2382006-03-31 00:00:00 -05001081/*******************************************************************************
1082 *
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001083 * MSCT - Maximum System Characteristics Table (ACPI 4.0)
1084 * Version 1
1085 *
1086 ******************************************************************************/
1087
1088struct acpi_table_msct {
1089 struct acpi_table_header header; /* Common ACPI table header */
1090 u32 proximity_offset; /* Location of proximity info struct(s) */
1091 u32 max_proximity_domains; /* Max number of proximity domains */
1092 u32 max_clock_domains; /* Max number of clock domains */
1093 u64 max_address; /* Max physical address in system */
1094};
1095
Bob Mooreba494be2012-07-12 09:40:10 +08001096/* subtable - Maximum Proximity Domain Information. Version 1 */
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001097
1098struct acpi_msct_proximity {
1099 u8 revision;
1100 u8 length;
1101 u32 range_start; /* Start of domain range */
1102 u32 range_end; /* End of domain range */
1103 u32 processor_capacity;
1104 u64 memory_capacity; /* In bytes */
1105};
1106
1107/*******************************************************************************
1108 *
Bob Moore138a9552016-03-24 09:39:14 +08001109 * NFIT - NVDIMM Interface Table (ACPI 6.0+)
Bob Moore04f8e382015-05-21 10:31:58 +08001110 * Version 1
1111 *
1112 ******************************************************************************/
1113
1114struct acpi_table_nfit {
1115 struct acpi_table_header header; /* Common ACPI table header */
1116 u32 reserved; /* Reserved, must be zero */
1117};
1118
1119/* Subtable header for NFIT */
1120
1121struct acpi_nfit_header {
1122 u16 type;
1123 u16 length;
1124};
1125
1126/* Values for subtable type in struct acpi_nfit_header */
1127
1128enum acpi_nfit_type {
1129 ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
1130 ACPI_NFIT_TYPE_MEMORY_MAP = 1,
1131 ACPI_NFIT_TYPE_INTERLEAVE = 2,
1132 ACPI_NFIT_TYPE_SMBIOS = 3,
1133 ACPI_NFIT_TYPE_CONTROL_REGION = 4,
1134 ACPI_NFIT_TYPE_DATA_REGION = 5,
1135 ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
1136 ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */
1137};
1138
1139/*
1140 * NFIT Subtables
1141 */
1142
1143/* 0: System Physical Address Range Structure */
1144
1145struct acpi_nfit_system_address {
1146 struct acpi_nfit_header header;
1147 u16 range_index;
1148 u16 flags;
1149 u32 reserved; /* Reseved, must be zero */
1150 u32 proximity_domain;
1151 u8 range_guid[16];
1152 u64 address;
1153 u64 length;
1154 u64 memory_mapping;
1155};
1156
1157/* Flags */
1158
1159#define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
1160#define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
1161
1162/* Range Type GUIDs appear in the include/acuuid.h file */
1163
1164/* 1: Memory Device to System Address Range Map Structure */
1165
1166struct acpi_nfit_memory_map {
1167 struct acpi_nfit_header header;
1168 u32 device_handle;
1169 u16 physical_id;
1170 u16 region_id;
1171 u16 range_index;
1172 u16 region_index;
1173 u64 region_size;
1174 u64 region_offset;
1175 u64 address;
1176 u16 interleave_index;
1177 u16 interleave_ways;
1178 u16 flags;
1179 u16 reserved; /* Reserved, must be zero */
1180};
1181
1182/* Flags */
1183
1184#define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
1185#define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
1186#define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
Bob Mooreca321d12015-10-19 10:24:52 +08001187#define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
Bob Moore04f8e382015-05-21 10:31:58 +08001188#define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
1189#define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
Bob Moore138a9552016-03-24 09:39:14 +08001190#define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
Bob Moore04f8e382015-05-21 10:31:58 +08001191
1192/* 2: Interleave Structure */
1193
1194struct acpi_nfit_interleave {
1195 struct acpi_nfit_header header;
1196 u16 interleave_index;
1197 u16 reserved; /* Reserved, must be zero */
1198 u32 line_count;
1199 u32 line_size;
1200 u32 line_offset[1]; /* Variable length */
1201};
1202
1203/* 3: SMBIOS Management Information Structure */
1204
1205struct acpi_nfit_smbios {
1206 struct acpi_nfit_header header;
1207 u32 reserved; /* Reserved, must be zero */
1208 u8 data[1]; /* Variable length */
1209};
1210
1211/* 4: NVDIMM Control Region Structure */
1212
1213struct acpi_nfit_control_region {
1214 struct acpi_nfit_header header;
1215 u16 region_index;
1216 u16 vendor_id;
1217 u16 device_id;
1218 u16 revision_id;
1219 u16 subsystem_vendor_id;
1220 u16 subsystem_device_id;
1221 u16 subsystem_revision_id;
Bob Moore138a9552016-03-24 09:39:14 +08001222 u8 valid_fields;
1223 u8 manufacturing_location;
1224 u16 manufacturing_date;
1225 u8 reserved[2]; /* Reserved, must be zero */
Bob Moore04f8e382015-05-21 10:31:58 +08001226 u32 serial_number;
1227 u16 code;
1228 u16 windows;
1229 u64 window_size;
1230 u64 command_offset;
1231 u64 command_size;
1232 u64 status_offset;
1233 u64 status_size;
1234 u16 flags;
1235 u8 reserved1[6]; /* Reserved, must be zero */
1236};
1237
1238/* Flags */
1239
Bob Moore138a9552016-03-24 09:39:14 +08001240#define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
1241
1242/* valid_fields bits */
1243
1244#define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
Bob Moore04f8e382015-05-21 10:31:58 +08001245
1246/* 5: NVDIMM Block Data Window Region Structure */
1247
1248struct acpi_nfit_data_region {
1249 struct acpi_nfit_header header;
1250 u16 region_index;
1251 u16 windows;
1252 u64 offset;
1253 u64 size;
1254 u64 capacity;
1255 u64 start_address;
1256};
1257
1258/* 6: Flush Hint Address Structure */
1259
1260struct acpi_nfit_flush_address {
1261 struct acpi_nfit_header header;
1262 u32 device_handle;
1263 u16 hint_count;
1264 u8 reserved[6]; /* Reserved, must be zero */
1265 u64 hint_address[1]; /* Variable length */
1266};
1267
1268/*******************************************************************************
1269 *
Lv Zhengb8355bc2017-06-05 16:38:26 +08001270 * PPTT - Processor Properties Topology Table (ACPI 6.2)
1271 * Version 1
1272 *
1273 ******************************************************************************/
1274
1275struct acpi_table_pptt {
1276 struct acpi_table_header header; /* Common ACPI table header */
1277};
1278
1279/* Values for Type field above */
1280
1281enum acpi_pptt_type {
1282 ACPI_PPTT_TYPE_PROCESSOR = 0,
1283 ACPI_PPTT_TYPE_CACHE = 1,
1284 ACPI_PPTT_TYPE_ID = 2,
1285 ACPI_PPTT_TYPE_RESERVED = 3
1286};
1287
1288/* 0: Processor Hierarchy Node Structure */
1289
1290struct acpi_pptt_processor {
1291 struct acpi_subtable_header header;
1292 u16 reserved;
1293 u32 flags;
1294 u32 parent;
1295 u32 acpi_processor_id;
1296 u32 number_of_priv_resources;
1297};
1298
1299/* Flags */
1300
1301#define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */
1302#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */
1303
1304/* 1: Cache Type Structure */
1305
1306struct acpi_pptt_cache {
1307 struct acpi_subtable_header header;
1308 u16 reserved;
1309 u32 flags;
1310 u32 next_level_of_cache;
1311 u32 size;
1312 u32 number_of_sets;
1313 u8 associativity;
1314 u8 attributes;
1315 u16 line_size;
1316};
1317
1318/* Flags */
1319
1320#define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
1321#define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
1322#define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
1323#define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
1324#define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
1325#define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
1326#define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
1327
1328/* Masks for Attributes */
1329
1330#define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
1331#define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
1332#define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
1333
1334/* 2: ID Structure */
1335
1336struct acpi_pptt_id {
1337 struct acpi_subtable_header header;
1338 u16 reserved;
1339 u32 vendor_id;
1340 u64 level1_id;
1341 u64 level2_id;
1342 u16 major_rev;
1343 u16 minor_rev;
1344 u16 spin_rev;
1345};
1346
1347/*******************************************************************************
1348 *
Bob Moore793c2382006-03-31 00:00:00 -05001349 * SBST - Smart Battery Specification Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001350 * Version 1
Bob Moore793c2382006-03-31 00:00:00 -05001351 *
1352 ******************************************************************************/
1353
Bob Mooref3d2e782007-02-02 19:48:18 +03001354struct acpi_table_sbst {
1355 struct acpi_table_header header; /* Common ACPI table header */
1356 u32 warning_level;
Bob Moore793c2382006-03-31 00:00:00 -05001357 u32 low_level;
1358 u32 critical_level;
1359};
1360
1361/*******************************************************************************
1362 *
1363 * SLIT - System Locality Distance Information Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001364 * Version 1
Bob Moore793c2382006-03-31 00:00:00 -05001365 *
1366 ******************************************************************************/
1367
Bob Mooref3d2e782007-02-02 19:48:18 +03001368struct acpi_table_slit {
1369 struct acpi_table_header header; /* Common ACPI table header */
1370 u64 locality_count;
1371 u8 entry[1]; /* Real size = localities^2 */
Bob Moore793c2382006-03-31 00:00:00 -05001372};
1373
1374/*******************************************************************************
1375 *
Bob Moore793c2382006-03-31 00:00:00 -05001376 * SRAT - System Resource Affinity Table
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001377 * Version 3
Bob Moore793c2382006-03-31 00:00:00 -05001378 *
1379 ******************************************************************************/
1380
Bob Mooref3d2e782007-02-02 19:48:18 +03001381struct acpi_table_srat {
1382 struct acpi_table_header header; /* Common ACPI table header */
1383 u32 table_revision; /* Must be value '1' */
1384 u64 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -05001385};
1386
Bob Mooref3d2e782007-02-02 19:48:18 +03001387/* Values for subtable type in struct acpi_subtable_header */
Bob Moore793c2382006-03-31 00:00:00 -05001388
Bob Mooref3d2e782007-02-02 19:48:18 +03001389enum acpi_srat_type {
1390 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
1391 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
Bob Moore1d7cc032008-08-04 10:42:47 +08001392 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
Hanjun Guo63b8f8c2014-09-02 08:27:12 +08001393 ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
1394 ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
Bob Mooref3d2e782007-02-02 19:48:18 +03001395};
Bob Moore793c2382006-03-31 00:00:00 -05001396
Bob Moore1d7cc032008-08-04 10:42:47 +08001397/*
Bob Moore1a49b722014-04-30 10:04:28 +08001398 * SRAT Subtables, correspond to Type in struct acpi_subtable_header
Bob Moore1d7cc032008-08-04 10:42:47 +08001399 */
1400
1401/* 0: Processor Local APIC/SAPIC Affinity */
Bob Moore793c2382006-03-31 00:00:00 -05001402
Bob Mooref3d2e782007-02-02 19:48:18 +03001403struct acpi_srat_cpu_affinity {
1404 struct acpi_subtable_header header;
1405 u8 proximity_domain_lo;
Bob Moore793c2382006-03-31 00:00:00 -05001406 u8 apic_id;
Bob Mooref3d2e782007-02-02 19:48:18 +03001407 u32 flags;
Bob Moore793c2382006-03-31 00:00:00 -05001408 u8 local_sapic_eid;
1409 u8 proximity_domain_hi[3];
Hanjun Guo63b8f8c2014-09-02 08:27:12 +08001410 u32 clock_domain;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001411};
1412
Bob Moore6e2d5eb2009-07-27 10:53:00 +08001413/* Flags */
1414
1415#define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
1416
Bob Moore1d7cc032008-08-04 10:42:47 +08001417/* 1: Memory Affinity */
Bob Mooref3d2e782007-02-02 19:48:18 +03001418
1419struct acpi_srat_mem_affinity {
1420 struct acpi_subtable_header header;
1421 u32 proximity_domain;
1422 u16 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -05001423 u64 base_address;
Bob Mooref3d2e782007-02-02 19:48:18 +03001424 u64 length;
Bob Moore19d0cfe2008-06-10 15:54:40 +08001425 u32 reserved1;
Bob Mooref3d2e782007-02-02 19:48:18 +03001426 u32 flags;
Bob Moore19d0cfe2008-06-10 15:54:40 +08001427 u64 reserved2; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +03001428};
Bob Moore793c2382006-03-31 00:00:00 -05001429
Bob Mooref3d2e782007-02-02 19:48:18 +03001430/* Flags */
Bob Moore793c2382006-03-31 00:00:00 -05001431
Bob Mooref3d2e782007-02-02 19:48:18 +03001432#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
1433#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
1434#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
Bob Moore793c2382006-03-31 00:00:00 -05001435
Bob Mooreeb2289b2009-06-24 13:42:00 +08001436/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +08001437
1438struct acpi_srat_x2apic_cpu_affinity {
1439 struct acpi_subtable_header header;
1440 u16 reserved; /* Reserved, must be zero */
1441 u32 proximity_domain;
1442 u32 apic_id;
1443 u32 flags;
Bob Mooreeb2289b2009-06-24 13:42:00 +08001444 u32 clock_domain;
1445 u32 reserved2;
Bob Moore1d7cc032008-08-04 10:42:47 +08001446};
1447
1448/* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
1449
1450#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
1451
Hanjun Guo63b8f8c2014-09-02 08:27:12 +08001452/* 3: GICC Affinity (ACPI 5.1) */
1453
1454struct acpi_srat_gicc_affinity {
1455 struct acpi_subtable_header header;
1456 u32 proximity_domain;
1457 u32 acpi_processor_uid;
1458 u32 flags;
1459 u32 clock_domain;
1460};
1461
1462/* Flags for struct acpi_srat_gicc_affinity */
1463
1464#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
1465
Robert Moore6e596082014-03-05 14:12:01 +08001466/* Reset to default packing */
1467
1468#pragma pack()
Linus Torvalds1da177e2005-04-16 15:20:36 -07001469
Len Brown4be44fc2005-08-05 00:44:28 -04001470#endif /* __ACTBL1_H__ */