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;
363 /* Flag Definitions: TimerFlags and VirtualTimerFlags above */
365 #define ACPI_GTDT_GT_IRQ_MODE (1)
366 #define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
368 /* Flag Definitions: CommonFlags above */
370 #define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
371 #define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
374 /* 1: SBSA Generic Watchdog Structure */
376 typedef struct acpi_gtdt_watchdog
378 ACPI_GTDT_HEADER Header;
380 UINT64 RefreshFrameAddress;
381 UINT64 ControlFrameAddress;
382 UINT32 TimerInterrupt;
385 } ACPI_GTDT_WATCHDOG;
387 /* Flag Definitions: TimerFlags above */
389 #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
390 #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
391 #define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
394 /*******************************************************************************
396 * MPST - Memory Power State Table (ACPI 5.0)
399 ******************************************************************************/
401 #define ACPI_MPST_CHANNEL_INFO \
403 UINT8 Reserved1[3]; \
404 UINT16 PowerNodeCount; \
409 typedef struct acpi_table_mpst
411 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
412 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
417 /* Memory Platform Communication Channel Info */
419 typedef struct acpi_mpst_channel
421 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
426 /* Memory Power Node Structure */
428 typedef struct acpi_mpst_power_node
436 UINT32 NumPowerStates;
437 UINT32 NumPhysicalComponents;
439 } ACPI_MPST_POWER_NODE;
441 /* Values for Flags field above */
443 #define ACPI_MPST_ENABLED 1
444 #define ACPI_MPST_POWER_MANAGED 2
445 #define ACPI_MPST_HOT_PLUG_CAPABLE 4
448 /* Memory Power State Structure (follows POWER_NODE above) */
450 typedef struct acpi_mpst_power_state
455 } ACPI_MPST_POWER_STATE;
458 /* Physical Component ID Structure (follows POWER_STATE above) */
460 typedef struct acpi_mpst_component
464 } ACPI_MPST_COMPONENT;
467 /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
469 typedef struct acpi_mpst_data_hdr
471 UINT16 CharacteristicsCount;
474 } ACPI_MPST_DATA_HDR;
476 typedef struct acpi_mpst_power_data
486 } ACPI_MPST_POWER_DATA;
488 /* Values for Flags field above */
490 #define ACPI_MPST_PRESERVE 1
491 #define ACPI_MPST_AUTOENTRY 2
492 #define ACPI_MPST_AUTOEXIT 4
495 /* Shared Memory Region (not part of an ACPI table) */
497 typedef struct acpi_mpst_shared
502 UINT32 CommandRegister;
503 UINT32 StatusRegister;
506 UINT64 EnergyConsumed;
512 /*******************************************************************************
514 * PCCT - Platform Communications Channel Table (ACPI 5.0)
517 ******************************************************************************/
519 typedef struct acpi_table_pcct
521 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
527 /* Values for Flags field above */
529 #define ACPI_PCCT_DOORBELL 1
531 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
535 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
536 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
537 ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
541 * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
544 /* 0: Generic Communications Subspace */
546 typedef struct acpi_pcct_subspace
548 ACPI_SUBTABLE_HEADER Header;
552 ACPI_GENERIC_ADDRESS DoorbellRegister;
556 UINT32 MaxAccessRate;
557 UINT16 MinTurnaroundTime;
559 } ACPI_PCCT_SUBSPACE;
562 /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
564 typedef struct acpi_pcct_hw_reduced
566 ACPI_SUBTABLE_HEADER Header;
567 UINT32 DoorbellInterrupt;
572 ACPI_GENERIC_ADDRESS DoorbellRegister;
576 UINT32 MaxAccessRate;
577 UINT16 MinTurnaroundTime;
579 } ACPI_PCCT_HW_REDUCED;
581 /* Values for doorbell flags above */
583 #define ACPI_PCCT_INTERRUPT_POLARITY (1)
584 #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
588 * PCC memory structures (not part of the ACPI table)
591 /* Shared Memory Region */
593 typedef struct acpi_pcct_shared_memory
599 } ACPI_PCCT_SHARED_MEMORY;
602 /*******************************************************************************
604 * PMTT - Platform Memory Topology Table (ACPI 5.0)
607 ******************************************************************************/
609 typedef struct acpi_table_pmtt
611 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
617 /* Common header for PMTT subtables that follow main table */
619 typedef struct acpi_pmtt_header
629 /* Values for Type field above */
631 #define ACPI_PMTT_TYPE_SOCKET 0
632 #define ACPI_PMTT_TYPE_CONTROLLER 1
633 #define ACPI_PMTT_TYPE_DIMM 2
634 #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
636 /* Values for Flags field above */
638 #define ACPI_PMTT_TOP_LEVEL 0x0001
639 #define ACPI_PMTT_PHYSICAL 0x0002
640 #define ACPI_PMTT_MEMORY_TYPE 0x000C
644 * PMTT subtables, correspond to Type in acpi_pmtt_header
648 /* 0: Socket Structure */
650 typedef struct acpi_pmtt_socket
652 ACPI_PMTT_HEADER Header;
659 /* 1: Memory Controller subtable */
661 typedef struct acpi_pmtt_controller
663 ACPI_PMTT_HEADER Header;
666 UINT32 ReadBandwidth;
667 UINT32 WriteBandwidth;
673 } ACPI_PMTT_CONTROLLER;
675 /* 1a: Proximity Domain substructure */
677 typedef struct acpi_pmtt_domain
679 UINT32 ProximityDomain;
684 /* 2: Physical Component Identifier (DIMM) */
686 typedef struct acpi_pmtt_physical_component
688 ACPI_PMTT_HEADER Header;
694 } ACPI_PMTT_PHYSICAL_COMPONENT;
697 /*******************************************************************************
699 * RASF - RAS Feature Table (ACPI 5.0)
702 ******************************************************************************/
704 typedef struct acpi_table_rasf
706 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
711 /* RASF Platform Communication Channel Shared Memory Region */
713 typedef struct acpi_rasf_shared_memory
719 UINT8 Capabilities[16];
720 UINT8 SetCapabilities[16];
721 UINT16 NumParameterBlocks;
722 UINT32 SetCapabilitiesStatus;
724 } ACPI_RASF_SHARED_MEMORY;
726 /* RASF Parameter Block Structure Header */
728 typedef struct acpi_rasf_parameter_block
734 } ACPI_RASF_PARAMETER_BLOCK;
736 /* RASF Parameter Block Structure for PATROL_SCRUB */
738 typedef struct acpi_rasf_patrol_scrub_parameter
740 ACPI_RASF_PARAMETER_BLOCK Header;
741 UINT16 PatrolScrubCommand;
742 UINT64 RequestedAddressRange[2];
743 UINT64 ActualAddressRange[2];
745 UINT8 RequestedSpeed;
747 } ACPI_RASF_PATROL_SCRUB_PARAMETER;
749 /* Masks for Flags and Speed fields above */
751 #define ACPI_RASF_SCRUBBER_RUNNING 1
752 #define ACPI_RASF_SPEED (7<<1)
753 #define ACPI_RASF_SPEED_SLOW (0<<1)
754 #define ACPI_RASF_SPEED_MEDIUM (4<<1)
755 #define ACPI_RASF_SPEED_FAST (7<<1)
757 /* Channel Commands */
759 enum AcpiRasfCommands
761 ACPI_RASF_EXECUTE_RASF_COMMAND = 1
764 /* Platform RAS Capabilities */
766 enum AcpiRasfCapabiliities
768 ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
769 ACPI_SW_PATROL_SCRUB_EXPOSED = 1
772 /* Patrol Scrub Commands */
774 enum AcpiRasfPatrolScrubCommands
776 ACPI_RASF_GET_PATROL_PARAMETERS = 1,
777 ACPI_RASF_START_PATROL_SCRUBBER = 2,
778 ACPI_RASF_STOP_PATROL_SCRUBBER = 3
781 /* Channel Command flags */
783 #define ACPI_RASF_GENERATE_SCI (1<<15)
789 ACPI_RASF_SUCCESS = 0,
790 ACPI_RASF_NOT_VALID = 1,
791 ACPI_RASF_NOT_SUPPORTED = 2,
793 ACPI_RASF_FAILED = 4,
794 ACPI_RASF_ABORTED = 5,
795 ACPI_RASF_INVALID_DATA = 6
800 #define ACPI_RASF_COMMAND_COMPLETE (1)
801 #define ACPI_RASF_SCI_DOORBELL (1<<1)
802 #define ACPI_RASF_ERROR (1<<2)
803 #define ACPI_RASF_STATUS (0x1F<<3)
806 /*******************************************************************************
808 * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
811 * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
813 ******************************************************************************/
815 typedef struct acpi_table_tpm2
817 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
819 UINT64 ControlAddress;
824 /* Control area structure (not part of table, pointed to by ControlAddress) */
826 typedef struct acpi_tpm2_control
832 UINT64 InterruptControl;
834 UINT64 CommandAddress;
836 UINT64 ResponseAddress;
841 /* Reset to default packing */
845 #endif /* __ACTBL3_H__ */