]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/dev/acpica/include/actbl2.h
Merge ACPICA 20150717.
[FreeBSD/FreeBSD.git] / sys / contrib / dev / acpica / include / actbl2.h
1 /******************************************************************************
2  *
3  * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
4  *
5  *****************************************************************************/
6
7 /*
8  * Copyright (C) 2000 - 2015, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43
44 #ifndef __ACTBL2_H__
45 #define __ACTBL2_H__
46
47
48 /*******************************************************************************
49  *
50  * Additional ACPI Tables (2)
51  *
52  * These tables are not consumed directly by the ACPICA subsystem, but are
53  * included here to support device drivers and the AML disassembler.
54  *
55  * Generally, the tables in this file are defined by third-party specifications,
56  * and are not defined directly by the ACPI specification itself.
57  *
58  ******************************************************************************/
59
60
61 /*
62  * Values for description table header signatures for tables defined in this
63  * file. Useful because they make it more difficult to inadvertently type in
64  * the wrong signature.
65  */
66 #define ACPI_SIG_ASF            "ASF!"      /* Alert Standard Format table */
67 #define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
68 #define ACPI_SIG_CSRT           "CSRT"      /* Core System Resource Table */
69 #define ACPI_SIG_DBG2           "DBG2"      /* Debug Port table type 2 */
70 #define ACPI_SIG_DBGP           "DBGP"      /* Debug Port table */
71 #define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
72 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
73 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
74 #define ACPI_SIG_IORT           "IORT"      /* IO Remapping Table */
75 #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
76 #define ACPI_SIG_LPIT           "LPIT"      /* Low Power Idle Table */
77 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
78 #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
79 #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
80 #define ACPI_SIG_MTMR           "MTMR"      /* MID Timer table */
81 #define ACPI_SIG_SLIC           "SLIC"      /* Software Licensing Description Table */
82 #define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
83 #define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
84 #define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
85 #define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */
86 #define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
87 #define ACPI_SIG_VRTC           "VRTC"      /* Virtual Real Time Clock Table */
88 #define ACPI_SIG_WAET           "WAET"      /* Windows ACPI Emulated devices Table */
89 #define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
90 #define ACPI_SIG_WDDT           "WDDT"      /* Watchdog Timer Description Table */
91 #define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
92
93 #ifdef ACPI_UNDEFINED_TABLES
94 /*
95  * These tables have been seen in the field, but no definition has been found
96  */
97 #define ACPI_SIG_ATKG           "ATKG"
98 #define ACPI_SIG_GSCI           "GSCI"      /* GMCH SCI table */
99 #define ACPI_SIG_IEIT           "IEIT"
100 #endif
101
102 /*
103  * All tables must be byte-packed to match the ACPI specification, since
104  * the tables are provided by the system BIOS.
105  */
106 #pragma pack(1)
107
108 /*
109  * Note: C bitfields are not used for this reason:
110  *
111  * "Bitfields are great and easy to read, but unfortunately the C language
112  * does not specify the layout of bitfields in memory, which means they are
113  * essentially useless for dealing with packed data in on-disk formats or
114  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
115  * this decision was a design error in C. Ritchie could have picked an order
116  * and stuck with it." Norman Ramsey.
117  * See http://stackoverflow.com/a/1053662/41661
118  */
119
120
121 /*******************************************************************************
122  *
123  * ASF - Alert Standard Format table (Signature "ASF!")
124  *       Revision 0x10
125  *
126  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
127  *
128  ******************************************************************************/
129
130 typedef struct acpi_table_asf
131 {
132     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
133
134 } ACPI_TABLE_ASF;
135
136
137 /* ASF subtable header */
138
139 typedef struct acpi_asf_header
140 {
141     UINT8                   Type;
142     UINT8                   Reserved;
143     UINT16                  Length;
144
145 } ACPI_ASF_HEADER;
146
147
148 /* Values for Type field above */
149
150 enum AcpiAsfType
151 {
152     ACPI_ASF_TYPE_INFO          = 0,
153     ACPI_ASF_TYPE_ALERT         = 1,
154     ACPI_ASF_TYPE_CONTROL       = 2,
155     ACPI_ASF_TYPE_BOOT          = 3,
156     ACPI_ASF_TYPE_ADDRESS       = 4,
157     ACPI_ASF_TYPE_RESERVED      = 5
158 };
159
160 /*
161  * ASF subtables
162  */
163
164 /* 0: ASF Information */
165
166 typedef struct acpi_asf_info
167 {
168     ACPI_ASF_HEADER         Header;
169     UINT8                   MinResetValue;
170     UINT8                   MinPollInterval;
171     UINT16                  SystemId;
172     UINT32                  MfgId;
173     UINT8                   Flags;
174     UINT8                   Reserved2[3];
175
176 } ACPI_ASF_INFO;
177
178 /* Masks for Flags field above */
179
180 #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
181
182
183 /* 1: ASF Alerts */
184
185 typedef struct acpi_asf_alert
186 {
187     ACPI_ASF_HEADER         Header;
188     UINT8                   AssertMask;
189     UINT8                   DeassertMask;
190     UINT8                   Alerts;
191     UINT8                   DataLength;
192
193 } ACPI_ASF_ALERT;
194
195 typedef struct acpi_asf_alert_data
196 {
197     UINT8                   Address;
198     UINT8                   Command;
199     UINT8                   Mask;
200     UINT8                   Value;
201     UINT8                   SensorType;
202     UINT8                   Type;
203     UINT8                   Offset;
204     UINT8                   SourceType;
205     UINT8                   Severity;
206     UINT8                   SensorNumber;
207     UINT8                   Entity;
208     UINT8                   Instance;
209
210 } ACPI_ASF_ALERT_DATA;
211
212
213 /* 2: ASF Remote Control */
214
215 typedef struct acpi_asf_remote
216 {
217     ACPI_ASF_HEADER         Header;
218     UINT8                   Controls;
219     UINT8                   DataLength;
220     UINT16                  Reserved2;
221
222 } ACPI_ASF_REMOTE;
223
224 typedef struct acpi_asf_control_data
225 {
226     UINT8                   Function;
227     UINT8                   Address;
228     UINT8                   Command;
229     UINT8                   Value;
230
231 } ACPI_ASF_CONTROL_DATA;
232
233
234 /* 3: ASF RMCP Boot Options */
235
236 typedef struct acpi_asf_rmcp
237 {
238     ACPI_ASF_HEADER         Header;
239     UINT8                   Capabilities[7];
240     UINT8                   CompletionCode;
241     UINT32                  EnterpriseId;
242     UINT8                   Command;
243     UINT16                  Parameter;
244     UINT16                  BootOptions;
245     UINT16                  OemParameters;
246
247 } ACPI_ASF_RMCP;
248
249
250 /* 4: ASF Address */
251
252 typedef struct acpi_asf_address
253 {
254     ACPI_ASF_HEADER         Header;
255     UINT8                   EpromAddress;
256     UINT8                   Devices;
257
258 } ACPI_ASF_ADDRESS;
259
260
261 /*******************************************************************************
262  *
263  * BOOT - Simple Boot Flag Table
264  *        Version 1
265  *
266  * Conforms to the "Simple Boot Flag Specification", Version 2.1
267  *
268  ******************************************************************************/
269
270 typedef struct acpi_table_boot
271 {
272     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
273     UINT8                   CmosIndex;          /* Index in CMOS RAM for the boot register */
274     UINT8                   Reserved[3];
275
276 } ACPI_TABLE_BOOT;
277
278
279 /*******************************************************************************
280  *
281  * CSRT - Core System Resource Table
282  *        Version 0
283  *
284  * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
285  *
286  ******************************************************************************/
287
288 typedef struct acpi_table_csrt
289 {
290     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
291
292 } ACPI_TABLE_CSRT;
293
294
295 /* Resource Group subtable */
296
297 typedef struct acpi_csrt_group
298 {
299     UINT32                  Length;
300     UINT32                  VendorId;
301     UINT32                  SubvendorId;
302     UINT16                  DeviceId;
303     UINT16                  SubdeviceId;
304     UINT16                  Revision;
305     UINT16                  Reserved;
306     UINT32                  SharedInfoLength;
307
308     /* Shared data immediately follows (Length = SharedInfoLength) */
309
310 } ACPI_CSRT_GROUP;
311
312 /* Shared Info subtable */
313
314 typedef struct acpi_csrt_shared_info
315 {
316     UINT16                  MajorVersion;
317     UINT16                  MinorVersion;
318     UINT32                  MmioBaseLow;
319     UINT32                  MmioBaseHigh;
320     UINT32                  GsiInterrupt;
321     UINT8                   InterruptPolarity;
322     UINT8                   InterruptMode;
323     UINT8                   NumChannels;
324     UINT8                   DmaAddressWidth;
325     UINT16                  BaseRequestLine;
326     UINT16                  NumHandshakeSignals;
327     UINT32                  MaxBlockSize;
328
329     /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */
330
331 } ACPI_CSRT_SHARED_INFO;
332
333 /* Resource Descriptor subtable */
334
335 typedef struct acpi_csrt_descriptor
336 {
337     UINT32                  Length;
338     UINT16                  Type;
339     UINT16                  Subtype;
340     UINT32                  Uid;
341
342     /* Resource-specific information immediately follows */
343
344 } ACPI_CSRT_DESCRIPTOR;
345
346
347 /* Resource Types */
348
349 #define ACPI_CSRT_TYPE_INTERRUPT    0x0001
350 #define ACPI_CSRT_TYPE_TIMER        0x0002
351 #define ACPI_CSRT_TYPE_DMA          0x0003
352
353 /* Resource Subtypes */
354
355 #define ACPI_CSRT_XRUPT_LINE        0x0000
356 #define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
357 #define ACPI_CSRT_TIMER             0x0000
358 #define ACPI_CSRT_DMA_CHANNEL       0x0000
359 #define ACPI_CSRT_DMA_CONTROLLER    0x0001
360
361
362 /*******************************************************************************
363  *
364  * DBG2 - Debug Port Table 2
365  *        Version 0 (Both main table and subtables)
366  *
367  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
368  *
369  ******************************************************************************/
370
371 typedef struct acpi_table_dbg2
372 {
373     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
374     UINT32                  InfoOffset;
375     UINT32                  InfoCount;
376
377 } ACPI_TABLE_DBG2;
378
379
380 typedef struct acpi_dbg2_header
381 {
382     UINT32                  InfoOffset;
383     UINT32                  InfoCount;
384
385 } ACPI_DBG2_HEADER;
386
387
388 /* Debug Device Information Subtable */
389
390 typedef struct acpi_dbg2_device
391 {
392     UINT8                   Revision;
393     UINT16                  Length;
394     UINT8                   RegisterCount;      /* Number of BaseAddress registers */
395     UINT16                  NamepathLength;
396     UINT16                  NamepathOffset;
397     UINT16                  OemDataLength;
398     UINT16                  OemDataOffset;
399     UINT16                  PortType;
400     UINT16                  PortSubtype;
401     UINT16                  Reserved;
402     UINT16                  BaseAddressOffset;
403     UINT16                  AddressSizeOffset;
404     /*
405      * Data that follows:
406      *    BaseAddress (required) - Each in 12-byte Generic Address Structure format.
407      *    AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register.
408      *    Namepath    (required) - Null terminated string. Single dot if not supported.
409      *    OemData     (optional) - Length is OemDataLength.
410      */
411 } ACPI_DBG2_DEVICE;
412
413 /* Types for PortType field above */
414
415 #define ACPI_DBG2_SERIAL_PORT       0x8000
416 #define ACPI_DBG2_1394_PORT         0x8001
417 #define ACPI_DBG2_USB_PORT          0x8002
418 #define ACPI_DBG2_NET_PORT          0x8003
419
420 /* Subtypes for PortSubtype field above */
421
422 #define ACPI_DBG2_16550_COMPATIBLE  0x0000
423 #define ACPI_DBG2_16550_SUBSET      0x0001
424
425 #define ACPI_DBG2_1394_STANDARD     0x0000
426
427 #define ACPI_DBG2_USB_XHCI          0x0000
428 #define ACPI_DBG2_USB_EHCI          0x0001
429
430
431 /*******************************************************************************
432  *
433  * DBGP - Debug Port table
434  *        Version 1
435  *
436  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
437  *
438  ******************************************************************************/
439
440 typedef struct acpi_table_dbgp
441 {
442     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
443     UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
444     UINT8                   Reserved[3];
445     ACPI_GENERIC_ADDRESS    DebugPort;
446
447 } ACPI_TABLE_DBGP;
448
449
450 /*******************************************************************************
451  *
452  * DMAR - DMA Remapping table
453  *        Version 1
454  *
455  * Conforms to "Intel Virtualization Technology for Directed I/O",
456  * Version 2.2, Sept. 2013
457  *
458  ******************************************************************************/
459
460 typedef struct acpi_table_dmar
461 {
462     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
463     UINT8                   Width;              /* Host Address Width */
464     UINT8                   Flags;
465     UINT8                   Reserved[10];
466
467 } ACPI_TABLE_DMAR;
468
469 /* Masks for Flags field above */
470
471 #define ACPI_DMAR_INTR_REMAP        (1)
472 #define ACPI_DMAR_X2APIC_OPT_OUT    (2)
473
474
475 /* DMAR subtable header */
476
477 typedef struct acpi_dmar_header
478 {
479     UINT16                  Type;
480     UINT16                  Length;
481
482 } ACPI_DMAR_HEADER;
483
484 /* Values for subtable type in ACPI_DMAR_HEADER */
485
486 enum AcpiDmarType
487 {
488     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
489     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
490     ACPI_DMAR_TYPE_ROOT_ATS             = 2,
491     ACPI_DMAR_TYPE_HARDWARE_AFFINITY    = 3,
492     ACPI_DMAR_TYPE_NAMESPACE            = 4,
493     ACPI_DMAR_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
494 };
495
496
497 /* DMAR Device Scope structure */
498
499 typedef struct acpi_dmar_device_scope
500 {
501     UINT8                   EntryType;
502     UINT8                   Length;
503     UINT16                  Reserved;
504     UINT8                   EnumerationId;
505     UINT8                   Bus;
506
507 } ACPI_DMAR_DEVICE_SCOPE;
508
509 /* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
510
511 enum AcpiDmarScopeType
512 {
513     ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
514     ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
515     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
516     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
517     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
518     ACPI_DMAR_SCOPE_TYPE_NAMESPACE      = 5,
519     ACPI_DMAR_SCOPE_TYPE_RESERVED       = 6     /* 6 and greater are reserved */
520 };
521
522 typedef struct acpi_dmar_pci_path
523 {
524     UINT8                   Device;
525     UINT8                   Function;
526
527 } ACPI_DMAR_PCI_PATH;
528
529
530 /*
531  * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
532  */
533
534 /* 0: Hardware Unit Definition */
535
536 typedef struct acpi_dmar_hardware_unit
537 {
538     ACPI_DMAR_HEADER        Header;
539     UINT8                   Flags;
540     UINT8                   Reserved;
541     UINT16                  Segment;
542     UINT64                  Address;            /* Register Base Address */
543
544 } ACPI_DMAR_HARDWARE_UNIT;
545
546 /* Masks for Flags field above */
547
548 #define ACPI_DMAR_INCLUDE_ALL       (1)
549
550
551 /* 1: Reserved Memory Defininition */
552
553 typedef struct acpi_dmar_reserved_memory
554 {
555     ACPI_DMAR_HEADER        Header;
556     UINT16                  Reserved;
557     UINT16                  Segment;
558     UINT64                  BaseAddress;        /* 4K aligned base address */
559     UINT64                  EndAddress;         /* 4K aligned limit address */
560
561 } ACPI_DMAR_RESERVED_MEMORY;
562
563 /* Masks for Flags field above */
564
565 #define ACPI_DMAR_ALLOW_ALL         (1)
566
567
568 /* 2: Root Port ATS Capability Reporting Structure */
569
570 typedef struct acpi_dmar_atsr
571 {
572     ACPI_DMAR_HEADER        Header;
573     UINT8                   Flags;
574     UINT8                   Reserved;
575     UINT16                  Segment;
576
577 } ACPI_DMAR_ATSR;
578
579 /* Masks for Flags field above */
580
581 #define ACPI_DMAR_ALL_PORTS         (1)
582
583
584 /* 3: Remapping Hardware Static Affinity Structure */
585
586 typedef struct acpi_dmar_rhsa
587 {
588     ACPI_DMAR_HEADER        Header;
589     UINT32                  Reserved;
590     UINT64                  BaseAddress;
591     UINT32                  ProximityDomain;
592
593 } ACPI_DMAR_RHSA;
594
595
596 /* 4: ACPI Namespace Device Declaration Structure */
597
598 typedef struct acpi_dmar_andd
599 {
600     ACPI_DMAR_HEADER        Header;
601     UINT8                   Reserved[3];
602     UINT8                   DeviceNumber;
603     char                    DeviceName[1];
604
605 } ACPI_DMAR_ANDD;
606
607
608 /*******************************************************************************
609  *
610  * HPET - High Precision Event Timer table
611  *        Version 1
612  *
613  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
614  * Version 1.0a, October 2004
615  *
616  ******************************************************************************/
617
618 typedef struct acpi_table_hpet
619 {
620     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
621     UINT32                  Id;                 /* Hardware ID of event timer block */
622     ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
623     UINT8                   Sequence;           /* HPET sequence number */
624     UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
625     UINT8                   Flags;
626
627 } ACPI_TABLE_HPET;
628
629 /* Masks for Flags field above */
630
631 #define ACPI_HPET_PAGE_PROTECT_MASK (3)
632
633 /* Values for Page Protect flags */
634
635 enum AcpiHpetPageProtect
636 {
637     ACPI_HPET_NO_PAGE_PROTECT       = 0,
638     ACPI_HPET_PAGE_PROTECT4         = 1,
639     ACPI_HPET_PAGE_PROTECT64        = 2
640 };
641
642
643 /*******************************************************************************
644  *
645  * IBFT - Boot Firmware Table
646  *        Version 1
647  *
648  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
649  * Specification", Version 1.01, March 1, 2007
650  *
651  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
652  * Therefore, it is not currently supported by the disassembler.
653  *
654  ******************************************************************************/
655
656 typedef struct acpi_table_ibft
657 {
658     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
659     UINT8                   Reserved[12];
660
661 } ACPI_TABLE_IBFT;
662
663
664 /* IBFT common subtable header */
665
666 typedef struct acpi_ibft_header
667 {
668     UINT8                   Type;
669     UINT8                   Version;
670     UINT16                  Length;
671     UINT8                   Index;
672     UINT8                   Flags;
673
674 } ACPI_IBFT_HEADER;
675
676 /* Values for Type field above */
677
678 enum AcpiIbftType
679 {
680     ACPI_IBFT_TYPE_NOT_USED         = 0,
681     ACPI_IBFT_TYPE_CONTROL          = 1,
682     ACPI_IBFT_TYPE_INITIATOR        = 2,
683     ACPI_IBFT_TYPE_NIC              = 3,
684     ACPI_IBFT_TYPE_TARGET           = 4,
685     ACPI_IBFT_TYPE_EXTENSIONS       = 5,
686     ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
687 };
688
689
690 /* IBFT subtables */
691
692 typedef struct acpi_ibft_control
693 {
694     ACPI_IBFT_HEADER        Header;
695     UINT16                  Extensions;
696     UINT16                  InitiatorOffset;
697     UINT16                  Nic0Offset;
698     UINT16                  Target0Offset;
699     UINT16                  Nic1Offset;
700     UINT16                  Target1Offset;
701
702 } ACPI_IBFT_CONTROL;
703
704 typedef struct acpi_ibft_initiator
705 {
706     ACPI_IBFT_HEADER        Header;
707     UINT8                   SnsServer[16];
708     UINT8                   SlpServer[16];
709     UINT8                   PrimaryServer[16];
710     UINT8                   SecondaryServer[16];
711     UINT16                  NameLength;
712     UINT16                  NameOffset;
713
714 } ACPI_IBFT_INITIATOR;
715
716 typedef struct acpi_ibft_nic
717 {
718     ACPI_IBFT_HEADER        Header;
719     UINT8                   IpAddress[16];
720     UINT8                   SubnetMaskPrefix;
721     UINT8                   Origin;
722     UINT8                   Gateway[16];
723     UINT8                   PrimaryDns[16];
724     UINT8                   SecondaryDns[16];
725     UINT8                   Dhcp[16];
726     UINT16                  Vlan;
727     UINT8                   MacAddress[6];
728     UINT16                  PciAddress;
729     UINT16                  NameLength;
730     UINT16                  NameOffset;
731
732 } ACPI_IBFT_NIC;
733
734 typedef struct acpi_ibft_target
735 {
736     ACPI_IBFT_HEADER        Header;
737     UINT8                   TargetIpAddress[16];
738     UINT16                  TargetIpSocket;
739     UINT8                   TargetBootLun[8];
740     UINT8                   ChapType;
741     UINT8                   NicAssociation;
742     UINT16                  TargetNameLength;
743     UINT16                  TargetNameOffset;
744     UINT16                  ChapNameLength;
745     UINT16                  ChapNameOffset;
746     UINT16                  ChapSecretLength;
747     UINT16                  ChapSecretOffset;
748     UINT16                  ReverseChapNameLength;
749     UINT16                  ReverseChapNameOffset;
750     UINT16                  ReverseChapSecretLength;
751     UINT16                  ReverseChapSecretOffset;
752
753 } ACPI_IBFT_TARGET;
754
755
756 /*******************************************************************************
757  *
758  * IORT - IO Remapping Table
759  *
760  * Conforms to "IO Remapping Table System Software on ARM Platforms",
761  * Document number: ARM DEN 0049A, 2015
762  *
763  ******************************************************************************/
764
765 typedef struct acpi_table_iort
766 {
767     ACPI_TABLE_HEADER       Header;
768     UINT32                  NodeCount;
769     UINT32                  NodeOffset;
770     UINT32                  Reserved;
771
772 } ACPI_TABLE_IORT;
773
774
775 /*
776  * IORT subtables
777  */
778 typedef struct acpi_iort_node
779 {
780     UINT8                   Type;
781     UINT16                  Length;
782     UINT8                   Revision;
783     UINT32                  Reserved;
784     UINT32                  MappingCount;
785     UINT32                  MappingOffset;
786     char                    NodeData[1];
787
788 } ACPI_IORT_NODE;
789
790 /* Values for subtable Type above */
791
792 enum AcpiIortNodeType
793 {
794     ACPI_IORT_NODE_ITS_GROUP            = 0x00,
795     ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
796     ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
797     ACPI_IORT_NODE_SMMU                 = 0x03
798 };
799
800
801 typedef struct acpi_iort_id_mapping
802 {
803     UINT32                  InputBase;          /* Lowest value in input range */
804     UINT32                  IdCount;            /* Number of IDs */
805     UINT32                  OutputBase;         /* Lowest value in output range */
806     UINT32                  OutputReference;    /* A reference to the output node */
807     UINT32                  Flags;
808
809 } ACPI_IORT_ID_MAPPING;
810
811 /* Masks for Flags field above for IORT subtable */
812
813 #define ACPI_IORT_ID_SINGLE_MAPPING (1)
814
815
816 typedef struct acpi_iort_memory_access
817 {
818     UINT32                  CacheCoherency;
819     UINT8                   Hints;
820     UINT16                  Reserved;
821     UINT8                   MemoryFlags;
822
823 } ACPI_IORT_MEMORY_ACCESS;
824
825 /* Values for CacheCoherency field above */
826
827 #define ACPI_IORT_NODE_COHERENT         0x00000001  /* The device node is fully coherent */
828 #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000  /* The device node is not coherent */
829
830 /* Masks for Hints field above */
831
832 #define ACPI_IORT_HT_TRANSIENT          (1)
833 #define ACPI_IORT_HT_WRITE              (1<<1)
834 #define ACPI_IORT_HT_READ               (1<<2)
835 #define ACPI_IORT_HT_OVERRIDE           (1<<3)
836
837 /* Masks for MemoryFlags field above */
838
839 #define ACPI_IORT_MF_COHERENCY          (1)
840 #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
841
842
843 /*
844  * IORT node specific subtables
845  */
846 typedef struct acpi_iort_its_group
847 {
848     UINT32                  ItsCount;
849     UINT32                  Identifiers[1];         /* GIC ITS identifier arrary */
850
851 } ACPI_IORT_ITS_GROUP;
852
853
854 typedef struct acpi_iort_named_component
855 {
856     UINT32                  NodeFlags;
857     UINT64                  MemoryProperties;       /* Memory access properties */
858     UINT8                   MemoryAddressLimit;     /* Memory address size limit */
859     char                    DeviceName[1];          /* Path of namespace object */
860
861 } ACPI_IORT_NAMED_COMPONENT;
862
863
864 typedef struct acpi_iort_root_complex
865 {
866     UINT64                  MemoryProperties;       /* Memory access properties */
867     UINT32                  AtsAttribute;
868     UINT32                  PciSegmentNumber;
869
870 } ACPI_IORT_ROOT_COMPLEX;
871
872 /* Values for AtsAttribute field above */
873
874 #define ACPI_IORT_ATS_SUPPORTED         0x00000001  /* The root complex supports ATS */
875 #define ACPI_IORT_ATS_UNSUPPORTED       0x00000000  /* The root complex doesn't support ATS */
876
877
878 typedef struct acpi_iort_smmu
879 {
880     UINT64                  BaseAddress;            /* SMMU base address */
881     UINT64                  Span;                   /* Length of memory range */
882     UINT32                  Model;
883     UINT32                  Flags;
884     UINT32                  GlobalInterruptOffset;
885     UINT32                  ContextInterruptCount;
886     UINT32                  ContextInterruptOffset;
887     UINT32                  PmuInterruptCount;
888     UINT32                  PmuInterruptOffset;
889     UINT64                  Interrupts[1];          /* Interrupt array */
890
891 } ACPI_IORT_SMMU;
892
893 /* Values for Model field above */
894
895 #define ACPI_IORT_SMMU_V1               0x00000000  /* Generic SMMUv1 */
896 #define ACPI_IORT_SMMU_V2               0x00000001  /* Generic SMMUv2 */
897 #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002  /* ARM Corelink MMU-400 */
898 #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003  /* ARM Corelink MMU-500 */
899
900 /* Masks for Flags field above */
901
902 #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
903 #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
904
905
906 /*******************************************************************************
907  *
908  * IVRS - I/O Virtualization Reporting Structure
909  *        Version 1
910  *
911  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
912  * Revision 1.26, February 2009.
913  *
914  ******************************************************************************/
915
916 typedef struct acpi_table_ivrs
917 {
918     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
919     UINT32                  Info;               /* Common virtualization info */
920     UINT64                  Reserved;
921
922 } ACPI_TABLE_IVRS;
923
924 /* Values for Info field above */
925
926 #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
927 #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
928 #define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
929
930
931 /* IVRS subtable header */
932
933 typedef struct acpi_ivrs_header
934 {
935     UINT8                   Type;               /* Subtable type */
936     UINT8                   Flags;
937     UINT16                  Length;             /* Subtable length */
938     UINT16                  DeviceId;           /* ID of IOMMU */
939
940 } ACPI_IVRS_HEADER;
941
942 /* Values for subtable Type above */
943
944 enum AcpiIvrsType
945 {
946     ACPI_IVRS_TYPE_HARDWARE         = 0x10,
947     ACPI_IVRS_TYPE_MEMORY1          = 0x20,
948     ACPI_IVRS_TYPE_MEMORY2          = 0x21,
949     ACPI_IVRS_TYPE_MEMORY3          = 0x22
950 };
951
952 /* Masks for Flags field above for IVHD subtable */
953
954 #define ACPI_IVHD_TT_ENABLE         (1)
955 #define ACPI_IVHD_PASS_PW           (1<<1)
956 #define ACPI_IVHD_RES_PASS_PW       (1<<2)
957 #define ACPI_IVHD_ISOC              (1<<3)
958 #define ACPI_IVHD_IOTLB             (1<<4)
959
960 /* Masks for Flags field above for IVMD subtable */
961
962 #define ACPI_IVMD_UNITY             (1)
963 #define ACPI_IVMD_READ              (1<<1)
964 #define ACPI_IVMD_WRITE             (1<<2)
965 #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
966
967
968 /*
969  * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
970  */
971
972 /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
973
974 typedef struct acpi_ivrs_hardware
975 {
976     ACPI_IVRS_HEADER        Header;
977     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
978     UINT64                  BaseAddress;        /* IOMMU control registers */
979     UINT16                  PciSegmentGroup;
980     UINT16                  Info;               /* MSI number and unit ID */
981     UINT32                  Reserved;
982
983 } ACPI_IVRS_HARDWARE;
984
985 /* Masks for Info field above */
986
987 #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
988 #define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
989
990
991 /*
992  * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
993  * Upper two bits of the Type field are the (encoded) length of the structure.
994  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
995  * are reserved for future use but not defined.
996  */
997 typedef struct acpi_ivrs_de_header
998 {
999     UINT8                   Type;
1000     UINT16                  Id;
1001     UINT8                   DataSetting;
1002
1003 } ACPI_IVRS_DE_HEADER;
1004
1005 /* Length of device entry is in the top two bits of Type field above */
1006
1007 #define ACPI_IVHD_ENTRY_LENGTH      0xC0
1008
1009 /* Values for device entry Type field above */
1010
1011 enum AcpiIvrsDeviceEntryType
1012 {
1013     /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
1014
1015     ACPI_IVRS_TYPE_PAD4             = 0,
1016     ACPI_IVRS_TYPE_ALL              = 1,
1017     ACPI_IVRS_TYPE_SELECT           = 2,
1018     ACPI_IVRS_TYPE_START            = 3,
1019     ACPI_IVRS_TYPE_END              = 4,
1020
1021     /* 8-byte device entries */
1022
1023     ACPI_IVRS_TYPE_PAD8             = 64,
1024     ACPI_IVRS_TYPE_NOT_USED         = 65,
1025     ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
1026     ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
1027     ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
1028     ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
1029     ACPI_IVRS_TYPE_SPECIAL          = 72  /* Uses ACPI_IVRS_DEVICE8C */
1030 };
1031
1032 /* Values for Data field above */
1033
1034 #define ACPI_IVHD_INIT_PASS         (1)
1035 #define ACPI_IVHD_EINT_PASS         (1<<1)
1036 #define ACPI_IVHD_NMI_PASS          (1<<2)
1037 #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
1038 #define ACPI_IVHD_LINT0_PASS        (1<<6)
1039 #define ACPI_IVHD_LINT1_PASS        (1<<7)
1040
1041
1042 /* Types 0-4: 4-byte device entry */
1043
1044 typedef struct acpi_ivrs_device4
1045 {
1046     ACPI_IVRS_DE_HEADER     Header;
1047
1048 } ACPI_IVRS_DEVICE4;
1049
1050 /* Types 66-67: 8-byte device entry */
1051
1052 typedef struct acpi_ivrs_device8a
1053 {
1054     ACPI_IVRS_DE_HEADER     Header;
1055     UINT8                   Reserved1;
1056     UINT16                  UsedId;
1057     UINT8                   Reserved2;
1058
1059 } ACPI_IVRS_DEVICE8A;
1060
1061 /* Types 70-71: 8-byte device entry */
1062
1063 typedef struct acpi_ivrs_device8b
1064 {
1065     ACPI_IVRS_DE_HEADER     Header;
1066     UINT32                  ExtendedData;
1067
1068 } ACPI_IVRS_DEVICE8B;
1069
1070 /* Values for ExtendedData above */
1071
1072 #define ACPI_IVHD_ATS_DISABLED      (1<<31)
1073
1074 /* Type 72: 8-byte device entry */
1075
1076 typedef struct acpi_ivrs_device8c
1077 {
1078     ACPI_IVRS_DE_HEADER     Header;
1079     UINT8                   Handle;
1080     UINT16                  UsedId;
1081     UINT8                   Variety;
1082
1083 } ACPI_IVRS_DEVICE8C;
1084
1085 /* Values for Variety field above */
1086
1087 #define ACPI_IVHD_IOAPIC            1
1088 #define ACPI_IVHD_HPET              2
1089
1090
1091 /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
1092
1093 typedef struct acpi_ivrs_memory
1094 {
1095     ACPI_IVRS_HEADER        Header;
1096     UINT16                  AuxData;
1097     UINT64                  Reserved;
1098     UINT64                  StartAddress;
1099     UINT64                  MemoryLength;
1100
1101 } ACPI_IVRS_MEMORY;
1102
1103
1104 /*******************************************************************************
1105  *
1106  * LPIT - Low Power Idle Table
1107  *
1108  * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
1109  *
1110  ******************************************************************************/
1111
1112 typedef struct acpi_table_lpit
1113 {
1114     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1115
1116 } ACPI_TABLE_LPIT;
1117
1118
1119 /* LPIT subtable header */
1120
1121 typedef struct acpi_lpit_header
1122 {
1123     UINT32                  Type;               /* Subtable type */
1124     UINT32                  Length;             /* Subtable length */
1125     UINT16                  UniqueId;
1126     UINT16                  Reserved;
1127     UINT32                  Flags;
1128
1129 } ACPI_LPIT_HEADER;
1130
1131 /* Values for subtable Type above */
1132
1133 enum AcpiLpitType
1134 {
1135     ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
1136     ACPI_LPIT_TYPE_RESERVED         = 0x01      /* 1 and above are reserved */
1137 };
1138
1139 /* Masks for Flags field above  */
1140
1141 #define ACPI_LPIT_STATE_DISABLED    (1)
1142 #define ACPI_LPIT_NO_COUNTER        (1<<1)
1143
1144 /*
1145  * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
1146  */
1147
1148 /* 0x00: Native C-state instruction based LPI structure */
1149
1150 typedef struct acpi_lpit_native
1151 {
1152     ACPI_LPIT_HEADER        Header;
1153     ACPI_GENERIC_ADDRESS    EntryTrigger;
1154     UINT32                  Residency;
1155     UINT32                  Latency;
1156     ACPI_GENERIC_ADDRESS    ResidencyCounter;
1157     UINT64                  CounterFrequency;
1158
1159 } ACPI_LPIT_NATIVE;
1160
1161
1162 /*******************************************************************************
1163  *
1164  * MCFG - PCI Memory Mapped Configuration table and subtable
1165  *        Version 1
1166  *
1167  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
1168  *
1169  ******************************************************************************/
1170
1171 typedef struct acpi_table_mcfg
1172 {
1173     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1174     UINT8                   Reserved[8];
1175
1176 } ACPI_TABLE_MCFG;
1177
1178
1179 /* Subtable */
1180
1181 typedef struct acpi_mcfg_allocation
1182 {
1183     UINT64                  Address;            /* Base address, processor-relative */
1184     UINT16                  PciSegment;         /* PCI segment group number */
1185     UINT8                   StartBusNumber;     /* Starting PCI Bus number */
1186     UINT8                   EndBusNumber;       /* Final PCI Bus number */
1187     UINT32                  Reserved;
1188
1189 } ACPI_MCFG_ALLOCATION;
1190
1191
1192 /*******************************************************************************
1193  *
1194  * MCHI - Management Controller Host Interface Table
1195  *        Version 1
1196  *
1197  * Conforms to "Management Component Transport Protocol (MCTP) Host
1198  * Interface Specification", Revision 1.0.0a, October 13, 2009
1199  *
1200  ******************************************************************************/
1201
1202 typedef struct acpi_table_mchi
1203 {
1204     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1205     UINT8                   InterfaceType;
1206     UINT8                   Protocol;
1207     UINT64                  ProtocolData;
1208     UINT8                   InterruptType;
1209     UINT8                   Gpe;
1210     UINT8                   PciDeviceFlag;
1211     UINT32                  GlobalInterrupt;
1212     ACPI_GENERIC_ADDRESS    ControlRegister;
1213     UINT8                   PciSegment;
1214     UINT8                   PciBus;
1215     UINT8                   PciDevice;
1216     UINT8                   PciFunction;
1217
1218 } ACPI_TABLE_MCHI;
1219
1220
1221 /*******************************************************************************
1222  *
1223  * MSDM - Microsoft Data Management table
1224  *
1225  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
1226  * November 29, 2011. Copyright 2011 Microsoft
1227  *
1228  ******************************************************************************/
1229
1230 /* Basic MSDM table is only the common ACPI header */
1231
1232 typedef struct acpi_table_msdm
1233 {
1234     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1235
1236 } ACPI_TABLE_MSDM;
1237
1238
1239 /*******************************************************************************
1240  *
1241  * MTMR - MID Timer Table
1242  *        Version 1
1243  *
1244  * Conforms to "Simple Firmware Interface Specification",
1245  * Draft 0.8.2, Oct 19, 2010
1246  * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
1247  *
1248  ******************************************************************************/
1249
1250 typedef struct acpi_table_mtmr
1251 {
1252     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1253
1254 } ACPI_TABLE_MTMR;
1255
1256 /* MTMR entry */
1257
1258 typedef struct acpi_mtmr_entry
1259 {
1260     ACPI_GENERIC_ADDRESS    PhysicalAddress;
1261     UINT32                  Frequency;
1262     UINT32                  Irq;
1263
1264 } ACPI_MTMR_ENTRY;
1265
1266
1267 /*******************************************************************************
1268  *
1269  * SLIC - Software Licensing Description Table
1270  *
1271  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
1272  * November 29, 2011. Copyright 2011 Microsoft
1273  *
1274  ******************************************************************************/
1275
1276 /* Basic SLIC table is only the common ACPI header */
1277
1278 typedef struct acpi_table_slic
1279 {
1280     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1281
1282 } ACPI_TABLE_SLIC;
1283
1284
1285 /*******************************************************************************
1286  *
1287  * SPCR - Serial Port Console Redirection table
1288  *        Version 1
1289  *
1290  * Conforms to "Serial Port Console Redirection Table",
1291  * Version 1.00, January 11, 2002
1292  *
1293  ******************************************************************************/
1294
1295 typedef struct acpi_table_spcr
1296 {
1297     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1298     UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
1299     UINT8                   Reserved[3];
1300     ACPI_GENERIC_ADDRESS    SerialPort;
1301     UINT8                   InterruptType;
1302     UINT8                   PcInterrupt;
1303     UINT32                  Interrupt;
1304     UINT8                   BaudRate;
1305     UINT8                   Parity;
1306     UINT8                   StopBits;
1307     UINT8                   FlowControl;
1308     UINT8                   TerminalType;
1309     UINT8                   Reserved1;
1310     UINT16                  PciDeviceId;
1311     UINT16                  PciVendorId;
1312     UINT8                   PciBus;
1313     UINT8                   PciDevice;
1314     UINT8                   PciFunction;
1315     UINT32                  PciFlags;
1316     UINT8                   PciSegment;
1317     UINT32                  Reserved2;
1318
1319 } ACPI_TABLE_SPCR;
1320
1321 /* Masks for PciFlags field above */
1322
1323 #define ACPI_SPCR_DO_NOT_DISABLE    (1)
1324
1325
1326 /*******************************************************************************
1327  *
1328  * SPMI - Server Platform Management Interface table
1329  *        Version 5
1330  *
1331  * Conforms to "Intelligent Platform Management Interface Specification
1332  * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
1333  * June 12, 2009 markup.
1334  *
1335  ******************************************************************************/
1336
1337 typedef struct acpi_table_spmi
1338 {
1339     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1340     UINT8                   InterfaceType;
1341     UINT8                   Reserved;           /* Must be 1 */
1342     UINT16                  SpecRevision;       /* Version of IPMI */
1343     UINT8                   InterruptType;
1344     UINT8                   GpeNumber;          /* GPE assigned */
1345     UINT8                   Reserved1;
1346     UINT8                   PciDeviceFlag;
1347     UINT32                  Interrupt;
1348     ACPI_GENERIC_ADDRESS    IpmiRegister;
1349     UINT8                   PciSegment;
1350     UINT8                   PciBus;
1351     UINT8                   PciDevice;
1352     UINT8                   PciFunction;
1353     UINT8                   Reserved2;
1354
1355 } ACPI_TABLE_SPMI;
1356
1357 /* Values for InterfaceType above */
1358
1359 enum AcpiSpmiInterfaceTypes
1360 {
1361     ACPI_SPMI_NOT_USED              = 0,
1362     ACPI_SPMI_KEYBOARD              = 1,
1363     ACPI_SPMI_SMI                   = 2,
1364     ACPI_SPMI_BLOCK_TRANSFER        = 3,
1365     ACPI_SPMI_SMBUS                 = 4,
1366     ACPI_SPMI_RESERVED              = 5         /* 5 and above are reserved */
1367 };
1368
1369
1370 /*******************************************************************************
1371  *
1372  * TCPA - Trusted Computing Platform Alliance table
1373  *        Version 2
1374  *
1375  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1376  * December 19, 2014
1377  *
1378  * NOTE: There are two versions of the table with the same signature --
1379  * the client version and the server version. The common PlatformClass
1380  * field is used to differentiate the two types of tables.
1381  *
1382  ******************************************************************************/
1383
1384 typedef struct acpi_table_tcpa_hdr
1385 {
1386     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1387     UINT16                  PlatformClass;
1388
1389 } ACPI_TABLE_TCPA_HDR;
1390
1391 /*
1392  * Values for PlatformClass above.
1393  * This is how the client and server subtables are differentiated
1394  */
1395 #define ACPI_TCPA_CLIENT_TABLE          0
1396 #define ACPI_TCPA_SERVER_TABLE          1
1397
1398
1399 typedef struct acpi_table_tcpa_client
1400 {
1401     UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
1402     UINT64                  LogAddress;         /* Address of the event log area */
1403
1404 } ACPI_TABLE_TCPA_CLIENT;
1405
1406 typedef struct acpi_table_tcpa_server
1407 {
1408     UINT16                  Reserved;
1409     UINT64                  MinimumLogLength;   /* Minimum length for the event log area */
1410     UINT64                  LogAddress;         /* Address of the event log area */
1411     UINT16                  SpecRevision;
1412     UINT8                   DeviceFlags;
1413     UINT8                   InterruptFlags;
1414     UINT8                   GpeNumber;
1415     UINT8                   Reserved2[3];
1416     UINT32                  GlobalInterrupt;
1417     ACPI_GENERIC_ADDRESS    Address;
1418     UINT32                  Reserved3;
1419     ACPI_GENERIC_ADDRESS    ConfigAddress;
1420     UINT8                   Group;
1421     UINT8                   Bus;                /* PCI Bus/Segment/Function numbers */
1422     UINT8                   Device;
1423     UINT8                   Function;
1424
1425 } ACPI_TABLE_TCPA_SERVER;
1426
1427 /* Values for DeviceFlags above */
1428
1429 #define ACPI_TCPA_PCI_DEVICE            (1)
1430 #define ACPI_TCPA_BUS_PNP               (1<<1)
1431 #define ACPI_TCPA_ADDRESS_VALID         (1<<2)
1432
1433 /* Values for InterruptFlags above */
1434
1435 #define ACPI_TCPA_INTERRUPT_MODE        (1)
1436 #define ACPI_TCPA_INTERRUPT_POLARITY    (1<<1)
1437 #define ACPI_TCPA_SCI_VIA_GPE           (1<<2)
1438 #define ACPI_TCPA_GLOBAL_INTERRUPT      (1<<3)
1439
1440
1441 /*******************************************************************************
1442  *
1443  * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
1444  *        Version 4
1445  *
1446  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1447  * December 19, 2014
1448  *
1449  ******************************************************************************/
1450
1451 typedef struct acpi_table_tpm2
1452 {
1453     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1454     UINT16                  PlatformClass;
1455     UINT16                  Reserved;
1456     UINT64                  ControlAddress;
1457     UINT32                  StartMethod;
1458
1459     /* Platform-specific data follows */
1460
1461 } ACPI_TABLE_TPM2;
1462
1463 /* Values for StartMethod above */
1464
1465 #define ACPI_TPM2_NOT_ALLOWED                       0
1466 #define ACPI_TPM2_START_METHOD                      2
1467 #define ACPI_TPM2_MEMORY_MAPPED                     6
1468 #define ACPI_TPM2_COMMAND_BUFFER                    7
1469 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD  8
1470
1471
1472 /*******************************************************************************
1473  *
1474  * UEFI - UEFI Boot optimization Table
1475  *        Version 1
1476  *
1477  * Conforms to "Unified Extensible Firmware Interface Specification",
1478  * Version 2.3, May 8, 2009
1479  *
1480  ******************************************************************************/
1481
1482 typedef struct acpi_table_uefi
1483 {
1484     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1485     UINT8                   Identifier[16];     /* UUID identifier */
1486     UINT16                  DataOffset;         /* Offset of remaining data in table */
1487
1488 } ACPI_TABLE_UEFI;
1489
1490
1491 /*******************************************************************************
1492  *
1493  * VRTC - Virtual Real Time Clock Table
1494  *        Version 1
1495  *
1496  * Conforms to "Simple Firmware Interface Specification",
1497  * Draft 0.8.2, Oct 19, 2010
1498  * NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
1499  *
1500  ******************************************************************************/
1501
1502 typedef struct acpi_table_vrtc
1503 {
1504     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1505
1506 } ACPI_TABLE_VRTC;
1507
1508 /* VRTC entry */
1509
1510 typedef struct acpi_vrtc_entry
1511 {
1512     ACPI_GENERIC_ADDRESS    PhysicalAddress;
1513     UINT32                  Irq;
1514
1515 } ACPI_VRTC_ENTRY;
1516
1517
1518 /*******************************************************************************
1519  *
1520  * WAET - Windows ACPI Emulated devices Table
1521  *        Version 1
1522  *
1523  * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
1524  *
1525  ******************************************************************************/
1526
1527 typedef struct acpi_table_waet
1528 {
1529     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1530     UINT32                  Flags;
1531
1532 } ACPI_TABLE_WAET;
1533
1534 /* Masks for Flags field above */
1535
1536 #define ACPI_WAET_RTC_NO_ACK        (1)         /* RTC requires no int acknowledge */
1537 #define ACPI_WAET_TIMER_ONE_READ    (1<<1)      /* PM timer requires only one read */
1538
1539
1540 /*******************************************************************************
1541  *
1542  * WDAT - Watchdog Action Table
1543  *        Version 1
1544  *
1545  * Conforms to "Hardware Watchdog Timers Design Specification",
1546  * Copyright 2006 Microsoft Corporation.
1547  *
1548  ******************************************************************************/
1549
1550 typedef struct acpi_table_wdat
1551 {
1552     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1553     UINT32                  HeaderLength;       /* Watchdog Header Length */
1554     UINT16                  PciSegment;         /* PCI Segment number */
1555     UINT8                   PciBus;             /* PCI Bus number */
1556     UINT8                   PciDevice;          /* PCI Device number */
1557     UINT8                   PciFunction;        /* PCI Function number */
1558     UINT8                   Reserved[3];
1559     UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
1560     UINT32                  MaxCount;           /* Maximum counter value supported */
1561     UINT32                  MinCount;           /* Minimum counter value */
1562     UINT8                   Flags;
1563     UINT8                   Reserved2[3];
1564     UINT32                  Entries;            /* Number of watchdog entries that follow */
1565
1566 } ACPI_TABLE_WDAT;
1567
1568 /* Masks for Flags field above */
1569
1570 #define ACPI_WDAT_ENABLED           (1)
1571 #define ACPI_WDAT_STOPPED           0x80
1572
1573
1574 /* WDAT Instruction Entries (actions) */
1575
1576 typedef struct acpi_wdat_entry
1577 {
1578     UINT8                   Action;
1579     UINT8                   Instruction;
1580     UINT16                  Reserved;
1581     ACPI_GENERIC_ADDRESS    RegisterRegion;
1582     UINT32                  Value;              /* Value used with Read/Write register */
1583     UINT32                  Mask;               /* Bitmask required for this register instruction */
1584
1585 } ACPI_WDAT_ENTRY;
1586
1587 /* Values for Action field above */
1588
1589 enum AcpiWdatActions
1590 {
1591     ACPI_WDAT_RESET                 = 1,
1592     ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1593     ACPI_WDAT_GET_COUNTDOWN         = 5,
1594     ACPI_WDAT_SET_COUNTDOWN         = 6,
1595     ACPI_WDAT_GET_RUNNING_STATE     = 8,
1596     ACPI_WDAT_SET_RUNNING_STATE     = 9,
1597     ACPI_WDAT_GET_STOPPED_STATE     = 10,
1598     ACPI_WDAT_SET_STOPPED_STATE     = 11,
1599     ACPI_WDAT_GET_REBOOT            = 16,
1600     ACPI_WDAT_SET_REBOOT            = 17,
1601     ACPI_WDAT_GET_SHUTDOWN          = 18,
1602     ACPI_WDAT_SET_SHUTDOWN          = 19,
1603     ACPI_WDAT_GET_STATUS            = 32,
1604     ACPI_WDAT_SET_STATUS            = 33,
1605     ACPI_WDAT_ACTION_RESERVED       = 34    /* 34 and greater are reserved */
1606 };
1607
1608 /* Values for Instruction field above */
1609
1610 enum AcpiWdatInstructions
1611 {
1612     ACPI_WDAT_READ_VALUE            = 0,
1613     ACPI_WDAT_READ_COUNTDOWN        = 1,
1614     ACPI_WDAT_WRITE_VALUE           = 2,
1615     ACPI_WDAT_WRITE_COUNTDOWN       = 3,
1616     ACPI_WDAT_INSTRUCTION_RESERVED  = 4,    /* 4 and greater are reserved */
1617     ACPI_WDAT_PRESERVE_REGISTER     = 0x80  /* Except for this value */
1618 };
1619
1620
1621 /*******************************************************************************
1622  *
1623  * WDDT - Watchdog Descriptor Table
1624  *        Version 1
1625  *
1626  * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
1627  * Version 001, September 2002
1628  *
1629  ******************************************************************************/
1630
1631 typedef struct acpi_table_wddt
1632 {
1633     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1634     UINT16                  SpecVersion;
1635     UINT16                  TableVersion;
1636     UINT16                  PciVendorId;
1637     ACPI_GENERIC_ADDRESS    Address;
1638     UINT16                  MaxCount;           /* Maximum counter value supported */
1639     UINT16                  MinCount;           /* Minimum counter value supported */
1640     UINT16                  Period;
1641     UINT16                  Status;
1642     UINT16                  Capability;
1643
1644 } ACPI_TABLE_WDDT;
1645
1646 /* Flags for Status field above */
1647
1648 #define ACPI_WDDT_AVAILABLE     (1)
1649 #define ACPI_WDDT_ACTIVE        (1<<1)
1650 #define ACPI_WDDT_TCO_OS_OWNED  (1<<2)
1651 #define ACPI_WDDT_USER_RESET    (1<<11)
1652 #define ACPI_WDDT_WDT_RESET     (1<<12)
1653 #define ACPI_WDDT_POWER_FAIL    (1<<13)
1654 #define ACPI_WDDT_UNKNOWN_RESET (1<<14)
1655
1656 /* Flags for Capability field above */
1657
1658 #define ACPI_WDDT_AUTO_RESET    (1)
1659 #define ACPI_WDDT_ALERT_SUPPORT (1<<1)
1660
1661
1662 /*******************************************************************************
1663  *
1664  * WDRT - Watchdog Resource Table
1665  *        Version 1
1666  *
1667  * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
1668  * Version 1.01, August 28, 2006
1669  *
1670  ******************************************************************************/
1671
1672 typedef struct acpi_table_wdrt
1673 {
1674     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1675     ACPI_GENERIC_ADDRESS    ControlRegister;
1676     ACPI_GENERIC_ADDRESS    CountRegister;
1677     UINT16                  PciDeviceId;
1678     UINT16                  PciVendorId;
1679     UINT8                   PciBus;             /* PCI Bus number */
1680     UINT8                   PciDevice;          /* PCI Device number */
1681     UINT8                   PciFunction;        /* PCI Function number */
1682     UINT8                   PciSegment;         /* PCI Segment number */
1683     UINT16                  MaxCount;           /* Maximum counter value supported */
1684     UINT8                   Units;
1685
1686 } ACPI_TABLE_WDRT;
1687
1688
1689 /* Reset to default packing */
1690
1691 #pragma pack()
1692
1693 #endif /* __ACTBL2_H__ */