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