1 /******************************************************************************
3 * Name: actbl3.h - ACPI Table Definitions
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, 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 * In general, the tables in this file are fully defined within the ACPI
58 ******************************************************************************/
62 * Values for description table header signatures for tables defined in this
63 * file. Useful because they make it more difficult to inadvertently type in
64 * the wrong signature.
66 #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
67 #define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */
68 #define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */
69 #define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */
70 #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
71 #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
72 #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
73 #define ACPI_SIG_RASF "RASF" /* RAS Feature table */
74 #define ACPI_SIG_STAO "STAO" /* Status Override 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 (Performance Record Structure) */
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_pointer
235 ACPI_FPDT_HEADER Header
;
239 } ACPI_FPDT_BOOT_POINTER
;
242 /* 1: S3 Performance Table Pointer Record */
244 typedef struct acpi_fpdt_s3pt_pointer
246 ACPI_FPDT_HEADER Header
;
250 } ACPI_FPDT_S3PT_POINTER
;
254 * S3PT - S3 Performance Table. This table is pointed to by the
255 * S3 Pointer Record above.
257 typedef struct acpi_table_s3pt
259 UINT8 Signature
[4]; /* "S3PT" */
266 * S3PT Subtables (Not part of the actual FPDT)
269 /* Values for Type field in S3PT header */
273 ACPI_S3PT_TYPE_RESUME
= 0,
274 ACPI_S3PT_TYPE_SUSPEND
= 1,
275 ACPI_FPDT_BOOT_PERFORMANCE
= 2
278 typedef struct acpi_s3pt_resume
280 ACPI_FPDT_HEADER Header
;
283 UINT64 AverageResume
;
287 typedef struct acpi_s3pt_suspend
289 ACPI_FPDT_HEADER Header
;
297 * FPDT Boot Performance Record (Not part of the actual FPDT)
299 typedef struct acpi_fpdt_boot
301 ACPI_FPDT_HEADER Header
;
306 UINT64 ExitServicesEntry
;
307 UINT64 ExitServicesExit
;
312 /*******************************************************************************
314 * GTDT - Generic Timer Description Table (ACPI 5.1)
317 ******************************************************************************/
319 typedef struct acpi_table_gtdt
321 ACPI_TABLE_HEADER Header
; /* Common ACPI table header */
322 UINT64 CounterBlockAddresss
;
324 UINT32 SecureEl1Interrupt
;
325 UINT32 SecureEl1Flags
;
326 UINT32 NonSecureEl1Interrupt
;
327 UINT32 NonSecureEl1Flags
;
328 UINT32 VirtualTimerInterrupt
;
329 UINT32 VirtualTimerFlags
;
330 UINT32 NonSecureEl2Interrupt
;
331 UINT32 NonSecureEl2Flags
;
332 UINT64 CounterReadBlockAddress
;
333 UINT32 PlatformTimerCount
;
334 UINT32 PlatformTimerOffset
;
338 /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
340 #define ACPI_GTDT_INTERRUPT_MODE (1)
341 #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
342 #define ACPI_GTDT_ALWAYS_ON (1<<2)
345 /* Common GTDT subtable header */
347 typedef struct acpi_gtdt_header
354 /* Values for GTDT subtable type above */
358 ACPI_GTDT_TYPE_TIMER_BLOCK
= 0,
359 ACPI_GTDT_TYPE_WATCHDOG
= 1,
360 ACPI_GTDT_TYPE_RESERVED
= 2 /* 2 and greater are reserved */
364 /* GTDT Subtables, correspond to Type in acpi_gtdt_header */
366 /* 0: Generic Timer Block */
368 typedef struct acpi_gtdt_timer_block
370 ACPI_GTDT_HEADER Header
;
376 } ACPI_GTDT_TIMER_BLOCK
;
378 /* Timer Sub-Structure, one per timer */
380 typedef struct acpi_gtdt_timer_entry
385 UINT64 El0BaseAddress
;
386 UINT32 TimerInterrupt
;
388 UINT32 VirtualTimerInterrupt
;
389 UINT32 VirtualTimerFlags
;
392 } ACPI_GTDT_TIMER_ENTRY
;
394 /* Flag Definitions: TimerFlags and VirtualTimerFlags above */
396 #define ACPI_GTDT_GT_IRQ_MODE (1)
397 #define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
399 /* Flag Definitions: CommonFlags above */
401 #define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
402 #define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
405 /* 1: SBSA Generic Watchdog Structure */
407 typedef struct acpi_gtdt_watchdog
409 ACPI_GTDT_HEADER Header
;
411 UINT64 RefreshFrameAddress
;
412 UINT64 ControlFrameAddress
;
413 UINT32 TimerInterrupt
;
416 } ACPI_GTDT_WATCHDOG
;
418 /* Flag Definitions: TimerFlags above */
420 #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
421 #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
422 #define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
425 /*******************************************************************************
427 * MPST - Memory Power State Table (ACPI 5.0)
430 ******************************************************************************/
432 #define ACPI_MPST_CHANNEL_INFO \
434 UINT8 Reserved1[3]; \
435 UINT16 PowerNodeCount; \
440 typedef struct acpi_table_mpst
442 ACPI_TABLE_HEADER Header
; /* Common ACPI table header */
443 ACPI_MPST_CHANNEL_INFO
/* Platform Communication Channel */
448 /* Memory Platform Communication Channel Info */
450 typedef struct acpi_mpst_channel
452 ACPI_MPST_CHANNEL_INFO
/* Platform Communication Channel */
457 /* Memory Power Node Structure */
459 typedef struct acpi_mpst_power_node
467 UINT32 NumPowerStates
;
468 UINT32 NumPhysicalComponents
;
470 } ACPI_MPST_POWER_NODE
;
472 /* Values for Flags field above */
474 #define ACPI_MPST_ENABLED 1
475 #define ACPI_MPST_POWER_MANAGED 2
476 #define ACPI_MPST_HOT_PLUG_CAPABLE 4
479 /* Memory Power State Structure (follows POWER_NODE above) */
481 typedef struct acpi_mpst_power_state
486 } ACPI_MPST_POWER_STATE
;
489 /* Physical Component ID Structure (follows POWER_STATE above) */
491 typedef struct acpi_mpst_component
495 } ACPI_MPST_COMPONENT
;
498 /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
500 typedef struct acpi_mpst_data_hdr
502 UINT16 CharacteristicsCount
;
505 } ACPI_MPST_DATA_HDR
;
507 typedef struct acpi_mpst_power_data
517 } ACPI_MPST_POWER_DATA
;
519 /* Values for Flags field above */
521 #define ACPI_MPST_PRESERVE 1
522 #define ACPI_MPST_AUTOENTRY 2
523 #define ACPI_MPST_AUTOEXIT 4
526 /* Shared Memory Region (not part of an ACPI table) */
528 typedef struct acpi_mpst_shared
533 UINT32 CommandRegister
;
534 UINT32 StatusRegister
;
537 UINT64 EnergyConsumed
;
543 /*******************************************************************************
545 * PCCT - Platform Communications Channel Table (ACPI 5.0)
548 ******************************************************************************/
550 typedef struct acpi_table_pcct
552 ACPI_TABLE_HEADER Header
; /* Common ACPI table header */
558 /* Values for Flags field above */
560 #define ACPI_PCCT_DOORBELL 1
562 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
566 ACPI_PCCT_TYPE_GENERIC_SUBSPACE
= 0,
567 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE
= 1,
568 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2
= 2, /* ACPI 6.1 */
569 ACPI_PCCT_TYPE_RESERVED
= 3 /* 3 and greater are reserved */
573 * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
576 /* 0: Generic Communications Subspace */
578 typedef struct acpi_pcct_subspace
580 ACPI_SUBTABLE_HEADER Header
;
584 ACPI_GENERIC_ADDRESS DoorbellRegister
;
588 UINT32 MaxAccessRate
;
589 UINT16 MinTurnaroundTime
;
591 } ACPI_PCCT_SUBSPACE
;
594 /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
596 typedef struct acpi_pcct_hw_reduced
598 ACPI_SUBTABLE_HEADER Header
;
599 UINT32 DoorbellInterrupt
;
604 ACPI_GENERIC_ADDRESS DoorbellRegister
;
608 UINT32 MaxAccessRate
;
609 UINT16 MinTurnaroundTime
;
611 } ACPI_PCCT_HW_REDUCED
;
614 /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
616 typedef struct acpi_pcct_hw_reduced_type2
618 ACPI_SUBTABLE_HEADER Header
;
619 UINT32 DoorbellInterrupt
;
624 ACPI_GENERIC_ADDRESS DoorbellRegister
;
628 UINT32 MaxAccessRate
;
629 UINT16 MinTurnaroundTime
;
630 ACPI_GENERIC_ADDRESS DoorbellAckRegister
;
631 UINT64 AckPreserveMask
;
634 } ACPI_PCCT_HW_REDUCED_TYPE2
;
637 /* Values for doorbell flags above */
639 #define ACPI_PCCT_INTERRUPT_POLARITY (1)
640 #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
644 * PCC memory structures (not part of the ACPI table)
647 /* Shared Memory Region */
649 typedef struct acpi_pcct_shared_memory
655 } ACPI_PCCT_SHARED_MEMORY
;
658 /*******************************************************************************
660 * PMTT - Platform Memory Topology Table (ACPI 5.0)
663 ******************************************************************************/
665 typedef struct acpi_table_pmtt
667 ACPI_TABLE_HEADER Header
; /* Common ACPI table header */
673 /* Common header for PMTT subtables that follow main table */
675 typedef struct acpi_pmtt_header
685 /* Values for Type field above */
687 #define ACPI_PMTT_TYPE_SOCKET 0
688 #define ACPI_PMTT_TYPE_CONTROLLER 1
689 #define ACPI_PMTT_TYPE_DIMM 2
690 #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
692 /* Values for Flags field above */
694 #define ACPI_PMTT_TOP_LEVEL 0x0001
695 #define ACPI_PMTT_PHYSICAL 0x0002
696 #define ACPI_PMTT_MEMORY_TYPE 0x000C
700 * PMTT subtables, correspond to Type in acpi_pmtt_header
704 /* 0: Socket Structure */
706 typedef struct acpi_pmtt_socket
708 ACPI_PMTT_HEADER Header
;
715 /* 1: Memory Controller subtable */
717 typedef struct acpi_pmtt_controller
719 ACPI_PMTT_HEADER Header
;
722 UINT32 ReadBandwidth
;
723 UINT32 WriteBandwidth
;
729 } ACPI_PMTT_CONTROLLER
;
731 /* 1a: Proximity Domain substructure */
733 typedef struct acpi_pmtt_domain
735 UINT32 ProximityDomain
;
740 /* 2: Physical Component Identifier (DIMM) */
742 typedef struct acpi_pmtt_physical_component
744 ACPI_PMTT_HEADER Header
;
750 } ACPI_PMTT_PHYSICAL_COMPONENT
;
753 /*******************************************************************************
755 * RASF - RAS Feature Table (ACPI 5.0)
758 ******************************************************************************/
760 typedef struct acpi_table_rasf
762 ACPI_TABLE_HEADER Header
; /* Common ACPI table header */
767 /* RASF Platform Communication Channel Shared Memory Region */
769 typedef struct acpi_rasf_shared_memory
775 UINT8 Capabilities
[16];
776 UINT8 SetCapabilities
[16];
777 UINT16 NumParameterBlocks
;
778 UINT32 SetCapabilitiesStatus
;
780 } ACPI_RASF_SHARED_MEMORY
;
782 /* RASF Parameter Block Structure Header */
784 typedef struct acpi_rasf_parameter_block
790 } ACPI_RASF_PARAMETER_BLOCK
;
792 /* RASF Parameter Block Structure for PATROL_SCRUB */
794 typedef struct acpi_rasf_patrol_scrub_parameter
796 ACPI_RASF_PARAMETER_BLOCK Header
;
797 UINT16 PatrolScrubCommand
;
798 UINT64 RequestedAddressRange
[2];
799 UINT64 ActualAddressRange
[2];
801 UINT8 RequestedSpeed
;
803 } ACPI_RASF_PATROL_SCRUB_PARAMETER
;
805 /* Masks for Flags and Speed fields above */
807 #define ACPI_RASF_SCRUBBER_RUNNING 1
808 #define ACPI_RASF_SPEED (7<<1)
809 #define ACPI_RASF_SPEED_SLOW (0<<1)
810 #define ACPI_RASF_SPEED_MEDIUM (4<<1)
811 #define ACPI_RASF_SPEED_FAST (7<<1)
813 /* Channel Commands */
815 enum AcpiRasfCommands
817 ACPI_RASF_EXECUTE_RASF_COMMAND
= 1
820 /* Platform RAS Capabilities */
822 enum AcpiRasfCapabiliities
824 ACPI_HW_PATROL_SCRUB_SUPPORTED
= 0,
825 ACPI_SW_PATROL_SCRUB_EXPOSED
= 1
828 /* Patrol Scrub Commands */
830 enum AcpiRasfPatrolScrubCommands
832 ACPI_RASF_GET_PATROL_PARAMETERS
= 1,
833 ACPI_RASF_START_PATROL_SCRUBBER
= 2,
834 ACPI_RASF_STOP_PATROL_SCRUBBER
= 3
837 /* Channel Command flags */
839 #define ACPI_RASF_GENERATE_SCI (1<<15)
845 ACPI_RASF_SUCCESS
= 0,
846 ACPI_RASF_NOT_VALID
= 1,
847 ACPI_RASF_NOT_SUPPORTED
= 2,
849 ACPI_RASF_FAILED
= 4,
850 ACPI_RASF_ABORTED
= 5,
851 ACPI_RASF_INVALID_DATA
= 6
856 #define ACPI_RASF_COMMAND_COMPLETE (1)
857 #define ACPI_RASF_SCI_DOORBELL (1<<1)
858 #define ACPI_RASF_ERROR (1<<2)
859 #define ACPI_RASF_STATUS (0x1F<<3)
862 /*******************************************************************************
864 * STAO - Status Override Table (_STA override) - ACPI 6.0
867 * Conforms to "ACPI Specification for Status Override Table"
870 ******************************************************************************/
872 typedef struct acpi_table_stao
874 ACPI_TABLE_HEADER Header
; /* Common ACPI table header */
880 /*******************************************************************************
882 * WPBT - Windows Platform Environment Table (ACPI 6.0)
885 * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
887 ******************************************************************************/
889 typedef struct acpi_table_wpbt
891 ACPI_TABLE_HEADER Header
; /* Common ACPI table header */
893 UINT64 HandoffAddress
;
896 UINT16 ArgumentsLength
;
901 /*******************************************************************************
903 * XENV - Xen Environment Table (ACPI 6.0)
906 * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
908 ******************************************************************************/
910 typedef struct acpi_table_xenv
912 ACPI_TABLE_HEADER Header
; /* Common ACPI table header */
913 UINT64 GrantTableAddress
;
914 UINT64 GrantTableSize
;
915 UINT32 EventInterrupt
;
921 /* Reset to default packing */
925 #endif /* __ACTBL3_H__ */