xref: /titanic_50/usr/src/uts/intel/sys/acpi/actbl2.h (revision 53548f91e84cd97a638c23b5b295cc69089a5030)
1 /******************************************************************************
2  *
3  * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2016, 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)", December 10, 2015
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 #define ACPI_DBG2_ARM_PL011         0x0003
425 #define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
426 #define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
427 #define ACPI_DBG2_ARM_DCC           0x000F
428 #define ACPI_DBG2_BCM2835           0x0010
429 
430 #define ACPI_DBG2_1394_STANDARD     0x0000
431 
432 #define ACPI_DBG2_USB_XHCI          0x0000
433 #define ACPI_DBG2_USB_EHCI          0x0001
434 
435 
436 /*******************************************************************************
437  *
438  * DBGP - Debug Port table
439  *        Version 1
440  *
441  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
442  *
443  ******************************************************************************/
444 
445 typedef struct acpi_table_dbgp
446 {
447     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
448     UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
449     UINT8                   Reserved[3];
450     ACPI_GENERIC_ADDRESS    DebugPort;
451 
452 } ACPI_TABLE_DBGP;
453 
454 
455 /*******************************************************************************
456  *
457  * DMAR - DMA Remapping table
458  *        Version 1
459  *
460  * Conforms to "Intel Virtualization Technology for Directed I/O",
461  * Version 2.3, October 2014
462  *
463  ******************************************************************************/
464 
465 typedef struct acpi_table_dmar
466 {
467     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
468     UINT8                   Width;              /* Host Address Width */
469     UINT8                   Flags;
470     UINT8                   Reserved[10];
471 
472 } ACPI_TABLE_DMAR;
473 
474 /* Masks for Flags field above */
475 
476 #define ACPI_DMAR_INTR_REMAP        (1)
477 #define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
478 #define ACPI_DMAR_X2APIC_MODE       (1<<2)
479 
480 
481 /* DMAR subtable header */
482 
483 typedef struct acpi_dmar_header
484 {
485     UINT16                  Type;
486     UINT16                  Length;
487 
488 } ACPI_DMAR_HEADER;
489 
490 /* Values for subtable type in ACPI_DMAR_HEADER */
491 
492 enum AcpiDmarType
493 {
494     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
495     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
496     ACPI_DMAR_TYPE_ROOT_ATS             = 2,
497     ACPI_DMAR_TYPE_HARDWARE_AFFINITY    = 3,
498     ACPI_DMAR_TYPE_NAMESPACE            = 4,
499     ACPI_DMAR_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
500 };
501 
502 
503 /* DMAR Device Scope structure */
504 
505 typedef struct acpi_dmar_device_scope
506 {
507     UINT8                   EntryType;
508     UINT8                   Length;
509     UINT16                  Reserved;
510     UINT8                   EnumerationId;
511     UINT8                   Bus;
512 
513 } ACPI_DMAR_DEVICE_SCOPE;
514 
515 /* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
516 
517 enum AcpiDmarScopeType
518 {
519     ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
520     ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
521     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
522     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
523     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
524     ACPI_DMAR_SCOPE_TYPE_NAMESPACE      = 5,
525     ACPI_DMAR_SCOPE_TYPE_RESERVED       = 6     /* 6 and greater are reserved */
526 };
527 
528 typedef struct acpi_dmar_pci_path
529 {
530     UINT8                   Device;
531     UINT8                   Function;
532 
533 } ACPI_DMAR_PCI_PATH;
534 
535 
536 /*
537  * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
538  */
539 
540 /* 0: Hardware Unit Definition */
541 
542 typedef struct acpi_dmar_hardware_unit
543 {
544     ACPI_DMAR_HEADER        Header;
545     UINT8                   Flags;
546     UINT8                   Reserved;
547     UINT16                  Segment;
548     UINT64                  Address;            /* Register Base Address */
549 
550 } ACPI_DMAR_HARDWARE_UNIT;
551 
552 /* Masks for Flags field above */
553 
554 #define ACPI_DMAR_INCLUDE_ALL       (1)
555 
556 
557 /* 1: Reserved Memory Defininition */
558 
559 typedef struct acpi_dmar_reserved_memory
560 {
561     ACPI_DMAR_HEADER        Header;
562     UINT16                  Reserved;
563     UINT16                  Segment;
564     UINT64                  BaseAddress;        /* 4K aligned base address */
565     UINT64                  EndAddress;         /* 4K aligned limit address */
566 
567 } ACPI_DMAR_RESERVED_MEMORY;
568 
569 /* Masks for Flags field above */
570 
571 #define ACPI_DMAR_ALLOW_ALL         (1)
572 
573 
574 /* 2: Root Port ATS Capability Reporting Structure */
575 
576 typedef struct acpi_dmar_atsr
577 {
578     ACPI_DMAR_HEADER        Header;
579     UINT8                   Flags;
580     UINT8                   Reserved;
581     UINT16                  Segment;
582 
583 } ACPI_DMAR_ATSR;
584 
585 /* Masks for Flags field above */
586 
587 #define ACPI_DMAR_ALL_PORTS         (1)
588 
589 
590 /* 3: Remapping Hardware Static Affinity Structure */
591 
592 typedef struct acpi_dmar_rhsa
593 {
594     ACPI_DMAR_HEADER        Header;
595     UINT32                  Reserved;
596     UINT64                  BaseAddress;
597     UINT32                  ProximityDomain;
598 
599 } ACPI_DMAR_RHSA;
600 
601 
602 /* 4: ACPI Namespace Device Declaration Structure */
603 
604 typedef struct acpi_dmar_andd
605 {
606     ACPI_DMAR_HEADER        Header;
607     UINT8                   Reserved[3];
608     UINT8                   DeviceNumber;
609     char                    DeviceName[1];
610 
611 } ACPI_DMAR_ANDD;
612 
613 
614 /*******************************************************************************
615  *
616  * HPET - High Precision Event Timer table
617  *        Version 1
618  *
619  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
620  * Version 1.0a, October 2004
621  *
622  ******************************************************************************/
623 
624 typedef struct acpi_table_hpet
625 {
626     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
627     UINT32                  Id;                 /* Hardware ID of event timer block */
628     ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
629     UINT8                   Sequence;           /* HPET sequence number */
630     UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
631     UINT8                   Flags;
632 
633 } ACPI_TABLE_HPET;
634 
635 /* Masks for Flags field above */
636 
637 #define ACPI_HPET_PAGE_PROTECT_MASK (3)
638 
639 /* Values for Page Protect flags */
640 
641 enum AcpiHpetPageProtect
642 {
643     ACPI_HPET_NO_PAGE_PROTECT       = 0,
644     ACPI_HPET_PAGE_PROTECT4         = 1,
645     ACPI_HPET_PAGE_PROTECT64        = 2
646 };
647 
648 
649 /*******************************************************************************
650  *
651  * IBFT - Boot Firmware Table
652  *        Version 1
653  *
654  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
655  * Specification", Version 1.01, March 1, 2007
656  *
657  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
658  * Therefore, it is not currently supported by the disassembler.
659  *
660  ******************************************************************************/
661 
662 typedef struct acpi_table_ibft
663 {
664     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
665     UINT8                   Reserved[12];
666 
667 } ACPI_TABLE_IBFT;
668 
669 
670 /* IBFT common subtable header */
671 
672 typedef struct acpi_ibft_header
673 {
674     UINT8                   Type;
675     UINT8                   Version;
676     UINT16                  Length;
677     UINT8                   Index;
678     UINT8                   Flags;
679 
680 } ACPI_IBFT_HEADER;
681 
682 /* Values for Type field above */
683 
684 enum AcpiIbftType
685 {
686     ACPI_IBFT_TYPE_NOT_USED         = 0,
687     ACPI_IBFT_TYPE_CONTROL          = 1,
688     ACPI_IBFT_TYPE_INITIATOR        = 2,
689     ACPI_IBFT_TYPE_NIC              = 3,
690     ACPI_IBFT_TYPE_TARGET           = 4,
691     ACPI_IBFT_TYPE_EXTENSIONS       = 5,
692     ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
693 };
694 
695 
696 /* IBFT subtables */
697 
698 typedef struct acpi_ibft_control
699 {
700     ACPI_IBFT_HEADER        Header;
701     UINT16                  Extensions;
702     UINT16                  InitiatorOffset;
703     UINT16                  Nic0Offset;
704     UINT16                  Target0Offset;
705     UINT16                  Nic1Offset;
706     UINT16                  Target1Offset;
707 
708 } ACPI_IBFT_CONTROL;
709 
710 typedef struct acpi_ibft_initiator
711 {
712     ACPI_IBFT_HEADER        Header;
713     UINT8                   SnsServer[16];
714     UINT8                   SlpServer[16];
715     UINT8                   PrimaryServer[16];
716     UINT8                   SecondaryServer[16];
717     UINT16                  NameLength;
718     UINT16                  NameOffset;
719 
720 } ACPI_IBFT_INITIATOR;
721 
722 typedef struct acpi_ibft_nic
723 {
724     ACPI_IBFT_HEADER        Header;
725     UINT8                   IpAddress[16];
726     UINT8                   SubnetMaskPrefix;
727     UINT8                   Origin;
728     UINT8                   Gateway[16];
729     UINT8                   PrimaryDns[16];
730     UINT8                   SecondaryDns[16];
731     UINT8                   Dhcp[16];
732     UINT16                  Vlan;
733     UINT8                   MacAddress[6];
734     UINT16                  PciAddress;
735     UINT16                  NameLength;
736     UINT16                  NameOffset;
737 
738 } ACPI_IBFT_NIC;
739 
740 typedef struct acpi_ibft_target
741 {
742     ACPI_IBFT_HEADER        Header;
743     UINT8                   TargetIpAddress[16];
744     UINT16                  TargetIpSocket;
745     UINT8                   TargetBootLun[8];
746     UINT8                   ChapType;
747     UINT8                   NicAssociation;
748     UINT16                  TargetNameLength;
749     UINT16                  TargetNameOffset;
750     UINT16                  ChapNameLength;
751     UINT16                  ChapNameOffset;
752     UINT16                  ChapSecretLength;
753     UINT16                  ChapSecretOffset;
754     UINT16                  ReverseChapNameLength;
755     UINT16                  ReverseChapNameOffset;
756     UINT16                  ReverseChapSecretLength;
757     UINT16                  ReverseChapSecretOffset;
758 
759 } ACPI_IBFT_TARGET;
760 
761 
762 /*******************************************************************************
763  *
764  * IORT - IO Remapping Table
765  *
766  * Conforms to "IO Remapping Table System Software on ARM Platforms",
767  * Document number: ARM DEN 0049B, October 2015
768  *
769  ******************************************************************************/
770 
771 typedef struct acpi_table_iort
772 {
773     ACPI_TABLE_HEADER       Header;
774     UINT32                  NodeCount;
775     UINT32                  NodeOffset;
776     UINT32                  Reserved;
777 
778 } ACPI_TABLE_IORT;
779 
780 
781 /*
782  * IORT subtables
783  */
784 typedef struct acpi_iort_node
785 {
786     UINT8                   Type;
787     UINT16                  Length;
788     UINT8                   Revision;
789     UINT32                  Reserved;
790     UINT32                  MappingCount;
791     UINT32                  MappingOffset;
792     char                    NodeData[1];
793 
794 } ACPI_IORT_NODE;
795 
796 /* Values for subtable Type above */
797 
798 enum AcpiIortNodeType
799 {
800     ACPI_IORT_NODE_ITS_GROUP            = 0x00,
801     ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
802     ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
803     ACPI_IORT_NODE_SMMU                 = 0x03,
804     ACPI_IORT_NODE_SMMU_V3              = 0x04
805 };
806 
807 
808 typedef struct acpi_iort_id_mapping
809 {
810     UINT32                  InputBase;          /* Lowest value in input range */
811     UINT32                  IdCount;            /* Number of IDs */
812     UINT32                  OutputBase;         /* Lowest value in output range */
813     UINT32                  OutputReference;    /* A reference to the output node */
814     UINT32                  Flags;
815 
816 } ACPI_IORT_ID_MAPPING;
817 
818 /* Masks for Flags field above for IORT subtable */
819 
820 #define ACPI_IORT_ID_SINGLE_MAPPING (1)
821 
822 
823 typedef struct acpi_iort_memory_access
824 {
825     UINT32                  CacheCoherency;
826     UINT8                   Hints;
827     UINT16                  Reserved;
828     UINT8                   MemoryFlags;
829 
830 } ACPI_IORT_MEMORY_ACCESS;
831 
832 /* Values for CacheCoherency field above */
833 
834 #define ACPI_IORT_NODE_COHERENT         0x00000001  /* The device node is fully coherent */
835 #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000  /* The device node is not coherent */
836 
837 /* Masks for Hints field above */
838 
839 #define ACPI_IORT_HT_TRANSIENT          (1)
840 #define ACPI_IORT_HT_WRITE              (1<<1)
841 #define ACPI_IORT_HT_READ               (1<<2)
842 #define ACPI_IORT_HT_OVERRIDE           (1<<3)
843 
844 /* Masks for MemoryFlags field above */
845 
846 #define ACPI_IORT_MF_COHERENCY          (1)
847 #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
848 
849 
850 /*
851  * IORT node specific subtables
852  */
853 typedef struct acpi_iort_its_group
854 {
855     UINT32                  ItsCount;
856     UINT32                  Identifiers[1];         /* GIC ITS identifier arrary */
857 
858 } ACPI_IORT_ITS_GROUP;
859 
860 
861 typedef struct acpi_iort_named_component
862 {
863     UINT32                  NodeFlags;
864     UINT64                  MemoryProperties;       /* Memory access properties */
865     UINT8                   MemoryAddressLimit;     /* Memory address size limit */
866     char                    DeviceName[1];          /* Path of namespace object */
867 
868 } ACPI_IORT_NAMED_COMPONENT;
869 
870 
871 typedef struct acpi_iort_root_complex
872 {
873     UINT64                  MemoryProperties;       /* Memory access properties */
874     UINT32                  AtsAttribute;
875     UINT32                  PciSegmentNumber;
876 
877 } ACPI_IORT_ROOT_COMPLEX;
878 
879 /* Values for AtsAttribute field above */
880 
881 #define ACPI_IORT_ATS_SUPPORTED         0x00000001  /* The root complex supports ATS */
882 #define ACPI_IORT_ATS_UNSUPPORTED       0x00000000  /* The root complex doesn't support ATS */
883 
884 
885 typedef struct acpi_iort_smmu
886 {
887     UINT64                  BaseAddress;            /* SMMU base address */
888     UINT64                  Span;                   /* Length of memory range */
889     UINT32                  Model;
890     UINT32                  Flags;
891     UINT32                  GlobalInterruptOffset;
892     UINT32                  ContextInterruptCount;
893     UINT32                  ContextInterruptOffset;
894     UINT32                  PmuInterruptCount;
895     UINT32                  PmuInterruptOffset;
896     UINT64                  Interrupts[1];          /* Interrupt array */
897 
898 } ACPI_IORT_SMMU;
899 
900 /* Values for Model field above */
901 
902 #define ACPI_IORT_SMMU_V1               0x00000000  /* Generic SMMUv1 */
903 #define ACPI_IORT_SMMU_V2               0x00000001  /* Generic SMMUv2 */
904 #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002  /* ARM Corelink MMU-400 */
905 #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003  /* ARM Corelink MMU-500 */
906 
907 /* Masks for Flags field above */
908 
909 #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
910 #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
911 
912 
913 typedef struct acpi_iort_smmu_v3
914 {
915     UINT64                  BaseAddress;            /* SMMUv3 base address */
916     UINT32                  Flags;
917     UINT32                  Reserved;
918     UINT64                  VatosAddress;
919     UINT32                  Model;                 /* O: generic SMMUv3 */
920     UINT32                  EventGsiv;
921     UINT32                  PriGsiv;
922     UINT32                  GerrGsiv;
923     UINT32                  SyncGsiv;
924 
925 } ACPI_IORT_SMMU_V3;
926 
927 /* Masks for Flags field above */
928 
929 #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
930 #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (1<<1)
931 
932 
933 /*******************************************************************************
934  *
935  * IVRS - I/O Virtualization Reporting Structure
936  *        Version 1
937  *
938  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
939  * Revision 1.26, February 2009.
940  *
941  ******************************************************************************/
942 
943 typedef struct acpi_table_ivrs
944 {
945     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
946     UINT32                  Info;               /* Common virtualization info */
947     UINT64                  Reserved;
948 
949 } ACPI_TABLE_IVRS;
950 
951 /* Values for Info field above */
952 
953 #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
954 #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
955 #define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
956 
957 
958 /* IVRS subtable header */
959 
960 typedef struct acpi_ivrs_header
961 {
962     UINT8                   Type;               /* Subtable type */
963     UINT8                   Flags;
964     UINT16                  Length;             /* Subtable length */
965     UINT16                  DeviceId;           /* ID of IOMMU */
966 
967 } ACPI_IVRS_HEADER;
968 
969 /* Values for subtable Type above */
970 
971 enum AcpiIvrsType
972 {
973     ACPI_IVRS_TYPE_HARDWARE         = 0x10,
974     ACPI_IVRS_TYPE_MEMORY1          = 0x20,
975     ACPI_IVRS_TYPE_MEMORY2          = 0x21,
976     ACPI_IVRS_TYPE_MEMORY3          = 0x22
977 };
978 
979 /* Masks for Flags field above for IVHD subtable */
980 
981 #define ACPI_IVHD_TT_ENABLE         (1)
982 #define ACPI_IVHD_PASS_PW           (1<<1)
983 #define ACPI_IVHD_RES_PASS_PW       (1<<2)
984 #define ACPI_IVHD_ISOC              (1<<3)
985 #define ACPI_IVHD_IOTLB             (1<<4)
986 
987 /* Masks for Flags field above for IVMD subtable */
988 
989 #define ACPI_IVMD_UNITY             (1)
990 #define ACPI_IVMD_READ              (1<<1)
991 #define ACPI_IVMD_WRITE             (1<<2)
992 #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
993 
994 
995 /*
996  * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
997  */
998 
999 /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
1000 
1001 typedef struct acpi_ivrs_hardware
1002 {
1003     ACPI_IVRS_HEADER        Header;
1004     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
1005     UINT64                  BaseAddress;        /* IOMMU control registers */
1006     UINT16                  PciSegmentGroup;
1007     UINT16                  Info;               /* MSI number and unit ID */
1008     UINT32                  Reserved;
1009 
1010 } ACPI_IVRS_HARDWARE;
1011 
1012 /* Masks for Info field above */
1013 
1014 #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
1015 #define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
1016 
1017 
1018 /*
1019  * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
1020  * Upper two bits of the Type field are the (encoded) length of the structure.
1021  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
1022  * are reserved for future use but not defined.
1023  */
1024 typedef struct acpi_ivrs_de_header
1025 {
1026     UINT8                   Type;
1027     UINT16                  Id;
1028     UINT8                   DataSetting;
1029 
1030 } ACPI_IVRS_DE_HEADER;
1031 
1032 /* Length of device entry is in the top two bits of Type field above */
1033 
1034 #define ACPI_IVHD_ENTRY_LENGTH      0xC0
1035 
1036 /* Values for device entry Type field above */
1037 
1038 enum AcpiIvrsDeviceEntryType
1039 {
1040     /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
1041 
1042     ACPI_IVRS_TYPE_PAD4             = 0,
1043     ACPI_IVRS_TYPE_ALL              = 1,
1044     ACPI_IVRS_TYPE_SELECT           = 2,
1045     ACPI_IVRS_TYPE_START            = 3,
1046     ACPI_IVRS_TYPE_END              = 4,
1047 
1048     /* 8-byte device entries */
1049 
1050     ACPI_IVRS_TYPE_PAD8             = 64,
1051     ACPI_IVRS_TYPE_NOT_USED         = 65,
1052     ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
1053     ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
1054     ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
1055     ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
1056     ACPI_IVRS_TYPE_SPECIAL          = 72  /* Uses ACPI_IVRS_DEVICE8C */
1057 };
1058 
1059 /* Values for Data field above */
1060 
1061 #define ACPI_IVHD_INIT_PASS         (1)
1062 #define ACPI_IVHD_EINT_PASS         (1<<1)
1063 #define ACPI_IVHD_NMI_PASS          (1<<2)
1064 #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
1065 #define ACPI_IVHD_LINT0_PASS        (1<<6)
1066 #define ACPI_IVHD_LINT1_PASS        (1<<7)
1067 
1068 
1069 /* Types 0-4: 4-byte device entry */
1070 
1071 typedef struct acpi_ivrs_device4
1072 {
1073     ACPI_IVRS_DE_HEADER     Header;
1074 
1075 } ACPI_IVRS_DEVICE4;
1076 
1077 /* Types 66-67: 8-byte device entry */
1078 
1079 typedef struct acpi_ivrs_device8a
1080 {
1081     ACPI_IVRS_DE_HEADER     Header;
1082     UINT8                   Reserved1;
1083     UINT16                  UsedId;
1084     UINT8                   Reserved2;
1085 
1086 } ACPI_IVRS_DEVICE8A;
1087 
1088 /* Types 70-71: 8-byte device entry */
1089 
1090 typedef struct acpi_ivrs_device8b
1091 {
1092     ACPI_IVRS_DE_HEADER     Header;
1093     UINT32                  ExtendedData;
1094 
1095 } ACPI_IVRS_DEVICE8B;
1096 
1097 /* Values for ExtendedData above */
1098 
1099 #define ACPI_IVHD_ATS_DISABLED      (1<<31)
1100 
1101 /* Type 72: 8-byte device entry */
1102 
1103 typedef struct acpi_ivrs_device8c
1104 {
1105     ACPI_IVRS_DE_HEADER     Header;
1106     UINT8                   Handle;
1107     UINT16                  UsedId;
1108     UINT8                   Variety;
1109 
1110 } ACPI_IVRS_DEVICE8C;
1111 
1112 /* Values for Variety field above */
1113 
1114 #define ACPI_IVHD_IOAPIC            1
1115 #define ACPI_IVHD_HPET              2
1116 
1117 
1118 /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
1119 
1120 typedef struct acpi_ivrs_memory
1121 {
1122     ACPI_IVRS_HEADER        Header;
1123     UINT16                  AuxData;
1124     UINT64                  Reserved;
1125     UINT64                  StartAddress;
1126     UINT64                  MemoryLength;
1127 
1128 } ACPI_IVRS_MEMORY;
1129 
1130 
1131 /*******************************************************************************
1132  *
1133  * LPIT - Low Power Idle Table
1134  *
1135  * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
1136  *
1137  ******************************************************************************/
1138 
1139 typedef struct acpi_table_lpit
1140 {
1141     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1142 
1143 } ACPI_TABLE_LPIT;
1144 
1145 
1146 /* LPIT subtable header */
1147 
1148 typedef struct acpi_lpit_header
1149 {
1150     UINT32                  Type;               /* Subtable type */
1151     UINT32                  Length;             /* Subtable length */
1152     UINT16                  UniqueId;
1153     UINT16                  Reserved;
1154     UINT32                  Flags;
1155 
1156 } ACPI_LPIT_HEADER;
1157 
1158 /* Values for subtable Type above */
1159 
1160 enum AcpiLpitType
1161 {
1162     ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
1163     ACPI_LPIT_TYPE_RESERVED         = 0x01      /* 1 and above are reserved */
1164 };
1165 
1166 /* Masks for Flags field above  */
1167 
1168 #define ACPI_LPIT_STATE_DISABLED    (1)
1169 #define ACPI_LPIT_NO_COUNTER        (1<<1)
1170 
1171 /*
1172  * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
1173  */
1174 
1175 /* 0x00: Native C-state instruction based LPI structure */
1176 
1177 typedef struct acpi_lpit_native
1178 {
1179     ACPI_LPIT_HEADER        Header;
1180     ACPI_GENERIC_ADDRESS    EntryTrigger;
1181     UINT32                  Residency;
1182     UINT32                  Latency;
1183     ACPI_GENERIC_ADDRESS    ResidencyCounter;
1184     UINT64                  CounterFrequency;
1185 
1186 } ACPI_LPIT_NATIVE;
1187 
1188 
1189 /*******************************************************************************
1190  *
1191  * MCFG - PCI Memory Mapped Configuration table and subtable
1192  *        Version 1
1193  *
1194  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
1195  *
1196  ******************************************************************************/
1197 
1198 typedef struct acpi_table_mcfg
1199 {
1200     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1201     UINT8                   Reserved[8];
1202 
1203 } ACPI_TABLE_MCFG;
1204 
1205 
1206 /* Subtable */
1207 
1208 typedef struct acpi_mcfg_allocation
1209 {
1210     UINT64                  Address;            /* Base address, processor-relative */
1211     UINT16                  PciSegment;         /* PCI segment group number */
1212     UINT8                   StartBusNumber;     /* Starting PCI Bus number */
1213     UINT8                   EndBusNumber;       /* Final PCI Bus number */
1214     UINT32                  Reserved;
1215 
1216 } ACPI_MCFG_ALLOCATION;
1217 
1218 
1219 /*******************************************************************************
1220  *
1221  * MCHI - Management Controller Host Interface Table
1222  *        Version 1
1223  *
1224  * Conforms to "Management Component Transport Protocol (MCTP) Host
1225  * Interface Specification", Revision 1.0.0a, October 13, 2009
1226  *
1227  ******************************************************************************/
1228 
1229 typedef struct acpi_table_mchi
1230 {
1231     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1232     UINT8                   InterfaceType;
1233     UINT8                   Protocol;
1234     UINT64                  ProtocolData;
1235     UINT8                   InterruptType;
1236     UINT8                   Gpe;
1237     UINT8                   PciDeviceFlag;
1238     UINT32                  GlobalInterrupt;
1239     ACPI_GENERIC_ADDRESS    ControlRegister;
1240     UINT8                   PciSegment;
1241     UINT8                   PciBus;
1242     UINT8                   PciDevice;
1243     UINT8                   PciFunction;
1244 
1245 } ACPI_TABLE_MCHI;
1246 
1247 
1248 /*******************************************************************************
1249  *
1250  * MSDM - Microsoft Data Management table
1251  *
1252  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
1253  * November 29, 2011. Copyright 2011 Microsoft
1254  *
1255  ******************************************************************************/
1256 
1257 /* Basic MSDM table is only the common ACPI header */
1258 
1259 typedef struct acpi_table_msdm
1260 {
1261     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1262 
1263 } ACPI_TABLE_MSDM;
1264 
1265 
1266 /*******************************************************************************
1267  *
1268  * MTMR - MID Timer Table
1269  *        Version 1
1270  *
1271  * Conforms to "Simple Firmware Interface Specification",
1272  * Draft 0.8.2, Oct 19, 2010
1273  * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
1274  *
1275  ******************************************************************************/
1276 
1277 typedef struct acpi_table_mtmr
1278 {
1279     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1280 
1281 } ACPI_TABLE_MTMR;
1282 
1283 /* MTMR entry */
1284 
1285 typedef struct acpi_mtmr_entry
1286 {
1287     ACPI_GENERIC_ADDRESS    PhysicalAddress;
1288     UINT32                  Frequency;
1289     UINT32                  Irq;
1290 
1291 } ACPI_MTMR_ENTRY;
1292 
1293 
1294 /*******************************************************************************
1295  *
1296  * SLIC - Software Licensing Description Table
1297  *
1298  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
1299  * November 29, 2011. Copyright 2011 Microsoft
1300  *
1301  ******************************************************************************/
1302 
1303 /* Basic SLIC table is only the common ACPI header */
1304 
1305 typedef struct acpi_table_slic
1306 {
1307     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1308 
1309 } ACPI_TABLE_SLIC;
1310 
1311 
1312 /*******************************************************************************
1313  *
1314  * SPCR - Serial Port Console Redirection table
1315  *        Version 2
1316  *
1317  * Conforms to "Serial Port Console Redirection Table",
1318  * Version 1.03, August 10, 2015
1319  *
1320  ******************************************************************************/
1321 
1322 typedef struct acpi_table_spcr
1323 {
1324     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1325     UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
1326     UINT8                   Reserved[3];
1327     ACPI_GENERIC_ADDRESS    SerialPort;
1328     UINT8                   InterruptType;
1329     UINT8                   PcInterrupt;
1330     UINT32                  Interrupt;
1331     UINT8                   BaudRate;
1332     UINT8                   Parity;
1333     UINT8                   StopBits;
1334     UINT8                   FlowControl;
1335     UINT8                   TerminalType;
1336     UINT8                   Reserved1;
1337     UINT16                  PciDeviceId;
1338     UINT16                  PciVendorId;
1339     UINT8                   PciBus;
1340     UINT8                   PciDevice;
1341     UINT8                   PciFunction;
1342     UINT32                  PciFlags;
1343     UINT8                   PciSegment;
1344     UINT32                  Reserved2;
1345 
1346 } ACPI_TABLE_SPCR;
1347 
1348 /* Masks for PciFlags field above */
1349 
1350 #define ACPI_SPCR_DO_NOT_DISABLE    (1)
1351 
1352 /* Values for Interface Type: See the definition of the DBG2 table */
1353 
1354 
1355 /*******************************************************************************
1356  *
1357  * SPMI - Server Platform Management Interface table
1358  *        Version 5
1359  *
1360  * Conforms to "Intelligent Platform Management Interface Specification
1361  * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
1362  * June 12, 2009 markup.
1363  *
1364  ******************************************************************************/
1365 
1366 typedef struct acpi_table_spmi
1367 {
1368     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1369     UINT8                   InterfaceType;
1370     UINT8                   Reserved;           /* Must be 1 */
1371     UINT16                  SpecRevision;       /* Version of IPMI */
1372     UINT8                   InterruptType;
1373     UINT8                   GpeNumber;          /* GPE assigned */
1374     UINT8                   Reserved1;
1375     UINT8                   PciDeviceFlag;
1376     UINT32                  Interrupt;
1377     ACPI_GENERIC_ADDRESS    IpmiRegister;
1378     UINT8                   PciSegment;
1379     UINT8                   PciBus;
1380     UINT8                   PciDevice;
1381     UINT8                   PciFunction;
1382     UINT8                   Reserved2;
1383 
1384 } ACPI_TABLE_SPMI;
1385 
1386 /* Values for InterfaceType above */
1387 
1388 enum AcpiSpmiInterfaceTypes
1389 {
1390     ACPI_SPMI_NOT_USED              = 0,
1391     ACPI_SPMI_KEYBOARD              = 1,
1392     ACPI_SPMI_SMI                   = 2,
1393     ACPI_SPMI_BLOCK_TRANSFER        = 3,
1394     ACPI_SPMI_SMBUS                 = 4,
1395     ACPI_SPMI_RESERVED              = 5         /* 5 and above are reserved */
1396 };
1397 
1398 
1399 /*******************************************************************************
1400  *
1401  * TCPA - Trusted Computing Platform Alliance table
1402  *        Version 2
1403  *
1404  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1405  * December 19, 2014
1406  *
1407  * NOTE: There are two versions of the table with the same signature --
1408  * the client version and the server version. The common PlatformClass
1409  * field is used to differentiate the two types of tables.
1410  *
1411  ******************************************************************************/
1412 
1413 typedef struct acpi_table_tcpa_hdr
1414 {
1415     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1416     UINT16                  PlatformClass;
1417 
1418 } ACPI_TABLE_TCPA_HDR;
1419 
1420 /*
1421  * Values for PlatformClass above.
1422  * This is how the client and server subtables are differentiated
1423  */
1424 #define ACPI_TCPA_CLIENT_TABLE          0
1425 #define ACPI_TCPA_SERVER_TABLE          1
1426 
1427 
1428 typedef struct acpi_table_tcpa_client
1429 {
1430     UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
1431     UINT64                  LogAddress;         /* Address of the event log area */
1432 
1433 } ACPI_TABLE_TCPA_CLIENT;
1434 
1435 typedef struct acpi_table_tcpa_server
1436 {
1437     UINT16                  Reserved;
1438     UINT64                  MinimumLogLength;   /* Minimum length for the event log area */
1439     UINT64                  LogAddress;         /* Address of the event log area */
1440     UINT16                  SpecRevision;
1441     UINT8                   DeviceFlags;
1442     UINT8                   InterruptFlags;
1443     UINT8                   GpeNumber;
1444     UINT8                   Reserved2[3];
1445     UINT32                  GlobalInterrupt;
1446     ACPI_GENERIC_ADDRESS    Address;
1447     UINT32                  Reserved3;
1448     ACPI_GENERIC_ADDRESS    ConfigAddress;
1449     UINT8                   Group;
1450     UINT8                   Bus;                /* PCI Bus/Segment/Function numbers */
1451     UINT8                   Device;
1452     UINT8                   Function;
1453 
1454 } ACPI_TABLE_TCPA_SERVER;
1455 
1456 /* Values for DeviceFlags above */
1457 
1458 #define ACPI_TCPA_PCI_DEVICE            (1)
1459 #define ACPI_TCPA_BUS_PNP               (1<<1)
1460 #define ACPI_TCPA_ADDRESS_VALID         (1<<2)
1461 
1462 /* Values for InterruptFlags above */
1463 
1464 #define ACPI_TCPA_INTERRUPT_MODE        (1)
1465 #define ACPI_TCPA_INTERRUPT_POLARITY    (1<<1)
1466 #define ACPI_TCPA_SCI_VIA_GPE           (1<<2)
1467 #define ACPI_TCPA_GLOBAL_INTERRUPT      (1<<3)
1468 
1469 
1470 /*******************************************************************************
1471  *
1472  * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
1473  *        Version 4
1474  *
1475  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1476  * December 19, 2014
1477  *
1478  ******************************************************************************/
1479 
1480 typedef struct acpi_table_tpm2
1481 {
1482     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1483     UINT16                  PlatformClass;
1484     UINT16                  Reserved;
1485     UINT64                  ControlAddress;
1486     UINT32                  StartMethod;
1487 
1488     /* Platform-specific data follows */
1489 
1490 } ACPI_TABLE_TPM2;
1491 
1492 /* Values for StartMethod above */
1493 
1494 #define ACPI_TPM2_NOT_ALLOWED                       0
1495 #define ACPI_TPM2_START_METHOD                      2
1496 #define ACPI_TPM2_MEMORY_MAPPED                     6
1497 #define ACPI_TPM2_COMMAND_BUFFER                    7
1498 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD  8
1499 
1500 
1501 /*******************************************************************************
1502  *
1503  * UEFI - UEFI Boot optimization Table
1504  *        Version 1
1505  *
1506  * Conforms to "Unified Extensible Firmware Interface Specification",
1507  * Version 2.3, May 8, 2009
1508  *
1509  ******************************************************************************/
1510 
1511 typedef struct acpi_table_uefi
1512 {
1513     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1514     UINT8                   Identifier[16];     /* UUID identifier */
1515     UINT16                  DataOffset;         /* Offset of remaining data in table */
1516 
1517 } ACPI_TABLE_UEFI;
1518 
1519 
1520 /*******************************************************************************
1521  *
1522  * VRTC - Virtual Real Time Clock Table
1523  *        Version 1
1524  *
1525  * Conforms to "Simple Firmware Interface Specification",
1526  * Draft 0.8.2, Oct 19, 2010
1527  * NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
1528  *
1529  ******************************************************************************/
1530 
1531 typedef struct acpi_table_vrtc
1532 {
1533     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1534 
1535 } ACPI_TABLE_VRTC;
1536 
1537 /* VRTC entry */
1538 
1539 typedef struct acpi_vrtc_entry
1540 {
1541     ACPI_GENERIC_ADDRESS    PhysicalAddress;
1542     UINT32                  Irq;
1543 
1544 } ACPI_VRTC_ENTRY;
1545 
1546 
1547 /*******************************************************************************
1548  *
1549  * WAET - Windows ACPI Emulated devices Table
1550  *        Version 1
1551  *
1552  * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
1553  *
1554  ******************************************************************************/
1555 
1556 typedef struct acpi_table_waet
1557 {
1558     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1559     UINT32                  Flags;
1560 
1561 } ACPI_TABLE_WAET;
1562 
1563 /* Masks for Flags field above */
1564 
1565 #define ACPI_WAET_RTC_NO_ACK        (1)         /* RTC requires no int acknowledge */
1566 #define ACPI_WAET_TIMER_ONE_READ    (1<<1)      /* PM timer requires only one read */
1567 
1568 
1569 /*******************************************************************************
1570  *
1571  * WDAT - Watchdog Action Table
1572  *        Version 1
1573  *
1574  * Conforms to "Hardware Watchdog Timers Design Specification",
1575  * Copyright 2006 Microsoft Corporation.
1576  *
1577  ******************************************************************************/
1578 
1579 typedef struct acpi_table_wdat
1580 {
1581     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1582     UINT32                  HeaderLength;       /* Watchdog Header Length */
1583     UINT16                  PciSegment;         /* PCI Segment number */
1584     UINT8                   PciBus;             /* PCI Bus number */
1585     UINT8                   PciDevice;          /* PCI Device number */
1586     UINT8                   PciFunction;        /* PCI Function number */
1587     UINT8                   Reserved[3];
1588     UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
1589     UINT32                  MaxCount;           /* Maximum counter value supported */
1590     UINT32                  MinCount;           /* Minimum counter value */
1591     UINT8                   Flags;
1592     UINT8                   Reserved2[3];
1593     UINT32                  Entries;            /* Number of watchdog entries that follow */
1594 
1595 } ACPI_TABLE_WDAT;
1596 
1597 /* Masks for Flags field above */
1598 
1599 #define ACPI_WDAT_ENABLED           (1)
1600 #define ACPI_WDAT_STOPPED           0x80
1601 
1602 
1603 /* WDAT Instruction Entries (actions) */
1604 
1605 typedef struct acpi_wdat_entry
1606 {
1607     UINT8                   Action;
1608     UINT8                   Instruction;
1609     UINT16                  Reserved;
1610     ACPI_GENERIC_ADDRESS    RegisterRegion;
1611     UINT32                  Value;              /* Value used with Read/Write register */
1612     UINT32                  Mask;               /* Bitmask required for this register instruction */
1613 
1614 } ACPI_WDAT_ENTRY;
1615 
1616 /* Values for Action field above */
1617 
1618 enum AcpiWdatActions
1619 {
1620     ACPI_WDAT_RESET                 = 1,
1621     ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1622     ACPI_WDAT_GET_COUNTDOWN         = 5,
1623     ACPI_WDAT_SET_COUNTDOWN         = 6,
1624     ACPI_WDAT_GET_RUNNING_STATE     = 8,
1625     ACPI_WDAT_SET_RUNNING_STATE     = 9,
1626     ACPI_WDAT_GET_STOPPED_STATE     = 10,
1627     ACPI_WDAT_SET_STOPPED_STATE     = 11,
1628     ACPI_WDAT_GET_REBOOT            = 16,
1629     ACPI_WDAT_SET_REBOOT            = 17,
1630     ACPI_WDAT_GET_SHUTDOWN          = 18,
1631     ACPI_WDAT_SET_SHUTDOWN          = 19,
1632     ACPI_WDAT_GET_STATUS            = 32,
1633     ACPI_WDAT_SET_STATUS            = 33,
1634     ACPI_WDAT_ACTION_RESERVED       = 34    /* 34 and greater are reserved */
1635 };
1636 
1637 /* Values for Instruction field above */
1638 
1639 enum AcpiWdatInstructions
1640 {
1641     ACPI_WDAT_READ_VALUE            = 0,
1642     ACPI_WDAT_READ_COUNTDOWN        = 1,
1643     ACPI_WDAT_WRITE_VALUE           = 2,
1644     ACPI_WDAT_WRITE_COUNTDOWN       = 3,
1645     ACPI_WDAT_INSTRUCTION_RESERVED  = 4,    /* 4 and greater are reserved */
1646     ACPI_WDAT_PRESERVE_REGISTER     = 0x80  /* Except for this value */
1647 };
1648 
1649 
1650 /*******************************************************************************
1651  *
1652  * WDDT - Watchdog Descriptor Table
1653  *        Version 1
1654  *
1655  * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
1656  * Version 001, September 2002
1657  *
1658  ******************************************************************************/
1659 
1660 typedef struct acpi_table_wddt
1661 {
1662     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1663     UINT16                  SpecVersion;
1664     UINT16                  TableVersion;
1665     UINT16                  PciVendorId;
1666     ACPI_GENERIC_ADDRESS    Address;
1667     UINT16                  MaxCount;           /* Maximum counter value supported */
1668     UINT16                  MinCount;           /* Minimum counter value supported */
1669     UINT16                  Period;
1670     UINT16                  Status;
1671     UINT16                  Capability;
1672 
1673 } ACPI_TABLE_WDDT;
1674 
1675 /* Flags for Status field above */
1676 
1677 #define ACPI_WDDT_AVAILABLE     (1)
1678 #define ACPI_WDDT_ACTIVE        (1<<1)
1679 #define ACPI_WDDT_TCO_OS_OWNED  (1<<2)
1680 #define ACPI_WDDT_USER_RESET    (1<<11)
1681 #define ACPI_WDDT_WDT_RESET     (1<<12)
1682 #define ACPI_WDDT_POWER_FAIL    (1<<13)
1683 #define ACPI_WDDT_UNKNOWN_RESET (1<<14)
1684 
1685 /* Flags for Capability field above */
1686 
1687 #define ACPI_WDDT_AUTO_RESET    (1)
1688 #define ACPI_WDDT_ALERT_SUPPORT (1<<1)
1689 
1690 
1691 /*******************************************************************************
1692  *
1693  * WDRT - Watchdog Resource Table
1694  *        Version 1
1695  *
1696  * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
1697  * Version 1.01, August 28, 2006
1698  *
1699  ******************************************************************************/
1700 
1701 typedef struct acpi_table_wdrt
1702 {
1703     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1704     ACPI_GENERIC_ADDRESS    ControlRegister;
1705     ACPI_GENERIC_ADDRESS    CountRegister;
1706     UINT16                  PciDeviceId;
1707     UINT16                  PciVendorId;
1708     UINT8                   PciBus;             /* PCI Bus number */
1709     UINT8                   PciDevice;          /* PCI Device number */
1710     UINT8                   PciFunction;        /* PCI Function number */
1711     UINT8                   PciSegment;         /* PCI Segment number */
1712     UINT16                  MaxCount;           /* Maximum counter value supported */
1713     UINT8                   Units;
1714 
1715 } ACPI_TABLE_WDRT;
1716 
1717 
1718 /* Reset to default packing */
1719 
1720 #pragma pack()
1721 
1722 #endif /* __ACTBL2_H__ */
1723