ACPICA: iASL/Disassembler: Add support for VRTC table
[linux-2.6-block.git] / include / acpi / actbl2.h
CommitLineData
a8357b0c
BM
1/******************************************************************************
2 *
5cf4d733 3 * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
a8357b0c
BM
4 *
5 *****************************************************************************/
6
7/*
25f044e6 8 * Copyright (C) 2000 - 2013, Intel Corp.
a8357b0c
BM
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
b24aad44
BM
44#ifndef __ACTBL2_H__
45#define __ACTBL2_H__
46
47/*******************************************************************************
48 *
49 * Additional ACPI Tables (2)
50 *
51 * These tables are not consumed directly by the ACPICA subsystem, but are
52 * included here to support device drivers and the AML disassembler.
53 *
54 * The tables in this file are defined by third-party specifications, and are
55 * not defined directly by the ACPI specification itself.
56 *
57 ******************************************************************************/
58
59/*
6e2d5ebd
BM
60 * Values for description table header signatures for tables defined in this
61 * file. Useful because they make it more difficult to inadvertently type in
62 * the wrong signature.
b24aad44
BM
63 */
64#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
65#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
4e2f9c27
BM
66#define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */
67#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */
b24aad44
BM
68#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
69#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
70#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
ba494bee 71#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
6e2d5ebd 72#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
b24aad44 73#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
0e264f0b 74#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
b24aad44
BM
75#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
76#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
77#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
78#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
79#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
25c0330a 80#define ACPI_SIG_VRTC "VRTC" /* Virtual Real Time Clock Table */
6e2d5ebd 81#define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */
b24aad44 82#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
9d8b5e7b 83#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
b24aad44
BM
84#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
85
4461cf54
BM
86#ifdef ACPI_UNDEFINED_TABLES
87/*
88 * These tables have been seen in the field, but no definition has been found
89 */
90#define ACPI_SIG_ATKG "ATKG"
91#define ACPI_SIG_GSCI "GSCI" /* GMCH SCI table */
92#define ACPI_SIG_IEIT "IEIT"
93#endif
94
b24aad44
BM
95/*
96 * All tables must be byte-packed to match the ACPI specification, since
97 * the tables are provided by the system BIOS.
98 */
99#pragma pack(1)
100
101/*
be030a57
BM
102 * Note: C bitfields are not used for this reason:
103 *
104 * "Bitfields are great and easy to read, but unfortunately the C language
105 * does not specify the layout of bitfields in memory, which means they are
106 * essentially useless for dealing with packed data in on-disk formats or
107 * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
108 * this decision was a design error in C. Ritchie could have picked an order
109 * and stuck with it." Norman Ramsey.
110 * See http://stackoverflow.com/a/1053662/41661
b24aad44
BM
111 */
112
113/*******************************************************************************
114 *
115 * ASF - Alert Standard Format table (Signature "ASF!")
6e2d5ebd 116 * Revision 0x10
b24aad44
BM
117 *
118 * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
119 *
120 ******************************************************************************/
121
122struct acpi_table_asf {
123 struct acpi_table_header header; /* Common ACPI table header */
124};
125
126/* ASF subtable header */
127
128struct acpi_asf_header {
129 u8 type;
130 u8 reserved;
131 u16 length;
132};
133
134/* Values for Type field above */
135
136enum acpi_asf_type {
137 ACPI_ASF_TYPE_INFO = 0,
138 ACPI_ASF_TYPE_ALERT = 1,
139 ACPI_ASF_TYPE_CONTROL = 2,
140 ACPI_ASF_TYPE_BOOT = 3,
141 ACPI_ASF_TYPE_ADDRESS = 4,
142 ACPI_ASF_TYPE_RESERVED = 5
143};
144
145/*
146 * ASF subtables
147 */
148
149/* 0: ASF Information */
150
151struct acpi_asf_info {
152 struct acpi_asf_header header;
153 u8 min_reset_value;
154 u8 min_poll_interval;
155 u16 system_id;
156 u32 mfg_id;
157 u8 flags;
158 u8 reserved2[3];
159};
160
6e2d5ebd
BM
161/* Masks for Flags field above */
162
163#define ACPI_ASF_SMBUS_PROTOCOLS (1)
164
b24aad44
BM
165/* 1: ASF Alerts */
166
167struct acpi_asf_alert {
168 struct acpi_asf_header header;
169 u8 assert_mask;
170 u8 deassert_mask;
171 u8 alerts;
172 u8 data_length;
173};
174
175struct acpi_asf_alert_data {
176 u8 address;
177 u8 command;
178 u8 mask;
179 u8 value;
180 u8 sensor_type;
181 u8 type;
182 u8 offset;
183 u8 source_type;
184 u8 severity;
185 u8 sensor_number;
186 u8 entity;
187 u8 instance;
188};
189
190/* 2: ASF Remote Control */
191
192struct acpi_asf_remote {
193 struct acpi_asf_header header;
194 u8 controls;
195 u8 data_length;
196 u16 reserved2;
197};
198
199struct acpi_asf_control_data {
200 u8 function;
201 u8 address;
202 u8 command;
203 u8 value;
204};
205
206/* 3: ASF RMCP Boot Options */
207
208struct acpi_asf_rmcp {
209 struct acpi_asf_header header;
210 u8 capabilities[7];
211 u8 completion_code;
212 u32 enterprise_id;
213 u8 command;
214 u16 parameter;
215 u16 boot_options;
216 u16 oem_parameters;
217};
218
219/* 4: ASF Address */
220
221struct acpi_asf_address {
222 struct acpi_asf_header header;
223 u8 eprom_address;
224 u8 devices;
225};
226
227/*******************************************************************************
228 *
229 * BOOT - Simple Boot Flag Table
6e2d5ebd
BM
230 * Version 1
231 *
232 * Conforms to the "Simple Boot Flag Specification", Version 2.1
b24aad44
BM
233 *
234 ******************************************************************************/
235
236struct acpi_table_boot {
237 struct acpi_table_header header; /* Common ACPI table header */
238 u8 cmos_index; /* Index in CMOS RAM for the boot register */
239 u8 reserved[3];
240};
241
4e2f9c27
BM
242/*******************************************************************************
243 *
244 * CSRT - Core System Resource Table
245 * Version 0
246 *
247 * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
248 *
249 ******************************************************************************/
250
251struct acpi_table_csrt {
252 struct acpi_table_header header; /* Common ACPI table header */
253};
254
255/* Resource Group subtable */
256
257struct acpi_csrt_group {
258 u32 length;
259 u32 vendor_id;
260 u32 subvendor_id;
261 u16 device_id;
262 u16 subdevice_id;
263 u16 revision;
264 u16 reserved;
e6750be9 265 u32 shared_info_length;
4e2f9c27 266
e6750be9
BM
267 /* Shared data immediately follows (Length = shared_info_length) */
268};
269
270/* Shared Info subtable */
271
272struct acpi_csrt_shared_info {
273 u16 major_version;
274 u16 minor_version;
275 u32 mmio_base_low;
276 u32 mmio_base_high;
277 u32 gsi_interrupt;
278 u8 interrupt_polarity;
279 u8 interrupt_mode;
280 u8 num_channels;
281 u8 dma_address_width;
282 u16 base_request_line;
283 u16 num_handshake_signals;
284 u32 max_block_size;
285
286 /* Resource descriptors immediately follow (Length = Group length - shared_info_length) */
4e2f9c27
BM
287};
288
289/* Resource Descriptor subtable */
290
291struct acpi_csrt_descriptor {
292 u32 length;
293 u16 type;
294 u16 subtype;
295 u32 uid;
296
297 /* Resource-specific information immediately follows */
298};
299
300/* Resource Types */
301
302#define ACPI_CSRT_TYPE_INTERRUPT 0x0001
303#define ACPI_CSRT_TYPE_TIMER 0x0002
304#define ACPI_CSRT_TYPE_DMA 0x0003
305
306/* Resource Subtypes */
307
308#define ACPI_CSRT_XRUPT_LINE 0x0000
309#define ACPI_CSRT_XRUPT_CONTROLLER 0x0001
310#define ACPI_CSRT_TIMER 0x0000
311#define ACPI_CSRT_DMA_CHANNEL 0x0000
312#define ACPI_CSRT_DMA_CONTROLLER 0x0001
313
314/*******************************************************************************
315 *
316 * DBG2 - Debug Port Table 2
317 * Version 0 (Both main table and subtables)
318 *
319 * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
320 *
321 ******************************************************************************/
322
323struct acpi_table_dbg2 {
324 struct acpi_table_header header; /* Common ACPI table header */
325 u32 info_offset;
326 u32 info_count;
327};
328
329/* Debug Device Information Subtable */
330
331struct acpi_dbg2_device {
332 u8 revision;
333 u16 length;
334 u8 register_count; /* Number of base_address registers */
335 u16 namepath_length;
336 u16 namepath_offset;
337 u16 oem_data_length;
338 u16 oem_data_offset;
339 u16 port_type;
340 u16 port_subtype;
341 u16 reserved;
342 u16 base_address_offset;
343 u16 address_size_offset;
344 /*
345 * Data that follows:
346 * base_address (required) - Each in 12-byte Generic Address Structure format.
347 * address_size (required) - Array of u32 sizes corresponding to each base_address register.
348 * Namepath (required) - Null terminated string. Single dot if not supported.
349 * oem_data (optional) - Length is oem_data_length.
350 */
351};
352
353/* Types for port_type field above */
354
355#define ACPI_DBG2_SERIAL_PORT 0x8000
356#define ACPI_DBG2_1394_PORT 0x8001
357#define ACPI_DBG2_USB_PORT 0x8002
358#define ACPI_DBG2_NET_PORT 0x8003
359
360/* Subtypes for port_subtype field above */
361
362#define ACPI_DBG2_16550_COMPATIBLE 0x0000
363#define ACPI_DBG2_16550_SUBSET 0x0001
364
365#define ACPI_DBG2_1394_STANDARD 0x0000
366
367#define ACPI_DBG2_USB_XHCI 0x0000
368#define ACPI_DBG2_USB_EHCI 0x0001
369
b24aad44
BM
370/*******************************************************************************
371 *
372 * DBGP - Debug Port table
6e2d5ebd
BM
373 * Version 1
374 *
375 * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
b24aad44
BM
376 *
377 ******************************************************************************/
378
379struct acpi_table_dbgp {
380 struct acpi_table_header header; /* Common ACPI table header */
381 u8 type; /* 0=full 16550, 1=subset of 16550 */
382 u8 reserved[3];
383 struct acpi_generic_address debug_port;
384};
385
386/*******************************************************************************
387 *
388 * DMAR - DMA Remapping table
6e2d5ebd
BM
389 * Version 1
390 *
391 * Conforms to "Intel Virtualization Technology for Directed I/O",
392 * Version 1.2, Sept. 2008
b24aad44
BM
393 *
394 ******************************************************************************/
395
396struct acpi_table_dmar {
397 struct acpi_table_header header; /* Common ACPI table header */
398 u8 width; /* Host Address Width */
399 u8 flags;
400 u8 reserved[10];
401};
402
6e2d5ebd 403/* Masks for Flags field above */
b24aad44
BM
404
405#define ACPI_DMAR_INTR_REMAP (1)
406
407/* DMAR subtable header */
408
409struct acpi_dmar_header {
410 u16 type;
411 u16 length;
412};
413
414/* Values for subtable type in struct acpi_dmar_header */
415
416enum acpi_dmar_type {
417 ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
418 ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
419 ACPI_DMAR_TYPE_ATSR = 2,
6e2d5ebd
BM
420 ACPI_DMAR_HARDWARE_AFFINITY = 3,
421 ACPI_DMAR_TYPE_RESERVED = 4 /* 4 and greater are reserved */
b24aad44
BM
422};
423
6e2d5ebd
BM
424/* DMAR Device Scope structure */
425
b24aad44
BM
426struct acpi_dmar_device_scope {
427 u8 entry_type;
428 u8 length;
429 u16 reserved;
430 u8 enumeration_id;
431 u8 bus;
432};
433
434/* Values for entry_type in struct acpi_dmar_device_scope */
435
436enum acpi_dmar_scope_type {
437 ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
438 ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
439 ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
440 ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
441 ACPI_DMAR_SCOPE_TYPE_HPET = 4,
442 ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */
443};
444
445struct acpi_dmar_pci_path {
446 u8 dev;
447 u8 fn;
448};
449
450/*
451 * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
452 */
453
454/* 0: Hardware Unit Definition */
455
456struct acpi_dmar_hardware_unit {
457 struct acpi_dmar_header header;
458 u8 flags;
459 u8 reserved;
460 u16 segment;
461 u64 address; /* Register Base Address */
462};
463
6e2d5ebd 464/* Masks for Flags field above */
b24aad44
BM
465
466#define ACPI_DMAR_INCLUDE_ALL (1)
467
468/* 1: Reserved Memory Defininition */
469
470struct acpi_dmar_reserved_memory {
471 struct acpi_dmar_header header;
472 u16 reserved;
473 u16 segment;
ba494bee
BM
474 u64 base_address; /* 4K aligned base address */
475 u64 end_address; /* 4K aligned limit address */
b24aad44
BM
476};
477
6e2d5ebd 478/* Masks for Flags field above */
b24aad44
BM
479
480#define ACPI_DMAR_ALLOW_ALL (1)
481
482/* 2: Root Port ATS Capability Reporting Structure */
483
484struct acpi_dmar_atsr {
485 struct acpi_dmar_header header;
486 u8 flags;
487 u8 reserved;
488 u16 segment;
489};
490
6e2d5ebd 491/* Masks for Flags field above */
b24aad44
BM
492
493#define ACPI_DMAR_ALL_PORTS (1)
494
6e2d5ebd
BM
495/* 3: Remapping Hardware Static Affinity Structure */
496
497struct acpi_dmar_rhsa {
498 struct acpi_dmar_header header;
499 u32 reserved;
500 u64 base_address;
501 u32 proximity_domain;
502};
503
b24aad44
BM
504/*******************************************************************************
505 *
506 * HPET - High Precision Event Timer table
6e2d5ebd
BM
507 * Version 1
508 *
509 * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
510 * Version 1.0a, October 2004
b24aad44
BM
511 *
512 ******************************************************************************/
513
514struct acpi_table_hpet {
515 struct acpi_table_header header; /* Common ACPI table header */
516 u32 id; /* Hardware ID of event timer block */
517 struct acpi_generic_address address; /* Address of event timer block */
518 u8 sequence; /* HPET sequence number */
519 u16 minimum_tick; /* Main counter min tick, periodic mode */
520 u8 flags;
521};
522
6e2d5ebd 523/* Masks for Flags field above */
b24aad44 524
6e2d5ebd 525#define ACPI_HPET_PAGE_PROTECT_MASK (3)
b24aad44 526
6e2d5ebd
BM
527/* Values for Page Protect flags */
528
529enum acpi_hpet_page_protect {
530 ACPI_HPET_NO_PAGE_PROTECT = 0,
531 ACPI_HPET_PAGE_PROTECT4 = 1,
532 ACPI_HPET_PAGE_PROTECT64 = 2
533};
b24aad44
BM
534
535/*******************************************************************************
536 *
537 * IBFT - Boot Firmware Table
6e2d5ebd
BM
538 * Version 1
539 *
540 * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
541 * Specification", Version 1.01, March 1, 2007
542 *
543 * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
544 * Therefore, it is not currently supported by the disassembler.
b24aad44
BM
545 *
546 ******************************************************************************/
547
548struct acpi_table_ibft {
549 struct acpi_table_header header; /* Common ACPI table header */
550 u8 reserved[12];
551};
552
553/* IBFT common subtable header */
554
555struct acpi_ibft_header {
556 u8 type;
557 u8 version;
558 u16 length;
559 u8 index;
560 u8 flags;
561};
562
563/* Values for Type field above */
564
565enum acpi_ibft_type {
566 ACPI_IBFT_TYPE_NOT_USED = 0,
567 ACPI_IBFT_TYPE_CONTROL = 1,
568 ACPI_IBFT_TYPE_INITIATOR = 2,
569 ACPI_IBFT_TYPE_NIC = 3,
570 ACPI_IBFT_TYPE_TARGET = 4,
571 ACPI_IBFT_TYPE_EXTENSIONS = 5,
572 ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
573};
574
575/* IBFT subtables */
576
577struct acpi_ibft_control {
578 struct acpi_ibft_header header;
579 u16 extensions;
580 u16 initiator_offset;
581 u16 nic0_offset;
582 u16 target0_offset;
583 u16 nic1_offset;
584 u16 target1_offset;
585};
586
587struct acpi_ibft_initiator {
588 struct acpi_ibft_header header;
589 u8 sns_server[16];
590 u8 slp_server[16];
591 u8 primary_server[16];
592 u8 secondary_server[16];
593 u16 name_length;
594 u16 name_offset;
595};
596
597struct acpi_ibft_nic {
598 struct acpi_ibft_header header;
599 u8 ip_address[16];
600 u8 subnet_mask_prefix;
601 u8 origin;
602 u8 gateway[16];
603 u8 primary_dns[16];
604 u8 secondary_dns[16];
605 u8 dhcp[16];
606 u16 vlan;
607 u8 mac_address[6];
608 u16 pci_address;
609 u16 name_length;
610 u16 name_offset;
611};
612
613struct acpi_ibft_target {
614 struct acpi_ibft_header header;
615 u8 target_ip_address[16];
616 u16 target_ip_socket;
617 u8 target_boot_lun[8];
618 u8 chap_type;
619 u8 nic_association;
620 u16 target_name_length;
621 u16 target_name_offset;
622 u16 chap_name_length;
623 u16 chap_name_offset;
624 u16 chap_secret_length;
625 u16 chap_secret_offset;
626 u16 reverse_chap_name_length;
627 u16 reverse_chap_name_offset;
628 u16 reverse_chap_secret_length;
629 u16 reverse_chap_secret_offset;
630};
631
6e2d5ebd
BM
632/*******************************************************************************
633 *
634 * IVRS - I/O Virtualization Reporting Structure
635 * Version 1
636 *
637 * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
638 * Revision 1.26, February 2009.
639 *
640 ******************************************************************************/
641
642struct acpi_table_ivrs {
643 struct acpi_table_header header; /* Common ACPI table header */
644 u32 info; /* Common virtualization info */
645 u64 reserved;
646};
647
648/* Values for Info field above */
649
650#define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */
651#define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */
652#define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */
653
654/* IVRS subtable header */
655
656struct acpi_ivrs_header {
657 u8 type; /* Subtable type */
658 u8 flags;
659 u16 length; /* Subtable length */
660 u16 device_id; /* ID of IOMMU */
661};
662
663/* Values for subtable Type above */
664
665enum acpi_ivrs_type {
666 ACPI_IVRS_TYPE_HARDWARE = 0x10,
667 ACPI_IVRS_TYPE_MEMORY1 = 0x20,
668 ACPI_IVRS_TYPE_MEMORY2 = 0x21,
669 ACPI_IVRS_TYPE_MEMORY3 = 0x22
670};
671
672/* Masks for Flags field above for IVHD subtable */
673
674#define ACPI_IVHD_TT_ENABLE (1)
675#define ACPI_IVHD_PASS_PW (1<<1)
676#define ACPI_IVHD_RES_PASS_PW (1<<2)
677#define ACPI_IVHD_ISOC (1<<3)
678#define ACPI_IVHD_IOTLB (1<<4)
679
680/* Masks for Flags field above for IVMD subtable */
681
682#define ACPI_IVMD_UNITY (1)
683#define ACPI_IVMD_READ (1<<1)
684#define ACPI_IVMD_WRITE (1<<2)
685#define ACPI_IVMD_EXCLUSION_RANGE (1<<3)
686
687/*
688 * IVRS subtables, correspond to Type in struct acpi_ivrs_header
689 */
690
691/* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
692
693struct acpi_ivrs_hardware {
694 struct acpi_ivrs_header header;
695 u16 capability_offset; /* Offset for IOMMU control fields */
696 u64 base_address; /* IOMMU control registers */
697 u16 pci_segment_group;
698 u16 info; /* MSI number and unit ID */
699 u32 reserved;
700};
701
702/* Masks for Info field above */
703
704#define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */
ba494bee 705#define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_ID */
6e2d5ebd
BM
706
707/*
708 * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
709 * Upper two bits of the Type field are the (encoded) length of the structure.
710 * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
711 * are reserved for future use but not defined.
712 */
713struct acpi_ivrs_de_header {
714 u8 type;
715 u16 id;
716 u8 data_setting;
717};
718
719/* Length of device entry is in the top two bits of Type field above */
720
721#define ACPI_IVHD_ENTRY_LENGTH 0xC0
722
723/* Values for device entry Type field above */
724
725enum acpi_ivrs_device_entry_type {
726 /* 4-byte device entries, all use struct acpi_ivrs_device4 */
727
728 ACPI_IVRS_TYPE_PAD4 = 0,
729 ACPI_IVRS_TYPE_ALL = 1,
730 ACPI_IVRS_TYPE_SELECT = 2,
731 ACPI_IVRS_TYPE_START = 3,
732 ACPI_IVRS_TYPE_END = 4,
733
734 /* 8-byte device entries */
735
736 ACPI_IVRS_TYPE_PAD8 = 64,
737 ACPI_IVRS_TYPE_NOT_USED = 65,
738 ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses struct acpi_ivrs_device8a */
739 ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses struct acpi_ivrs_device8a */
740 ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses struct acpi_ivrs_device8b */
741 ACPI_IVRS_TYPE_EXT_START = 71, /* Uses struct acpi_ivrs_device8b */
742 ACPI_IVRS_TYPE_SPECIAL = 72 /* Uses struct acpi_ivrs_device8c */
743};
744
745/* Values for Data field above */
746
747#define ACPI_IVHD_INIT_PASS (1)
748#define ACPI_IVHD_EINT_PASS (1<<1)
749#define ACPI_IVHD_NMI_PASS (1<<2)
750#define ACPI_IVHD_SYSTEM_MGMT (3<<4)
751#define ACPI_IVHD_LINT0_PASS (1<<6)
752#define ACPI_IVHD_LINT1_PASS (1<<7)
753
754/* Types 0-4: 4-byte device entry */
755
756struct acpi_ivrs_device4 {
757 struct acpi_ivrs_de_header header;
758};
759
760/* Types 66-67: 8-byte device entry */
761
762struct acpi_ivrs_device8a {
763 struct acpi_ivrs_de_header header;
764 u8 reserved1;
765 u16 used_id;
766 u8 reserved2;
767};
768
769/* Types 70-71: 8-byte device entry */
770
771struct acpi_ivrs_device8b {
772 struct acpi_ivrs_de_header header;
773 u32 extended_data;
774};
775
776/* Values for extended_data above */
777
778#define ACPI_IVHD_ATS_DISABLED (1<<31)
779
780/* Type 72: 8-byte device entry */
781
782struct acpi_ivrs_device8c {
783 struct acpi_ivrs_de_header header;
784 u8 handle;
785 u16 used_id;
786 u8 variety;
787};
788
789/* Values for Variety field above */
790
791#define ACPI_IVHD_IOAPIC 1
792#define ACPI_IVHD_HPET 2
793
794/* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
795
796struct acpi_ivrs_memory {
797 struct acpi_ivrs_header header;
798 u16 aux_data;
799 u64 reserved;
800 u64 start_address;
801 u64 memory_length;
802};
803
b24aad44
BM
804/*******************************************************************************
805 *
806 * MCFG - PCI Memory Mapped Configuration table and sub-table
6e2d5ebd
BM
807 * Version 1
808 *
809 * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
b24aad44
BM
810 *
811 ******************************************************************************/
812
813struct acpi_table_mcfg {
814 struct acpi_table_header header; /* Common ACPI table header */
815 u8 reserved[8];
816};
817
818/* Subtable */
819
820struct acpi_mcfg_allocation {
821 u64 address; /* Base address, processor-relative */
822 u16 pci_segment; /* PCI segment group number */
823 u8 start_bus_number; /* Starting PCI Bus number */
824 u8 end_bus_number; /* Final PCI Bus number */
825 u32 reserved;
826};
827
0e264f0b
BM
828/*******************************************************************************
829 *
830 * MCHI - Management Controller Host Interface Table
831 * Version 1
832 *
833 * Conforms to "Management Component Transport Protocol (MCTP) Host
834 * Interface Specification", Revision 1.0.0a, October 13, 2009
835 *
836 ******************************************************************************/
837
838struct acpi_table_mchi {
839 struct acpi_table_header header; /* Common ACPI table header */
840 u8 interface_type;
841 u8 protocol;
842 u64 protocol_data;
843 u8 interrupt_type;
844 u8 gpe;
845 u8 pci_device_flag;
846 u32 global_interrupt;
847 struct acpi_generic_address control_register;
848 u8 pci_segment;
849 u8 pci_bus;
850 u8 pci_device;
851 u8 pci_function;
852};
853
5cf4d733
BM
854/*******************************************************************************
855 *
856 * SLIC - Software Licensing Description Table
857 * Version 1
858 *
859 * Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
860 * Copyright 2006
861 *
862 ******************************************************************************/
863
864/* Basic SLIC table is only the common ACPI header */
865
866struct acpi_table_slic {
867 struct acpi_table_header header; /* Common ACPI table header */
868};
869
870/* Common SLIC subtable header */
871
872struct acpi_slic_header {
873 u32 type;
874 u32 length;
875};
876
877/* Values for Type field above */
878
879enum acpi_slic_type {
880 ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
881 ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
882 ACPI_SLIC_TYPE_RESERVED = 2 /* 2 and greater are reserved */
883};
884
885/*
886 * SLIC Sub-tables, correspond to Type in struct acpi_slic_header
887 */
888
889/* 0: Public Key Structure */
890
891struct acpi_slic_key {
892 struct acpi_slic_header header;
893 u8 key_type;
894 u8 version;
895 u16 reserved;
896 u32 algorithm;
897 char magic[4];
898 u32 bit_length;
899 u32 exponent;
900 u8 modulus[128];
901};
902
903/* 1: Windows Marker Structure */
904
905struct acpi_slic_marker {
906 struct acpi_slic_header header;
907 u32 version;
908 char oem_id[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
909 char oem_table_id[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
910 char windows_flag[8];
911 u32 slic_version;
912 u8 reserved[16];
913 u8 signature[128];
914};
915
b24aad44
BM
916/*******************************************************************************
917 *
918 * SPCR - Serial Port Console Redirection table
6e2d5ebd
BM
919 * Version 1
920 *
921 * Conforms to "Serial Port Console Redirection Table",
922 * Version 1.00, January 11, 2002
b24aad44
BM
923 *
924 ******************************************************************************/
925
926struct acpi_table_spcr {
927 struct acpi_table_header header; /* Common ACPI table header */
928 u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
929 u8 reserved[3];
930 struct acpi_generic_address serial_port;
931 u8 interrupt_type;
932 u8 pc_interrupt;
933 u32 interrupt;
934 u8 baud_rate;
935 u8 parity;
936 u8 stop_bits;
937 u8 flow_control;
938 u8 terminal_type;
939 u8 reserved1;
940 u16 pci_device_id;
941 u16 pci_vendor_id;
942 u8 pci_bus;
943 u8 pci_device;
944 u8 pci_function;
945 u32 pci_flags;
946 u8 pci_segment;
947 u32 reserved2;
948};
949
6e2d5ebd
BM
950/* Masks for pci_flags field above */
951
952#define ACPI_SPCR_DO_NOT_DISABLE (1)
953
b24aad44
BM
954/*******************************************************************************
955 *
956 * SPMI - Server Platform Management Interface table
6e2d5ebd
BM
957 * Version 5
958 *
959 * Conforms to "Intelligent Platform Management Interface Specification
960 * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
961 * June 12, 2009 markup.
b24aad44
BM
962 *
963 ******************************************************************************/
964
965struct acpi_table_spmi {
966 struct acpi_table_header header; /* Common ACPI table header */
b24aad44 967 u8 interface_type;
6e2d5ebd 968 u8 reserved; /* Must be 1 */
b24aad44
BM
969 u16 spec_revision; /* Version of IPMI */
970 u8 interrupt_type;
971 u8 gpe_number; /* GPE assigned */
972 u8 reserved1;
973 u8 pci_device_flag;
974 u32 interrupt;
975 struct acpi_generic_address ipmi_register;
976 u8 pci_segment;
977 u8 pci_bus;
978 u8 pci_device;
979 u8 pci_function;
6e2d5ebd
BM
980 u8 reserved2;
981};
982
983/* Values for interface_type above */
984
985enum acpi_spmi_interface_types {
986 ACPI_SPMI_NOT_USED = 0,
987 ACPI_SPMI_KEYBOARD = 1,
988 ACPI_SPMI_SMI = 2,
989 ACPI_SPMI_BLOCK_TRANSFER = 3,
990 ACPI_SPMI_SMBUS = 4,
991 ACPI_SPMI_RESERVED = 5 /* 5 and above are reserved */
b24aad44
BM
992};
993
994/*******************************************************************************
995 *
996 * TCPA - Trusted Computing Platform Alliance table
6e2d5ebd
BM
997 * Version 1
998 *
999 * Conforms to "TCG PC Specific Implementation Specification",
1000 * Version 1.1, August 18, 2003
b24aad44
BM
1001 *
1002 ******************************************************************************/
1003
1004struct acpi_table_tcpa {
1005 struct acpi_table_header header; /* Common ACPI table header */
1006 u16 reserved;
1007 u32 max_log_length; /* Maximum length for the event log area */
1008 u64 log_address; /* Address of the event log area */
1009};
1010
1011/*******************************************************************************
1012 *
1013 * UEFI - UEFI Boot optimization Table
6e2d5ebd
BM
1014 * Version 1
1015 *
1016 * Conforms to "Unified Extensible Firmware Interface Specification",
1017 * Version 2.3, May 8, 2009
b24aad44
BM
1018 *
1019 ******************************************************************************/
1020
1021struct acpi_table_uefi {
1022 struct acpi_table_header header; /* Common ACPI table header */
1023 u8 identifier[16]; /* UUID identifier */
1024 u16 data_offset; /* Offset of remaining data in table */
b24aad44
BM
1025};
1026
25c0330a
LZ
1027/*******************************************************************************
1028 *
1029 * VRTC - Virtual Real Time Clock Table
1030 * Version 1
1031 *
1032 * Conforms to "Simple Firmware Interface Specification",
1033 * Draft 0.8.2, Oct 19, 2010
1034 * NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
1035 *
1036 ******************************************************************************/
1037
1038struct acpi_table_vrtc {
1039 struct acpi_table_header header; /* Common ACPI table header */
1040};
1041
1042/* VRTC entry */
1043
1044struct acpi_vrtc_entry {
1045 struct acpi_generic_address physical_address;
1046 u32 irq;
1047};
1048
6e2d5ebd
BM
1049/*******************************************************************************
1050 *
1051 * WAET - Windows ACPI Emulated devices Table
1052 * Version 1
1053 *
1054 * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
1055 *
1056 ******************************************************************************/
1057
1058struct acpi_table_waet {
1059 struct acpi_table_header header; /* Common ACPI table header */
1060 u32 flags;
1061};
1062
1063/* Masks for Flags field above */
1064
1065#define ACPI_WAET_RTC_NO_ACK (1) /* RTC requires no int acknowledge */
1066#define ACPI_WAET_TIMER_ONE_READ (1<<1) /* PM timer requires only one read */
1067
b24aad44
BM
1068/*******************************************************************************
1069 *
1070 * WDAT - Watchdog Action Table
6e2d5ebd
BM
1071 * Version 1
1072 *
1073 * Conforms to "Hardware Watchdog Timers Design Specification",
1074 * Copyright 2006 Microsoft Corporation.
b24aad44
BM
1075 *
1076 ******************************************************************************/
1077
1078struct acpi_table_wdat {
1079 struct acpi_table_header header; /* Common ACPI table header */
1080 u32 header_length; /* Watchdog Header Length */
1081 u16 pci_segment; /* PCI Segment number */
1082 u8 pci_bus; /* PCI Bus number */
1083 u8 pci_device; /* PCI Device number */
1084 u8 pci_function; /* PCI Function number */
1085 u8 reserved[3];
1086 u32 timer_period; /* Period of one timer count (msec) */
1087 u32 max_count; /* Maximum counter value supported */
1088 u32 min_count; /* Minimum counter value */
1089 u8 flags;
1090 u8 reserved2[3];
1091 u32 entries; /* Number of watchdog entries that follow */
1092};
1093
6e2d5ebd
BM
1094/* Masks for Flags field above */
1095
1096#define ACPI_WDAT_ENABLED (1)
1097#define ACPI_WDAT_STOPPED 0x80
1098
b24aad44
BM
1099/* WDAT Instruction Entries (actions) */
1100
1101struct acpi_wdat_entry {
6e2d5ebd
BM
1102 u8 action;
1103 u8 instruction;
1104 u16 reserved;
1105 struct acpi_generic_address register_region;
1106 u32 value; /* Value used with Read/Write register */
1107 u32 mask; /* Bitmask required for this register instruction */
b24aad44
BM
1108};
1109
1110/* Values for Action field above */
1111
1112enum acpi_wdat_actions {
1113 ACPI_WDAT_RESET = 1,
1114 ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1115 ACPI_WDAT_GET_COUNTDOWN = 5,
1116 ACPI_WDAT_SET_COUNTDOWN = 6,
1117 ACPI_WDAT_GET_RUNNING_STATE = 8,
1118 ACPI_WDAT_SET_RUNNING_STATE = 9,
1119 ACPI_WDAT_GET_STOPPED_STATE = 10,
1120 ACPI_WDAT_SET_STOPPED_STATE = 11,
1121 ACPI_WDAT_GET_REBOOT = 16,
1122 ACPI_WDAT_SET_REBOOT = 17,
1123 ACPI_WDAT_GET_SHUTDOWN = 18,
1124 ACPI_WDAT_SET_SHUTDOWN = 19,
1125 ACPI_WDAT_GET_STATUS = 32,
1126 ACPI_WDAT_SET_STATUS = 33,
1127 ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */
1128};
1129
1130/* Values for Instruction field above */
1131
1132enum acpi_wdat_instructions {
1133 ACPI_WDAT_READ_VALUE = 0,
1134 ACPI_WDAT_READ_COUNTDOWN = 1,
1135 ACPI_WDAT_WRITE_VALUE = 2,
1136 ACPI_WDAT_WRITE_COUNTDOWN = 3,
1137 ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */
1138 ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */
1139};
1140
9d8b5e7b
BM
1141/*******************************************************************************
1142 *
1143 * WDDT - Watchdog Descriptor Table
1144 * Version 1
1145 *
1146 * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
1147 * Version 001, September 2002
1148 *
1149 ******************************************************************************/
1150
1151struct acpi_table_wddt {
1152 struct acpi_table_header header; /* Common ACPI table header */
1153 u16 spec_version;
1154 u16 table_version;
1155 u16 pci_vendor_id;
1156 struct acpi_generic_address address;
1157 u16 max_count; /* Maximum counter value supported */
1158 u16 min_count; /* Minimum counter value supported */
1159 u16 period;
1160 u16 status;
1161 u16 capability;
1162};
1163
1164/* Flags for Status field above */
1165
1166#define ACPI_WDDT_AVAILABLE (1)
1167#define ACPI_WDDT_ACTIVE (1<<1)
1168#define ACPI_WDDT_TCO_OS_OWNED (1<<2)
1169#define ACPI_WDDT_USER_RESET (1<<11)
1170#define ACPI_WDDT_WDT_RESET (1<<12)
1171#define ACPI_WDDT_POWER_FAIL (1<<13)
1172#define ACPI_WDDT_UNKNOWN_RESET (1<<14)
1173
1174/* Flags for Capability field above */
1175
1176#define ACPI_WDDT_AUTO_RESET (1)
1177#define ACPI_WDDT_ALERT_SUPPORT (1<<1)
1178
b24aad44
BM
1179/*******************************************************************************
1180 *
1181 * WDRT - Watchdog Resource Table
6e2d5ebd
BM
1182 * Version 1
1183 *
1184 * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
1185 * Version 1.01, August 28, 2006
b24aad44
BM
1186 *
1187 ******************************************************************************/
1188
1189struct acpi_table_wdrt {
1190 struct acpi_table_header header; /* Common ACPI table header */
6e2d5ebd
BM
1191 struct acpi_generic_address control_register;
1192 struct acpi_generic_address count_register;
1193 u16 pci_device_id;
1194 u16 pci_vendor_id;
b24aad44
BM
1195 u8 pci_bus; /* PCI Bus number */
1196 u8 pci_device; /* PCI Device number */
1197 u8 pci_function; /* PCI Function number */
6e2d5ebd
BM
1198 u8 pci_segment; /* PCI Segment number */
1199 u16 max_count; /* Maximum counter value supported */
1200 u8 units;
b24aad44
BM
1201};
1202
b24aad44
BM
1203/* Reset to default packing */
1204
1205#pragma pack()
1206
1207#endif /* __ACTBL2_H__ */