]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/contrib/dev/acpica/include/actbl2.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / contrib / dev / acpica / include / actbl2.h
1 /******************************************************************************
2  *
3  * Name: actbl2.h - ACPI Specification Revision 2.0 Tables
4  *
5  *****************************************************************************/
6
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2010, 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 #ifndef __ACTBL2_H__
117 #define __ACTBL2_H__
118
119
120 /*******************************************************************************
121  *
122  * Additional ACPI Tables (2)
123  *
124  * These tables are not consumed directly by the ACPICA subsystem, but are
125  * included here to support device drivers and the AML disassembler.
126  *
127  * The tables in this file are defined by third-party specifications, and are
128  * not defined directly by the ACPI specification itself.
129  *
130  ******************************************************************************/
131
132
133 /*
134  * Values for description table header signatures for tables defined in this
135  * file. Useful because they make it more difficult to inadvertently type in
136  * the wrong signature.
137  */
138 #define ACPI_SIG_ASF            "ASF!"      /* Alert Standard Format table */
139 #define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
140 #define ACPI_SIG_DBGP           "DBGP"      /* Debug Port table */
141 #define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
142 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
143 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
144 #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
145 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
146 #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
147 #define ACPI_SIG_SLIC           "SLIC"      /* Software Licensing Description Table */
148 #define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
149 #define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
150 #define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
151 #define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
152 #define ACPI_SIG_WAET           "WAET"      /* Windows ACPI Emulated devices Table */
153 #define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
154 #define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
155
156
157 /*
158  * All tables must be byte-packed to match the ACPI specification, since
159  * the tables are provided by the system BIOS.
160  */
161 #pragma pack(1)
162
163 /*
164  * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
165  * This is the only type that is even remotely portable. Anything else is not
166  * portable, so do not use any other bitfield types.
167  */
168
169
170 /*******************************************************************************
171  *
172  * ASF - Alert Standard Format table (Signature "ASF!")
173  *       Revision 0x10
174  *
175  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
176  *
177  ******************************************************************************/
178
179 typedef struct acpi_table_asf
180 {
181     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
182
183 } ACPI_TABLE_ASF;
184
185
186 /* ASF subtable header */
187
188 typedef struct acpi_asf_header
189 {
190     UINT8                   Type;
191     UINT8                   Reserved;
192     UINT16                  Length;
193
194 } ACPI_ASF_HEADER;
195
196
197 /* Values for Type field above */
198
199 enum AcpiAsfType
200 {
201     ACPI_ASF_TYPE_INFO          = 0,
202     ACPI_ASF_TYPE_ALERT         = 1,
203     ACPI_ASF_TYPE_CONTROL       = 2,
204     ACPI_ASF_TYPE_BOOT          = 3,
205     ACPI_ASF_TYPE_ADDRESS       = 4,
206     ACPI_ASF_TYPE_RESERVED      = 5
207 };
208
209 /*
210  * ASF subtables
211  */
212
213 /* 0: ASF Information */
214
215 typedef struct acpi_asf_info
216 {
217     ACPI_ASF_HEADER         Header;
218     UINT8                   MinResetValue;
219     UINT8                   MinPollInterval;
220     UINT16                  SystemId;
221     UINT32                  MfgId;
222     UINT8                   Flags;
223     UINT8                   Reserved2[3];
224
225 } ACPI_ASF_INFO;
226
227 /* Masks for Flags field above */
228
229 #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
230
231
232 /* 1: ASF Alerts */
233
234 typedef struct acpi_asf_alert
235 {
236     ACPI_ASF_HEADER         Header;
237     UINT8                   AssertMask;
238     UINT8                   DeassertMask;
239     UINT8                   Alerts;
240     UINT8                   DataLength;
241
242 } ACPI_ASF_ALERT;
243
244 typedef struct acpi_asf_alert_data
245 {
246     UINT8                   Address;
247     UINT8                   Command;
248     UINT8                   Mask;
249     UINT8                   Value;
250     UINT8                   SensorType;
251     UINT8                   Type;
252     UINT8                   Offset;
253     UINT8                   SourceType;
254     UINT8                   Severity;
255     UINT8                   SensorNumber;
256     UINT8                   Entity;
257     UINT8                   Instance;
258
259 } ACPI_ASF_ALERT_DATA;
260
261
262 /* 2: ASF Remote Control */
263
264 typedef struct acpi_asf_remote
265 {
266     ACPI_ASF_HEADER         Header;
267     UINT8                   Controls;
268     UINT8                   DataLength;
269     UINT16                  Reserved2;
270
271 } ACPI_ASF_REMOTE;
272
273 typedef struct acpi_asf_control_data
274 {
275     UINT8                   Function;
276     UINT8                   Address;
277     UINT8                   Command;
278     UINT8                   Value;
279
280 } ACPI_ASF_CONTROL_DATA;
281
282
283 /* 3: ASF RMCP Boot Options */
284
285 typedef struct acpi_asf_rmcp
286 {
287     ACPI_ASF_HEADER         Header;
288     UINT8                   Capabilities[7];
289     UINT8                   CompletionCode;
290     UINT32                  EnterpriseId;
291     UINT8                   Command;
292     UINT16                  Parameter;
293     UINT16                  BootOptions;
294     UINT16                  OemParameters;
295
296 } ACPI_ASF_RMCP;
297
298
299 /* 4: ASF Address */
300
301 typedef struct acpi_asf_address
302 {
303     ACPI_ASF_HEADER         Header;
304     UINT8                   EpromAddress;
305     UINT8                   Devices;
306
307 } ACPI_ASF_ADDRESS;
308
309
310 /*******************************************************************************
311  *
312  * BOOT - Simple Boot Flag Table
313  *        Version 1
314  *
315  * Conforms to the "Simple Boot Flag Specification", Version 2.1
316  *
317  ******************************************************************************/
318
319 typedef struct acpi_table_boot
320 {
321     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
322     UINT8                   CmosIndex;          /* Index in CMOS RAM for the boot register */
323     UINT8                   Reserved[3];
324
325 } ACPI_TABLE_BOOT;
326
327
328 /*******************************************************************************
329  *
330  * DBGP - Debug Port table
331  *        Version 1
332  *
333  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
334  *
335  ******************************************************************************/
336
337 typedef struct acpi_table_dbgp
338 {
339     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
340     UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
341     UINT8                   Reserved[3];
342     ACPI_GENERIC_ADDRESS    DebugPort;
343
344 } ACPI_TABLE_DBGP;
345
346
347 /*******************************************************************************
348  *
349  * DMAR - DMA Remapping table
350  *        Version 1
351  *
352  * Conforms to "Intel Virtualization Technology for Directed I/O",
353  * Version 1.2, Sept. 2008
354  *
355  ******************************************************************************/
356
357 typedef struct acpi_table_dmar
358 {
359     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
360     UINT8                   Width;              /* Host Address Width */
361     UINT8                   Flags;
362     UINT8                   Reserved[10];
363
364 } ACPI_TABLE_DMAR;
365
366 /* Masks for Flags field above */
367
368 #define ACPI_DMAR_INTR_REMAP        (1)
369
370
371 /* DMAR subtable header */
372
373 typedef struct acpi_dmar_header
374 {
375     UINT16                  Type;
376     UINT16                  Length;
377
378 } ACPI_DMAR_HEADER;
379
380 /* Values for subtable type in ACPI_DMAR_HEADER */
381
382 enum AcpiDmarType
383 {
384     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
385     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
386     ACPI_DMAR_TYPE_ATSR                 = 2,
387     ACPI_DMAR_HARDWARE_AFFINITY         = 3,
388     ACPI_DMAR_TYPE_RESERVED             = 4     /* 4 and greater are reserved */
389 };
390
391
392 /* DMAR Device Scope structure */
393
394 typedef struct acpi_dmar_device_scope
395 {
396     UINT8                   EntryType;
397     UINT8                   Length;
398     UINT16                  Reserved;
399     UINT8                   EnumerationId;
400     UINT8                   Bus;
401
402 } ACPI_DMAR_DEVICE_SCOPE;
403
404 /* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
405
406 enum AcpiDmarScopeType
407 {
408     ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
409     ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
410     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
411     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
412     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
413     ACPI_DMAR_SCOPE_TYPE_RESERVED       = 5     /* 5 and greater are reserved */
414 };
415
416 typedef struct acpi_dmar_pci_path
417 {
418     UINT8                   Device;
419     UINT8                   Function;
420
421 } ACPI_DMAR_PCI_PATH;
422
423
424 /*
425  * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
426  */
427
428 /* 0: Hardware Unit Definition */
429
430 typedef struct acpi_dmar_hardware_unit
431 {
432     ACPI_DMAR_HEADER        Header;
433     UINT8                   Flags;
434     UINT8                   Reserved;
435     UINT16                  Segment;
436     UINT64                  Address;            /* Register Base Address */
437
438 } ACPI_DMAR_HARDWARE_UNIT;
439
440 /* Masks for Flags field above */
441
442 #define ACPI_DMAR_INCLUDE_ALL       (1)
443
444
445 /* 1: Reserved Memory Defininition */
446
447 typedef struct acpi_dmar_reserved_memory
448 {
449     ACPI_DMAR_HEADER        Header;
450     UINT16                  Reserved;
451     UINT16                  Segment;
452     UINT64                  BaseAddress;        /* 4K aligned base address */
453     UINT64                  EndAddress;         /* 4K aligned limit address */
454
455 } ACPI_DMAR_RESERVED_MEMORY;
456
457 /* Masks for Flags field above */
458
459 #define ACPI_DMAR_ALLOW_ALL         (1)
460
461
462 /* 2: Root Port ATS Capability Reporting Structure */
463
464 typedef struct acpi_dmar_atsr
465 {
466     ACPI_DMAR_HEADER        Header;
467     UINT8                   Flags;
468     UINT8                   Reserved;
469     UINT16                  Segment;
470
471 } ACPI_DMAR_ATSR;
472
473 /* Masks for Flags field above */
474
475 #define ACPI_DMAR_ALL_PORTS         (1)
476
477
478 /* 3: Remapping Hardware Static Affinity Structure */
479
480 typedef struct acpi_dmar_rhsa
481 {
482     ACPI_DMAR_HEADER        Header;
483     UINT32                  Reserved;
484     UINT64                  BaseAddress;
485     UINT32                  ProximityDomain;
486
487 } ACPI_DMAR_RHSA;
488
489
490 /*******************************************************************************
491  *
492  * HPET - High Precision Event Timer table
493  *        Version 1
494  *
495  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
496  * Version 1.0a, October 2004
497  *
498  ******************************************************************************/
499
500 typedef struct acpi_table_hpet
501 {
502     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
503     UINT32                  Id;                 /* Hardware ID of event timer block */
504     ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
505     UINT8                   Sequence;           /* HPET sequence number */
506     UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
507     UINT8                   Flags;
508
509 } ACPI_TABLE_HPET;
510
511 /* Masks for Flags field above */
512
513 #define ACPI_HPET_PAGE_PROTECT_MASK (3)
514
515 /* Values for Page Protect flags */
516
517 enum AcpiHpetPageProtect
518 {
519     ACPI_HPET_NO_PAGE_PROTECT       = 0,
520     ACPI_HPET_PAGE_PROTECT4         = 1,
521     ACPI_HPET_PAGE_PROTECT64        = 2
522 };
523
524
525 /*******************************************************************************
526  *
527  * IBFT - Boot Firmware Table
528  *        Version 1
529  *
530  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
531  * Specification", Version 1.01, March 1, 2007
532  *
533  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
534  * Therefore, it is not currently supported by the disassembler.
535  *
536  ******************************************************************************/
537
538 typedef struct acpi_table_ibft
539 {
540     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
541     UINT8                   Reserved[12];
542
543 } ACPI_TABLE_IBFT;
544
545
546 /* IBFT common subtable header */
547
548 typedef struct acpi_ibft_header
549 {
550     UINT8                   Type;
551     UINT8                   Version;
552     UINT16                  Length;
553     UINT8                   Index;
554     UINT8                   Flags;
555
556 } ACPI_IBFT_HEADER;
557
558 /* Values for Type field above */
559
560 enum AcpiIbftType
561 {
562     ACPI_IBFT_TYPE_NOT_USED         = 0,
563     ACPI_IBFT_TYPE_CONTROL          = 1,
564     ACPI_IBFT_TYPE_INITIATOR        = 2,
565     ACPI_IBFT_TYPE_NIC              = 3,
566     ACPI_IBFT_TYPE_TARGET           = 4,
567     ACPI_IBFT_TYPE_EXTENSIONS       = 5,
568     ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
569 };
570
571
572 /* IBFT subtables */
573
574 typedef struct acpi_ibft_control
575 {
576     ACPI_IBFT_HEADER        Header;
577     UINT16                  Extensions;
578     UINT16                  InitiatorOffset;
579     UINT16                  Nic0Offset;
580     UINT16                  Target0Offset;
581     UINT16                  Nic1Offset;
582     UINT16                  Target1Offset;
583
584 } ACPI_IBFT_CONTROL;
585
586 typedef struct acpi_ibft_initiator
587 {
588     ACPI_IBFT_HEADER        Header;
589     UINT8                   SnsServer[16];
590     UINT8                   SlpServer[16];
591     UINT8                   PrimaryServer[16];
592     UINT8                   SecondaryServer[16];
593     UINT16                  NameLength;
594     UINT16                  NameOffset;
595
596 } ACPI_IBFT_INITIATOR;
597
598 typedef struct acpi_ibft_nic
599 {
600     ACPI_IBFT_HEADER        Header;
601     UINT8                   IpAddress[16];
602     UINT8                   SubnetMaskPrefix;
603     UINT8                   Origin;
604     UINT8                   Gateway[16];
605     UINT8                   PrimaryDns[16];
606     UINT8                   SecondaryDns[16];
607     UINT8                   Dhcp[16];
608     UINT16                  Vlan;
609     UINT8                   MacAddress[6];
610     UINT16                  PciAddress;
611     UINT16                  NameLength;
612     UINT16                  NameOffset;
613
614 } ACPI_IBFT_NIC;
615
616 typedef struct acpi_ibft_target
617 {
618     ACPI_IBFT_HEADER        Header;
619     UINT8                   TargetIpAddress[16];
620     UINT16                  TargetIpSocket;
621     UINT8                   TargetBootLun[8];
622     UINT8                   ChapType;
623     UINT8                   NicAssociation;
624     UINT16                  TargetNameLength;
625     UINT16                  TargetNameOffset;
626     UINT16                  ChapNameLength;
627     UINT16                  ChapNameOffset;
628     UINT16                  ChapSecretLength;
629     UINT16                  ChapSecretOffset;
630     UINT16                  ReverseChapNameLength;
631     UINT16                  ReverseChapNameOffset;
632     UINT16                  ReverseChapSecretLength;
633     UINT16                  ReverseChapSecretOffset;
634
635 } ACPI_IBFT_TARGET;
636
637
638 /*******************************************************************************
639  *
640  * IVRS - I/O Virtualization Reporting Structure
641  *        Version 1
642  *
643  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
644  * Revision 1.26, February 2009.
645  *
646  ******************************************************************************/
647
648 typedef struct acpi_table_ivrs
649 {
650     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
651     UINT32                  Info;               /* Common virtualization info */
652     UINT64                  Reserved;
653
654 } ACPI_TABLE_IVRS;
655
656 /* Values for Info field above */
657
658 #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
659 #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
660 #define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
661
662
663 /* IVRS subtable header */
664
665 typedef struct acpi_ivrs_header
666 {
667     UINT8                   Type;               /* Subtable type */
668     UINT8                   Flags;
669     UINT16                  Length;             /* Subtable length */
670     UINT16                  DeviceId;           /* ID of IOMMU */
671
672 } ACPI_IVRS_HEADER;
673
674 /* Values for subtable Type above */
675
676 enum AcpiIvrsType
677 {
678     ACPI_IVRS_TYPE_HARDWARE         = 0x10,
679     ACPI_IVRS_TYPE_MEMORY1          = 0x20,
680     ACPI_IVRS_TYPE_MEMORY2          = 0x21,
681     ACPI_IVRS_TYPE_MEMORY3          = 0x22
682 };
683
684 /* Masks for Flags field above for IVHD subtable */
685
686 #define ACPI_IVHD_TT_ENABLE         (1)
687 #define ACPI_IVHD_PASS_PW           (1<<1)
688 #define ACPI_IVHD_RES_PASS_PW       (1<<2)
689 #define ACPI_IVHD_ISOC              (1<<3)
690 #define ACPI_IVHD_IOTLB             (1<<4)
691
692 /* Masks for Flags field above for IVMD subtable */
693
694 #define ACPI_IVMD_UNITY             (1)
695 #define ACPI_IVMD_READ              (1<<1)
696 #define ACPI_IVMD_WRITE             (1<<2)
697 #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
698
699
700 /*
701  * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
702  */
703
704 /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
705
706 typedef struct acpi_ivrs_hardware
707 {
708     ACPI_IVRS_HEADER        Header;
709     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
710     UINT64                  BaseAddress;        /* IOMMU control registers */
711     UINT16                  PciSegmentGroup;
712     UINT16                  Info;               /* MSI number and unit ID */
713     UINT32                  Reserved;
714
715 } ACPI_IVRS_HARDWARE;
716
717 /* Masks for Info field above */
718
719 #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
720 #define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
721
722
723 /*
724  * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
725  * Upper two bits of the Type field are the (encoded) length of the structure.
726  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
727  * are reserved for future use but not defined.
728  */
729 typedef struct acpi_ivrs_de_header
730 {
731     UINT8                   Type;
732     UINT16                  Id;
733     UINT8                   DataSetting;
734
735 } ACPI_IVRS_DE_HEADER;
736
737 /* Length of device entry is in the top two bits of Type field above */
738
739 #define ACPI_IVHD_ENTRY_LENGTH      0xC0
740
741 /* Values for device entry Type field above */
742
743 enum AcpiIvrsDeviceEntryType
744 {
745     /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
746
747     ACPI_IVRS_TYPE_PAD4             = 0,
748     ACPI_IVRS_TYPE_ALL              = 1,
749     ACPI_IVRS_TYPE_SELECT           = 2,
750     ACPI_IVRS_TYPE_START            = 3,
751     ACPI_IVRS_TYPE_END              = 4,
752
753     /* 8-byte device entries */
754
755     ACPI_IVRS_TYPE_PAD8             = 64,
756     ACPI_IVRS_TYPE_NOT_USED         = 65,
757     ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
758     ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
759     ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
760     ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
761     ACPI_IVRS_TYPE_SPECIAL          = 72  /* Uses ACPI_IVRS_DEVICE8C */
762 };
763
764 /* Values for Data field above */
765
766 #define ACPI_IVHD_INIT_PASS         (1)
767 #define ACPI_IVHD_EINT_PASS         (1<<1)
768 #define ACPI_IVHD_NMI_PASS          (1<<2)
769 #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
770 #define ACPI_IVHD_LINT0_PASS        (1<<6)
771 #define ACPI_IVHD_LINT1_PASS        (1<<7)
772
773
774 /* Types 0-4: 4-byte device entry */
775
776 typedef struct acpi_ivrs_device4
777 {
778     ACPI_IVRS_DE_HEADER     Header;
779
780 } ACPI_IVRS_DEVICE4;
781
782 /* Types 66-67: 8-byte device entry */
783
784 typedef struct acpi_ivrs_device8a
785 {
786     ACPI_IVRS_DE_HEADER     Header;
787     UINT8                   Reserved1;
788     UINT16                  UsedId;
789     UINT8                   Reserved2;
790
791 } ACPI_IVRS_DEVICE8A;
792
793 /* Types 70-71: 8-byte device entry */
794
795 typedef struct acpi_ivrs_device8b
796 {
797     ACPI_IVRS_DE_HEADER     Header;
798     UINT32                  ExtendedData;
799
800 } ACPI_IVRS_DEVICE8B;
801
802 /* Values for ExtendedData above */
803
804 #define ACPI_IVHD_ATS_DISABLED      (1<<31)
805
806 /* Type 72: 8-byte device entry */
807
808 typedef struct acpi_ivrs_device8c
809 {
810     ACPI_IVRS_DE_HEADER     Header;
811     UINT8                   Handle;
812     UINT16                  UsedId;
813     UINT8                   Variety;
814
815 } ACPI_IVRS_DEVICE8C;
816
817 /* Values for Variety field above */
818
819 #define ACPI_IVHD_IOAPIC            1
820 #define ACPI_IVHD_HPET              2
821
822
823 /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
824
825 typedef struct acpi_ivrs_memory
826 {
827     ACPI_IVRS_HEADER        Header;
828     UINT16                  AuxData;
829     UINT64                  Reserved;
830     UINT64                  StartAddress;
831     UINT64                  MemoryLength;
832
833 } ACPI_IVRS_MEMORY;
834
835
836 /*******************************************************************************
837  *
838  * MCFG - PCI Memory Mapped Configuration table and sub-table
839  *        Version 1
840  *
841  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
842  *
843  ******************************************************************************/
844
845 typedef struct acpi_table_mcfg
846 {
847     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
848     UINT8                   Reserved[8];
849
850 } ACPI_TABLE_MCFG;
851
852
853 /* Subtable */
854
855 typedef struct acpi_mcfg_allocation
856 {
857     UINT64                  Address;            /* Base address, processor-relative */
858     UINT16                  PciSegment;         /* PCI segment group number */
859     UINT8                   StartBusNumber;     /* Starting PCI Bus number */
860     UINT8                   EndBusNumber;       /* Final PCI Bus number */
861     UINT32                  Reserved;
862
863 } ACPI_MCFG_ALLOCATION;
864
865
866 /*******************************************************************************
867  *
868  * MCHI - Management Controller Host Interface Table
869  *        Version 1
870  *
871  * Conforms to "Management Component Transport Protocol (MCTP) Host
872  * Interface Specification", Revision 1.0.0a, October 13, 2009
873  *
874  ******************************************************************************/
875
876 typedef struct acpi_table_mchi
877 {
878     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
879     UINT8                   InterfaceType;
880     UINT8                   Protocol;
881     UINT64                  ProtocolData;
882     UINT8                   InterruptType;
883     UINT8                   Gpe;
884     UINT8                   PciDeviceFlag;
885     UINT32                  GlobalInterrupt;
886     ACPI_GENERIC_ADDRESS    ControlRegister;
887     UINT8                   PciSegment;
888     UINT8                   PciBus;
889     UINT8                   PciDevice;
890     UINT8                   PciFunction;
891
892 } ACPI_TABLE_MCHI;
893
894
895 /*******************************************************************************
896  *
897  * SPCR - Serial Port Console Redirection table
898  *        Version 1
899  *
900  * Conforms to "Serial Port Console Redirection Table",
901  * Version 1.00, January 11, 2002
902  *
903  ******************************************************************************/
904
905 typedef struct acpi_table_spcr
906 {
907     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
908     UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
909     UINT8                   Reserved[3];
910     ACPI_GENERIC_ADDRESS    SerialPort;
911     UINT8                   InterruptType;
912     UINT8                   PcInterrupt;
913     UINT32                  Interrupt;
914     UINT8                   BaudRate;
915     UINT8                   Parity;
916     UINT8                   StopBits;
917     UINT8                   FlowControl;
918     UINT8                   TerminalType;
919     UINT8                   Reserved1;
920     UINT16                  PciDeviceId;
921     UINT16                  PciVendorId;
922     UINT8                   PciBus;
923     UINT8                   PciDevice;
924     UINT8                   PciFunction;
925     UINT32                  PciFlags;
926     UINT8                   PciSegment;
927     UINT32                  Reserved2;
928
929 } ACPI_TABLE_SPCR;
930
931 /* Masks for PciFlags field above */
932
933 #define ACPI_SPCR_DO_NOT_DISABLE    (1)
934
935
936 /*******************************************************************************
937  *
938  * SPMI - Server Platform Management Interface table
939  *        Version 5
940  *
941  * Conforms to "Intelligent Platform Management Interface Specification
942  * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
943  * June 12, 2009 markup.
944  *
945  ******************************************************************************/
946
947 typedef struct acpi_table_spmi
948 {
949     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
950     UINT8                   InterfaceType;
951     UINT8                   Reserved;           /* Must be 1 */
952     UINT16                  SpecRevision;       /* Version of IPMI */
953     UINT8                   InterruptType;
954     UINT8                   GpeNumber;          /* GPE assigned */
955     UINT8                   Reserved1;
956     UINT8                   PciDeviceFlag;
957     UINT32                  Interrupt;
958     ACPI_GENERIC_ADDRESS    IpmiRegister;
959     UINT8                   PciSegment;
960     UINT8                   PciBus;
961     UINT8                   PciDevice;
962     UINT8                   PciFunction;
963     UINT8                   Reserved2;
964
965 } ACPI_TABLE_SPMI;
966
967 /* Values for InterfaceType above */
968
969 enum AcpiSpmiInterfaceTypes
970 {
971     ACPI_SPMI_NOT_USED              = 0,
972     ACPI_SPMI_KEYBOARD              = 1,
973     ACPI_SPMI_SMI                   = 2,
974     ACPI_SPMI_BLOCK_TRANSFER        = 3,
975     ACPI_SPMI_SMBUS                 = 4,
976     ACPI_SPMI_RESERVED              = 5         /* 5 and above are reserved */
977 };
978
979
980 /*******************************************************************************
981  *
982  * TCPA - Trusted Computing Platform Alliance table
983  *        Version 1
984  *
985  * Conforms to "TCG PC Specific Implementation Specification",
986  * Version 1.1, August 18, 2003
987  *
988  ******************************************************************************/
989
990 typedef struct acpi_table_tcpa
991 {
992     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
993     UINT16                  Reserved;
994     UINT32                  MaxLogLength;       /* Maximum length for the event log area */
995     UINT64                  LogAddress;         /* Address of the event log area */
996
997 } ACPI_TABLE_TCPA;
998
999
1000 /*******************************************************************************
1001  *
1002  * UEFI - UEFI Boot optimization Table
1003  *        Version 1
1004  *
1005  * Conforms to "Unified Extensible Firmware Interface Specification",
1006  * Version 2.3, May 8, 2009
1007  *
1008  ******************************************************************************/
1009
1010 typedef struct acpi_table_uefi
1011 {
1012     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1013     UINT8                   Identifier[16];     /* UUID identifier */
1014     UINT16                  DataOffset;         /* Offset of remaining data in table */
1015
1016 } ACPI_TABLE_UEFI;
1017
1018
1019 /*******************************************************************************
1020  *
1021  * WAET - Windows ACPI Emulated devices Table
1022  *        Version 1
1023  *
1024  * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
1025  *
1026  ******************************************************************************/
1027
1028 typedef struct acpi_table_waet
1029 {
1030     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1031     UINT32                  Flags;
1032
1033 } ACPI_TABLE_WAET;
1034
1035 /* Masks for Flags field above */
1036
1037 #define ACPI_WAET_RTC_NO_ACK        (1)         /* RTC requires no int acknowledge */
1038 #define ACPI_WAET_TIMER_ONE_READ    (1<<1)      /* PM timer requires only one read */
1039
1040
1041 /*******************************************************************************
1042  *
1043  * WDAT - Watchdog Action Table
1044  *        Version 1
1045  *
1046  * Conforms to "Hardware Watchdog Timers Design Specification",
1047  * Copyright 2006 Microsoft Corporation.
1048  *
1049  ******************************************************************************/
1050
1051 typedef struct acpi_table_wdat
1052 {
1053     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1054     UINT32                  HeaderLength;       /* Watchdog Header Length */
1055     UINT16                  PciSegment;         /* PCI Segment number */
1056     UINT8                   PciBus;             /* PCI Bus number */
1057     UINT8                   PciDevice;          /* PCI Device number */
1058     UINT8                   PciFunction;        /* PCI Function number */
1059     UINT8                   Reserved[3];
1060     UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
1061     UINT32                  MaxCount;           /* Maximum counter value supported */
1062     UINT32                  MinCount;           /* Minimum counter value */
1063     UINT8                   Flags;
1064     UINT8                   Reserved2[3];
1065     UINT32                  Entries;            /* Number of watchdog entries that follow */
1066
1067 } ACPI_TABLE_WDAT;
1068
1069 /* Masks for Flags field above */
1070
1071 #define ACPI_WDAT_ENABLED           (1)
1072 #define ACPI_WDAT_STOPPED           0x80
1073
1074
1075 /* WDAT Instruction Entries (actions) */
1076
1077 typedef struct acpi_wdat_entry
1078 {
1079     UINT8                   Action;
1080     UINT8                   Instruction;
1081     UINT16                  Reserved;
1082     ACPI_GENERIC_ADDRESS    RegisterRegion;
1083     UINT32                  Value;              /* Value used with Read/Write register */
1084     UINT32                  Mask;               /* Bitmask required for this register instruction */
1085
1086 } ACPI_WDAT_ENTRY;
1087
1088 /* Values for Action field above */
1089
1090 enum AcpiWdatActions
1091 {
1092     ACPI_WDAT_RESET                 = 1,
1093     ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1094     ACPI_WDAT_GET_COUNTDOWN         = 5,
1095     ACPI_WDAT_SET_COUNTDOWN         = 6,
1096     ACPI_WDAT_GET_RUNNING_STATE     = 8,
1097     ACPI_WDAT_SET_RUNNING_STATE     = 9,
1098     ACPI_WDAT_GET_STOPPED_STATE     = 10,
1099     ACPI_WDAT_SET_STOPPED_STATE     = 11,
1100     ACPI_WDAT_GET_REBOOT            = 16,
1101     ACPI_WDAT_SET_REBOOT            = 17,
1102     ACPI_WDAT_GET_SHUTDOWN          = 18,
1103     ACPI_WDAT_SET_SHUTDOWN          = 19,
1104     ACPI_WDAT_GET_STATUS            = 32,
1105     ACPI_WDAT_SET_STATUS            = 33,
1106     ACPI_WDAT_ACTION_RESERVED       = 34    /* 34 and greater are reserved */
1107 };
1108
1109 /* Values for Instruction field above */
1110
1111 enum AcpiWdatInstructions
1112 {
1113     ACPI_WDAT_READ_VALUE            = 0,
1114     ACPI_WDAT_READ_COUNTDOWN        = 1,
1115     ACPI_WDAT_WRITE_VALUE           = 2,
1116     ACPI_WDAT_WRITE_COUNTDOWN       = 3,
1117     ACPI_WDAT_INSTRUCTION_RESERVED  = 4,    /* 4 and greater are reserved */
1118     ACPI_WDAT_PRESERVE_REGISTER     = 0x80  /* Except for this value */
1119 };
1120
1121
1122 /*******************************************************************************
1123  *
1124  * WDRT - Watchdog Resource Table
1125  *        Version 1
1126  *
1127  * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
1128  * Version 1.01, August 28, 2006
1129  *
1130  ******************************************************************************/
1131
1132 typedef struct acpi_table_wdrt
1133 {
1134     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1135     ACPI_GENERIC_ADDRESS    ControlRegister;
1136     ACPI_GENERIC_ADDRESS    CountRegister;
1137     UINT16                  PciDeviceId;
1138     UINT16                  PciVendorId;
1139     UINT8                   PciBus;             /* PCI Bus number */
1140     UINT8                   PciDevice;          /* PCI Device number */
1141     UINT8                   PciFunction;        /* PCI Function number */
1142     UINT8                   PciSegment;         /* PCI Segment number */
1143     UINT16                  MaxCount;           /* Maximum counter value supported */
1144     UINT8                   Units;
1145
1146 } ACPI_TABLE_WDRT;
1147
1148
1149 /* Reset to default packing */
1150
1151 #pragma pack()
1152
1153 #endif /* __ACTBL2_H__ */
1154