1 /******************************************************************************
3 * Name: actbl3.h - ACPI Table Definitions
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2015, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
48 /*******************************************************************************
50 * Additional ACPI Tables (3)
52 * These tables are not consumed directly by the ACPICA subsystem, but are
53 * included here to support device drivers and the AML disassembler.
55 * The tables in this file are fully defined within the ACPI specification.
57 ******************************************************************************/
61 * Values for description table header signatures for tables defined in this
62 * file. Useful because they make it more difficult to inadvertently type in
63 * the wrong signature.
65 #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
66 #define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */
67 #define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */
68 #define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */
69 #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
70 #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
71 #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
72 #define ACPI_SIG_RASF "RASF" /* RAS Feature table */
73 #define ACPI_SIG_STAO "STAO" /* Status Override table */
74 #define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */
75 #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
76 #define ACPI_SIG_XENV "XENV" /* Xen Environment table */
78 #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
79 #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
81 /* Reserved table signatures */
83 #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
84 #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
87 * All tables must be byte-packed to match the ACPI specification, since
88 * the tables are provided by the system BIOS.
93 * Note: C bitfields are not used for this reason:
95 * "Bitfields are great and easy to read, but unfortunately the C language
96 * does not specify the layout of bitfields in memory, which means they are
97 * essentially useless for dealing with packed data in on-disk formats or
98 * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
99 * this decision was a design error in C. Ritchie could have picked an order
100 * and stuck with it." Norman Ramsey.
101 * See http://stackoverflow.com/a/1053662/41661
105 /*******************************************************************************
107 * BGRT - Boot Graphics Resource Table (ACPI 5.0)
110 ******************************************************************************/
112 typedef struct acpi_table_bgrt
114 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
125 /*******************************************************************************
127 * DRTM - Dynamic Root of Trust for Measurement table
128 * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
131 ******************************************************************************/
133 typedef struct acpi_table_drtm
135 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
136 UINT64 EntryBaseAddress;
138 UINT32 EntryAddress32;
139 UINT64 EntryAddress64;
141 UINT64 LogAreaAddress;
142 UINT32 LogAreaLength;
143 UINT64 ArchDependentAddress;
148 /* Flag Definitions for above */
150 #define ACPI_DRTM_ACCESS_ALLOWED (1)
151 #define ACPI_DRTM_ENABLE_GAP_CODE (1<<1)
152 #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS (1<<2)
153 #define ACPI_DRTM_AUTHORITY_ORDER (1<<3)
156 /* 1) Validated Tables List (64-bit addresses) */
158 typedef struct acpi_drtm_vtable_list
160 UINT32 ValidatedTableCount;
161 UINT64 ValidatedTables[1];
163 } ACPI_DRTM_VTABLE_LIST;
165 /* 2) Resources List (of Resource Descriptors) */
167 /* Resource Descriptor */
169 typedef struct acpi_drtm_resource
175 } ACPI_DRTM_RESOURCE;
177 typedef struct acpi_drtm_resource_list
179 UINT32 ResourceCount;
180 ACPI_DRTM_RESOURCE Resources[1];
182 } ACPI_DRTM_RESOURCE_LIST;
184 /* 3) Platform-specific Identifiers List */
186 typedef struct acpi_drtm_dps_id
194 /*******************************************************************************
196 * FPDT - Firmware Performance Data Table (ACPI 5.0)
199 ******************************************************************************/
201 typedef struct acpi_table_fpdt
203 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
208 /* FPDT subtable header */
210 typedef struct acpi_fpdt_header
218 /* Values for Type field above */
222 ACPI_FPDT_TYPE_BOOT = 0,
223 ACPI_FPDT_TYPE_S3PERF = 1
231 /* 0: Firmware Basic Boot Performance Record */
233 typedef struct acpi_fpdt_boot
235 ACPI_FPDT_HEADER Header;
240 UINT64 ExitServicesEntry;
241 UINT64 ExitServicesExit;
246 /* 1: S3 Performance Table Pointer Record */
248 typedef struct acpi_fpdt_s3pt_ptr
250 ACPI_FPDT_HEADER Header;
254 } ACPI_FPDT_S3PT_PTR;
258 * S3PT - S3 Performance Table. This table is pointed to by the
259 * FPDT S3 Pointer Record above.
261 typedef struct acpi_table_s3pt
263 UINT8 Signature[4]; /* "S3PT" */
272 typedef struct acpi_s3pt_header
280 /* Values for Type field above */
284 ACPI_S3PT_TYPE_RESUME = 0,
285 ACPI_S3PT_TYPE_SUSPEND = 1
288 typedef struct acpi_s3pt_resume
290 ACPI_S3PT_HEADER Header;
293 UINT64 AverageResume;
297 typedef struct acpi_s3pt_suspend
299 ACPI_S3PT_HEADER Header;
306 /*******************************************************************************
308 * GTDT - Generic Timer Description Table (ACPI 5.1)
311 ******************************************************************************/
313 typedef struct acpi_table_gtdt
315 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
316 UINT64 CounterBlockAddresss;
318 UINT32 SecureEl1Interrupt;
319 UINT32 SecureEl1Flags;
320 UINT32 NonSecureEl1Interrupt;
321 UINT32 NonSecureEl1Flags;
322 UINT32 VirtualTimerInterrupt;
323 UINT32 VirtualTimerFlags;
324 UINT32 NonSecureEl2Interrupt;
325 UINT32 NonSecureEl2Flags;
326 UINT64 CounterReadBlockAddress;
327 UINT32 PlatformTimerCount;
328 UINT32 PlatformTimerOffset;
332 /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
334 #define ACPI_GTDT_INTERRUPT_MODE (1)
335 #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
336 #define ACPI_GTDT_ALWAYS_ON (1<<2)
339 /* Common GTDT subtable header */
341 typedef struct acpi_gtdt_header
348 /* Values for GTDT subtable type above */
352 ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
353 ACPI_GTDT_TYPE_WATCHDOG = 1,
354 ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
358 /* GTDT Subtables, correspond to Type in acpi_gtdt_header */
360 /* 0: Generic Timer Block */
362 typedef struct acpi_gtdt_timer_block
364 ACPI_GTDT_HEADER Header;
370 } ACPI_GTDT_TIMER_BLOCK;
372 /* Timer Sub-Structure, one per timer */
374 typedef struct acpi_gtdt_timer_entry
379 UINT64 El0BaseAddress;
380 UINT32 TimerInterrupt;
382 UINT32 VirtualTimerInterrupt;
383 UINT32 VirtualTimerFlags;
386 } ACPI_GTDT_TIMER_ENTRY;
388 /* Flag Definitions: TimerFlags and VirtualTimerFlags above */
390 #define ACPI_GTDT_GT_IRQ_MODE (1)
391 #define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
393 /* Flag Definitions: CommonFlags above */
395 #define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
396 #define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
399 /* 1: SBSA Generic Watchdog Structure */
401 typedef struct acpi_gtdt_watchdog
403 ACPI_GTDT_HEADER Header;
405 UINT64 RefreshFrameAddress;
406 UINT64 ControlFrameAddress;
407 UINT32 TimerInterrupt;
410 } ACPI_GTDT_WATCHDOG;
412 /* Flag Definitions: TimerFlags above */
414 #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
415 #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
416 #define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
419 /*******************************************************************************
421 * MPST - Memory Power State Table (ACPI 5.0)
424 ******************************************************************************/
426 #define ACPI_MPST_CHANNEL_INFO \
428 UINT8 Reserved1[3]; \
429 UINT16 PowerNodeCount; \
434 typedef struct acpi_table_mpst
436 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
437 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
442 /* Memory Platform Communication Channel Info */
444 typedef struct acpi_mpst_channel
446 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
451 /* Memory Power Node Structure */
453 typedef struct acpi_mpst_power_node
461 UINT32 NumPowerStates;
462 UINT32 NumPhysicalComponents;
464 } ACPI_MPST_POWER_NODE;
466 /* Values for Flags field above */
468 #define ACPI_MPST_ENABLED 1
469 #define ACPI_MPST_POWER_MANAGED 2
470 #define ACPI_MPST_HOT_PLUG_CAPABLE 4
473 /* Memory Power State Structure (follows POWER_NODE above) */
475 typedef struct acpi_mpst_power_state
480 } ACPI_MPST_POWER_STATE;
483 /* Physical Component ID Structure (follows POWER_STATE above) */
485 typedef struct acpi_mpst_component
489 } ACPI_MPST_COMPONENT;
492 /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
494 typedef struct acpi_mpst_data_hdr
496 UINT16 CharacteristicsCount;
499 } ACPI_MPST_DATA_HDR;
501 typedef struct acpi_mpst_power_data
511 } ACPI_MPST_POWER_DATA;
513 /* Values for Flags field above */
515 #define ACPI_MPST_PRESERVE 1
516 #define ACPI_MPST_AUTOENTRY 2
517 #define ACPI_MPST_AUTOEXIT 4
520 /* Shared Memory Region (not part of an ACPI table) */
522 typedef struct acpi_mpst_shared
527 UINT32 CommandRegister;
528 UINT32 StatusRegister;
531 UINT64 EnergyConsumed;
537 /*******************************************************************************
539 * PCCT - Platform Communications Channel Table (ACPI 5.0)
542 ******************************************************************************/
544 typedef struct acpi_table_pcct
546 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
552 /* Values for Flags field above */
554 #define ACPI_PCCT_DOORBELL 1
556 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
560 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
561 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
562 ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
566 * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
569 /* 0: Generic Communications Subspace */
571 typedef struct acpi_pcct_subspace
573 ACPI_SUBTABLE_HEADER Header;
577 ACPI_GENERIC_ADDRESS DoorbellRegister;
581 UINT32 MaxAccessRate;
582 UINT16 MinTurnaroundTime;
584 } ACPI_PCCT_SUBSPACE;
587 /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
589 typedef struct acpi_pcct_hw_reduced
591 ACPI_SUBTABLE_HEADER Header;
592 UINT32 DoorbellInterrupt;
597 ACPI_GENERIC_ADDRESS DoorbellRegister;
601 UINT32 MaxAccessRate;
602 UINT16 MinTurnaroundTime;
604 } ACPI_PCCT_HW_REDUCED;
606 /* Values for doorbell flags above */
608 #define ACPI_PCCT_INTERRUPT_POLARITY (1)
609 #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
613 * PCC memory structures (not part of the ACPI table)
616 /* Shared Memory Region */
618 typedef struct acpi_pcct_shared_memory
624 } ACPI_PCCT_SHARED_MEMORY;
627 /*******************************************************************************
629 * PMTT - Platform Memory Topology Table (ACPI 5.0)
632 ******************************************************************************/
634 typedef struct acpi_table_pmtt
636 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
642 /* Common header for PMTT subtables that follow main table */
644 typedef struct acpi_pmtt_header
654 /* Values for Type field above */
656 #define ACPI_PMTT_TYPE_SOCKET 0
657 #define ACPI_PMTT_TYPE_CONTROLLER 1
658 #define ACPI_PMTT_TYPE_DIMM 2
659 #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
661 /* Values for Flags field above */
663 #define ACPI_PMTT_TOP_LEVEL 0x0001
664 #define ACPI_PMTT_PHYSICAL 0x0002
665 #define ACPI_PMTT_MEMORY_TYPE 0x000C
669 * PMTT subtables, correspond to Type in acpi_pmtt_header
673 /* 0: Socket Structure */
675 typedef struct acpi_pmtt_socket
677 ACPI_PMTT_HEADER Header;
684 /* 1: Memory Controller subtable */
686 typedef struct acpi_pmtt_controller
688 ACPI_PMTT_HEADER Header;
691 UINT32 ReadBandwidth;
692 UINT32 WriteBandwidth;
698 } ACPI_PMTT_CONTROLLER;
700 /* 1a: Proximity Domain substructure */
702 typedef struct acpi_pmtt_domain
704 UINT32 ProximityDomain;
709 /* 2: Physical Component Identifier (DIMM) */
711 typedef struct acpi_pmtt_physical_component
713 ACPI_PMTT_HEADER Header;
719 } ACPI_PMTT_PHYSICAL_COMPONENT;
722 /*******************************************************************************
724 * RASF - RAS Feature Table (ACPI 5.0)
727 ******************************************************************************/
729 typedef struct acpi_table_rasf
731 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
736 /* RASF Platform Communication Channel Shared Memory Region */
738 typedef struct acpi_rasf_shared_memory
744 UINT8 Capabilities[16];
745 UINT8 SetCapabilities[16];
746 UINT16 NumParameterBlocks;
747 UINT32 SetCapabilitiesStatus;
749 } ACPI_RASF_SHARED_MEMORY;
751 /* RASF Parameter Block Structure Header */
753 typedef struct acpi_rasf_parameter_block
759 } ACPI_RASF_PARAMETER_BLOCK;
761 /* RASF Parameter Block Structure for PATROL_SCRUB */
763 typedef struct acpi_rasf_patrol_scrub_parameter
765 ACPI_RASF_PARAMETER_BLOCK Header;
766 UINT16 PatrolScrubCommand;
767 UINT64 RequestedAddressRange[2];
768 UINT64 ActualAddressRange[2];
770 UINT8 RequestedSpeed;
772 } ACPI_RASF_PATROL_SCRUB_PARAMETER;
774 /* Masks for Flags and Speed fields above */
776 #define ACPI_RASF_SCRUBBER_RUNNING 1
777 #define ACPI_RASF_SPEED (7<<1)
778 #define ACPI_RASF_SPEED_SLOW (0<<1)
779 #define ACPI_RASF_SPEED_MEDIUM (4<<1)
780 #define ACPI_RASF_SPEED_FAST (7<<1)
782 /* Channel Commands */
784 enum AcpiRasfCommands
786 ACPI_RASF_EXECUTE_RASF_COMMAND = 1
789 /* Platform RAS Capabilities */
791 enum AcpiRasfCapabiliities
793 ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
794 ACPI_SW_PATROL_SCRUB_EXPOSED = 1
797 /* Patrol Scrub Commands */
799 enum AcpiRasfPatrolScrubCommands
801 ACPI_RASF_GET_PATROL_PARAMETERS = 1,
802 ACPI_RASF_START_PATROL_SCRUBBER = 2,
803 ACPI_RASF_STOP_PATROL_SCRUBBER = 3
806 /* Channel Command flags */
808 #define ACPI_RASF_GENERATE_SCI (1<<15)
814 ACPI_RASF_SUCCESS = 0,
815 ACPI_RASF_NOT_VALID = 1,
816 ACPI_RASF_NOT_SUPPORTED = 2,
818 ACPI_RASF_FAILED = 4,
819 ACPI_RASF_ABORTED = 5,
820 ACPI_RASF_INVALID_DATA = 6
825 #define ACPI_RASF_COMMAND_COMPLETE (1)
826 #define ACPI_RASF_SCI_DOORBELL (1<<1)
827 #define ACPI_RASF_ERROR (1<<2)
828 #define ACPI_RASF_STATUS (0x1F<<3)
831 /*******************************************************************************
833 * STAO - Status Override Table (_STA override) - ACPI 6.0
836 * Conforms to "ACPI Specification for Status Override Table"
839 ******************************************************************************/
841 typedef struct acpi_table_stao
843 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
849 /*******************************************************************************
851 * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
854 * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
856 ******************************************************************************/
858 typedef struct acpi_table_tpm2
860 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
862 UINT64 ControlAddress;
867 /* Control area structure (not part of table, pointed to by ControlAddress) */
869 typedef struct acpi_tpm2_control
875 UINT64 InterruptControl;
877 UINT64 CommandAddress;
879 UINT64 ResponseAddress;
884 /*******************************************************************************
886 * WPBT - Windows Platform Environment Table (ACPI 6.0)
889 * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
891 ******************************************************************************/
893 typedef struct acpi_table_wpbt
895 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
897 UINT64 HandoffAddress;
900 UINT16 ArgumentsLength;
905 /*******************************************************************************
907 * XENV - Xen Environment Table (ACPI 6.0)
910 * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
912 ******************************************************************************/
914 typedef struct acpi_table_xenv
916 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
917 UINT64 GrantTableAddress;
918 UINT64 GrantTableSize;
919 UINT32 EventInterrupt;
925 /* Reset to default packing */
929 #endif /* __ACTBL3_H__ */