1 /******************************************************************************
3 * Name: actbl3.h - ACPI Table Definitions
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2014, 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_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */
75 #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
76 #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
78 /* Reserved table signatures */
80 #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
81 #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
82 #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
85 * All tables must be byte-packed to match the ACPI specification, since
86 * the tables are provided by the system BIOS.
91 * Note: C bitfields are not used for this reason:
93 * "Bitfields are great and easy to read, but unfortunately the C language
94 * does not specify the layout of bitfields in memory, which means they are
95 * essentially useless for dealing with packed data in on-disk formats or
96 * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
97 * this decision was a design error in C. Ritchie could have picked an order
98 * and stuck with it." Norman Ramsey.
99 * See http://stackoverflow.com/a/1053662/41661
103 /*******************************************************************************
105 * BGRT - Boot Graphics Resource Table (ACPI 5.0)
108 ******************************************************************************/
110 typedef struct acpi_table_bgrt
112 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
123 /*******************************************************************************
125 * DRTM - Dynamic Root of Trust for Measurement table
127 ******************************************************************************/
129 typedef struct acpi_table_drtm
131 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
132 UINT64 EntryBaseAddress;
134 UINT32 EntryAddress32;
135 UINT64 EntryAddress64;
137 UINT64 LogAreaAddress;
138 UINT32 LogAreaLength;
139 UINT64 ArchDependentAddress;
144 /* 1) Validated Tables List */
146 typedef struct acpi_drtm_vtl_list
148 UINT32 ValidatedTableListCount;
150 } ACPI_DRTM_VTL_LIST;
152 /* 2) Resources List */
154 typedef struct acpi_drtm_resource_list
156 UINT32 ResourceListCount;
158 } ACPI_DRTM_RESOURCE_LIST;
160 /* 3) Platform-specific Identifiers List */
162 typedef struct acpi_drtm_id_list
169 /*******************************************************************************
171 * FPDT - Firmware Performance Data Table (ACPI 5.0)
174 ******************************************************************************/
176 typedef struct acpi_table_fpdt
178 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
183 /* FPDT subtable header */
185 typedef struct acpi_fpdt_header
193 /* Values for Type field above */
197 ACPI_FPDT_TYPE_BOOT = 0,
198 ACPI_FPDT_TYPE_S3PERF = 1
206 /* 0: Firmware Basic Boot Performance Record */
208 typedef struct acpi_fpdt_boot
210 ACPI_FPDT_HEADER Header;
215 UINT64 ExitServicesEntry;
216 UINT64 ExitServicesExit;
221 /* 1: S3 Performance Table Pointer Record */
223 typedef struct acpi_fpdt_s3pt_ptr
225 ACPI_FPDT_HEADER Header;
229 } ACPI_FPDT_S3PT_PTR;
233 * S3PT - S3 Performance Table. This table is pointed to by the
234 * FPDT S3 Pointer Record above.
236 typedef struct acpi_table_s3pt
238 UINT8 Signature[4]; /* "S3PT" */
247 typedef struct acpi_s3pt_header
255 /* Values for Type field above */
259 ACPI_S3PT_TYPE_RESUME = 0,
260 ACPI_S3PT_TYPE_SUSPEND = 1
263 typedef struct acpi_s3pt_resume
265 ACPI_S3PT_HEADER Header;
268 UINT64 AverageResume;
272 typedef struct acpi_s3pt_suspend
274 ACPI_S3PT_HEADER Header;
281 /*******************************************************************************
283 * GTDT - Generic Timer Description Table (ACPI 5.1)
286 ******************************************************************************/
288 typedef struct acpi_table_gtdt
290 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
291 UINT64 CounterBlockAddresss;
293 UINT32 SecureEl1Interrupt;
294 UINT32 SecureEl1Flags;
295 UINT32 NonSecureEl1Interrupt;
296 UINT32 NonSecureEl1Flags;
297 UINT32 VirtualTimerInterrupt;
298 UINT32 VirtualTimerFlags;
299 UINT32 NonSecureEl2Interrupt;
300 UINT32 NonSecureEl2Flags;
301 UINT64 CounterReadBlockAddress;
302 UINT32 PlatformTimerCount;
303 UINT32 PlatformTimerOffset;
307 /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
309 #define ACPI_GTDT_INTERRUPT_MODE (1)
310 #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
311 #define ACPI_GTDT_ALWAYS_ON (1<<2)
314 /* Common GTDT subtable header */
316 typedef struct acpi_gtdt_header
323 /* Values for GTDT subtable type above */
327 ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
328 ACPI_GTDT_TYPE_WATCHDOG = 1,
329 ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
333 /* GTDT Subtables, correspond to Type in acpi_gtdt_header */
335 /* 0: Generic Timer Block */
337 typedef struct acpi_gtdt_timer_block
339 ACPI_GTDT_HEADER Header;
345 } ACPI_GTDT_TIMER_BLOCK;
347 /* Timer Sub-Structure, one per timer */
349 typedef struct acpi_gtdt_timer_entry
354 UINT64 El0BaseAddress;
355 UINT32 TimerInterrupt;
357 UINT32 VirtualTimerInterrupt;
358 UINT32 VirtualTimerFlags;
361 } ACPI_GTDT_TIMER_ENTRY;
364 /* Flag Definitions: CommonFlags above */
366 #define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
367 #define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
370 /* 1: SBSA Generic Watchdog Structure */
372 typedef struct acpi_gtdt_watchdog
374 ACPI_GTDT_HEADER Header;
376 UINT64 RefreshFrameAddress;
377 UINT64 ControlFrameAddress;
378 UINT32 TimerInterrupt;
381 } ACPI_GTDT_WATCHDOG;
383 /* Flag Definitions: TimerFlags above */
385 #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
386 #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
387 #define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
390 /*******************************************************************************
392 * MPST - Memory Power State Table (ACPI 5.0)
395 ******************************************************************************/
397 #define ACPI_MPST_CHANNEL_INFO \
399 UINT8 Reserved1[3]; \
400 UINT16 PowerNodeCount; \
405 typedef struct acpi_table_mpst
407 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
408 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
413 /* Memory Platform Communication Channel Info */
415 typedef struct acpi_mpst_channel
417 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
422 /* Memory Power Node Structure */
424 typedef struct acpi_mpst_power_node
432 UINT32 NumPowerStates;
433 UINT32 NumPhysicalComponents;
435 } ACPI_MPST_POWER_NODE;
437 /* Values for Flags field above */
439 #define ACPI_MPST_ENABLED 1
440 #define ACPI_MPST_POWER_MANAGED 2
441 #define ACPI_MPST_HOT_PLUG_CAPABLE 4
444 /* Memory Power State Structure (follows POWER_NODE above) */
446 typedef struct acpi_mpst_power_state
451 } ACPI_MPST_POWER_STATE;
454 /* Physical Component ID Structure (follows POWER_STATE above) */
456 typedef struct acpi_mpst_component
460 } ACPI_MPST_COMPONENT;
463 /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
465 typedef struct acpi_mpst_data_hdr
467 UINT16 CharacteristicsCount;
470 } ACPI_MPST_DATA_HDR;
472 typedef struct acpi_mpst_power_data
482 } ACPI_MPST_POWER_DATA;
484 /* Values for Flags field above */
486 #define ACPI_MPST_PRESERVE 1
487 #define ACPI_MPST_AUTOENTRY 2
488 #define ACPI_MPST_AUTOEXIT 4
491 /* Shared Memory Region (not part of an ACPI table) */
493 typedef struct acpi_mpst_shared
498 UINT32 CommandRegister;
499 UINT32 StatusRegister;
502 UINT64 EnergyConsumed;
508 /*******************************************************************************
510 * PCCT - Platform Communications Channel Table (ACPI 5.0)
513 ******************************************************************************/
515 typedef struct acpi_table_pcct
517 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
523 /* Values for Flags field above */
525 #define ACPI_PCCT_DOORBELL 1
527 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
531 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
532 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
533 ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
537 * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
540 /* 0: Generic Communications Subspace */
542 typedef struct acpi_pcct_subspace
544 ACPI_SUBTABLE_HEADER Header;
548 ACPI_GENERIC_ADDRESS DoorbellRegister;
552 UINT32 MaxAccessRate;
553 UINT16 MinTurnaroundTime;
555 } ACPI_PCCT_SUBSPACE;
558 /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
560 typedef struct acpi_pcct_hw_reduced
562 ACPI_SUBTABLE_HEADER Header;
563 UINT32 DoorbellInterrupt;
568 ACPI_GENERIC_ADDRESS DoorbellRegister;
572 UINT32 MaxAccessRate;
573 UINT16 MinTurnaroundTime;
575 } ACPI_PCCT_HW_REDUCED;
577 /* Values for doorbell flags above */
579 #define ACPI_PCCT_INTERRUPT_POLARITY (1)
580 #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
584 * PCC memory structures (not part of the ACPI table)
587 /* Shared Memory Region */
589 typedef struct acpi_pcct_shared_memory
595 } ACPI_PCCT_SHARED_MEMORY;
598 /*******************************************************************************
600 * PMTT - Platform Memory Topology Table (ACPI 5.0)
603 ******************************************************************************/
605 typedef struct acpi_table_pmtt
607 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
613 /* Common header for PMTT subtables that follow main table */
615 typedef struct acpi_pmtt_header
625 /* Values for Type field above */
627 #define ACPI_PMTT_TYPE_SOCKET 0
628 #define ACPI_PMTT_TYPE_CONTROLLER 1
629 #define ACPI_PMTT_TYPE_DIMM 2
630 #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
632 /* Values for Flags field above */
634 #define ACPI_PMTT_TOP_LEVEL 0x0001
635 #define ACPI_PMTT_PHYSICAL 0x0002
636 #define ACPI_PMTT_MEMORY_TYPE 0x000C
640 * PMTT subtables, correspond to Type in acpi_pmtt_header
644 /* 0: Socket Structure */
646 typedef struct acpi_pmtt_socket
648 ACPI_PMTT_HEADER Header;
655 /* 1: Memory Controller subtable */
657 typedef struct acpi_pmtt_controller
659 ACPI_PMTT_HEADER Header;
662 UINT32 ReadBandwidth;
663 UINT32 WriteBandwidth;
669 } ACPI_PMTT_CONTROLLER;
671 /* 1a: Proximity Domain substructure */
673 typedef struct acpi_pmtt_domain
675 UINT32 ProximityDomain;
680 /* 2: Physical Component Identifier (DIMM) */
682 typedef struct acpi_pmtt_physical_component
684 ACPI_PMTT_HEADER Header;
690 } ACPI_PMTT_PHYSICAL_COMPONENT;
693 /*******************************************************************************
695 * RASF - RAS Feature Table (ACPI 5.0)
698 ******************************************************************************/
700 typedef struct acpi_table_rasf
702 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
707 /* RASF Platform Communication Channel Shared Memory Region */
709 typedef struct acpi_rasf_shared_memory
715 UINT8 Capabilities[16];
716 UINT8 SetCapabilities[16];
717 UINT16 NumParameterBlocks;
718 UINT32 SetCapabilitiesStatus;
720 } ACPI_RASF_SHARED_MEMORY;
722 /* RASF Parameter Block Structure Header */
724 typedef struct acpi_rasf_parameter_block
730 } ACPI_RASF_PARAMETER_BLOCK;
732 /* RASF Parameter Block Structure for PATROL_SCRUB */
734 typedef struct acpi_rasf_patrol_scrub_parameter
736 ACPI_RASF_PARAMETER_BLOCK Header;
737 UINT16 PatrolScrubCommand;
738 UINT64 RequestedAddressRange[2];
739 UINT64 ActualAddressRange[2];
741 UINT8 RequestedSpeed;
743 } ACPI_RASF_PATROL_SCRUB_PARAMETER;
745 /* Masks for Flags and Speed fields above */
747 #define ACPI_RASF_SCRUBBER_RUNNING 1
748 #define ACPI_RASF_SPEED (7<<1)
749 #define ACPI_RASF_SPEED_SLOW (0<<1)
750 #define ACPI_RASF_SPEED_MEDIUM (4<<1)
751 #define ACPI_RASF_SPEED_FAST (7<<1)
753 /* Channel Commands */
755 enum AcpiRasfCommands
757 ACPI_RASF_EXECUTE_RASF_COMMAND = 1
760 /* Platform RAS Capabilities */
762 enum AcpiRasfCapabiliities
764 ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
765 ACPI_SW_PATROL_SCRUB_EXPOSED = 1
768 /* Patrol Scrub Commands */
770 enum AcpiRasfPatrolScrubCommands
772 ACPI_RASF_GET_PATROL_PARAMETERS = 1,
773 ACPI_RASF_START_PATROL_SCRUBBER = 2,
774 ACPI_RASF_STOP_PATROL_SCRUBBER = 3
777 /* Channel Command flags */
779 #define ACPI_RASF_GENERATE_SCI (1<<15)
785 ACPI_RASF_SUCCESS = 0,
786 ACPI_RASF_NOT_VALID = 1,
787 ACPI_RASF_NOT_SUPPORTED = 2,
789 ACPI_RASF_FAILED = 4,
790 ACPI_RASF_ABORTED = 5,
791 ACPI_RASF_INVALID_DATA = 6
796 #define ACPI_RASF_COMMAND_COMPLETE (1)
797 #define ACPI_RASF_SCI_DOORBELL (1<<1)
798 #define ACPI_RASF_ERROR (1<<2)
799 #define ACPI_RASF_STATUS (0x1F<<3)
802 /*******************************************************************************
804 * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
807 * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
809 ******************************************************************************/
811 typedef struct acpi_table_tpm2
813 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
815 UINT64 ControlAddress;
820 /* Control area structure (not part of table, pointed to by ControlAddress) */
822 typedef struct acpi_tpm2_control
828 UINT64 InterruptControl;
830 UINT64 CommandAddress;
832 UINT64 ResponseAddress;
837 /* Reset to default packing */
841 #endif /* __ACTBL3_H__ */