blob: 582af1fcb8f5e209d0a38d97dc2d8a6242dd1bb1 [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/*
Len Brown75a44ce2008-04-23 23:00:13 -04008 * Copyright (C) 2000 - 2008, 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/*
59 * Values for description table header signatures. Useful because they make
60 * it more difficult to inadvertently type in the wrong signature.
61 */
Bob Moore970d9c92008-04-10 19:06:42 +040062#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
Bob Moore793c2382006-03-31 00:00:00 -050063#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
Bob Moore793c2382006-03-31 00:00:00 -050064#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
Bob Moore970d9c92008-04-10 19:06:42 +040065#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
66#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
67#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
Bob Moore793c2382006-03-31 00:00:00 -050068#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
Bob Moore793c2382006-03-31 00:00:00 -050069#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
70#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
Bob Moore793c2382006-03-31 00:00:00 -050071#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
Bob Moore793c2382006-03-31 00:00:00 -050072
Bob Moore793c2382006-03-31 00:00:00 -050073/*
74 * All tables must be byte-packed to match the ACPI specification, since
75 * the tables are provided by the system BIOS.
76 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070077#pragma pack(1)
78
79/*
Bob Moore793c2382006-03-31 00:00:00 -050080 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
81 * This is the only type that is even remotely portable. Anything else is not
82 * portable, so do not use any other bitfield types.
Linus Torvalds1da177e2005-04-16 15:20:36 -070083 */
Bob Moore793c2382006-03-31 00:00:00 -050084
Bob Moore970d9c92008-04-10 19:06:42 +040085/* Common Subtable header (used in MADT, SRAT, etc.) */
Bob Mooref3d2e782007-02-02 19:48:18 +030086
87struct acpi_subtable_header {
88 u8 type;
89 u8 length;
90};
91
Bob Moore970d9c92008-04-10 19:06:42 +040092/* Common Subtable header for WHEA tables (EINJ, ERST, WDAT) */
93
94struct acpi_whea_header {
95 u8 action;
96 u8 instruction;
97 u8 flags;
98 u8 reserved;
99 struct acpi_generic_address register_region;
Bob Moore3fa34772008-04-10 19:06:43 +0400100 u64 value; /* Value used with Read/Write register */
101 u64 mask; /* Bitmask required for this register instruction */
Bob Moore970d9c92008-04-10 19:06:42 +0400102};
103
Bob Moore793c2382006-03-31 00:00:00 -0500104/*******************************************************************************
105 *
Bob Moore970d9c92008-04-10 19:06:42 +0400106 * BERT - Boot Error Record Table
107 *
108 ******************************************************************************/
109
110struct acpi_table_bert {
111 struct acpi_table_header header; /* Common ACPI table header */
112 u32 region_length; /* Length of the boot error region */
113 u64 address; /* Physical addresss of the error region */
114};
115
Bob Moore3fa34772008-04-10 19:06:43 +0400116/* Boot Error Region */
117
Bob Moore970d9c92008-04-10 19:06:42 +0400118struct acpi_bert_region {
119 u32 block_status;
120 u32 raw_data_offset;
121 u32 raw_data_length;
122 u32 data_length;
123 u32 error_severity;
Bob Moore970d9c92008-04-10 19:06:42 +0400124};
125
126/* block_status Flags */
127
128#define ACPI_BERT_UNCORRECTABLE (1)
129#define ACPI_BERT_CORRECTABLE (2)
130#define ACPI_BERT_MULTIPLE_UNCORRECTABLE (4)
131#define ACPI_BERT_MULTIPLE_CORRECTABLE (8)
132
133/*******************************************************************************
134 *
Bob Moore793c2382006-03-31 00:00:00 -0500135 * CPEP - Corrected Platform Error Polling table
136 *
137 ******************************************************************************/
138
139struct acpi_table_cpep {
Bob Mooref3d2e782007-02-02 19:48:18 +0300140 struct acpi_table_header header; /* Common ACPI table header */
141 u64 reserved;
Bob Moore793c2382006-03-31 00:00:00 -0500142};
143
144/* Subtable */
145
146struct acpi_cpep_polling {
147 u8 type;
148 u8 length;
Bob Mooref3d2e782007-02-02 19:48:18 +0300149 u8 id; /* Processor ID */
150 u8 eid; /* Processor EID */
151 u32 interval; /* Polling interval (msec) */
Bob Moore793c2382006-03-31 00:00:00 -0500152};
153
154/*******************************************************************************
155 *
Bob Moore793c2382006-03-31 00:00:00 -0500156 * ECDT - Embedded Controller Boot Resources Table
157 *
158 ******************************************************************************/
159
Bob Mooref3d2e782007-02-02 19:48:18 +0300160struct acpi_table_ecdt {
161 struct acpi_table_header header; /* Common ACPI table header */
162 struct acpi_generic_address control; /* Address of EC command/status register */
163 struct acpi_generic_address data; /* Address of EC data register */
Bob Moore793c2382006-03-31 00:00:00 -0500164 u32 uid; /* Unique ID - must be same as the EC _UID method */
Bob Mooref3d2e782007-02-02 19:48:18 +0300165 u8 gpe; /* The GPE for the EC */
166 u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
Bob Moore793c2382006-03-31 00:00:00 -0500167};
168
169/*******************************************************************************
170 *
Bob Moore970d9c92008-04-10 19:06:42 +0400171 * EINJ - Error Injection Table
172 *
173 ******************************************************************************/
174
175struct acpi_table_einj {
176 struct acpi_table_header header; /* Common ACPI table header */
177 u32 header_length;
178 u32 reserved;
179 u32 entries;
180};
181
182/* EINJ Injection Instruction Entries (actions) */
183
184struct acpi_einj_entry {
185 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
186};
187
188/* Values for Action field above */
189
190enum acpi_einj_actions {
191 ACPI_EINJ_BEGIN_OPERATION = 0,
192 ACPI_EINJ_GET_TRIGGER_TABLE = 1,
193 ACPI_EINJ_SET_ERROR_TYPE = 2,
194 ACPI_EINJ_GET_ERROR_TYPE = 3,
195 ACPI_EINJ_END_OPERATION = 4,
196 ACPI_EINJ_EXECUTE_OPERATION = 5,
197 ACPI_EINJ_CHECK_BUSY_STATUS = 6,
198 ACPI_EINJ_GET_COMMAND_STATUS = 7,
199 ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */
200 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
201};
202
203/* Values for Instruction field above */
204
205enum acpi_einj_instructions {
206 ACPI_EINJ_READ_REGISTER = 0,
207 ACPI_EINJ_READ_REGISTER_VALUE = 1,
208 ACPI_EINJ_WRITE_REGISTER = 2,
209 ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
210 ACPI_EINJ_NOOP = 4,
211 ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */
212};
213
Bob Moore3fa34772008-04-10 19:06:43 +0400214/* EINJ Trigger Error Action Table */
215
216struct acpi_einj_trigger {
217 u32 header_size;
218 u32 revision;
219 u32 table_size;
220 u32 entry_count;
221};
222
Bob Moore970d9c92008-04-10 19:06:42 +0400223/*******************************************************************************
224 *
225 * ERST - Error Record Serialization Table
226 *
227 ******************************************************************************/
228
229struct acpi_table_erst {
230 struct acpi_table_header header; /* Common ACPI table header */
231 u32 header_length;
232 u32 reserved;
233 u32 entries;
234};
235
236/* ERST Serialization Entries (actions) */
237
238struct acpi_erst_entry {
239 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
240};
241
242/* Values for Action field above */
243
244enum acpi_erst_actions {
245 ACPI_ERST_BEGIN_WRITE_OPERATION = 0,
246 ACPI_ERST_BEGIN_READ_OPERATION = 1,
247 ACPI_ERST_BETGIN_CLEAR_OPERATION = 2,
248 ACPI_ERST_END_OPERATION = 3,
249 ACPI_ERST_SET_RECORD_OFFSET = 4,
250 ACPI_ERST_EXECUTE_OPERATION = 5,
251 ACPI_ERST_CHECK_BUSY_STATUS = 6,
252 ACPI_ERST_GET_COMMAND_STATUS = 7,
253 ACPI_ERST_GET_RECORD_IDENTIFIER = 8,
254 ACPI_ERST_SET_RECORD_IDENTIFIER = 9,
255 ACPI_ERST_GET_RECORD_COUNT = 10,
256 ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
257 ACPI_ERST_NOT_USED = 12,
258 ACPI_ERST_GET_ERROR_RANGE = 13,
259 ACPI_ERST_GET_ERROR_LENGTH = 14,
260 ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
261 ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */
262};
263
264/* Values for Instruction field above */
265
266enum acpi_erst_instructions {
267 ACPI_ERST_READ_REGISTER = 0,
268 ACPI_ERST_READ_REGISTER_VALUE = 1,
269 ACPI_ERST_WRITE_REGISTER = 2,
270 ACPI_ERST_WRITE_REGISTER_VALUE = 3,
271 ACPI_ERST_NOOP = 4,
272 ACPI_ERST_LOAD_VAR1 = 5,
273 ACPI_ERST_LOAD_VAR2 = 6,
274 ACPI_ERST_STORE_VAR1 = 7,
275 ACPI_ERST_ADD = 8,
276 ACPI_ERST_SUBTRACT = 9,
277 ACPI_ERST_ADD_VALUE = 10,
278 ACPI_ERST_SUBTRACT_VALUE = 11,
279 ACPI_ERST_STALL = 12,
280 ACPI_ERST_STALL_WHILE_TRUE = 13,
281 ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
282 ACPI_ERST_GOTO = 15,
283 ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
284 ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
285 ACPI_ERST_MOVE_DATA = 18,
286 ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
287};
288
289/*******************************************************************************
290 *
291 * HEST - Hardware Error Source Table
292 *
293 ******************************************************************************/
294
295struct acpi_table_hest {
296 struct acpi_table_header header; /* Common ACPI table header */
297 u32 error_source_count;
298};
299
Bob Moore3fa34772008-04-10 19:06:43 +0400300/* HEST subtable header */
301
302struct acpi_hest_header {
303 u16 type;
304};
305
306/* Values for Type field above for subtables */
307
308enum acpi_hest_types {
309 ACPI_HEST_TYPE_XPF_MACHINE_CHECK = 0,
310 ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK = 1,
311 ACPI_HEST_TYPE_XPF_UNUSED = 2,
312 ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT = 3,
313 ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK = 4,
314 ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR = 5,
315 ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
316 ACPI_HEST_TYPE_AER_ENDPOINT = 7,
317 ACPI_HEST_TYPE_AER_BRIDGE = 8,
318 ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE = 9,
319 ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */
320};
321
322/*
323 * HEST Sub-subtables
324 */
325
326/* XPF Machine Check Error Bank */
327
328struct acpi_hest_xpf_error_bank {
329 u8 bank_number;
330 u8 clear_status_on_init;
331 u8 status_format;
332 u8 config_write_enable;
333 u32 control_register;
334 u64 control_init_data;
335 u32 status_register;
336 u32 address_register;
337 u32 misc_register;
338};
339
340/* Generic Error Status */
341
342struct acpi_hest_generic_status {
343 u32 block_status;
344 u32 raw_data_offset;
345 u32 raw_data_length;
346 u32 data_length;
347 u32 error_severity;
348};
349
350/* Generic Error Data */
351
352struct acpi_hest_generic_data {
353 u8 section_type[16];
354 u32 error_severity;
355 u16 revision;
356 u8 validation_bits;
357 u8 flags;
358 u32 error_data_length;
359 u8 fru_id[16];
360 u8 fru_text[20];
361};
362
363/* Common HEST structure for PCI/AER types below (6,7,8) */
364
365struct acpi_hest_aer_common {
366 u16 source_id;
367 u16 config_write_enable;
368 u8 flags;
369 u8 enabled;
370 u32 records_to_pre_allocate;
371 u32 max_sections_per_record;
372 u32 bus;
373 u16 device;
374 u16 function;
375 u16 device_control;
376 u16 reserved;
377 u32 uncorrectable_error_mask;
378 u32 uncorrectable_error_severity;
379 u32 correctable_error_mask;
Bob Moore7488c8d2008-12-16 16:04:29 +0800380 u32 advanced_error_capabilities;
Bob Moore3fa34772008-04-10 19:06:43 +0400381};
382
383/* Hardware Error Notification */
384
385struct acpi_hest_notify {
386 u8 type;
387 u8 length;
388 u16 config_write_enable;
389 u32 poll_interval;
390 u32 vector;
391 u32 polling_threshold_value;
392 u32 polling_threshold_window;
393 u32 error_threshold_value;
394 u32 error_threshold_window;
395};
396
397/* Values for Notify Type field above */
398
399enum acpi_hest_notify_types {
400 ACPI_HEST_NOTIFY_POLLED = 0,
401 ACPI_HEST_NOTIFY_EXTERNAL = 1,
402 ACPI_HEST_NOTIFY_LOCAL = 2,
403 ACPI_HEST_NOTIFY_SCI = 3,
404 ACPI_HEST_NOTIFY_NMI = 4,
405 ACPI_HEST_NOTIFY_RESERVED = 5 /* 5 and greater are reserved */
406};
407
408/*
409 * HEST subtables
410 *
411 * From WHEA Design Document, 16 May 2007.
412 * Note: There is no subtable type 2 in this version of the document,
413 * and there are two different subtable type 3s.
414 */
415
416 /* 0: XPF Machine Check Exception */
417
418struct acpi_hest_xpf_machine_check {
419 struct acpi_hest_header header;
420 u16 source_id;
421 u16 config_write_enable;
422 u8 flags;
423 u8 reserved1;
424 u32 records_to_pre_allocate;
425 u32 max_sections_per_record;
426 u64 global_capability_data;
427 u64 global_control_data;
428 u8 num_hardware_banks;
429 u8 reserved2[7];
430};
431
432/* 1: XPF Corrected Machine Check */
433
434struct acpi_table_hest_xpf_corrected {
435 struct acpi_hest_header header;
436 u16 source_id;
437 u16 config_write_enable;
438 u8 flags;
439 u8 enabled;
440 u32 records_to_pre_allocate;
441 u32 max_sections_per_record;
442 struct acpi_hest_notify notify;
443 u8 num_hardware_banks;
444 u8 reserved[3];
445};
446
447/* 3: XPF Non-Maskable Interrupt */
448
449struct acpi_hest_xpf_nmi {
450 struct acpi_hest_header header;
451 u16 source_id;
452 u32 reserved;
453 u32 records_to_pre_allocate;
454 u32 max_sections_per_record;
455 u32 max_raw_data_length;
456};
457
458/* 4: IPF Corrected Machine Check */
459
460struct acpi_hest_ipf_corrected {
461 struct acpi_hest_header header;
462 u8 enabled;
463 u8 reserved;
464};
465
466/* 5: IPF Corrected Platform Error */
467
468struct acpi_hest_ipf_corrected_platform {
469 struct acpi_hest_header header;
470 u8 enabled;
471 u8 reserved;
472};
473
474/* 6: PCI Express Root Port AER */
475
476struct acpi_hest_aer_root {
477 struct acpi_hest_header header;
478 struct acpi_hest_aer_common aer;
479 u32 root_error_command;
480};
481
482/* 7: PCI Express AER (AER Endpoint) */
483
484struct acpi_hest_aer {
485 struct acpi_hest_header header;
486 struct acpi_hest_aer_common aer;
487};
488
489/* 8: PCI Express/PCI-X Bridge AER */
490
491struct acpi_hest_aer_bridge {
492 struct acpi_hest_header header;
493 struct acpi_hest_aer_common aer;
494 u32 secondary_uncorrectable_error_mask;
495 u32 secondary_uncorrectable_error_severity;
496 u32 secondary_advanced_capabilities;
497};
498
499/* 9: Generic Hardware Error Source */
500
501struct acpi_hest_generic {
502 struct acpi_hest_header header;
503 u16 source_id;
504 u16 related_source_id;
505 u8 config_write_enable;
506 u8 enabled;
507 u32 records_to_pre_allocate;
508 u32 max_sections_per_record;
509 u32 max_raw_data_length;
510 struct acpi_generic_address error_status_address;
511 struct acpi_hest_notify notify;
512 u32 error_status_block_length;
513};
Bob Moore970d9c92008-04-10 19:06:42 +0400514
515/*******************************************************************************
516 *
Bob Moore793c2382006-03-31 00:00:00 -0500517 * MADT - Multiple APIC Description Table
518 *
519 ******************************************************************************/
520
Bob Mooref3d2e782007-02-02 19:48:18 +0300521struct acpi_table_madt {
522 struct acpi_table_header header; /* Common ACPI table header */
523 u32 address; /* Physical address of local APIC */
524 u32 flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700525};
526
Bob Mooref3d2e782007-02-02 19:48:18 +0300527/* Flags */
Bob Moore793c2382006-03-31 00:00:00 -0500528
Bob Mooref3d2e782007-02-02 19:48:18 +0300529#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
Bob Moore793c2382006-03-31 00:00:00 -0500530
Bob Mooref3d2e782007-02-02 19:48:18 +0300531/* Values for PCATCompat flag */
Bob Moore793c2382006-03-31 00:00:00 -0500532
Bob Mooref3d2e782007-02-02 19:48:18 +0300533#define ACPI_MADT_DUAL_PIC 0
534#define ACPI_MADT_MULTIPLE_APIC 1
Bob Moore793c2382006-03-31 00:00:00 -0500535
Bob Mooref3d2e782007-02-02 19:48:18 +0300536/* Values for subtable type in struct acpi_subtable_header */
Bob Moore793c2382006-03-31 00:00:00 -0500537
Bob Mooref3d2e782007-02-02 19:48:18 +0300538enum acpi_madt_type {
539 ACPI_MADT_TYPE_LOCAL_APIC = 0,
540 ACPI_MADT_TYPE_IO_APIC = 1,
541 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
542 ACPI_MADT_TYPE_NMI_SOURCE = 3,
543 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
544 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
545 ACPI_MADT_TYPE_IO_SAPIC = 6,
546 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
547 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
Bob Moore1d7cc032008-08-04 10:42:47 +0800548 ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
549 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
550 ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */
Bob Mooref3d2e782007-02-02 19:48:18 +0300551};
Bob Moore793c2382006-03-31 00:00:00 -0500552
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553/*
Bob Mooref3d2e782007-02-02 19:48:18 +0300554 * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
Linus Torvalds1da177e2005-04-16 15:20:36 -0700555 */
Bob Moore793c2382006-03-31 00:00:00 -0500556
Bob Mooref3d2e782007-02-02 19:48:18 +0300557/* 0: Processor Local APIC */
Bob Moore793c2382006-03-31 00:00:00 -0500558
Bob Mooref3d2e782007-02-02 19:48:18 +0300559struct acpi_madt_local_apic {
560 struct acpi_subtable_header header;
561 u8 processor_id; /* ACPI processor id */
562 u8 id; /* Processor's local APIC id */
563 u32 lapic_flags;
564};
Bob Moore793c2382006-03-31 00:00:00 -0500565
566/* 1: IO APIC */
567
Bob Mooref3d2e782007-02-02 19:48:18 +0300568struct acpi_madt_io_apic {
569 struct acpi_subtable_header header;
570 u8 id; /* I/O APIC ID */
Bob Moore793c2382006-03-31 00:00:00 -0500571 u8 reserved; /* Reserved - must be zero */
572 u32 address; /* APIC physical address */
Bob Mooref3d2e782007-02-02 19:48:18 +0300573 u32 global_irq_base; /* Global system interrupt where INTI lines start */
Bob Moore793c2382006-03-31 00:00:00 -0500574};
575
576/* 2: Interrupt Override */
577
Bob Mooref3d2e782007-02-02 19:48:18 +0300578struct acpi_madt_interrupt_override {
579 struct acpi_subtable_header header;
580 u8 bus; /* 0 - ISA */
581 u8 source_irq; /* Interrupt source (IRQ) */
582 u32 global_irq; /* Global system interrupt */
583 u16 inti_flags;
584};
Bob Moore793c2382006-03-31 00:00:00 -0500585
Bob Mooref3d2e782007-02-02 19:48:18 +0300586/* 3: NMI Source */
Bob Moore793c2382006-03-31 00:00:00 -0500587
Bob Mooref3d2e782007-02-02 19:48:18 +0300588struct acpi_madt_nmi_source {
589 struct acpi_subtable_header header;
590 u16 inti_flags;
591 u32 global_irq; /* Global system interrupt */
Bob Moore793c2382006-03-31 00:00:00 -0500592};
593
594/* 4: Local APIC NMI */
595
Bob Mooref3d2e782007-02-02 19:48:18 +0300596struct acpi_madt_local_apic_nmi {
597 struct acpi_subtable_header header;
598 u8 processor_id; /* ACPI processor id */
599 u16 inti_flags;
600 u8 lint; /* LINTn to which NMI is connected */
Bob Moore793c2382006-03-31 00:00:00 -0500601};
602
603/* 5: Address Override */
604
Bob Mooref3d2e782007-02-02 19:48:18 +0300605struct acpi_madt_local_apic_override {
606 struct acpi_subtable_header header;
607 u16 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -0500608 u64 address; /* APIC physical address */
609};
610
611/* 6: I/O Sapic */
612
Bob Mooref3d2e782007-02-02 19:48:18 +0300613struct acpi_madt_io_sapic {
614 struct acpi_subtable_header header;
615 u8 id; /* I/O SAPIC ID */
Bob Moore793c2382006-03-31 00:00:00 -0500616 u8 reserved; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +0300617 u32 global_irq_base; /* Global interrupt for SAPIC start */
Bob Moore793c2382006-03-31 00:00:00 -0500618 u64 address; /* SAPIC physical address */
619};
620
621/* 7: Local Sapic */
622
Bob Mooref3d2e782007-02-02 19:48:18 +0300623struct acpi_madt_local_sapic {
624 struct acpi_subtable_header header;
625 u8 processor_id; /* ACPI processor id */
626 u8 id; /* SAPIC ID */
627 u8 eid; /* SAPIC EID */
Bob Moore793c2382006-03-31 00:00:00 -0500628 u8 reserved[3]; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +0300629 u32 lapic_flags;
630 u32 uid; /* Numeric UID - ACPI 3.0 */
631 char uid_string[1]; /* String UID - ACPI 3.0 */
Bob Moore793c2382006-03-31 00:00:00 -0500632};
633
634/* 8: Platform Interrupt Source */
635
Bob Mooref3d2e782007-02-02 19:48:18 +0300636struct acpi_madt_interrupt_source {
637 struct acpi_subtable_header header;
638 u16 inti_flags;
639 u8 type; /* 1=PMI, 2=INIT, 3=corrected */
640 u8 id; /* Processor ID */
641 u8 eid; /* Processor EID */
Bob Moore793c2382006-03-31 00:00:00 -0500642 u8 io_sapic_vector; /* Vector value for PMI interrupts */
Bob Mooref3d2e782007-02-02 19:48:18 +0300643 u32 global_irq; /* Global system interrupt */
Bob Moore793c2382006-03-31 00:00:00 -0500644 u32 flags; /* Interrupt Source Flags */
645};
646
Bob Mooref3d2e782007-02-02 19:48:18 +0300647/* Flags field above */
648
649#define ACPI_MADT_CPEI_OVERRIDE (1)
650
Bob Mooreeb2289b2009-06-24 13:42:00 +0800651/* 9: Processor Local X2APIC (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +0800652
653struct acpi_madt_local_x2apic {
654 struct acpi_subtable_header header;
655 u16 reserved; /* Reserved - must be zero */
Suresh Siddha786c2212009-03-30 14:05:50 -0800656 u32 local_apic_id; /* Processor x2APIC ID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800657 u32 lapic_flags;
Suresh Siddha786c2212009-03-30 14:05:50 -0800658 u32 uid; /* ACPI processor UID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800659};
660
Bob Mooreeb2289b2009-06-24 13:42:00 +0800661/* 10: Local X2APIC NMI (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +0800662
663struct acpi_madt_local_x2apic_nmi {
664 struct acpi_subtable_header header;
665 u16 inti_flags;
Suresh Siddha786c2212009-03-30 14:05:50 -0800666 u32 uid; /* ACPI processor UID */
Bob Moore1d7cc032008-08-04 10:42:47 +0800667 u8 lint; /* LINTn to which NMI is connected */
668 u8 reserved[3];
669};
670
Bob Mooref3d2e782007-02-02 19:48:18 +0300671/*
672 * Common flags fields for MADT subtables
673 */
674
675/* MADT Local APIC flags (lapic_flags) */
676
677#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
678
679/* MADT MPS INTI flags (inti_flags) */
680
681#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
682#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
683
684/* Values for MPS INTI flags */
685
686#define ACPI_MADT_POLARITY_CONFORMS 0
687#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
688#define ACPI_MADT_POLARITY_RESERVED 2
689#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
690
691#define ACPI_MADT_TRIGGER_CONFORMS (0)
692#define ACPI_MADT_TRIGGER_EDGE (1<<2)
693#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
694#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
695
Bob Moore793c2382006-03-31 00:00:00 -0500696/*******************************************************************************
697 *
Bob Moore793c2382006-03-31 00:00:00 -0500698 * SBST - Smart Battery Specification Table
699 *
700 ******************************************************************************/
701
Bob Mooref3d2e782007-02-02 19:48:18 +0300702struct acpi_table_sbst {
703 struct acpi_table_header header; /* Common ACPI table header */
704 u32 warning_level;
Bob Moore793c2382006-03-31 00:00:00 -0500705 u32 low_level;
706 u32 critical_level;
707};
708
709/*******************************************************************************
710 *
711 * SLIT - System Locality Distance Information Table
712 *
713 ******************************************************************************/
714
Bob Mooref3d2e782007-02-02 19:48:18 +0300715struct acpi_table_slit {
716 struct acpi_table_header header; /* Common ACPI table header */
717 u64 locality_count;
718 u8 entry[1]; /* Real size = localities^2 */
Bob Moore793c2382006-03-31 00:00:00 -0500719};
720
721/*******************************************************************************
722 *
Bob Moore793c2382006-03-31 00:00:00 -0500723 * SRAT - System Resource Affinity Table
724 *
725 ******************************************************************************/
726
Bob Mooref3d2e782007-02-02 19:48:18 +0300727struct acpi_table_srat {
728 struct acpi_table_header header; /* Common ACPI table header */
729 u32 table_revision; /* Must be value '1' */
730 u64 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -0500731};
732
Bob Mooref3d2e782007-02-02 19:48:18 +0300733/* Values for subtable type in struct acpi_subtable_header */
Bob Moore793c2382006-03-31 00:00:00 -0500734
Bob Mooref3d2e782007-02-02 19:48:18 +0300735enum acpi_srat_type {
736 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
737 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
Bob Moore1d7cc032008-08-04 10:42:47 +0800738 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
739 ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
Bob Mooref3d2e782007-02-02 19:48:18 +0300740};
Bob Moore793c2382006-03-31 00:00:00 -0500741
Bob Moore1d7cc032008-08-04 10:42:47 +0800742/*
743 * SRAT Sub-tables, correspond to Type in struct acpi_subtable_header
744 */
745
746/* 0: Processor Local APIC/SAPIC Affinity */
Bob Moore793c2382006-03-31 00:00:00 -0500747
Bob Mooref3d2e782007-02-02 19:48:18 +0300748struct acpi_srat_cpu_affinity {
749 struct acpi_subtable_header header;
750 u8 proximity_domain_lo;
Bob Moore793c2382006-03-31 00:00:00 -0500751 u8 apic_id;
Bob Mooref3d2e782007-02-02 19:48:18 +0300752 u32 flags;
Bob Moore793c2382006-03-31 00:00:00 -0500753 u8 local_sapic_eid;
754 u8 proximity_domain_hi[3];
Bob Mooref3d2e782007-02-02 19:48:18 +0300755 u32 reserved; /* Reserved, must be zero */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700756};
757
Bob Moore1d7cc032008-08-04 10:42:47 +0800758/* 1: Memory Affinity */
Bob Mooref3d2e782007-02-02 19:48:18 +0300759
760struct acpi_srat_mem_affinity {
761 struct acpi_subtable_header header;
762 u32 proximity_domain;
763 u16 reserved; /* Reserved, must be zero */
Bob Moore793c2382006-03-31 00:00:00 -0500764 u64 base_address;
Bob Mooref3d2e782007-02-02 19:48:18 +0300765 u64 length;
Bob Moore19d0cfe2008-06-10 15:54:40 +0800766 u32 reserved1;
Bob Mooref3d2e782007-02-02 19:48:18 +0300767 u32 flags;
Bob Moore19d0cfe2008-06-10 15:54:40 +0800768 u64 reserved2; /* Reserved, must be zero */
Bob Mooref3d2e782007-02-02 19:48:18 +0300769};
Bob Moore793c2382006-03-31 00:00:00 -0500770
Bob Mooref3d2e782007-02-02 19:48:18 +0300771/* Flags */
Bob Moore793c2382006-03-31 00:00:00 -0500772
Bob Mooref3d2e782007-02-02 19:48:18 +0300773#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
774#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
775#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
Bob Moore793c2382006-03-31 00:00:00 -0500776
Bob Mooreeb2289b2009-06-24 13:42:00 +0800777/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
Bob Moore1d7cc032008-08-04 10:42:47 +0800778
779struct acpi_srat_x2apic_cpu_affinity {
780 struct acpi_subtable_header header;
781 u16 reserved; /* Reserved, must be zero */
782 u32 proximity_domain;
783 u32 apic_id;
784 u32 flags;
Bob Mooreeb2289b2009-06-24 13:42:00 +0800785 u32 clock_domain;
786 u32 reserved2;
Bob Moore1d7cc032008-08-04 10:42:47 +0800787};
788
789/* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
790
791#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
792
Bob Moore793c2382006-03-31 00:00:00 -0500793/* Reset to default packing */
794
Linus Torvalds1da177e2005-04-16 15:20:36 -0700795#pragma pack()
796
Len Brown4be44fc2005-08-05 00:44:28 -0400797#endif /* __ACTBL1_H__ */