1 /****************************************************************************** 2 * 3 * Name: actbl3.h - ACPI Table Definitions 4 * 5 *****************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2014, Intel Corp. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 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. 25 * 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. 29 * 30 * NO WARRANTY 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. 42 */ 43 44 #ifndef __ACTBL3_H__ 45 #define __ACTBL3_H__ 46 47 48 #pragma pack(push) /* Set default struct packing */ 49 50 /******************************************************************************* 51 * 52 * Additional ACPI Tables (3) 53 * 54 * These tables are not consumed directly by the ACPICA subsystem, but are 55 * included here to support device drivers and the AML disassembler. 56 * 57 * The tables in this file are fully defined within the ACPI specification. 58 * 59 ******************************************************************************/ 60 61 62 /* 63 * Values for description table header signatures for tables defined in this 64 * file. Useful because they make it more difficult to inadvertently type in 65 * the wrong signature. 66 */ 67 #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ 68 #define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */ 69 #define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */ 70 #define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */ 71 #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */ 72 #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ 73 #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ 74 #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ 75 #define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ 76 77 #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ 78 #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ 79 80 /* Reserved table signatures */ 81 82 #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ 83 #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ 84 #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ 85 86 /* 87 * All tables must be byte-packed to match the ACPI specification, since 88 * the tables are provided by the system BIOS. 89 */ 90 #pragma pack(1) 91 92 /* 93 * Note: C bitfields are not used for this reason: 94 * 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 102 */ 103 104 105 /******************************************************************************* 106 * 107 * BGRT - Boot Graphics Resource Table (ACPI 5.0) 108 * Version 1 109 * 110 ******************************************************************************/ 111 112 typedef struct acpi_table_bgrt 113 { 114 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 115 UINT16 Version; 116 UINT8 Status; 117 UINT8 ImageType; 118 UINT64 ImageAddress; 119 UINT32 ImageOffsetX; 120 UINT32 ImageOffsetY; 121 122 } ACPI_TABLE_BGRT; 123 124 125 /******************************************************************************* 126 * 127 * DRTM - Dynamic Root of Trust for Measurement table 128 * 129 ******************************************************************************/ 130 131 typedef struct acpi_table_drtm 132 { 133 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 134 UINT64 EntryBaseAddress; 135 UINT64 EntryLength; 136 UINT32 EntryAddress32; 137 UINT64 EntryAddress64; 138 UINT64 ExitAddress; 139 UINT64 LogAreaAddress; 140 UINT32 LogAreaLength; 141 UINT64 ArchDependentAddress; 142 UINT32 Flags; 143 144 } ACPI_TABLE_DRTM; 145 146 /* 1) Validated Tables List */ 147 148 typedef struct acpi_drtm_vtl_list 149 { 150 UINT32 ValidatedTableListCount; 151 152 } ACPI_DRTM_VTL_LIST; 153 154 /* 2) Resources List */ 155 156 typedef struct acpi_drtm_resource_list 157 { 158 UINT32 ResourceListCount; 159 160 } ACPI_DRTM_RESOURCE_LIST; 161 162 /* 3) Platform-specific Identifiers List */ 163 164 typedef struct acpi_drtm_id_list 165 { 166 UINT32 IdListCount; 167 168 } ACPI_DRTM_ID_LIST; 169 170 171 /******************************************************************************* 172 * 173 * FPDT - Firmware Performance Data Table (ACPI 5.0) 174 * Version 1 175 * 176 ******************************************************************************/ 177 178 typedef struct acpi_table_fpdt 179 { 180 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 181 182 } ACPI_TABLE_FPDT; 183 184 185 /* FPDT subtable header */ 186 187 typedef struct acpi_fpdt_header 188 { 189 UINT16 Type; 190 UINT8 Length; 191 UINT8 Revision; 192 193 } ACPI_FPDT_HEADER; 194 195 /* Values for Type field above */ 196 197 enum AcpiFpdtType 198 { 199 ACPI_FPDT_TYPE_BOOT = 0, 200 ACPI_FPDT_TYPE_S3PERF = 1 201 }; 202 203 204 /* 205 * FPDT subtables 206 */ 207 208 /* 0: Firmware Basic Boot Performance Record */ 209 210 typedef struct acpi_fpdt_boot 211 { 212 ACPI_FPDT_HEADER Header; 213 UINT8 Reserved[4]; 214 UINT64 ResetEnd; 215 UINT64 LoadStart; 216 UINT64 StartupStart; 217 UINT64 ExitServicesEntry; 218 UINT64 ExitServicesExit; 219 220 } ACPI_FPDT_BOOT; 221 222 223 /* 1: S3 Performance Table Pointer Record */ 224 225 typedef struct acpi_fpdt_s3pt_ptr 226 { 227 ACPI_FPDT_HEADER Header; 228 UINT8 Reserved[4]; 229 UINT64 Address; 230 231 } ACPI_FPDT_S3PT_PTR; 232 233 234 /* 235 * S3PT - S3 Performance Table. This table is pointed to by the 236 * FPDT S3 Pointer Record above. 237 */ 238 typedef struct acpi_table_s3pt 239 { 240 UINT8 Signature[4]; /* "S3PT" */ 241 UINT32 Length; 242 243 } ACPI_TABLE_S3PT; 244 245 246 /* 247 * S3PT Subtables 248 */ 249 typedef struct acpi_s3pt_header 250 { 251 UINT16 Type; 252 UINT8 Length; 253 UINT8 Revision; 254 255 } ACPI_S3PT_HEADER; 256 257 /* Values for Type field above */ 258 259 enum AcpiS3ptType 260 { 261 ACPI_S3PT_TYPE_RESUME = 0, 262 ACPI_S3PT_TYPE_SUSPEND = 1 263 }; 264 265 typedef struct acpi_s3pt_resume 266 { 267 ACPI_S3PT_HEADER Header; 268 UINT32 ResumeCount; 269 UINT64 FullResume; 270 UINT64 AverageResume; 271 272 } ACPI_S3PT_RESUME; 273 274 typedef struct acpi_s3pt_suspend 275 { 276 ACPI_S3PT_HEADER Header; 277 UINT64 SuspendStart; 278 UINT64 SuspendEnd; 279 280 } ACPI_S3PT_SUSPEND; 281 282 283 /******************************************************************************* 284 * 285 * GTDT - Generic Timer Description Table (ACPI 5.0) 286 * Version 1 287 * 288 ******************************************************************************/ 289 290 typedef struct acpi_table_gtdt 291 { 292 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 293 UINT64 Address; 294 UINT32 Flags; 295 UINT32 SecurePl1Interrupt; 296 UINT32 SecurePl1Flags; 297 UINT32 NonSecurePl1Interrupt; 298 UINT32 NonSecurePl1Flags; 299 UINT32 VirtualTimerInterrupt; 300 UINT32 VirtualTimerFlags; 301 UINT32 NonSecurePl2Interrupt; 302 UINT32 NonSecurePl2Flags; 303 304 } ACPI_TABLE_GTDT; 305 306 /* Values for Flags field above */ 307 308 #define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1 309 310 /* Values for all "TimerFlags" fields above */ 311 312 #define ACPI_GTDT_INTERRUPT_MODE 1 313 #define ACPI_GTDT_INTERRUPT_POLARITY 2 314 315 316 /******************************************************************************* 317 * 318 * MPST - Memory Power State Table (ACPI 5.0) 319 * Version 1 320 * 321 ******************************************************************************/ 322 323 #define ACPI_MPST_CHANNEL_INFO \ 324 UINT8 ChannelId; \ 325 UINT8 Reserved1[3]; \ 326 UINT16 PowerNodeCount; \ 327 UINT16 Reserved2; 328 329 /* Main table */ 330 331 typedef struct acpi_table_mpst 332 { 333 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 334 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ 335 336 } ACPI_TABLE_MPST; 337 338 339 /* Memory Platform Communication Channel Info */ 340 341 typedef struct acpi_mpst_channel 342 { 343 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ 344 345 } ACPI_MPST_CHANNEL; 346 347 348 /* Memory Power Node Structure */ 349 350 typedef struct acpi_mpst_power_node 351 { 352 UINT8 Flags; 353 UINT8 Reserved1; 354 UINT16 NodeId; 355 UINT32 Length; 356 UINT64 RangeAddress; 357 UINT64 RangeLength; 358 UINT32 NumPowerStates; 359 UINT32 NumPhysicalComponents; 360 361 } ACPI_MPST_POWER_NODE; 362 363 /* Values for Flags field above */ 364 365 #define ACPI_MPST_ENABLED 1 366 #define ACPI_MPST_POWER_MANAGED 2 367 #define ACPI_MPST_HOT_PLUG_CAPABLE 4 368 369 370 /* Memory Power State Structure (follows POWER_NODE above) */ 371 372 typedef struct acpi_mpst_power_state 373 { 374 UINT8 PowerState; 375 UINT8 InfoIndex; 376 377 } ACPI_MPST_POWER_STATE; 378 379 380 /* Physical Component ID Structure (follows POWER_STATE above) */ 381 382 typedef struct acpi_mpst_component 383 { 384 UINT16 ComponentId; 385 386 } ACPI_MPST_COMPONENT; 387 388 389 /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */ 390 391 typedef struct acpi_mpst_data_hdr 392 { 393 UINT16 CharacteristicsCount; 394 UINT16 Reserved; 395 396 } ACPI_MPST_DATA_HDR; 397 398 typedef struct acpi_mpst_power_data 399 { 400 UINT8 StructureId; 401 UINT8 Flags; 402 UINT16 Reserved1; 403 UINT32 AveragePower; 404 UINT32 PowerSaving; 405 UINT64 ExitLatency; 406 UINT64 Reserved2; 407 408 } ACPI_MPST_POWER_DATA; 409 410 /* Values for Flags field above */ 411 412 #define ACPI_MPST_PRESERVE 1 413 #define ACPI_MPST_AUTOENTRY 2 414 #define ACPI_MPST_AUTOEXIT 4 415 416 417 /* Shared Memory Region (not part of an ACPI table) */ 418 419 typedef struct acpi_mpst_shared 420 { 421 UINT32 Signature; 422 UINT16 PccCommand; 423 UINT16 PccStatus; 424 UINT32 CommandRegister; 425 UINT32 StatusRegister; 426 UINT32 PowerStateId; 427 UINT32 PowerNodeId; 428 UINT64 EnergyConsumed; 429 UINT64 AveragePower; 430 431 } ACPI_MPST_SHARED; 432 433 434 /******************************************************************************* 435 * 436 * PCCT - Platform Communications Channel Table (ACPI 5.0) 437 * Version 1 438 * 439 ******************************************************************************/ 440 441 typedef struct acpi_table_pcct 442 { 443 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 444 UINT32 Flags; 445 UINT64 Reserved; 446 447 } ACPI_TABLE_PCCT; 448 449 /* Values for Flags field above */ 450 451 #define ACPI_PCCT_DOORBELL 1 452 453 /* Values for subtable type in ACPI_SUBTABLE_HEADER */ 454 455 enum AcpiPcctType 456 { 457 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, 458 ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */ 459 }; 460 461 /* 462 * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER 463 */ 464 465 /* 0: Generic Communications Subspace */ 466 467 typedef struct acpi_pcct_subspace 468 { 469 ACPI_SUBTABLE_HEADER Header; 470 UINT8 Reserved[6]; 471 UINT64 BaseAddress; 472 UINT64 Length; 473 ACPI_GENERIC_ADDRESS DoorbellRegister; 474 UINT64 PreserveMask; 475 UINT64 WriteMask; 476 UINT32 Latency; 477 UINT32 MaxAccessRate; 478 UINT16 MinTurnaroundTime; 479 480 } ACPI_PCCT_SUBSPACE; 481 482 483 /* 484 * PCC memory structures (not part of the ACPI table) 485 */ 486 487 /* Shared Memory Region */ 488 489 typedef struct acpi_pcct_shared_memory 490 { 491 UINT32 Signature; 492 UINT16 Command; 493 UINT16 Status; 494 495 } ACPI_PCCT_SHARED_MEMORY; 496 497 498 /******************************************************************************* 499 * 500 * PMTT - Platform Memory Topology Table (ACPI 5.0) 501 * Version 1 502 * 503 ******************************************************************************/ 504 505 typedef struct acpi_table_pmtt 506 { 507 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 508 UINT32 Reserved; 509 510 } ACPI_TABLE_PMTT; 511 512 513 /* Common header for PMTT subtables that follow main table */ 514 515 typedef struct acpi_pmtt_header 516 { 517 UINT8 Type; 518 UINT8 Reserved1; 519 UINT16 Length; 520 UINT16 Flags; 521 UINT16 Reserved2; 522 523 } ACPI_PMTT_HEADER; 524 525 /* Values for Type field above */ 526 527 #define ACPI_PMTT_TYPE_SOCKET 0 528 #define ACPI_PMTT_TYPE_CONTROLLER 1 529 #define ACPI_PMTT_TYPE_DIMM 2 530 #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */ 531 532 /* Values for Flags field above */ 533 534 #define ACPI_PMTT_TOP_LEVEL 0x0001 535 #define ACPI_PMTT_PHYSICAL 0x0002 536 #define ACPI_PMTT_MEMORY_TYPE 0x000C 537 538 539 /* 540 * PMTT subtables, correspond to Type in acpi_pmtt_header 541 */ 542 543 544 /* 0: Socket Structure */ 545 546 typedef struct acpi_pmtt_socket 547 { 548 ACPI_PMTT_HEADER Header; 549 UINT16 SocketId; 550 UINT16 Reserved; 551 552 } ACPI_PMTT_SOCKET; 553 554 555 /* 1: Memory Controller subtable */ 556 557 typedef struct acpi_pmtt_controller 558 { 559 ACPI_PMTT_HEADER Header; 560 UINT32 ReadLatency; 561 UINT32 WriteLatency; 562 UINT32 ReadBandwidth; 563 UINT32 WriteBandwidth; 564 UINT16 AccessWidth; 565 UINT16 Alignment; 566 UINT16 Reserved; 567 UINT16 DomainCount; 568 569 } ACPI_PMTT_CONTROLLER; 570 571 /* 1a: Proximity Domain substructure */ 572 573 typedef struct acpi_pmtt_domain 574 { 575 UINT32 ProximityDomain; 576 577 } ACPI_PMTT_DOMAIN; 578 579 580 /* 2: Physical Component Identifier (DIMM) */ 581 582 typedef struct acpi_pmtt_physical_component 583 { 584 ACPI_PMTT_HEADER Header; 585 UINT16 ComponentId; 586 UINT16 Reserved; 587 UINT32 MemorySize; 588 UINT32 BiosHandle; 589 590 } ACPI_PMTT_PHYSICAL_COMPONENT; 591 592 593 /******************************************************************************* 594 * 595 * RASF - RAS Feature Table (ACPI 5.0) 596 * Version 1 597 * 598 ******************************************************************************/ 599 600 typedef struct acpi_table_rasf 601 { 602 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 603 UINT8 ChannelId[12]; 604 605 } ACPI_TABLE_RASF; 606 607 /* RASF Platform Communication Channel Shared Memory Region */ 608 609 typedef struct acpi_rasf_shared_memory 610 { 611 UINT32 Signature; 612 UINT16 Command; 613 UINT16 Status; 614 UINT16 Version; 615 UINT8 Capabilities[16]; 616 UINT8 SetCapabilities[16]; 617 UINT16 NumParameterBlocks; 618 UINT32 SetCapabilitiesStatus; 619 620 } ACPI_RASF_SHARED_MEMORY; 621 622 /* RASF Parameter Block Structure Header */ 623 624 typedef struct acpi_rasf_parameter_block 625 { 626 UINT16 Type; 627 UINT16 Version; 628 UINT16 Length; 629 630 } ACPI_RASF_PARAMETER_BLOCK; 631 632 /* RASF Parameter Block Structure for PATROL_SCRUB */ 633 634 typedef struct acpi_rasf_patrol_scrub_parameter 635 { 636 ACPI_RASF_PARAMETER_BLOCK Header; 637 UINT16 PatrolScrubCommand; 638 UINT64 RequestedAddressRange[2]; 639 UINT64 ActualAddressRange[2]; 640 UINT16 Flags; 641 UINT8 RequestedSpeed; 642 643 } ACPI_RASF_PATROL_SCRUB_PARAMETER; 644 645 /* Masks for Flags and Speed fields above */ 646 647 #define ACPI_RASF_SCRUBBER_RUNNING 1 648 #define ACPI_RASF_SPEED (7<<1) 649 #define ACPI_RASF_SPEED_SLOW (0<<1) 650 #define ACPI_RASF_SPEED_MEDIUM (4<<1) 651 #define ACPI_RASF_SPEED_FAST (7<<1) 652 653 /* Channel Commands */ 654 655 enum AcpiRasfCommands 656 { 657 ACPI_RASF_EXECUTE_RASF_COMMAND = 1 658 }; 659 660 /* Platform RAS Capabilities */ 661 662 enum AcpiRasfCapabiliities 663 { 664 ACPI_HW_PATROL_SCRUB_SUPPORTED = 0, 665 ACPI_SW_PATROL_SCRUB_EXPOSED = 1 666 }; 667 668 /* Patrol Scrub Commands */ 669 670 enum AcpiRasfPatrolScrubCommands 671 { 672 ACPI_RASF_GET_PATROL_PARAMETERS = 1, 673 ACPI_RASF_START_PATROL_SCRUBBER = 2, 674 ACPI_RASF_STOP_PATROL_SCRUBBER = 3 675 }; 676 677 /* Channel Command flags */ 678 679 #define ACPI_RASF_GENERATE_SCI (1<<15) 680 681 /* Status values */ 682 683 enum AcpiRasfStatus 684 { 685 ACPI_RASF_SUCCESS = 0, 686 ACPI_RASF_NOT_VALID = 1, 687 ACPI_RASF_NOT_SUPPORTED = 2, 688 ACPI_RASF_BUSY = 3, 689 ACPI_RASF_FAILED = 4, 690 ACPI_RASF_ABORTED = 5, 691 ACPI_RASF_INVALID_DATA = 6 692 }; 693 694 /* Status flags */ 695 696 #define ACPI_RASF_COMMAND_COMPLETE (1) 697 #define ACPI_RASF_SCI_DOORBELL (1<<1) 698 #define ACPI_RASF_ERROR (1<<2) 699 #define ACPI_RASF_STATUS (0x1F<<3) 700 701 702 /******************************************************************************* 703 * 704 * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table 705 * Version 3 706 * 707 * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011 708 * 709 ******************************************************************************/ 710 711 typedef struct acpi_table_tpm2 712 { 713 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 714 UINT32 Flags; 715 UINT64 ControlAddress; 716 UINT32 StartMethod; 717 718 } ACPI_TABLE_TPM2; 719 720 /* Control area structure (not part of table, pointed to by ControlAddress) */ 721 722 typedef struct acpi_tpm2_control 723 { 724 UINT32 Reserved; 725 UINT32 Error; 726 UINT32 Cancel; 727 UINT32 Start; 728 UINT64 InterruptControl; 729 UINT32 CommandSize; 730 UINT64 CommandAddress; 731 UINT32 ResponseSize; 732 UINT64 ResponseAddress; 733 734 } ACPI_TPM2_CONTROL; 735 736 737 #pragma pack(pop) /* Restore original struct packing */ 738 739 #endif /* __ACTBL3_H__ */ 740