195857638SErik Schmauss /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ 2a8357b0cSBob Moore /****************************************************************************** 3a8357b0cSBob Moore * 45cf4d733SBob Moore * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec) 5a8357b0cSBob Moore * 64441e55dSBob Moore * Copyright (C) 2000 - 2021, Intel Corp. 7a8357b0cSBob Moore * 895857638SErik Schmauss *****************************************************************************/ 9a8357b0cSBob Moore 10b24aad44SBob Moore #ifndef __ACTBL2_H__ 11b24aad44SBob Moore #define __ACTBL2_H__ 12b24aad44SBob Moore 13b24aad44SBob Moore /******************************************************************************* 14b24aad44SBob Moore * 15b24aad44SBob Moore * Additional ACPI Tables (2) 16b24aad44SBob Moore * 17b24aad44SBob Moore * These tables are not consumed directly by the ACPICA subsystem, but are 18b24aad44SBob Moore * included here to support device drivers and the AML disassembler. 19b24aad44SBob Moore * 20b24aad44SBob Moore ******************************************************************************/ 21b24aad44SBob Moore 22b24aad44SBob Moore /* 236e2d5ebdSBob Moore * Values for description table header signatures for tables defined in this 246e2d5ebdSBob Moore * file. Useful because they make it more difficult to inadvertently type in 256e2d5ebdSBob Moore * the wrong signature. 26b24aad44SBob Moore */ 275579649eSIlkka Koskinen #define ACPI_SIG_AGDI "AGDI" /* Arm Generic Diagnostic Dump and Reset Device Interface */ 289401eafaSBob Moore #define ACPI_SIG_BDAT "BDAT" /* BIOS Data ACPI Table */ 29874f6a72SLv Zheng #define ACPI_SIG_IORT "IORT" /* IO Remapping Table */ 306e2d5ebdSBob Moore #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ 31d36d4e30SBob Moore #define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */ 32e62f8227SErik Schmauss #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 33b24aad44SBob Moore #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ 340e264f0bSBob Moore #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ 35e62f8227SErik Schmauss #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */ 36e62f8227SErik Schmauss #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ 375132f2faSBob Moore #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ 38e62f8227SErik Schmauss #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */ 39a805aab8SBob Moore #define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */ 40e62f8227SErik Schmauss #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ 41e62f8227SErik Schmauss #define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */ 429f400337SErik Kaneda #define ACPI_SIG_PHAT "PHAT" /* Platform Health Assessment Table */ 43e62f8227SErik Schmauss #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ 44e62f8227SErik Schmauss #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */ 45d71df85aSErik Kaneda #define ACPI_SIG_PRMT "PRMT" /* Platform Runtime Mechanism Table */ 46e62f8227SErik Schmauss #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ 47536e35c9SBob Moore #define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */ 48e62f8227SErik Schmauss #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ 493bd38469SJames Morse #define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */ 50e62f8227SErik Schmauss #define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */ 518288f69eSKuppuswamy Sathyanarayanan #define ACPI_SIG_SVKL "SVKL" /* Storage Volume Key Location Table */ 522de6bb92SBob Moore #define ACPI_SIG_TDEL "TDEL" /* TD Event Log Table */ 534461cf54SBob Moore 54b24aad44SBob Moore /* 55b24aad44SBob Moore * All tables must be byte-packed to match the ACPI specification, since 56b24aad44SBob Moore * the tables are provided by the system BIOS. 57b24aad44SBob Moore */ 58b24aad44SBob Moore #pragma pack(1) 59b24aad44SBob Moore 60b24aad44SBob Moore /* 61be030a57SBob Moore * Note: C bitfields are not used for this reason: 62be030a57SBob Moore * 63be030a57SBob Moore * "Bitfields are great and easy to read, but unfortunately the C language 64be030a57SBob Moore * does not specify the layout of bitfields in memory, which means they are 65be030a57SBob Moore * essentially useless for dealing with packed data in on-disk formats or 66be030a57SBob Moore * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, 67be030a57SBob Moore * this decision was a design error in C. Ritchie could have picked an order 68be030a57SBob Moore * and stuck with it." Norman Ramsey. 69be030a57SBob Moore * See http://stackoverflow.com/a/1053662/41661 70b24aad44SBob Moore */ 71b24aad44SBob Moore 72b24aad44SBob Moore /******************************************************************************* 73b24aad44SBob Moore * 74e692fa13SBob Moore * AEST - Arm Error Source Table 75e692fa13SBob Moore * 76e692fa13SBob Moore * Conforms to: ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document 77e692fa13SBob Moore * September 2020. 78e692fa13SBob Moore * 79e692fa13SBob Moore ******************************************************************************/ 80e692fa13SBob Moore 81e692fa13SBob Moore struct acpi_table_aest { 82e692fa13SBob Moore struct acpi_table_header header; 83e692fa13SBob Moore void *node_array[]; 84e692fa13SBob Moore }; 85e692fa13SBob Moore 86e692fa13SBob Moore /* Common Subtable header - one per Node Structure (Subtable) */ 87e692fa13SBob Moore 88e692fa13SBob Moore struct acpi_aest_hdr { 89e692fa13SBob Moore u8 type; 90e692fa13SBob Moore u16 length; 91e692fa13SBob Moore u8 reserved; 92e692fa13SBob Moore u32 node_specific_offset; 93e692fa13SBob Moore u32 node_interface_offset; 94e692fa13SBob Moore u32 node_interrupt_offset; 95e692fa13SBob Moore u32 node_interrupt_count; 96e692fa13SBob Moore u64 timestamp_rate; 97e692fa13SBob Moore u64 reserved1; 98e692fa13SBob Moore u64 error_injection_rate; 99e692fa13SBob Moore }; 100e692fa13SBob Moore 101e692fa13SBob Moore /* Values for Type above */ 102e692fa13SBob Moore 103e692fa13SBob Moore #define ACPI_AEST_PROCESSOR_ERROR_NODE 0 104e692fa13SBob Moore #define ACPI_AEST_MEMORY_ERROR_NODE 1 105e692fa13SBob Moore #define ACPI_AEST_SMMU_ERROR_NODE 2 106e692fa13SBob Moore #define ACPI_AEST_VENDOR_ERROR_NODE 3 107e692fa13SBob Moore #define ACPI_AEST_GIC_ERROR_NODE 4 108e692fa13SBob Moore #define ACPI_AEST_NODE_TYPE_RESERVED 5 /* 5 and above are reserved */ 109e692fa13SBob Moore 110e692fa13SBob Moore /* 111e692fa13SBob Moore * AEST subtables (Error nodes) 112e692fa13SBob Moore */ 113e692fa13SBob Moore 114e692fa13SBob Moore /* 0: Processor Error */ 115e692fa13SBob Moore 116e692fa13SBob Moore typedef struct acpi_aest_processor { 117e692fa13SBob Moore u32 processor_id; 118e692fa13SBob Moore u8 resource_type; 119e692fa13SBob Moore u8 reserved; 120e692fa13SBob Moore u8 flags; 121e692fa13SBob Moore u8 revision; 122e692fa13SBob Moore u64 processor_affinity; 123e692fa13SBob Moore 124e692fa13SBob Moore } acpi_aest_processor; 125e692fa13SBob Moore 126e692fa13SBob Moore /* Values for resource_type above, related structs below */ 127e692fa13SBob Moore 128e692fa13SBob Moore #define ACPI_AEST_CACHE_RESOURCE 0 129e692fa13SBob Moore #define ACPI_AEST_TLB_RESOURCE 1 130e692fa13SBob Moore #define ACPI_AEST_GENERIC_RESOURCE 2 131e692fa13SBob Moore #define ACPI_AEST_RESOURCE_RESERVED 3 /* 3 and above are reserved */ 132e692fa13SBob Moore 133e692fa13SBob Moore /* 0R: Processor Cache Resource Substructure */ 134e692fa13SBob Moore 135e692fa13SBob Moore typedef struct acpi_aest_processor_cache { 136e692fa13SBob Moore u32 cache_reference; 137e692fa13SBob Moore u32 reserved; 138e692fa13SBob Moore 139e692fa13SBob Moore } acpi_aest_processor_cache; 140e692fa13SBob Moore 141e692fa13SBob Moore /* Values for cache_type above */ 142e692fa13SBob Moore 143e692fa13SBob Moore #define ACPI_AEST_CACHE_DATA 0 144e692fa13SBob Moore #define ACPI_AEST_CACHE_INSTRUCTION 1 145e692fa13SBob Moore #define ACPI_AEST_CACHE_UNIFIED 2 146e692fa13SBob Moore #define ACPI_AEST_CACHE_RESERVED 3 /* 3 and above are reserved */ 147e692fa13SBob Moore 148e692fa13SBob Moore /* 1R: Processor TLB Resource Substructure */ 149e692fa13SBob Moore 150e692fa13SBob Moore typedef struct acpi_aest_processor_tlb { 151e692fa13SBob Moore u32 tlb_level; 152e692fa13SBob Moore u32 reserved; 153e692fa13SBob Moore 154e692fa13SBob Moore } acpi_aest_processor_tlb; 155e692fa13SBob Moore 156e692fa13SBob Moore /* 2R: Processor Generic Resource Substructure */ 157e692fa13SBob Moore 158e692fa13SBob Moore typedef struct acpi_aest_processor_generic { 15900395b74SShuuichirou Ishii u32 resource; 160e692fa13SBob Moore 161e692fa13SBob Moore } acpi_aest_processor_generic; 162e692fa13SBob Moore 163e692fa13SBob Moore /* 1: Memory Error */ 164e692fa13SBob Moore 165e692fa13SBob Moore typedef struct acpi_aest_memory { 166e692fa13SBob Moore u32 srat_proximity_domain; 167e692fa13SBob Moore 168e692fa13SBob Moore } acpi_aest_memory; 169e692fa13SBob Moore 170e692fa13SBob Moore /* 2: Smmu Error */ 171e692fa13SBob Moore 172e692fa13SBob Moore typedef struct acpi_aest_smmu { 173e692fa13SBob Moore u32 iort_node_reference; 174e692fa13SBob Moore u32 subcomponent_reference; 175e692fa13SBob Moore 176e692fa13SBob Moore } acpi_aest_smmu; 177e692fa13SBob Moore 178e692fa13SBob Moore /* 3: Vendor Defined */ 179e692fa13SBob Moore 180e692fa13SBob Moore typedef struct acpi_aest_vendor { 181e692fa13SBob Moore u32 acpi_hid; 182e692fa13SBob Moore u32 acpi_uid; 183e692fa13SBob Moore u8 vendor_specific_data[16]; 184e692fa13SBob Moore 185e692fa13SBob Moore } acpi_aest_vendor; 186e692fa13SBob Moore 187e692fa13SBob Moore /* 4: Gic Error */ 188e692fa13SBob Moore 189e692fa13SBob Moore typedef struct acpi_aest_gic { 190e692fa13SBob Moore u32 interface_type; 191e692fa13SBob Moore u32 instance_id; 192e692fa13SBob Moore 193e692fa13SBob Moore } acpi_aest_gic; 194e692fa13SBob Moore 195e692fa13SBob Moore /* Values for interface_type above */ 196e692fa13SBob Moore 197e692fa13SBob Moore #define ACPI_AEST_GIC_CPU 0 198e692fa13SBob Moore #define ACPI_AEST_GIC_DISTRIBUTOR 1 199e692fa13SBob Moore #define ACPI_AEST_GIC_REDISTRIBUTOR 2 200e692fa13SBob Moore #define ACPI_AEST_GIC_ITS 3 201e692fa13SBob Moore #define ACPI_AEST_GIC_RESERVED 4 /* 4 and above are reserved */ 202e692fa13SBob Moore 203e692fa13SBob Moore /* Node Interface Structure */ 204e692fa13SBob Moore 205e692fa13SBob Moore typedef struct acpi_aest_node_interface { 206e692fa13SBob Moore u8 type; 207e692fa13SBob Moore u8 reserved[3]; 208e692fa13SBob Moore u32 flags; 209e692fa13SBob Moore u64 address; 210e692fa13SBob Moore u32 error_record_index; 211e692fa13SBob Moore u32 error_record_count; 212e692fa13SBob Moore u64 error_record_implemented; 213e692fa13SBob Moore u64 error_status_reporting; 214e692fa13SBob Moore u64 addressing_mode; 215e692fa13SBob Moore 216e692fa13SBob Moore } acpi_aest_node_interface; 217e692fa13SBob Moore 218e692fa13SBob Moore /* Values for Type field above */ 219e692fa13SBob Moore 220e692fa13SBob Moore #define ACPI_AEST_NODE_SYSTEM_REGISTER 0 221e692fa13SBob Moore #define ACPI_AEST_NODE_MEMORY_MAPPED 1 222e692fa13SBob Moore #define ACPI_AEST_XFACE_RESERVED 2 /* 2 and above are reserved */ 223e692fa13SBob Moore 224e692fa13SBob Moore /* Node Interrupt Structure */ 225e692fa13SBob Moore 226e692fa13SBob Moore typedef struct acpi_aest_node_interrupt { 227e692fa13SBob Moore u8 type; 228e692fa13SBob Moore u8 reserved[2]; 229e692fa13SBob Moore u8 flags; 230e692fa13SBob Moore u32 gsiv; 231e692fa13SBob Moore u8 iort_id; 232e692fa13SBob Moore u8 reserved1[3]; 233e692fa13SBob Moore 234e692fa13SBob Moore } acpi_aest_node_interrupt; 235e692fa13SBob Moore 236e692fa13SBob Moore /* Values for Type field above */ 237e692fa13SBob Moore 238e692fa13SBob Moore #define ACPI_AEST_NODE_FAULT_HANDLING 0 239e692fa13SBob Moore #define ACPI_AEST_NODE_ERROR_RECOVERY 1 240e692fa13SBob Moore #define ACPI_AEST_XRUPT_RESERVED 2 /* 2 and above are reserved */ 241e692fa13SBob Moore 242e692fa13SBob Moore /******************************************************************************* 2435579649eSIlkka Koskinen * AGDI - Arm Generic Diagnostic Dump and Reset Device Interface 2445579649eSIlkka Koskinen * 2455579649eSIlkka Koskinen * Conforms to "ACPI for Arm Components 1.1, Platform Design Document" 2465579649eSIlkka Koskinen * ARM DEN0093 v1.1 2475579649eSIlkka Koskinen * 2485579649eSIlkka Koskinen ******************************************************************************/ 2495579649eSIlkka Koskinen struct acpi_table_agdi { 2505579649eSIlkka Koskinen struct acpi_table_header header; /* Common ACPI table header */ 2515579649eSIlkka Koskinen u8 flags; 2525579649eSIlkka Koskinen u8 reserved[3]; 2535579649eSIlkka Koskinen u32 sdei_event; 2545579649eSIlkka Koskinen u32 gsiv; 2555579649eSIlkka Koskinen }; 2565579649eSIlkka Koskinen 2575579649eSIlkka Koskinen /* Mask for Flags field above */ 2585579649eSIlkka Koskinen 2595579649eSIlkka Koskinen #define ACPI_AGDI_SIGNALING_MODE (1) 2605579649eSIlkka Koskinen 2615579649eSIlkka Koskinen /******************************************************************************* 262e692fa13SBob Moore * 2639401eafaSBob Moore * BDAT - BIOS Data ACPI Table 2649401eafaSBob Moore * 2659401eafaSBob Moore * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5 2669401eafaSBob Moore * Nov 2020 2679401eafaSBob Moore * 2689401eafaSBob Moore ******************************************************************************/ 2699401eafaSBob Moore 2709401eafaSBob Moore struct acpi_table_bdat { 2719401eafaSBob Moore struct acpi_table_header header; 2729401eafaSBob Moore struct acpi_generic_address gas; 2739401eafaSBob Moore }; 2749401eafaSBob Moore 2759401eafaSBob Moore /******************************************************************************* 2769401eafaSBob Moore * 277874f6a72SLv Zheng * IORT - IO Remapping Table 278874f6a72SLv Zheng * 279874f6a72SLv Zheng * Conforms to "IO Remapping Table System Software on ARM Platforms", 2808e1fdd7fSShameer Kolothum * Document number: ARM DEN 0049E.b, Feb 2021 281874f6a72SLv Zheng * 282874f6a72SLv Zheng ******************************************************************************/ 283874f6a72SLv Zheng 284874f6a72SLv Zheng struct acpi_table_iort { 285874f6a72SLv Zheng struct acpi_table_header header; 286874f6a72SLv Zheng u32 node_count; 287874f6a72SLv Zheng u32 node_offset; 288874f6a72SLv Zheng u32 reserved; 289874f6a72SLv Zheng }; 290874f6a72SLv Zheng 291874f6a72SLv Zheng /* 292874f6a72SLv Zheng * IORT subtables 293874f6a72SLv Zheng */ 294874f6a72SLv Zheng struct acpi_iort_node { 295874f6a72SLv Zheng u8 type; 296874f6a72SLv Zheng u16 length; 297874f6a72SLv Zheng u8 revision; 2988e1fdd7fSShameer Kolothum u32 identifier; 299874f6a72SLv Zheng u32 mapping_count; 300874f6a72SLv Zheng u32 mapping_offset; 301874f6a72SLv Zheng char node_data[1]; 302874f6a72SLv Zheng }; 303874f6a72SLv Zheng 304874f6a72SLv Zheng /* Values for subtable Type above */ 305874f6a72SLv Zheng 306874f6a72SLv Zheng enum acpi_iort_node_type { 307874f6a72SLv Zheng ACPI_IORT_NODE_ITS_GROUP = 0x00, 308874f6a72SLv Zheng ACPI_IORT_NODE_NAMED_COMPONENT = 0x01, 309874f6a72SLv Zheng ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02, 3104ac78bafSAl Stone ACPI_IORT_NODE_SMMU = 0x03, 311a53eaef6SRobin Murphy ACPI_IORT_NODE_SMMU_V3 = 0x04, 3128e1fdd7fSShameer Kolothum ACPI_IORT_NODE_PMCG = 0x05, 3138e1fdd7fSShameer Kolothum ACPI_IORT_NODE_RMR = 0x06, 314874f6a72SLv Zheng }; 315874f6a72SLv Zheng 316874f6a72SLv Zheng struct acpi_iort_id_mapping { 317874f6a72SLv Zheng u32 input_base; /* Lowest value in input range */ 318874f6a72SLv Zheng u32 id_count; /* Number of IDs */ 319874f6a72SLv Zheng u32 output_base; /* Lowest value in output range */ 320874f6a72SLv Zheng u32 output_reference; /* A reference to the output node */ 321874f6a72SLv Zheng u32 flags; 322874f6a72SLv Zheng }; 323874f6a72SLv Zheng 324874f6a72SLv Zheng /* Masks for Flags field above for IORT subtable */ 325874f6a72SLv Zheng 326874f6a72SLv Zheng #define ACPI_IORT_ID_SINGLE_MAPPING (1) 327874f6a72SLv Zheng 328874f6a72SLv Zheng struct acpi_iort_memory_access { 329874f6a72SLv Zheng u32 cache_coherency; 330874f6a72SLv Zheng u8 hints; 331874f6a72SLv Zheng u16 reserved; 332874f6a72SLv Zheng u8 memory_flags; 333874f6a72SLv Zheng }; 334874f6a72SLv Zheng 335874f6a72SLv Zheng /* Values for cache_coherency field above */ 336874f6a72SLv Zheng 337874f6a72SLv Zheng #define ACPI_IORT_NODE_COHERENT 0x00000001 /* The device node is fully coherent */ 338874f6a72SLv Zheng #define ACPI_IORT_NODE_NOT_COHERENT 0x00000000 /* The device node is not coherent */ 339874f6a72SLv Zheng 340874f6a72SLv Zheng /* Masks for Hints field above */ 341874f6a72SLv Zheng 342874f6a72SLv Zheng #define ACPI_IORT_HT_TRANSIENT (1) 343874f6a72SLv Zheng #define ACPI_IORT_HT_WRITE (1<<1) 344874f6a72SLv Zheng #define ACPI_IORT_HT_READ (1<<2) 345874f6a72SLv Zheng #define ACPI_IORT_HT_OVERRIDE (1<<3) 346874f6a72SLv Zheng 347874f6a72SLv Zheng /* Masks for memory_flags field above */ 348874f6a72SLv Zheng 349874f6a72SLv Zheng #define ACPI_IORT_MF_COHERENCY (1) 350874f6a72SLv Zheng #define ACPI_IORT_MF_ATTRIBUTES (1<<1) 351874f6a72SLv Zheng 352874f6a72SLv Zheng /* 353874f6a72SLv Zheng * IORT node specific subtables 354874f6a72SLv Zheng */ 355874f6a72SLv Zheng struct acpi_iort_its_group { 356874f6a72SLv Zheng u32 its_count; 357c163f90cSErik Schmauss u32 identifiers[1]; /* GIC ITS identifier array */ 358874f6a72SLv Zheng }; 359874f6a72SLv Zheng 360874f6a72SLv Zheng struct acpi_iort_named_component { 361874f6a72SLv Zheng u32 node_flags; 362874f6a72SLv Zheng u64 memory_properties; /* Memory access properties */ 363874f6a72SLv Zheng u8 memory_address_limit; /* Memory address size limit */ 364874f6a72SLv Zheng char device_name[1]; /* Path of namespace object */ 365874f6a72SLv Zheng }; 366874f6a72SLv Zheng 367d87be043SRobin Murphy /* Masks for Flags field above */ 368d87be043SRobin Murphy 369d87be043SRobin Murphy #define ACPI_IORT_NC_STALL_SUPPORTED (1) 370d87be043SRobin Murphy #define ACPI_IORT_NC_PASID_BITS (31<<1) 371d87be043SRobin Murphy 372874f6a72SLv Zheng struct acpi_iort_root_complex { 373874f6a72SLv Zheng u64 memory_properties; /* Memory access properties */ 374874f6a72SLv Zheng u32 ats_attribute; 375874f6a72SLv Zheng u32 pci_segment_number; 376d87be043SRobin Murphy u8 memory_address_limit; /* Memory address size limit */ 377d87be043SRobin Murphy u8 reserved[3]; /* Reserved, must be zero */ 378874f6a72SLv Zheng }; 379874f6a72SLv Zheng 3808e1fdd7fSShameer Kolothum /* Masks for ats_attribute field above */ 381874f6a72SLv Zheng 3828e1fdd7fSShameer Kolothum #define ACPI_IORT_ATS_SUPPORTED (1) /* The root complex ATS support */ 3838e1fdd7fSShameer Kolothum #define ACPI_IORT_PRI_SUPPORTED (1<<1) /* The root complex PRI support */ 3848e1fdd7fSShameer Kolothum #define ACPI_IORT_PASID_FWD_SUPPORTED (1<<2) /* The root complex PASID forward support */ 385874f6a72SLv Zheng 386874f6a72SLv Zheng struct acpi_iort_smmu { 387874f6a72SLv Zheng u64 base_address; /* SMMU base address */ 388874f6a72SLv Zheng u64 span; /* Length of memory range */ 389874f6a72SLv Zheng u32 model; 390874f6a72SLv Zheng u32 flags; 391874f6a72SLv Zheng u32 global_interrupt_offset; 392874f6a72SLv Zheng u32 context_interrupt_count; 393874f6a72SLv Zheng u32 context_interrupt_offset; 394874f6a72SLv Zheng u32 pmu_interrupt_count; 395874f6a72SLv Zheng u32 pmu_interrupt_offset; 396874f6a72SLv Zheng u64 interrupts[1]; /* Interrupt array */ 397874f6a72SLv Zheng }; 398874f6a72SLv Zheng 399874f6a72SLv Zheng /* Values for Model field above */ 400874f6a72SLv Zheng 401874f6a72SLv Zheng #define ACPI_IORT_SMMU_V1 0x00000000 /* Generic SMMUv1 */ 402874f6a72SLv Zheng #define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */ 403874f6a72SLv Zheng #define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */ 404874f6a72SLv Zheng #define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */ 4050c2021c0SRobin Murphy #define ACPI_IORT_SMMU_CORELINK_MMU401 0x00000004 /* ARM Corelink MMU-401 */ 4060c2021c0SRobin Murphy #define ACPI_IORT_SMMU_CAVIUM_THUNDERX 0x00000005 /* Cavium thunder_x SMMUv2 */ 407874f6a72SLv Zheng 408874f6a72SLv Zheng /* Masks for Flags field above */ 409874f6a72SLv Zheng 410874f6a72SLv Zheng #define ACPI_IORT_SMMU_DVM_SUPPORTED (1) 411874f6a72SLv Zheng #define ACPI_IORT_SMMU_COHERENT_WALK (1<<1) 412874f6a72SLv Zheng 413bb1e23e6SLv Zheng /* Global interrupt format */ 414bb1e23e6SLv Zheng 415bb1e23e6SLv Zheng struct acpi_iort_smmu_gsi { 416bb1e23e6SLv Zheng u32 nsg_irpt; 417bb1e23e6SLv Zheng u32 nsg_irpt_flags; 418bb1e23e6SLv Zheng u32 nsg_cfg_irpt; 419bb1e23e6SLv Zheng u32 nsg_cfg_irpt_flags; 420bb1e23e6SLv Zheng }; 421bb1e23e6SLv Zheng 4224ac78bafSAl Stone struct acpi_iort_smmu_v3 { 4234ac78bafSAl Stone u64 base_address; /* SMMUv3 base address */ 4244ac78bafSAl Stone u32 flags; 4254ac78bafSAl Stone u32 reserved; 4264ac78bafSAl Stone u64 vatos_address; 4270c2021c0SRobin Murphy u32 model; 4284ac78bafSAl Stone u32 event_gsiv; 4294ac78bafSAl Stone u32 pri_gsiv; 4304ac78bafSAl Stone u32 gerr_gsiv; 4314ac78bafSAl Stone u32 sync_gsiv; 432d87be043SRobin Murphy u32 pxm; 4334c106aa4SHanjun Guo u32 id_mapping_index; 4344ac78bafSAl Stone }; 4354ac78bafSAl Stone 4360c2021c0SRobin Murphy /* Values for Model field above */ 4370c2021c0SRobin Murphy 4380c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_GENERIC 0x00000000 /* Generic SMMUv3 */ 4390c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_HISILICON_HI161X 0x00000001 /* hi_silicon Hi161x SMMUv3 */ 4400c2021c0SRobin Murphy #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x00000002 /* Cavium CN99xx SMMUv3 */ 4410c2021c0SRobin Murphy 4424ac78bafSAl Stone /* Masks for Flags field above */ 4434ac78bafSAl Stone 4444ac78bafSAl Stone #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1) 445d87be043SRobin Murphy #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1) 446c9442300SGanapatrao Kulkarni #define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3) 4474ac78bafSAl Stone 448a53eaef6SRobin Murphy struct acpi_iort_pmcg { 449a53eaef6SRobin Murphy u64 page0_base_address; 450a53eaef6SRobin Murphy u32 overflow_gsiv; 451a53eaef6SRobin Murphy u32 node_reference; 452a53eaef6SRobin Murphy u64 page1_base_address; 453a53eaef6SRobin Murphy }; 454a53eaef6SRobin Murphy 4558e1fdd7fSShameer Kolothum struct acpi_iort_rmr { 4568e1fdd7fSShameer Kolothum u32 flags; 4578e1fdd7fSShameer Kolothum u32 rmr_count; 4588e1fdd7fSShameer Kolothum u32 rmr_offset; 4598e1fdd7fSShameer Kolothum }; 4608e1fdd7fSShameer Kolothum 4618e1fdd7fSShameer Kolothum struct acpi_iort_rmr_desc { 4628e1fdd7fSShameer Kolothum u64 base_address; 4638e1fdd7fSShameer Kolothum u64 length; 4648e1fdd7fSShameer Kolothum u32 reserved; 4658e1fdd7fSShameer Kolothum }; 4668e1fdd7fSShameer Kolothum 467874f6a72SLv Zheng /******************************************************************************* 468874f6a72SLv Zheng * 4696e2d5ebdSBob Moore * IVRS - I/O Virtualization Reporting Structure 4706e2d5ebdSBob Moore * Version 1 4716e2d5ebdSBob Moore * 4726e2d5ebdSBob Moore * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification", 4736e2d5ebdSBob Moore * Revision 1.26, February 2009. 4746e2d5ebdSBob Moore * 4756e2d5ebdSBob Moore ******************************************************************************/ 4766e2d5ebdSBob Moore 4776e2d5ebdSBob Moore struct acpi_table_ivrs { 4786e2d5ebdSBob Moore struct acpi_table_header header; /* Common ACPI table header */ 4796e2d5ebdSBob Moore u32 info; /* Common virtualization info */ 4806e2d5ebdSBob Moore u64 reserved; 4816e2d5ebdSBob Moore }; 4826e2d5ebdSBob Moore 4836e2d5ebdSBob Moore /* Values for Info field above */ 4846e2d5ebdSBob Moore 4856e2d5ebdSBob Moore #define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */ 4866e2d5ebdSBob Moore #define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */ 4876e2d5ebdSBob Moore #define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */ 4886e2d5ebdSBob Moore 4896e2d5ebdSBob Moore /* IVRS subtable header */ 4906e2d5ebdSBob Moore 4916e2d5ebdSBob Moore struct acpi_ivrs_header { 4926e2d5ebdSBob Moore u8 type; /* Subtable type */ 4936e2d5ebdSBob Moore u8 flags; 4946e2d5ebdSBob Moore u16 length; /* Subtable length */ 4956e2d5ebdSBob Moore u16 device_id; /* ID of IOMMU */ 4966e2d5ebdSBob Moore }; 4976e2d5ebdSBob Moore 4986e2d5ebdSBob Moore /* Values for subtable Type above */ 4996e2d5ebdSBob Moore 5006e2d5ebdSBob Moore enum acpi_ivrs_type { 5011f6239caSMichał Żygowski ACPI_IVRS_TYPE_HARDWARE1 = 0x10, 5021f6239caSMichał Żygowski ACPI_IVRS_TYPE_HARDWARE2 = 0x11, 5037ce7a445SAlexander Monakov ACPI_IVRS_TYPE_HARDWARE3 = 0x40, 5046e2d5ebdSBob Moore ACPI_IVRS_TYPE_MEMORY1 = 0x20, 5056e2d5ebdSBob Moore ACPI_IVRS_TYPE_MEMORY2 = 0x21, 5066e2d5ebdSBob Moore ACPI_IVRS_TYPE_MEMORY3 = 0x22 5076e2d5ebdSBob Moore }; 5086e2d5ebdSBob Moore 5096e2d5ebdSBob Moore /* Masks for Flags field above for IVHD subtable */ 5106e2d5ebdSBob Moore 5116e2d5ebdSBob Moore #define ACPI_IVHD_TT_ENABLE (1) 5126e2d5ebdSBob Moore #define ACPI_IVHD_PASS_PW (1<<1) 5136e2d5ebdSBob Moore #define ACPI_IVHD_RES_PASS_PW (1<<2) 5146e2d5ebdSBob Moore #define ACPI_IVHD_ISOC (1<<3) 5156e2d5ebdSBob Moore #define ACPI_IVHD_IOTLB (1<<4) 5166e2d5ebdSBob Moore 5176e2d5ebdSBob Moore /* Masks for Flags field above for IVMD subtable */ 5186e2d5ebdSBob Moore 5196e2d5ebdSBob Moore #define ACPI_IVMD_UNITY (1) 5206e2d5ebdSBob Moore #define ACPI_IVMD_READ (1<<1) 5216e2d5ebdSBob Moore #define ACPI_IVMD_WRITE (1<<2) 5226e2d5ebdSBob Moore #define ACPI_IVMD_EXCLUSION_RANGE (1<<3) 5236e2d5ebdSBob Moore 5246e2d5ebdSBob Moore /* 5256e2d5ebdSBob Moore * IVRS subtables, correspond to Type in struct acpi_ivrs_header 5266e2d5ebdSBob Moore */ 5276e2d5ebdSBob Moore 5286e2d5ebdSBob Moore /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */ 5296e2d5ebdSBob Moore 5301f6239caSMichał Żygowski struct acpi_ivrs_hardware_10 { 5316e2d5ebdSBob Moore struct acpi_ivrs_header header; 5326e2d5ebdSBob Moore u16 capability_offset; /* Offset for IOMMU control fields */ 5336e2d5ebdSBob Moore u64 base_address; /* IOMMU control registers */ 5346e2d5ebdSBob Moore u16 pci_segment_group; 5356e2d5ebdSBob Moore u16 info; /* MSI number and unit ID */ 5360dc7e795SMichał Żygowski u32 feature_reporting; 5376e2d5ebdSBob Moore }; 5386e2d5ebdSBob Moore 5391f6239caSMichał Żygowski /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */ 5401f6239caSMichał Żygowski 5411f6239caSMichał Żygowski struct acpi_ivrs_hardware_11 { 5421f6239caSMichał Żygowski struct acpi_ivrs_header header; 5431f6239caSMichał Żygowski u16 capability_offset; /* Offset for IOMMU control fields */ 5441f6239caSMichał Żygowski u64 base_address; /* IOMMU control registers */ 5451f6239caSMichał Żygowski u16 pci_segment_group; 5461f6239caSMichał Żygowski u16 info; /* MSI number and unit ID */ 5471f6239caSMichał Żygowski u32 attributes; 5481f6239caSMichał Żygowski u64 efr_register_image; 5491f6239caSMichał Żygowski u64 reserved; 5501f6239caSMichał Żygowski }; 5511f6239caSMichał Żygowski 5526e2d5ebdSBob Moore /* Masks for Info field above */ 5536e2d5ebdSBob Moore 5546e2d5ebdSBob Moore #define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */ 555ba494beeSBob Moore #define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_ID */ 5566e2d5ebdSBob Moore 5576e2d5ebdSBob Moore /* 5586e2d5ebdSBob Moore * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure. 5596e2d5ebdSBob Moore * Upper two bits of the Type field are the (encoded) length of the structure. 5606e2d5ebdSBob Moore * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries 5616e2d5ebdSBob Moore * are reserved for future use but not defined. 5626e2d5ebdSBob Moore */ 5636e2d5ebdSBob Moore struct acpi_ivrs_de_header { 5646e2d5ebdSBob Moore u8 type; 5656e2d5ebdSBob Moore u16 id; 5666e2d5ebdSBob Moore u8 data_setting; 5676e2d5ebdSBob Moore }; 5686e2d5ebdSBob Moore 5696e2d5ebdSBob Moore /* Length of device entry is in the top two bits of Type field above */ 5706e2d5ebdSBob Moore 5716e2d5ebdSBob Moore #define ACPI_IVHD_ENTRY_LENGTH 0xC0 5726e2d5ebdSBob Moore 5736e2d5ebdSBob Moore /* Values for device entry Type field above */ 5746e2d5ebdSBob Moore 5756e2d5ebdSBob Moore enum acpi_ivrs_device_entry_type { 5766e2d5ebdSBob Moore /* 4-byte device entries, all use struct acpi_ivrs_device4 */ 5776e2d5ebdSBob Moore 5786e2d5ebdSBob Moore ACPI_IVRS_TYPE_PAD4 = 0, 5796e2d5ebdSBob Moore ACPI_IVRS_TYPE_ALL = 1, 5806e2d5ebdSBob Moore ACPI_IVRS_TYPE_SELECT = 2, 5816e2d5ebdSBob Moore ACPI_IVRS_TYPE_START = 3, 5826e2d5ebdSBob Moore ACPI_IVRS_TYPE_END = 4, 5836e2d5ebdSBob Moore 5846e2d5ebdSBob Moore /* 8-byte device entries */ 5856e2d5ebdSBob Moore 5866e2d5ebdSBob Moore ACPI_IVRS_TYPE_PAD8 = 64, 5876e2d5ebdSBob Moore ACPI_IVRS_TYPE_NOT_USED = 65, 5886e2d5ebdSBob Moore ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses struct acpi_ivrs_device8a */ 5896e2d5ebdSBob Moore ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses struct acpi_ivrs_device8a */ 5906e2d5ebdSBob Moore ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses struct acpi_ivrs_device8b */ 5916e2d5ebdSBob Moore ACPI_IVRS_TYPE_EXT_START = 71, /* Uses struct acpi_ivrs_device8b */ 5927ce7a445SAlexander Monakov ACPI_IVRS_TYPE_SPECIAL = 72, /* Uses struct acpi_ivrs_device8c */ 5937ce7a445SAlexander Monakov 5947ce7a445SAlexander Monakov /* Variable-length device entries */ 5957ce7a445SAlexander Monakov 5967ce7a445SAlexander Monakov ACPI_IVRS_TYPE_HID = 240 /* Uses ACPI_IVRS_DEVICE_HID */ 5976e2d5ebdSBob Moore }; 5986e2d5ebdSBob Moore 5996e2d5ebdSBob Moore /* Values for Data field above */ 6006e2d5ebdSBob Moore 6016e2d5ebdSBob Moore #define ACPI_IVHD_INIT_PASS (1) 6026e2d5ebdSBob Moore #define ACPI_IVHD_EINT_PASS (1<<1) 6036e2d5ebdSBob Moore #define ACPI_IVHD_NMI_PASS (1<<2) 6046e2d5ebdSBob Moore #define ACPI_IVHD_SYSTEM_MGMT (3<<4) 6056e2d5ebdSBob Moore #define ACPI_IVHD_LINT0_PASS (1<<6) 6066e2d5ebdSBob Moore #define ACPI_IVHD_LINT1_PASS (1<<7) 6076e2d5ebdSBob Moore 6086e2d5ebdSBob Moore /* Types 0-4: 4-byte device entry */ 6096e2d5ebdSBob Moore 6106e2d5ebdSBob Moore struct acpi_ivrs_device4 { 6116e2d5ebdSBob Moore struct acpi_ivrs_de_header header; 6126e2d5ebdSBob Moore }; 6136e2d5ebdSBob Moore 6146e2d5ebdSBob Moore /* Types 66-67: 8-byte device entry */ 6156e2d5ebdSBob Moore 6166e2d5ebdSBob Moore struct acpi_ivrs_device8a { 6176e2d5ebdSBob Moore struct acpi_ivrs_de_header header; 6186e2d5ebdSBob Moore u8 reserved1; 6196e2d5ebdSBob Moore u16 used_id; 6206e2d5ebdSBob Moore u8 reserved2; 6216e2d5ebdSBob Moore }; 6226e2d5ebdSBob Moore 6236e2d5ebdSBob Moore /* Types 70-71: 8-byte device entry */ 6246e2d5ebdSBob Moore 6256e2d5ebdSBob Moore struct acpi_ivrs_device8b { 6266e2d5ebdSBob Moore struct acpi_ivrs_de_header header; 6276e2d5ebdSBob Moore u32 extended_data; 6286e2d5ebdSBob Moore }; 6296e2d5ebdSBob Moore 6306e2d5ebdSBob Moore /* Values for extended_data above */ 6316e2d5ebdSBob Moore 6326e2d5ebdSBob Moore #define ACPI_IVHD_ATS_DISABLED (1<<31) 6336e2d5ebdSBob Moore 6346e2d5ebdSBob Moore /* Type 72: 8-byte device entry */ 6356e2d5ebdSBob Moore 6366e2d5ebdSBob Moore struct acpi_ivrs_device8c { 6376e2d5ebdSBob Moore struct acpi_ivrs_de_header header; 6386e2d5ebdSBob Moore u8 handle; 6396e2d5ebdSBob Moore u16 used_id; 6406e2d5ebdSBob Moore u8 variety; 6416e2d5ebdSBob Moore }; 6426e2d5ebdSBob Moore 6436e2d5ebdSBob Moore /* Values for Variety field above */ 6446e2d5ebdSBob Moore 6456e2d5ebdSBob Moore #define ACPI_IVHD_IOAPIC 1 6466e2d5ebdSBob Moore #define ACPI_IVHD_HPET 2 6476e2d5ebdSBob Moore 6487ce7a445SAlexander Monakov /* Type 240: variable-length device entry */ 6497ce7a445SAlexander Monakov 6507ce7a445SAlexander Monakov struct acpi_ivrs_device_hid { 6517ce7a445SAlexander Monakov struct acpi_ivrs_de_header header; 6527ce7a445SAlexander Monakov u64 acpi_hid; 6537ce7a445SAlexander Monakov u64 acpi_cid; 6547ce7a445SAlexander Monakov u8 uid_type; 6557ce7a445SAlexander Monakov u8 uid_length; 6567ce7a445SAlexander Monakov }; 6577ce7a445SAlexander Monakov 658c160b7d2SBob Moore /* Values for uid_type above */ 659c160b7d2SBob Moore 660c160b7d2SBob Moore #define ACPI_IVRS_UID_NOT_PRESENT 0 661c160b7d2SBob Moore #define ACPI_IVRS_UID_IS_INTEGER 1 662c160b7d2SBob Moore #define ACPI_IVRS_UID_IS_STRING 2 663c160b7d2SBob Moore 6646e2d5ebdSBob Moore /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */ 6656e2d5ebdSBob Moore 6666e2d5ebdSBob Moore struct acpi_ivrs_memory { 6676e2d5ebdSBob Moore struct acpi_ivrs_header header; 6686e2d5ebdSBob Moore u16 aux_data; 6696e2d5ebdSBob Moore u64 reserved; 6706e2d5ebdSBob Moore u64 start_address; 6716e2d5ebdSBob Moore u64 memory_length; 6726e2d5ebdSBob Moore }; 6736e2d5ebdSBob Moore 6746e2d5ebdSBob Moore /******************************************************************************* 6756e2d5ebdSBob Moore * 676d36d4e30SBob Moore * LPIT - Low Power Idle Table 677d36d4e30SBob Moore * 6789ab8cf1bSBob Moore * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014. 679d36d4e30SBob Moore * 680d36d4e30SBob Moore ******************************************************************************/ 681d36d4e30SBob Moore 682d36d4e30SBob Moore struct acpi_table_lpit { 683d36d4e30SBob Moore struct acpi_table_header header; /* Common ACPI table header */ 684d36d4e30SBob Moore }; 685d36d4e30SBob Moore 686d36d4e30SBob Moore /* LPIT subtable header */ 687d36d4e30SBob Moore 688d36d4e30SBob Moore struct acpi_lpit_header { 689d36d4e30SBob Moore u32 type; /* Subtable type */ 690d36d4e30SBob Moore u32 length; /* Subtable length */ 691d36d4e30SBob Moore u16 unique_id; 692d36d4e30SBob Moore u16 reserved; 693d36d4e30SBob Moore u32 flags; 694d36d4e30SBob Moore }; 695d36d4e30SBob Moore 696d36d4e30SBob Moore /* Values for subtable Type above */ 697d36d4e30SBob Moore 698d36d4e30SBob Moore enum acpi_lpit_type { 699d36d4e30SBob Moore ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00, 7009ab8cf1bSBob Moore ACPI_LPIT_TYPE_RESERVED = 0x01 /* 1 and above are reserved */ 701d36d4e30SBob Moore }; 702d36d4e30SBob Moore 703d36d4e30SBob Moore /* Masks for Flags field above */ 704d36d4e30SBob Moore 705d36d4e30SBob Moore #define ACPI_LPIT_STATE_DISABLED (1) 706d36d4e30SBob Moore #define ACPI_LPIT_NO_COUNTER (1<<1) 707d36d4e30SBob Moore 708d36d4e30SBob Moore /* 709d36d4e30SBob Moore * LPIT subtables, correspond to Type in struct acpi_lpit_header 710d36d4e30SBob Moore */ 711d36d4e30SBob Moore 712d36d4e30SBob Moore /* 0x00: Native C-state instruction based LPI structure */ 713d36d4e30SBob Moore 714d36d4e30SBob Moore struct acpi_lpit_native { 715d36d4e30SBob Moore struct acpi_lpit_header header; 716d36d4e30SBob Moore struct acpi_generic_address entry_trigger; 717d36d4e30SBob Moore u32 residency; 718d36d4e30SBob Moore u32 latency; 719d36d4e30SBob Moore struct acpi_generic_address residency_counter; 720d36d4e30SBob Moore u64 counter_frequency; 721d36d4e30SBob Moore }; 722d36d4e30SBob Moore 723d36d4e30SBob Moore /******************************************************************************* 724d36d4e30SBob Moore * 725e62f8227SErik Schmauss * MADT - Multiple APIC Description Table 726e62f8227SErik Schmauss * Version 3 727e62f8227SErik Schmauss * 728e62f8227SErik Schmauss ******************************************************************************/ 729e62f8227SErik Schmauss 730e62f8227SErik Schmauss struct acpi_table_madt { 731e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 732e62f8227SErik Schmauss u32 address; /* Physical address of local APIC */ 733e62f8227SErik Schmauss u32 flags; 734e62f8227SErik Schmauss }; 735e62f8227SErik Schmauss 736e62f8227SErik Schmauss /* Masks for Flags field above */ 737e62f8227SErik Schmauss 738e62f8227SErik Schmauss #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */ 739e62f8227SErik Schmauss 740e62f8227SErik Schmauss /* Values for PCATCompat flag */ 741e62f8227SErik Schmauss 742e62f8227SErik Schmauss #define ACPI_MADT_DUAL_PIC 1 743e62f8227SErik Schmauss #define ACPI_MADT_MULTIPLE_APIC 0 744e62f8227SErik Schmauss 745e62f8227SErik Schmauss /* Values for MADT subtable type in struct acpi_subtable_header */ 746e62f8227SErik Schmauss 747e62f8227SErik Schmauss enum acpi_madt_type { 748e62f8227SErik Schmauss ACPI_MADT_TYPE_LOCAL_APIC = 0, 749e62f8227SErik Schmauss ACPI_MADT_TYPE_IO_APIC = 1, 750e62f8227SErik Schmauss ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2, 751e62f8227SErik Schmauss ACPI_MADT_TYPE_NMI_SOURCE = 3, 752e62f8227SErik Schmauss ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4, 753e62f8227SErik Schmauss ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5, 754e62f8227SErik Schmauss ACPI_MADT_TYPE_IO_SAPIC = 6, 755e62f8227SErik Schmauss ACPI_MADT_TYPE_LOCAL_SAPIC = 7, 756e62f8227SErik Schmauss ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, 757e62f8227SErik Schmauss ACPI_MADT_TYPE_LOCAL_X2APIC = 9, 758e62f8227SErik Schmauss ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, 759e62f8227SErik Schmauss ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, 760e62f8227SErik Schmauss ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, 761e62f8227SErik Schmauss ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13, 762e62f8227SErik Schmauss ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14, 763e62f8227SErik Schmauss ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15, 7649557cb8cSErik Kaneda ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16, 7659557cb8cSErik Kaneda ACPI_MADT_TYPE_RESERVED = 17 /* 17 and greater are reserved */ 766e62f8227SErik Schmauss }; 767e62f8227SErik Schmauss 768e62f8227SErik Schmauss /* 769e62f8227SErik Schmauss * MADT Subtables, correspond to Type in struct acpi_subtable_header 770e62f8227SErik Schmauss */ 771e62f8227SErik Schmauss 772e62f8227SErik Schmauss /* 0: Processor Local APIC */ 773e62f8227SErik Schmauss 774e62f8227SErik Schmauss struct acpi_madt_local_apic { 775e62f8227SErik Schmauss struct acpi_subtable_header header; 776e62f8227SErik Schmauss u8 processor_id; /* ACPI processor id */ 777e62f8227SErik Schmauss u8 id; /* Processor's local APIC id */ 778e62f8227SErik Schmauss u32 lapic_flags; 779e62f8227SErik Schmauss }; 780e62f8227SErik Schmauss 781e62f8227SErik Schmauss /* 1: IO APIC */ 782e62f8227SErik Schmauss 783e62f8227SErik Schmauss struct acpi_madt_io_apic { 784e62f8227SErik Schmauss struct acpi_subtable_header header; 785e62f8227SErik Schmauss u8 id; /* I/O APIC ID */ 786e62f8227SErik Schmauss u8 reserved; /* reserved - must be zero */ 787e62f8227SErik Schmauss u32 address; /* APIC physical address */ 788e62f8227SErik Schmauss u32 global_irq_base; /* Global system interrupt where INTI lines start */ 789e62f8227SErik Schmauss }; 790e62f8227SErik Schmauss 791e62f8227SErik Schmauss /* 2: Interrupt Override */ 792e62f8227SErik Schmauss 793e62f8227SErik Schmauss struct acpi_madt_interrupt_override { 794e62f8227SErik Schmauss struct acpi_subtable_header header; 795e62f8227SErik Schmauss u8 bus; /* 0 - ISA */ 796e62f8227SErik Schmauss u8 source_irq; /* Interrupt source (IRQ) */ 797e62f8227SErik Schmauss u32 global_irq; /* Global system interrupt */ 798e62f8227SErik Schmauss u16 inti_flags; 799e62f8227SErik Schmauss }; 800e62f8227SErik Schmauss 801e62f8227SErik Schmauss /* 3: NMI Source */ 802e62f8227SErik Schmauss 803e62f8227SErik Schmauss struct acpi_madt_nmi_source { 804e62f8227SErik Schmauss struct acpi_subtable_header header; 805e62f8227SErik Schmauss u16 inti_flags; 806e62f8227SErik Schmauss u32 global_irq; /* Global system interrupt */ 807e62f8227SErik Schmauss }; 808e62f8227SErik Schmauss 809e62f8227SErik Schmauss /* 4: Local APIC NMI */ 810e62f8227SErik Schmauss 811e62f8227SErik Schmauss struct acpi_madt_local_apic_nmi { 812e62f8227SErik Schmauss struct acpi_subtable_header header; 813e62f8227SErik Schmauss u8 processor_id; /* ACPI processor id */ 814e62f8227SErik Schmauss u16 inti_flags; 815e62f8227SErik Schmauss u8 lint; /* LINTn to which NMI is connected */ 816e62f8227SErik Schmauss }; 817e62f8227SErik Schmauss 818e62f8227SErik Schmauss /* 5: Address Override */ 819e62f8227SErik Schmauss 820e62f8227SErik Schmauss struct acpi_madt_local_apic_override { 821e62f8227SErik Schmauss struct acpi_subtable_header header; 822e62f8227SErik Schmauss u16 reserved; /* Reserved, must be zero */ 823e62f8227SErik Schmauss u64 address; /* APIC physical address */ 824e62f8227SErik Schmauss }; 825e62f8227SErik Schmauss 826e62f8227SErik Schmauss /* 6: I/O Sapic */ 827e62f8227SErik Schmauss 828e62f8227SErik Schmauss struct acpi_madt_io_sapic { 829e62f8227SErik Schmauss struct acpi_subtable_header header; 830e62f8227SErik Schmauss u8 id; /* I/O SAPIC ID */ 831e62f8227SErik Schmauss u8 reserved; /* Reserved, must be zero */ 832e62f8227SErik Schmauss u32 global_irq_base; /* Global interrupt for SAPIC start */ 833e62f8227SErik Schmauss u64 address; /* SAPIC physical address */ 834e62f8227SErik Schmauss }; 835e62f8227SErik Schmauss 836e62f8227SErik Schmauss /* 7: Local Sapic */ 837e62f8227SErik Schmauss 838e62f8227SErik Schmauss struct acpi_madt_local_sapic { 839e62f8227SErik Schmauss struct acpi_subtable_header header; 840e62f8227SErik Schmauss u8 processor_id; /* ACPI processor id */ 841e62f8227SErik Schmauss u8 id; /* SAPIC ID */ 842e62f8227SErik Schmauss u8 eid; /* SAPIC EID */ 843e62f8227SErik Schmauss u8 reserved[3]; /* Reserved, must be zero */ 844e62f8227SErik Schmauss u32 lapic_flags; 845e62f8227SErik Schmauss u32 uid; /* Numeric UID - ACPI 3.0 */ 846e62f8227SErik Schmauss char uid_string[1]; /* String UID - ACPI 3.0 */ 847e62f8227SErik Schmauss }; 848e62f8227SErik Schmauss 849e62f8227SErik Schmauss /* 8: Platform Interrupt Source */ 850e62f8227SErik Schmauss 851e62f8227SErik Schmauss struct acpi_madt_interrupt_source { 852e62f8227SErik Schmauss struct acpi_subtable_header header; 853e62f8227SErik Schmauss u16 inti_flags; 854e62f8227SErik Schmauss u8 type; /* 1=PMI, 2=INIT, 3=corrected */ 855e62f8227SErik Schmauss u8 id; /* Processor ID */ 856e62f8227SErik Schmauss u8 eid; /* Processor EID */ 857e62f8227SErik Schmauss u8 io_sapic_vector; /* Vector value for PMI interrupts */ 858e62f8227SErik Schmauss u32 global_irq; /* Global system interrupt */ 859e62f8227SErik Schmauss u32 flags; /* Interrupt Source Flags */ 860e62f8227SErik Schmauss }; 861e62f8227SErik Schmauss 862e62f8227SErik Schmauss /* Masks for Flags field above */ 863e62f8227SErik Schmauss 864e62f8227SErik Schmauss #define ACPI_MADT_CPEI_OVERRIDE (1) 865e62f8227SErik Schmauss 866e62f8227SErik Schmauss /* 9: Processor Local X2APIC (ACPI 4.0) */ 867e62f8227SErik Schmauss 868e62f8227SErik Schmauss struct acpi_madt_local_x2apic { 869e62f8227SErik Schmauss struct acpi_subtable_header header; 870e62f8227SErik Schmauss u16 reserved; /* reserved - must be zero */ 871e62f8227SErik Schmauss u32 local_apic_id; /* Processor x2APIC ID */ 872e62f8227SErik Schmauss u32 lapic_flags; 873e62f8227SErik Schmauss u32 uid; /* ACPI processor UID */ 874e62f8227SErik Schmauss }; 875e62f8227SErik Schmauss 876e62f8227SErik Schmauss /* 10: Local X2APIC NMI (ACPI 4.0) */ 877e62f8227SErik Schmauss 878e62f8227SErik Schmauss struct acpi_madt_local_x2apic_nmi { 879e62f8227SErik Schmauss struct acpi_subtable_header header; 880e62f8227SErik Schmauss u16 inti_flags; 881e62f8227SErik Schmauss u32 uid; /* ACPI processor UID */ 882e62f8227SErik Schmauss u8 lint; /* LINTn to which NMI is connected */ 883e62f8227SErik Schmauss u8 reserved[3]; /* reserved - must be zero */ 884e62f8227SErik Schmauss }; 885e62f8227SErik Schmauss 886e646e0a5SErik Schmauss /* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */ 887e62f8227SErik Schmauss 888e62f8227SErik Schmauss struct acpi_madt_generic_interrupt { 889e62f8227SErik Schmauss struct acpi_subtable_header header; 890e62f8227SErik Schmauss u16 reserved; /* reserved - must be zero */ 891e62f8227SErik Schmauss u32 cpu_interface_number; 892e62f8227SErik Schmauss u32 uid; 893e62f8227SErik Schmauss u32 flags; 894e62f8227SErik Schmauss u32 parking_version; 895e62f8227SErik Schmauss u32 performance_interrupt; 896e62f8227SErik Schmauss u64 parked_address; 897e62f8227SErik Schmauss u64 base_address; 898e62f8227SErik Schmauss u64 gicv_base_address; 899e62f8227SErik Schmauss u64 gich_base_address; 900e62f8227SErik Schmauss u32 vgic_interrupt; 901e62f8227SErik Schmauss u64 gicr_base_address; 902e62f8227SErik Schmauss u64 arm_mpidr; 903e62f8227SErik Schmauss u8 efficiency_class; 904e646e0a5SErik Schmauss u8 reserved2[1]; 905e646e0a5SErik Schmauss u16 spe_interrupt; /* ACPI 6.3 */ 906e62f8227SErik Schmauss }; 907e62f8227SErik Schmauss 908e62f8227SErik Schmauss /* Masks for Flags field above */ 909e62f8227SErik Schmauss 910e62f8227SErik Schmauss /* ACPI_MADT_ENABLED (1) Processor is usable if set */ 911e62f8227SErik Schmauss #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */ 912e62f8227SErik Schmauss #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */ 913e62f8227SErik Schmauss 914e62f8227SErik Schmauss /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */ 915e62f8227SErik Schmauss 916e62f8227SErik Schmauss struct acpi_madt_generic_distributor { 917e62f8227SErik Schmauss struct acpi_subtable_header header; 918e62f8227SErik Schmauss u16 reserved; /* reserved - must be zero */ 919e62f8227SErik Schmauss u32 gic_id; 920e62f8227SErik Schmauss u64 base_address; 921e62f8227SErik Schmauss u32 global_irq_base; 922e62f8227SErik Schmauss u8 version; 923e62f8227SErik Schmauss u8 reserved2[3]; /* reserved - must be zero */ 924e62f8227SErik Schmauss }; 925e62f8227SErik Schmauss 926e62f8227SErik Schmauss /* Values for Version field above */ 927e62f8227SErik Schmauss 928e62f8227SErik Schmauss enum acpi_madt_gic_version { 929e62f8227SErik Schmauss ACPI_MADT_GIC_VERSION_NONE = 0, 930e62f8227SErik Schmauss ACPI_MADT_GIC_VERSION_V1 = 1, 931e62f8227SErik Schmauss ACPI_MADT_GIC_VERSION_V2 = 2, 932e62f8227SErik Schmauss ACPI_MADT_GIC_VERSION_V3 = 3, 933e62f8227SErik Schmauss ACPI_MADT_GIC_VERSION_V4 = 4, 934e62f8227SErik Schmauss ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */ 935e62f8227SErik Schmauss }; 936e62f8227SErik Schmauss 937e62f8227SErik Schmauss /* 13: Generic MSI Frame (ACPI 5.1) */ 938e62f8227SErik Schmauss 939e62f8227SErik Schmauss struct acpi_madt_generic_msi_frame { 940e62f8227SErik Schmauss struct acpi_subtable_header header; 941e62f8227SErik Schmauss u16 reserved; /* reserved - must be zero */ 942e62f8227SErik Schmauss u32 msi_frame_id; 943e62f8227SErik Schmauss u64 base_address; 944e62f8227SErik Schmauss u32 flags; 945e62f8227SErik Schmauss u16 spi_count; 946e62f8227SErik Schmauss u16 spi_base; 947e62f8227SErik Schmauss }; 948e62f8227SErik Schmauss 949e62f8227SErik Schmauss /* Masks for Flags field above */ 950e62f8227SErik Schmauss 951e62f8227SErik Schmauss #define ACPI_MADT_OVERRIDE_SPI_VALUES (1) 952e62f8227SErik Schmauss 953e62f8227SErik Schmauss /* 14: Generic Redistributor (ACPI 5.1) */ 954e62f8227SErik Schmauss 955e62f8227SErik Schmauss struct acpi_madt_generic_redistributor { 956e62f8227SErik Schmauss struct acpi_subtable_header header; 957e62f8227SErik Schmauss u16 reserved; /* reserved - must be zero */ 958e62f8227SErik Schmauss u64 base_address; 959e62f8227SErik Schmauss u32 length; 960e62f8227SErik Schmauss }; 961e62f8227SErik Schmauss 962e62f8227SErik Schmauss /* 15: Generic Translator (ACPI 6.0) */ 963e62f8227SErik Schmauss 964e62f8227SErik Schmauss struct acpi_madt_generic_translator { 965e62f8227SErik Schmauss struct acpi_subtable_header header; 966e62f8227SErik Schmauss u16 reserved; /* reserved - must be zero */ 967e62f8227SErik Schmauss u32 translation_id; 968e62f8227SErik Schmauss u64 base_address; 969e62f8227SErik Schmauss u32 reserved2; 970e62f8227SErik Schmauss }; 971e62f8227SErik Schmauss 9729557cb8cSErik Kaneda /* 16: Multiprocessor wakeup (ACPI 6.4) */ 9739557cb8cSErik Kaneda 9749557cb8cSErik Kaneda struct acpi_madt_multiproc_wakeup { 9759557cb8cSErik Kaneda struct acpi_subtable_header header; 9769557cb8cSErik Kaneda u16 mailbox_version; 9779557cb8cSErik Kaneda u32 reserved; /* reserved - must be zero */ 9789557cb8cSErik Kaneda u64 base_address; 9799557cb8cSErik Kaneda }; 9809557cb8cSErik Kaneda 98142d96e16SKuppuswamy Sathyanarayanan #define ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE 2032 98242d96e16SKuppuswamy Sathyanarayanan #define ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE 2048 98342d96e16SKuppuswamy Sathyanarayanan 98442d96e16SKuppuswamy Sathyanarayanan struct acpi_madt_multiproc_wakeup_mailbox { 98542d96e16SKuppuswamy Sathyanarayanan u16 command; 98642d96e16SKuppuswamy Sathyanarayanan u16 reserved; /* reserved - must be zero */ 98742d96e16SKuppuswamy Sathyanarayanan u32 apic_id; 98842d96e16SKuppuswamy Sathyanarayanan u64 wakeup_vector; 98942d96e16SKuppuswamy Sathyanarayanan u8 reserved_os[ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE]; /* reserved for OS use */ 99042d96e16SKuppuswamy Sathyanarayanan u8 reserved_firmware[ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE]; /* reserved for firmware use */ 99142d96e16SKuppuswamy Sathyanarayanan }; 99242d96e16SKuppuswamy Sathyanarayanan 99342d96e16SKuppuswamy Sathyanarayanan #define ACPI_MP_WAKE_COMMAND_WAKEUP 1 99442d96e16SKuppuswamy Sathyanarayanan 995e62f8227SErik Schmauss /* 996e62f8227SErik Schmauss * Common flags fields for MADT subtables 997e62f8227SErik Schmauss */ 998e62f8227SErik Schmauss 999e62f8227SErik Schmauss /* MADT Local APIC flags */ 1000e62f8227SErik Schmauss 1001e62f8227SErik Schmauss #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ 1002435a8dc8SMario Limonciello #define ACPI_MADT_ONLINE_CAPABLE (2) /* 01: System HW supports enabling processor at runtime */ 1003e62f8227SErik Schmauss 1004e62f8227SErik Schmauss /* MADT MPS INTI flags (inti_flags) */ 1005e62f8227SErik Schmauss 1006e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */ 1007e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */ 1008e62f8227SErik Schmauss 1009e62f8227SErik Schmauss /* Values for MPS INTI flags */ 1010e62f8227SErik Schmauss 1011e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_CONFORMS 0 1012e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1 1013e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_RESERVED 2 1014e62f8227SErik Schmauss #define ACPI_MADT_POLARITY_ACTIVE_LOW 3 1015e62f8227SErik Schmauss 1016e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_CONFORMS (0) 1017e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_EDGE (1<<2) 1018e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_RESERVED (2<<2) 1019e62f8227SErik Schmauss #define ACPI_MADT_TRIGGER_LEVEL (3<<2) 1020e62f8227SErik Schmauss 1021e62f8227SErik Schmauss /******************************************************************************* 1022e62f8227SErik Schmauss * 10231a49b72cSBob Moore * MCFG - PCI Memory Mapped Configuration table and subtable 10246e2d5ebdSBob Moore * Version 1 10256e2d5ebdSBob Moore * 10266e2d5ebdSBob Moore * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005 1027b24aad44SBob Moore * 1028b24aad44SBob Moore ******************************************************************************/ 1029b24aad44SBob Moore 1030b24aad44SBob Moore struct acpi_table_mcfg { 1031b24aad44SBob Moore struct acpi_table_header header; /* Common ACPI table header */ 1032b24aad44SBob Moore u8 reserved[8]; 1033b24aad44SBob Moore }; 1034b24aad44SBob Moore 1035b24aad44SBob Moore /* Subtable */ 1036b24aad44SBob Moore 1037b24aad44SBob Moore struct acpi_mcfg_allocation { 1038b24aad44SBob Moore u64 address; /* Base address, processor-relative */ 1039b24aad44SBob Moore u16 pci_segment; /* PCI segment group number */ 1040b24aad44SBob Moore u8 start_bus_number; /* Starting PCI Bus number */ 1041b24aad44SBob Moore u8 end_bus_number; /* Final PCI Bus number */ 1042b24aad44SBob Moore u32 reserved; 1043b24aad44SBob Moore }; 1044b24aad44SBob Moore 1045b24aad44SBob Moore /******************************************************************************* 1046b24aad44SBob Moore * 10470e264f0bSBob Moore * MCHI - Management Controller Host Interface Table 10480e264f0bSBob Moore * Version 1 10490e264f0bSBob Moore * 10500e264f0bSBob Moore * Conforms to "Management Component Transport Protocol (MCTP) Host 10510e264f0bSBob Moore * Interface Specification", Revision 1.0.0a, October 13, 2009 10520e264f0bSBob Moore * 10530e264f0bSBob Moore ******************************************************************************/ 10540e264f0bSBob Moore 10550e264f0bSBob Moore struct acpi_table_mchi { 10560e264f0bSBob Moore struct acpi_table_header header; /* Common ACPI table header */ 10570e264f0bSBob Moore u8 interface_type; 10580e264f0bSBob Moore u8 protocol; 10590e264f0bSBob Moore u64 protocol_data; 10600e264f0bSBob Moore u8 interrupt_type; 10610e264f0bSBob Moore u8 gpe; 10620e264f0bSBob Moore u8 pci_device_flag; 10630e264f0bSBob Moore u32 global_interrupt; 10640e264f0bSBob Moore struct acpi_generic_address control_register; 10650e264f0bSBob Moore u8 pci_segment; 10660e264f0bSBob Moore u8 pci_bus; 10670e264f0bSBob Moore u8 pci_device; 10680e264f0bSBob Moore u8 pci_function; 10690e264f0bSBob Moore }; 10700e264f0bSBob Moore 10710e264f0bSBob Moore /******************************************************************************* 10720e264f0bSBob Moore * 1073e62f8227SErik Schmauss * MPST - Memory Power State Table (ACPI 5.0) 1074e62f8227SErik Schmauss * Version 1 1075e62f8227SErik Schmauss * 1076e62f8227SErik Schmauss ******************************************************************************/ 1077e62f8227SErik Schmauss 1078e62f8227SErik Schmauss #define ACPI_MPST_CHANNEL_INFO \ 1079e62f8227SErik Schmauss u8 channel_id; \ 1080e62f8227SErik Schmauss u8 reserved1[3]; \ 1081e62f8227SErik Schmauss u16 power_node_count; \ 1082e62f8227SErik Schmauss u16 reserved2; 1083e62f8227SErik Schmauss 1084e62f8227SErik Schmauss /* Main table */ 1085e62f8227SErik Schmauss 1086e62f8227SErik Schmauss struct acpi_table_mpst { 1087e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 1088e62f8227SErik Schmauss ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ 1089e62f8227SErik Schmauss }; 1090e62f8227SErik Schmauss 1091e62f8227SErik Schmauss /* Memory Platform Communication Channel Info */ 1092e62f8227SErik Schmauss 1093e62f8227SErik Schmauss struct acpi_mpst_channel { 1094e62f8227SErik Schmauss ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ 1095e62f8227SErik Schmauss }; 1096e62f8227SErik Schmauss 1097e62f8227SErik Schmauss /* Memory Power Node Structure */ 1098e62f8227SErik Schmauss 1099e62f8227SErik Schmauss struct acpi_mpst_power_node { 1100e62f8227SErik Schmauss u8 flags; 1101e62f8227SErik Schmauss u8 reserved1; 1102e62f8227SErik Schmauss u16 node_id; 1103e62f8227SErik Schmauss u32 length; 1104e62f8227SErik Schmauss u64 range_address; 1105e62f8227SErik Schmauss u64 range_length; 1106e62f8227SErik Schmauss u32 num_power_states; 1107e62f8227SErik Schmauss u32 num_physical_components; 1108e62f8227SErik Schmauss }; 1109e62f8227SErik Schmauss 1110e62f8227SErik Schmauss /* Values for Flags field above */ 1111e62f8227SErik Schmauss 1112e62f8227SErik Schmauss #define ACPI_MPST_ENABLED 1 1113e62f8227SErik Schmauss #define ACPI_MPST_POWER_MANAGED 2 1114e62f8227SErik Schmauss #define ACPI_MPST_HOT_PLUG_CAPABLE 4 1115e62f8227SErik Schmauss 1116e62f8227SErik Schmauss /* Memory Power State Structure (follows POWER_NODE above) */ 1117e62f8227SErik Schmauss 1118e62f8227SErik Schmauss struct acpi_mpst_power_state { 1119e62f8227SErik Schmauss u8 power_state; 1120e62f8227SErik Schmauss u8 info_index; 1121e62f8227SErik Schmauss }; 1122e62f8227SErik Schmauss 1123e62f8227SErik Schmauss /* Physical Component ID Structure (follows POWER_STATE above) */ 1124e62f8227SErik Schmauss 1125e62f8227SErik Schmauss struct acpi_mpst_component { 1126e62f8227SErik Schmauss u16 component_id; 1127e62f8227SErik Schmauss }; 1128e62f8227SErik Schmauss 1129e62f8227SErik Schmauss /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */ 1130e62f8227SErik Schmauss 1131e62f8227SErik Schmauss struct acpi_mpst_data_hdr { 1132e62f8227SErik Schmauss u16 characteristics_count; 1133e62f8227SErik Schmauss u16 reserved; 1134e62f8227SErik Schmauss }; 1135e62f8227SErik Schmauss 1136e62f8227SErik Schmauss struct acpi_mpst_power_data { 1137e62f8227SErik Schmauss u8 structure_id; 1138e62f8227SErik Schmauss u8 flags; 1139e62f8227SErik Schmauss u16 reserved1; 1140e62f8227SErik Schmauss u32 average_power; 1141e62f8227SErik Schmauss u32 power_saving; 1142e62f8227SErik Schmauss u64 exit_latency; 1143e62f8227SErik Schmauss u64 reserved2; 1144e62f8227SErik Schmauss }; 1145e62f8227SErik Schmauss 1146e62f8227SErik Schmauss /* Values for Flags field above */ 1147e62f8227SErik Schmauss 1148e62f8227SErik Schmauss #define ACPI_MPST_PRESERVE 1 1149e62f8227SErik Schmauss #define ACPI_MPST_AUTOENTRY 2 1150e62f8227SErik Schmauss #define ACPI_MPST_AUTOEXIT 4 1151e62f8227SErik Schmauss 1152e62f8227SErik Schmauss /* Shared Memory Region (not part of an ACPI table) */ 1153e62f8227SErik Schmauss 1154e62f8227SErik Schmauss struct acpi_mpst_shared { 1155e62f8227SErik Schmauss u32 signature; 1156e62f8227SErik Schmauss u16 pcc_command; 1157e62f8227SErik Schmauss u16 pcc_status; 1158e62f8227SErik Schmauss u32 command_register; 1159e62f8227SErik Schmauss u32 status_register; 1160e62f8227SErik Schmauss u32 power_state_id; 1161e62f8227SErik Schmauss u32 power_node_id; 1162e62f8227SErik Schmauss u64 energy_consumed; 1163e62f8227SErik Schmauss u64 average_power; 1164e62f8227SErik Schmauss }; 1165e62f8227SErik Schmauss 1166e62f8227SErik Schmauss /******************************************************************************* 1167e62f8227SErik Schmauss * 1168e62f8227SErik Schmauss * MSCT - Maximum System Characteristics Table (ACPI 4.0) 1169e62f8227SErik Schmauss * Version 1 1170e62f8227SErik Schmauss * 1171e62f8227SErik Schmauss ******************************************************************************/ 1172e62f8227SErik Schmauss 1173e62f8227SErik Schmauss struct acpi_table_msct { 1174e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 1175e62f8227SErik Schmauss u32 proximity_offset; /* Location of proximity info struct(s) */ 1176e62f8227SErik Schmauss u32 max_proximity_domains; /* Max number of proximity domains */ 1177e62f8227SErik Schmauss u32 max_clock_domains; /* Max number of clock domains */ 1178e62f8227SErik Schmauss u64 max_address; /* Max physical address in system */ 1179e62f8227SErik Schmauss }; 1180e62f8227SErik Schmauss 1181e62f8227SErik Schmauss /* subtable - Maximum Proximity Domain Information. Version 1 */ 1182e62f8227SErik Schmauss 1183e62f8227SErik Schmauss struct acpi_msct_proximity { 1184e62f8227SErik Schmauss u8 revision; 1185e62f8227SErik Schmauss u8 length; 1186e62f8227SErik Schmauss u32 range_start; /* Start of domain range */ 1187e62f8227SErik Schmauss u32 range_end; /* End of domain range */ 1188e62f8227SErik Schmauss u32 processor_capacity; 1189e62f8227SErik Schmauss u64 memory_capacity; /* In bytes */ 1190e62f8227SErik Schmauss }; 1191e62f8227SErik Schmauss 1192e62f8227SErik Schmauss /******************************************************************************* 1193e62f8227SErik Schmauss * 11945132f2faSBob Moore * MSDM - Microsoft Data Management table 11955132f2faSBob Moore * 11965132f2faSBob Moore * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)", 11975132f2faSBob Moore * November 29, 2011. Copyright 2011 Microsoft 11985132f2faSBob Moore * 11995132f2faSBob Moore ******************************************************************************/ 12005132f2faSBob Moore 12015132f2faSBob Moore /* Basic MSDM table is only the common ACPI header */ 12025132f2faSBob Moore 12035132f2faSBob Moore struct acpi_table_msdm { 12045132f2faSBob Moore struct acpi_table_header header; /* Common ACPI table header */ 12055132f2faSBob Moore }; 12065132f2faSBob Moore 12075132f2faSBob Moore /******************************************************************************* 12085132f2faSBob Moore * 1209e62f8227SErik Schmauss * NFIT - NVDIMM Interface Table (ACPI 6.0+) 1210e62f8227SErik Schmauss * Version 1 1211e62f8227SErik Schmauss * 1212e62f8227SErik Schmauss ******************************************************************************/ 1213e62f8227SErik Schmauss 1214e62f8227SErik Schmauss struct acpi_table_nfit { 1215e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 1216e62f8227SErik Schmauss u32 reserved; /* Reserved, must be zero */ 1217e62f8227SErik Schmauss }; 1218e62f8227SErik Schmauss 1219e62f8227SErik Schmauss /* Subtable header for NFIT */ 1220e62f8227SErik Schmauss 1221e62f8227SErik Schmauss struct acpi_nfit_header { 1222e62f8227SErik Schmauss u16 type; 1223e62f8227SErik Schmauss u16 length; 1224e62f8227SErik Schmauss }; 1225e62f8227SErik Schmauss 1226e62f8227SErik Schmauss /* Values for subtable type in struct acpi_nfit_header */ 1227e62f8227SErik Schmauss 1228e62f8227SErik Schmauss enum acpi_nfit_type { 1229e62f8227SErik Schmauss ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0, 1230e62f8227SErik Schmauss ACPI_NFIT_TYPE_MEMORY_MAP = 1, 1231e62f8227SErik Schmauss ACPI_NFIT_TYPE_INTERLEAVE = 2, 1232e62f8227SErik Schmauss ACPI_NFIT_TYPE_SMBIOS = 3, 1233e62f8227SErik Schmauss ACPI_NFIT_TYPE_CONTROL_REGION = 4, 1234e62f8227SErik Schmauss ACPI_NFIT_TYPE_DATA_REGION = 5, 1235e62f8227SErik Schmauss ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6, 1236e62f8227SErik Schmauss ACPI_NFIT_TYPE_CAPABILITIES = 7, 1237e62f8227SErik Schmauss ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */ 1238e62f8227SErik Schmauss }; 1239e62f8227SErik Schmauss 1240e62f8227SErik Schmauss /* 1241e62f8227SErik Schmauss * NFIT Subtables 1242e62f8227SErik Schmauss */ 1243e62f8227SErik Schmauss 1244e62f8227SErik Schmauss /* 0: System Physical Address Range Structure */ 1245e62f8227SErik Schmauss 1246e62f8227SErik Schmauss struct acpi_nfit_system_address { 1247e62f8227SErik Schmauss struct acpi_nfit_header header; 1248e62f8227SErik Schmauss u16 range_index; 1249e62f8227SErik Schmauss u16 flags; 1250e62f8227SErik Schmauss u32 reserved; /* Reserved, must be zero */ 1251e62f8227SErik Schmauss u32 proximity_domain; 1252e62f8227SErik Schmauss u8 range_guid[16]; 1253e62f8227SErik Schmauss u64 address; 1254e62f8227SErik Schmauss u64 length; 1255e62f8227SErik Schmauss u64 memory_mapping; 1256cf16b05cSBob Moore u64 location_cookie; /* ACPI 6.4 */ 1257e62f8227SErik Schmauss }; 1258e62f8227SErik Schmauss 1259e62f8227SErik Schmauss /* Flags */ 1260e62f8227SErik Schmauss 1261e62f8227SErik Schmauss #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */ 1262e62f8227SErik Schmauss #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */ 1263cf16b05cSBob Moore #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2) /* 02: SPA location cookie valid (ACPI 6.4) */ 1264e62f8227SErik Schmauss 1265e62f8227SErik Schmauss /* Range Type GUIDs appear in the include/acuuid.h file */ 1266e62f8227SErik Schmauss 1267e62f8227SErik Schmauss /* 1: Memory Device to System Address Range Map Structure */ 1268e62f8227SErik Schmauss 1269e62f8227SErik Schmauss struct acpi_nfit_memory_map { 1270e62f8227SErik Schmauss struct acpi_nfit_header header; 1271e62f8227SErik Schmauss u32 device_handle; 1272e62f8227SErik Schmauss u16 physical_id; 1273e62f8227SErik Schmauss u16 region_id; 1274e62f8227SErik Schmauss u16 range_index; 1275e62f8227SErik Schmauss u16 region_index; 1276e62f8227SErik Schmauss u64 region_size; 1277e62f8227SErik Schmauss u64 region_offset; 1278e62f8227SErik Schmauss u64 address; 1279e62f8227SErik Schmauss u16 interleave_index; 1280e62f8227SErik Schmauss u16 interleave_ways; 1281e62f8227SErik Schmauss u16 flags; 1282e62f8227SErik Schmauss u16 reserved; /* Reserved, must be zero */ 1283e62f8227SErik Schmauss }; 1284e62f8227SErik Schmauss 1285e62f8227SErik Schmauss /* Flags */ 1286e62f8227SErik Schmauss 1287e62f8227SErik Schmauss #define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */ 1288e62f8227SErik Schmauss #define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */ 1289e62f8227SErik Schmauss #define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */ 1290e62f8227SErik Schmauss #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */ 1291e62f8227SErik Schmauss #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */ 1292e62f8227SErik Schmauss #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */ 1293e62f8227SErik Schmauss #define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */ 1294e62f8227SErik Schmauss 1295e62f8227SErik Schmauss /* 2: Interleave Structure */ 1296e62f8227SErik Schmauss 1297e62f8227SErik Schmauss struct acpi_nfit_interleave { 1298e62f8227SErik Schmauss struct acpi_nfit_header header; 1299e62f8227SErik Schmauss u16 interleave_index; 1300e62f8227SErik Schmauss u16 reserved; /* Reserved, must be zero */ 1301e62f8227SErik Schmauss u32 line_count; 1302e62f8227SErik Schmauss u32 line_size; 1303e62f8227SErik Schmauss u32 line_offset[1]; /* Variable length */ 1304e62f8227SErik Schmauss }; 1305e62f8227SErik Schmauss 1306e62f8227SErik Schmauss /* 3: SMBIOS Management Information Structure */ 1307e62f8227SErik Schmauss 1308e62f8227SErik Schmauss struct acpi_nfit_smbios { 1309e62f8227SErik Schmauss struct acpi_nfit_header header; 1310e62f8227SErik Schmauss u32 reserved; /* Reserved, must be zero */ 1311e62f8227SErik Schmauss u8 data[1]; /* Variable length */ 1312e62f8227SErik Schmauss }; 1313e62f8227SErik Schmauss 1314e62f8227SErik Schmauss /* 4: NVDIMM Control Region Structure */ 1315e62f8227SErik Schmauss 1316e62f8227SErik Schmauss struct acpi_nfit_control_region { 1317e62f8227SErik Schmauss struct acpi_nfit_header header; 1318e62f8227SErik Schmauss u16 region_index; 1319e62f8227SErik Schmauss u16 vendor_id; 1320e62f8227SErik Schmauss u16 device_id; 1321e62f8227SErik Schmauss u16 revision_id; 1322e62f8227SErik Schmauss u16 subsystem_vendor_id; 1323e62f8227SErik Schmauss u16 subsystem_device_id; 1324e62f8227SErik Schmauss u16 subsystem_revision_id; 1325e62f8227SErik Schmauss u8 valid_fields; 1326e62f8227SErik Schmauss u8 manufacturing_location; 1327e62f8227SErik Schmauss u16 manufacturing_date; 1328e62f8227SErik Schmauss u8 reserved[2]; /* Reserved, must be zero */ 1329e62f8227SErik Schmauss u32 serial_number; 1330e62f8227SErik Schmauss u16 code; 1331e62f8227SErik Schmauss u16 windows; 1332e62f8227SErik Schmauss u64 window_size; 1333e62f8227SErik Schmauss u64 command_offset; 1334e62f8227SErik Schmauss u64 command_size; 1335e62f8227SErik Schmauss u64 status_offset; 1336e62f8227SErik Schmauss u64 status_size; 1337e62f8227SErik Schmauss u16 flags; 1338e62f8227SErik Schmauss u8 reserved1[6]; /* Reserved, must be zero */ 1339e62f8227SErik Schmauss }; 1340e62f8227SErik Schmauss 1341e62f8227SErik Schmauss /* Flags */ 1342e62f8227SErik Schmauss 1343e62f8227SErik Schmauss #define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */ 1344e62f8227SErik Schmauss 1345e62f8227SErik Schmauss /* valid_fields bits */ 1346e62f8227SErik Schmauss 1347e62f8227SErik Schmauss #define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */ 1348e62f8227SErik Schmauss 1349e62f8227SErik Schmauss /* 5: NVDIMM Block Data Window Region Structure */ 1350e62f8227SErik Schmauss 1351e62f8227SErik Schmauss struct acpi_nfit_data_region { 1352e62f8227SErik Schmauss struct acpi_nfit_header header; 1353e62f8227SErik Schmauss u16 region_index; 1354e62f8227SErik Schmauss u16 windows; 1355e62f8227SErik Schmauss u64 offset; 1356e62f8227SErik Schmauss u64 size; 1357e62f8227SErik Schmauss u64 capacity; 1358e62f8227SErik Schmauss u64 start_address; 1359e62f8227SErik Schmauss }; 1360e62f8227SErik Schmauss 1361e62f8227SErik Schmauss /* 6: Flush Hint Address Structure */ 1362e62f8227SErik Schmauss 1363e62f8227SErik Schmauss struct acpi_nfit_flush_address { 1364e62f8227SErik Schmauss struct acpi_nfit_header header; 1365e62f8227SErik Schmauss u32 device_handle; 1366e62f8227SErik Schmauss u16 hint_count; 1367e62f8227SErik Schmauss u8 reserved[6]; /* Reserved, must be zero */ 1368e62f8227SErik Schmauss u64 hint_address[1]; /* Variable length */ 1369e62f8227SErik Schmauss }; 1370e62f8227SErik Schmauss 1371e62f8227SErik Schmauss /* 7: Platform Capabilities Structure */ 1372e62f8227SErik Schmauss 1373e62f8227SErik Schmauss struct acpi_nfit_capabilities { 1374e62f8227SErik Schmauss struct acpi_nfit_header header; 1375e62f8227SErik Schmauss u8 highest_capability; 1376e62f8227SErik Schmauss u8 reserved[3]; /* Reserved, must be zero */ 1377e62f8227SErik Schmauss u32 capabilities; 1378e62f8227SErik Schmauss u32 reserved2; 1379e62f8227SErik Schmauss }; 1380e62f8227SErik Schmauss 1381e62f8227SErik Schmauss /* Capabilities Flags */ 1382e62f8227SErik Schmauss 1383e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM capable */ 1384e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to NVDIMM capable */ 1385e62f8227SErik Schmauss #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring capable */ 1386e62f8227SErik Schmauss 1387e62f8227SErik Schmauss /* 1388e62f8227SErik Schmauss * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM 1389e62f8227SErik Schmauss */ 1390e62f8227SErik Schmauss struct nfit_device_handle { 1391e62f8227SErik Schmauss u32 handle; 1392e62f8227SErik Schmauss }; 1393e62f8227SErik Schmauss 1394e62f8227SErik Schmauss /* Device handle construction and extraction macros */ 1395e62f8227SErik Schmauss 1396e62f8227SErik Schmauss #define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F 1397e62f8227SErik Schmauss #define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0 1398e62f8227SErik Schmauss #define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00 1399e62f8227SErik Schmauss #define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000 1400e62f8227SErik Schmauss #define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000 1401e62f8227SErik Schmauss 1402e62f8227SErik Schmauss #define ACPI_NFIT_DIMM_NUMBER_OFFSET 0 1403e62f8227SErik Schmauss #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4 1404e62f8227SErik Schmauss #define ACPI_NFIT_MEMORY_ID_OFFSET 8 1405e62f8227SErik Schmauss #define ACPI_NFIT_SOCKET_ID_OFFSET 12 1406e62f8227SErik Schmauss #define ACPI_NFIT_NODE_ID_OFFSET 16 1407e62f8227SErik Schmauss 1408e62f8227SErik Schmauss /* Macro to construct a NFIT/NVDIMM device handle */ 1409e62f8227SErik Schmauss 1410e62f8227SErik Schmauss #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \ 1411e62f8227SErik Schmauss ((dimm) | \ 1412e62f8227SErik Schmauss ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \ 1413e62f8227SErik Schmauss ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \ 1414e62f8227SErik Schmauss ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \ 1415e62f8227SErik Schmauss ((node) << ACPI_NFIT_NODE_ID_OFFSET)) 1416e62f8227SErik Schmauss 1417e62f8227SErik Schmauss /* Macros to extract individual fields from a NFIT/NVDIMM device handle */ 1418e62f8227SErik Schmauss 1419e62f8227SErik Schmauss #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \ 1420e62f8227SErik Schmauss ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK) 1421e62f8227SErik Schmauss 1422e62f8227SErik Schmauss #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \ 1423e62f8227SErik Schmauss (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET) 1424e62f8227SErik Schmauss 1425e62f8227SErik Schmauss #define ACPI_NFIT_GET_MEMORY_ID(handle) \ 1426e62f8227SErik Schmauss (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET) 1427e62f8227SErik Schmauss 1428e62f8227SErik Schmauss #define ACPI_NFIT_GET_SOCKET_ID(handle) \ 1429e62f8227SErik Schmauss (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET) 1430e62f8227SErik Schmauss 1431e62f8227SErik Schmauss #define ACPI_NFIT_GET_NODE_ID(handle) \ 1432e62f8227SErik Schmauss (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET) 1433e62f8227SErik Schmauss 1434e62f8227SErik Schmauss /******************************************************************************* 1435e62f8227SErik Schmauss * 1436a805aab8SBob Moore * NHLT - Non HD Audio Link Table 1437a805aab8SBob Moore * 1438a805aab8SBob Moore * Conforms to: Intel Smart Sound Technology NHLT Specification 1439a805aab8SBob Moore * Version 0.8.1, January 2020. 1440a805aab8SBob Moore * 1441a805aab8SBob Moore ******************************************************************************/ 1442a805aab8SBob Moore 1443a805aab8SBob Moore /* Main table */ 1444a805aab8SBob Moore 1445a805aab8SBob Moore struct acpi_table_nhlt { 1446a805aab8SBob Moore struct acpi_table_header header; /* Common ACPI table header */ 1447a805aab8SBob Moore u8 endpoint_count; 1448a805aab8SBob Moore }; 1449a805aab8SBob Moore 1450a805aab8SBob Moore struct acpi_nhlt_endpoint { 1451a805aab8SBob Moore u32 descriptor_length; 1452a805aab8SBob Moore u8 link_type; 1453a805aab8SBob Moore u8 instance_id; 1454a805aab8SBob Moore u16 vendor_id; 1455a805aab8SBob Moore u16 device_id; 1456a805aab8SBob Moore u16 revision_id; 1457a805aab8SBob Moore u32 subsystem_id; 1458a805aab8SBob Moore u8 device_type; 1459a805aab8SBob Moore u8 direction; 1460a805aab8SBob Moore u8 virtual_bus_id; 1461a805aab8SBob Moore }; 1462a805aab8SBob Moore 1463a805aab8SBob Moore /* Types for link_type field above */ 1464a805aab8SBob Moore 1465a805aab8SBob Moore #define ACPI_NHLT_RESERVED_HD_AUDIO 0 1466a805aab8SBob Moore #define ACPI_NHLT_RESERVED_DSP 1 1467a805aab8SBob Moore #define ACPI_NHLT_PDM 2 1468a805aab8SBob Moore #define ACPI_NHLT_SSP 3 1469a805aab8SBob Moore #define ACPI_NHLT_RESERVED_SLIMBUS 4 1470a805aab8SBob Moore #define ACPI_NHLT_RESERVED_SOUNDWIRE 5 1471a805aab8SBob Moore #define ACPI_NHLT_TYPE_RESERVED 6 /* 6 and above are reserved */ 1472a805aab8SBob Moore 1473a805aab8SBob Moore /* All other values above are reserved */ 1474a805aab8SBob Moore 1475a805aab8SBob Moore /* Values for device_id field above */ 1476a805aab8SBob Moore 1477a805aab8SBob Moore #define ACPI_NHLT_PDM_DMIC 0xAE20 1478a805aab8SBob Moore #define ACPI_NHLT_BT_SIDEBAND 0xAE30 1479a805aab8SBob Moore #define ACPI_NHLT_I2S_TDM_CODECS 0xAE23 1480a805aab8SBob Moore 1481a805aab8SBob Moore /* Values for device_type field above */ 1482a805aab8SBob Moore 1483a805aab8SBob Moore /* SSP Link */ 1484a805aab8SBob Moore 1485a805aab8SBob Moore #define ACPI_NHLT_LINK_BT_SIDEBAND 0 1486a805aab8SBob Moore #define ACPI_NHLT_LINK_FM 1 1487a805aab8SBob Moore #define ACPI_NHLT_LINK_MODEM 2 1488a805aab8SBob Moore /* 3 is reserved */ 1489a805aab8SBob Moore #define ACPI_NHLT_LINK_SSP_ANALOG_CODEC 4 1490a805aab8SBob Moore 1491a805aab8SBob Moore /* PDM Link */ 1492a805aab8SBob Moore 1493a805aab8SBob Moore #define ACPI_NHLT_PDM_ON_CAVS_1P8 0 1494a805aab8SBob Moore #define ACPI_NHLT_PDM_ON_CAVS_1P5 1 1495a805aab8SBob Moore 1496a805aab8SBob Moore /* Values for Direction field above */ 1497a805aab8SBob Moore 1498a805aab8SBob Moore #define ACPI_NHLT_DIR_RENDER 0 1499a805aab8SBob Moore #define ACPI_NHLT_DIR_CAPTURE 1 1500a805aab8SBob Moore #define ACPI_NHLT_DIR_RENDER_LOOPBACK 2 1501a805aab8SBob Moore #define ACPI_NHLT_DIR_RENDER_FEEDBACK 3 1502a805aab8SBob Moore #define ACPI_NHLT_DIR_RESERVED 4 /* 4 and above are reserved */ 1503a805aab8SBob Moore 1504a805aab8SBob Moore struct acpi_nhlt_device_specific_config { 1505a805aab8SBob Moore u32 capabilities_size; 1506a805aab8SBob Moore u8 virtual_slot; 1507a805aab8SBob Moore u8 config_type; 1508a805aab8SBob Moore }; 1509a805aab8SBob Moore 1510a805aab8SBob Moore struct acpi_nhlt_device_specific_config_a { 1511a805aab8SBob Moore u32 capabilities_size; 1512a805aab8SBob Moore u8 virtual_slot; 1513a805aab8SBob Moore u8 config_type; 1514a805aab8SBob Moore u8 array_type; 1515a805aab8SBob Moore }; 1516a805aab8SBob Moore 1517a805aab8SBob Moore /* Values for Config Type above */ 1518a805aab8SBob Moore 1519e4a07f5aSBob Moore #define ACPI_NHLT_CONFIG_TYPE_GENERIC 0x00 1520e4a07f5aSBob Moore #define ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY 0x01 1521e4a07f5aSBob Moore #define ACPI_NHLT_CONFIG_TYPE_RENDER_FEEDBACK 0x03 1522e4a07f5aSBob Moore #define ACPI_NHLT_CONFIG_TYPE_RESERVED 0x04 /* 4 and above are reserved */ 1523a805aab8SBob Moore 1524a805aab8SBob Moore struct acpi_nhlt_device_specific_config_b { 1525a805aab8SBob Moore u32 capabilities_size; 1526a805aab8SBob Moore }; 1527a805aab8SBob Moore 1528a805aab8SBob Moore struct acpi_nhlt_device_specific_config_c { 1529a805aab8SBob Moore u32 capabilities_size; 1530a805aab8SBob Moore u8 virtual_slot; 1531a805aab8SBob Moore }; 1532a805aab8SBob Moore 1533e4a07f5aSBob Moore struct acpi_nhlt_render_device_specific_config { 1534e4a07f5aSBob Moore u32 capabilities_size; 1535e4a07f5aSBob Moore u8 virtual_slot; 1536e4a07f5aSBob Moore }; 1537e4a07f5aSBob Moore 1538a805aab8SBob Moore struct acpi_nhlt_wave_extensible { 1539a805aab8SBob Moore u16 format_tag; 1540a805aab8SBob Moore u16 channel_count; 1541a805aab8SBob Moore u32 samples_per_sec; 1542a805aab8SBob Moore u32 avg_bytes_per_sec; 1543a805aab8SBob Moore u16 block_align; 1544a805aab8SBob Moore u16 bits_per_sample; 1545a805aab8SBob Moore u16 extra_format_size; 1546a805aab8SBob Moore u16 valid_bits_per_sample; 1547a805aab8SBob Moore u32 channel_mask; 1548a805aab8SBob Moore u8 sub_format_guid[16]; 1549a805aab8SBob Moore }; 1550a805aab8SBob Moore 1551a805aab8SBob Moore /* Values for channel_mask above */ 1552a805aab8SBob Moore 1553a805aab8SBob Moore #define ACPI_NHLT_SPKR_FRONT_LEFT 0x1 1554a805aab8SBob Moore #define ACPI_NHLT_SPKR_FRONT_RIGHT 0x2 1555a805aab8SBob Moore #define ACPI_NHLT_SPKR_FRONT_CENTER 0x4 1556a805aab8SBob Moore #define ACPI_NHLT_SPKR_LOW_FREQ 0x8 1557a805aab8SBob Moore #define ACPI_NHLT_SPKR_BACK_LEFT 0x10 1558a805aab8SBob Moore #define ACPI_NHLT_SPKR_BACK_RIGHT 0x20 1559a805aab8SBob Moore #define ACPI_NHLT_SPKR_FRONT_LEFT_OF_CENTER 0x40 1560a805aab8SBob Moore #define ACPI_NHLT_SPKR_FRONT_RIGHT_OF_CENTER 0x80 1561a805aab8SBob Moore #define ACPI_NHLT_SPKR_BACK_CENTER 0x100 1562a805aab8SBob Moore #define ACPI_NHLT_SPKR_SIDE_LEFT 0x200 1563a805aab8SBob Moore #define ACPI_NHLT_SPKR_SIDE_RIGHT 0x400 1564a805aab8SBob Moore #define ACPI_NHLT_SPKR_TOP_CENTER 0x800 1565a805aab8SBob Moore #define ACPI_NHLT_SPKR_TOP_FRONT_LEFT 0x1000 1566a805aab8SBob Moore #define ACPI_NHLT_SPKR_TOP_FRONT_CENTER 0x2000 1567a805aab8SBob Moore #define ACPI_NHLT_SPKR_TOP_FRONT_RIGHT 0x4000 1568a805aab8SBob Moore #define ACPI_NHLT_SPKR_TOP_BACK_LEFT 0x8000 1569a805aab8SBob Moore #define ACPI_NHLT_SPKR_TOP_BACK_CENTER 0x10000 1570a805aab8SBob Moore #define ACPI_NHLT_SPKR_TOP_BACK_RIGHT 0x20000 1571a805aab8SBob Moore 1572a805aab8SBob Moore struct acpi_nhlt_format_config { 1573a805aab8SBob Moore struct acpi_nhlt_wave_extensible format; 1574a805aab8SBob Moore u32 capability_size; 1575a805aab8SBob Moore u8 capabilities[]; 1576a805aab8SBob Moore }; 1577a805aab8SBob Moore 1578a805aab8SBob Moore struct acpi_nhlt_formats_config { 1579a805aab8SBob Moore u8 formats_count; 1580a805aab8SBob Moore }; 1581a805aab8SBob Moore 1582a805aab8SBob Moore struct acpi_nhlt_device_specific_hdr { 1583a805aab8SBob Moore u8 virtual_slot; 1584a805aab8SBob Moore u8 config_type; 1585a805aab8SBob Moore }; 1586a805aab8SBob Moore 1587a805aab8SBob Moore /* Types for config_type above */ 1588a805aab8SBob Moore 1589a805aab8SBob Moore #define ACPI_NHLT_GENERIC 0 1590a805aab8SBob Moore #define ACPI_NHLT_MIC 1 1591a805aab8SBob Moore #define ACPI_NHLT_RENDER 3 1592a805aab8SBob Moore 1593a805aab8SBob Moore struct acpi_nhlt_mic_device_specific_config { 1594a805aab8SBob Moore struct acpi_nhlt_device_specific_hdr device_config; 1595a805aab8SBob Moore u8 array_type_ext; 1596a805aab8SBob Moore }; 1597a805aab8SBob Moore 1598a805aab8SBob Moore /* Values for array_type_ext above */ 1599a805aab8SBob Moore 1600e4a07f5aSBob Moore #define ACPI_NHLT_ARRAY_TYPE_RESERVED 0x09 // 9 and below are reserved 1601e4a07f5aSBob Moore #define ACPI_NHLT_SMALL_LINEAR_2ELEMENT 0x0A 1602e4a07f5aSBob Moore #define ACPI_NHLT_BIG_LINEAR_2ELEMENT 0x0B 1603e4a07f5aSBob Moore #define ACPI_NHLT_FIRST_GEOMETRY_LINEAR_4ELEMENT 0x0C 1604e4a07f5aSBob Moore #define ACPI_NHLT_PLANAR_LSHAPED_4ELEMENT 0x0D 1605e4a07f5aSBob Moore #define ACPI_NHLT_SECOND_GEOMETRY_LINEAR_4ELEMENT 0x0E 1606e4a07f5aSBob Moore #define ACPI_NHLT_VENDOR_DEFINED 0x0F 1607e4a07f5aSBob Moore #define ACPI_NHLT_ARRAY_TYPE_MASK 0x0F 1608e4a07f5aSBob Moore #define ACPI_NHLT_ARRAY_TYPE_EXT_MASK 0x10 1609a805aab8SBob Moore 1610e4a07f5aSBob Moore #define ACPI_NHLT_NO_EXTENSION 0x0 1611e4a07f5aSBob Moore #define ACPI_NHLT_MIC_SNR_SENSITIVITY_EXT (1<<4) 1612e4a07f5aSBob Moore 1613e4a07f5aSBob Moore struct acpi_nhlt_vendor_mic_count { 1614e4a07f5aSBob Moore u8 microphone_count; 1615e4a07f5aSBob Moore }; 1616a805aab8SBob Moore 1617a805aab8SBob Moore struct acpi_nhlt_vendor_mic_config { 1618a805aab8SBob Moore u8 type; 1619a805aab8SBob Moore u8 panel; 1620a805aab8SBob Moore u16 speaker_position_distance; // mm 1621a805aab8SBob Moore u16 horizontal_offset; // mm 1622a805aab8SBob Moore u16 vertical_offset; // mm 1623a805aab8SBob Moore u8 frequency_low_band; // 5*hz 1624a805aab8SBob Moore u8 frequency_high_band; // 500*hz 1625a805aab8SBob Moore u16 direction_angle; // -180 - + 180 1626a805aab8SBob Moore u16 elevation_angle; // -180 - + 180 1627a805aab8SBob Moore u16 work_vertical_angle_begin; // -180 - + 180 with 2 deg step 1628a805aab8SBob Moore u16 work_vertical_angle_end; // -180 - + 180 with 2 deg step 1629a805aab8SBob Moore u16 work_horizontal_angle_begin; // -180 - + 180 with 2 deg step 1630a805aab8SBob Moore u16 work_horizontal_angle_end; // -180 - + 180 with 2 deg step 1631a805aab8SBob Moore }; 1632a805aab8SBob Moore 1633a805aab8SBob Moore /* Values for Type field above */ 1634a805aab8SBob Moore 1635e4a07f5aSBob Moore #define ACPI_NHLT_MIC_OMNIDIRECTIONAL 0 1636e4a07f5aSBob Moore #define ACPI_NHLT_MIC_SUBCARDIOID 1 1637e4a07f5aSBob Moore #define ACPI_NHLT_MIC_CARDIOID 2 1638e4a07f5aSBob Moore #define ACPI_NHLT_MIC_SUPER_CARDIOID 3 1639e4a07f5aSBob Moore #define ACPI_NHLT_MIC_HYPER_CARDIOID 4 1640e4a07f5aSBob Moore #define ACPI_NHLT_MIC_8_SHAPED 5 1641e4a07f5aSBob Moore #define ACPI_NHLT_MIC_RESERVED6 6 // 6 is reserved 1642e4a07f5aSBob Moore #define ACPI_NHLT_MIC_VENDOR_DEFINED 7 1643e4a07f5aSBob Moore #define ACPI_NHLT_MIC_RESERVED 8 // 8 and above are reserved 1644a805aab8SBob Moore 1645a805aab8SBob Moore /* Values for Panel field above */ 1646a805aab8SBob Moore 1647e4a07f5aSBob Moore #define ACPI_NHLT_MIC_POSITION_TOP 0 1648e4a07f5aSBob Moore #define ACPI_NHLT_MIC_POSITION_BOTTOM 1 1649e4a07f5aSBob Moore #define ACPI_NHLT_MIC_POSITION_LEFT 2 1650e4a07f5aSBob Moore #define ACPI_NHLT_MIC_POSITION_RIGHT 3 1651e4a07f5aSBob Moore #define ACPI_NHLT_MIC_POSITION_FRONT 4 1652e4a07f5aSBob Moore #define ACPI_NHLT_MIC_POSITION_BACK 5 1653e4a07f5aSBob Moore #define ACPI_NHLT_MIC_POSITION_RESERVED 6 // 6 and above are reserved 1654a805aab8SBob Moore 1655a805aab8SBob Moore struct acpi_nhlt_vendor_mic_device_specific_config { 1656a805aab8SBob Moore struct acpi_nhlt_mic_device_specific_config mic_array_device_config; 1657a805aab8SBob Moore u8 number_of_microphones; 1658a805aab8SBob Moore struct acpi_nhlt_vendor_mic_config mic_config[]; // indexed by number_of_microphones 1659a805aab8SBob Moore }; 1660a805aab8SBob Moore 1661a805aab8SBob Moore /* Microphone SNR and Sensitivity extension */ 1662a805aab8SBob Moore 1663a805aab8SBob Moore struct acpi_nhlt_mic_snr_sensitivity_extension { 1664a805aab8SBob Moore u32 SNR; 1665a805aab8SBob Moore u32 sensitivity; 1666a805aab8SBob Moore }; 1667a805aab8SBob Moore 1668e4a07f5aSBob Moore /* Render device with feedback */ 1669e4a07f5aSBob Moore 1670a805aab8SBob Moore struct acpi_nhlt_render_feedback_device_specific_config { 1671a805aab8SBob Moore u8 feedback_virtual_slot; // render slot in case of capture 1672a805aab8SBob Moore u16 feedback_channels; // informative only 1673a805aab8SBob Moore u16 feedback_valid_bits_per_sample; 1674a805aab8SBob Moore }; 1675a805aab8SBob Moore 1676a805aab8SBob Moore /* Linux-specific structures */ 1677a805aab8SBob Moore 1678a805aab8SBob Moore struct acpi_nhlt_linux_specific_count { 1679a805aab8SBob Moore u8 structure_count; 1680a805aab8SBob Moore }; 1681a805aab8SBob Moore 1682a805aab8SBob Moore struct acpi_nhlt_linux_specific_data { 1683a805aab8SBob Moore u8 device_id[16]; 1684a805aab8SBob Moore u8 device_instance_id; 1685a805aab8SBob Moore u8 device_port_id; 1686*0c9a6727SBob Moore }; 1687*0c9a6727SBob Moore 1688*0c9a6727SBob Moore struct acpi_nhlt_linux_specific_data_b { 1689*0c9a6727SBob Moore u8 specific_data[18]; 1690a805aab8SBob Moore }; 1691a805aab8SBob Moore 1692a805aab8SBob Moore struct acpi_nhlt_table_terminator { 1693a805aab8SBob Moore u32 terminator_value; 1694a805aab8SBob Moore u32 terminator_signature; 1695a805aab8SBob Moore }; 1696a805aab8SBob Moore 1697a805aab8SBob Moore /******************************************************************************* 1698a805aab8SBob Moore * 1699e62f8227SErik Schmauss * PCCT - Platform Communications Channel Table (ACPI 5.0) 1700e62f8227SErik Schmauss * Version 2 (ACPI 6.2) 1701e62f8227SErik Schmauss * 1702e62f8227SErik Schmauss ******************************************************************************/ 1703e62f8227SErik Schmauss 1704e62f8227SErik Schmauss struct acpi_table_pcct { 1705e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 1706e62f8227SErik Schmauss u32 flags; 1707e62f8227SErik Schmauss u64 reserved; 1708e62f8227SErik Schmauss }; 1709e62f8227SErik Schmauss 1710e62f8227SErik Schmauss /* Values for Flags field above */ 1711e62f8227SErik Schmauss 1712e62f8227SErik Schmauss #define ACPI_PCCT_DOORBELL 1 1713e62f8227SErik Schmauss 1714e62f8227SErik Schmauss /* Values for subtable type in struct acpi_subtable_header */ 1715e62f8227SErik Schmauss 1716e62f8227SErik Schmauss enum acpi_pcct_type { 1717e62f8227SErik Schmauss ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, 1718e62f8227SErik Schmauss ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1, 1719e62f8227SErik Schmauss ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */ 1720e62f8227SErik Schmauss ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */ 1721e62f8227SErik Schmauss ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */ 172271f79a3fSErik Kaneda ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE = 5, /* ACPI 6.4 */ 172371f79a3fSErik Kaneda ACPI_PCCT_TYPE_RESERVED = 6 /* 6 and greater are reserved */ 1724e62f8227SErik Schmauss }; 1725e62f8227SErik Schmauss 1726e62f8227SErik Schmauss /* 1727e62f8227SErik Schmauss * PCCT Subtables, correspond to Type in struct acpi_subtable_header 1728e62f8227SErik Schmauss */ 1729e62f8227SErik Schmauss 1730e62f8227SErik Schmauss /* 0: Generic Communications Subspace */ 1731e62f8227SErik Schmauss 1732e62f8227SErik Schmauss struct acpi_pcct_subspace { 1733e62f8227SErik Schmauss struct acpi_subtable_header header; 1734e62f8227SErik Schmauss u8 reserved[6]; 1735e62f8227SErik Schmauss u64 base_address; 1736e62f8227SErik Schmauss u64 length; 1737e62f8227SErik Schmauss struct acpi_generic_address doorbell_register; 1738e62f8227SErik Schmauss u64 preserve_mask; 1739e62f8227SErik Schmauss u64 write_mask; 1740e62f8227SErik Schmauss u32 latency; 1741e62f8227SErik Schmauss u32 max_access_rate; 1742e62f8227SErik Schmauss u16 min_turnaround_time; 1743e62f8227SErik Schmauss }; 1744e62f8227SErik Schmauss 1745e62f8227SErik Schmauss /* 1: HW-reduced Communications Subspace (ACPI 5.1) */ 1746e62f8227SErik Schmauss 1747e62f8227SErik Schmauss struct acpi_pcct_hw_reduced { 1748e62f8227SErik Schmauss struct acpi_subtable_header header; 1749e62f8227SErik Schmauss u32 platform_interrupt; 1750e62f8227SErik Schmauss u8 flags; 1751e62f8227SErik Schmauss u8 reserved; 1752e62f8227SErik Schmauss u64 base_address; 1753e62f8227SErik Schmauss u64 length; 1754e62f8227SErik Schmauss struct acpi_generic_address doorbell_register; 1755e62f8227SErik Schmauss u64 preserve_mask; 1756e62f8227SErik Schmauss u64 write_mask; 1757e62f8227SErik Schmauss u32 latency; 1758e62f8227SErik Schmauss u32 max_access_rate; 1759e62f8227SErik Schmauss u16 min_turnaround_time; 1760e62f8227SErik Schmauss }; 1761e62f8227SErik Schmauss 1762e62f8227SErik Schmauss /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */ 1763e62f8227SErik Schmauss 1764e62f8227SErik Schmauss struct acpi_pcct_hw_reduced_type2 { 1765e62f8227SErik Schmauss struct acpi_subtable_header header; 1766e62f8227SErik Schmauss u32 platform_interrupt; 1767e62f8227SErik Schmauss u8 flags; 1768e62f8227SErik Schmauss u8 reserved; 1769e62f8227SErik Schmauss u64 base_address; 1770e62f8227SErik Schmauss u64 length; 1771e62f8227SErik Schmauss struct acpi_generic_address doorbell_register; 1772e62f8227SErik Schmauss u64 preserve_mask; 1773e62f8227SErik Schmauss u64 write_mask; 1774e62f8227SErik Schmauss u32 latency; 1775e62f8227SErik Schmauss u32 max_access_rate; 1776e62f8227SErik Schmauss u16 min_turnaround_time; 1777e62f8227SErik Schmauss struct acpi_generic_address platform_ack_register; 1778e62f8227SErik Schmauss u64 ack_preserve_mask; 1779e62f8227SErik Schmauss u64 ack_write_mask; 1780e62f8227SErik Schmauss }; 1781e62f8227SErik Schmauss 1782e62f8227SErik Schmauss /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */ 1783e62f8227SErik Schmauss 1784e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_master { 1785e62f8227SErik Schmauss struct acpi_subtable_header header; 1786e62f8227SErik Schmauss u32 platform_interrupt; 1787e62f8227SErik Schmauss u8 flags; 1788e62f8227SErik Schmauss u8 reserved1; 1789e62f8227SErik Schmauss u64 base_address; 1790e62f8227SErik Schmauss u32 length; 1791e62f8227SErik Schmauss struct acpi_generic_address doorbell_register; 1792e62f8227SErik Schmauss u64 preserve_mask; 1793e62f8227SErik Schmauss u64 write_mask; 1794e62f8227SErik Schmauss u32 latency; 1795e62f8227SErik Schmauss u32 max_access_rate; 1796e62f8227SErik Schmauss u32 min_turnaround_time; 1797e62f8227SErik Schmauss struct acpi_generic_address platform_ack_register; 1798e62f8227SErik Schmauss u64 ack_preserve_mask; 1799e62f8227SErik Schmauss u64 ack_set_mask; 1800e62f8227SErik Schmauss u64 reserved2; 1801e62f8227SErik Schmauss struct acpi_generic_address cmd_complete_register; 1802e62f8227SErik Schmauss u64 cmd_complete_mask; 1803e62f8227SErik Schmauss struct acpi_generic_address cmd_update_register; 1804e62f8227SErik Schmauss u64 cmd_update_preserve_mask; 1805e62f8227SErik Schmauss u64 cmd_update_set_mask; 1806e62f8227SErik Schmauss struct acpi_generic_address error_status_register; 1807e62f8227SErik Schmauss u64 error_status_mask; 1808e62f8227SErik Schmauss }; 1809e62f8227SErik Schmauss 1810e62f8227SErik Schmauss /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */ 1811e62f8227SErik Schmauss 1812e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_slave { 1813e62f8227SErik Schmauss struct acpi_subtable_header header; 1814e62f8227SErik Schmauss u32 platform_interrupt; 1815e62f8227SErik Schmauss u8 flags; 1816e62f8227SErik Schmauss u8 reserved1; 1817e62f8227SErik Schmauss u64 base_address; 1818e62f8227SErik Schmauss u32 length; 1819e62f8227SErik Schmauss struct acpi_generic_address doorbell_register; 1820e62f8227SErik Schmauss u64 preserve_mask; 1821e62f8227SErik Schmauss u64 write_mask; 1822e62f8227SErik Schmauss u32 latency; 1823e62f8227SErik Schmauss u32 max_access_rate; 1824e62f8227SErik Schmauss u32 min_turnaround_time; 1825e62f8227SErik Schmauss struct acpi_generic_address platform_ack_register; 1826e62f8227SErik Schmauss u64 ack_preserve_mask; 1827e62f8227SErik Schmauss u64 ack_set_mask; 1828e62f8227SErik Schmauss u64 reserved2; 1829e62f8227SErik Schmauss struct acpi_generic_address cmd_complete_register; 1830e62f8227SErik Schmauss u64 cmd_complete_mask; 1831e62f8227SErik Schmauss struct acpi_generic_address cmd_update_register; 1832e62f8227SErik Schmauss u64 cmd_update_preserve_mask; 1833e62f8227SErik Schmauss u64 cmd_update_set_mask; 1834e62f8227SErik Schmauss struct acpi_generic_address error_status_register; 1835e62f8227SErik Schmauss u64 error_status_mask; 1836e62f8227SErik Schmauss }; 1837e62f8227SErik Schmauss 183871f79a3fSErik Kaneda /* 5: HW Registers based Communications Subspace */ 183971f79a3fSErik Kaneda 184071f79a3fSErik Kaneda struct acpi_pcct_hw_reg { 184171f79a3fSErik Kaneda struct acpi_subtable_header header; 184271f79a3fSErik Kaneda u16 version; 184371f79a3fSErik Kaneda u64 base_address; 184471f79a3fSErik Kaneda u64 length; 184571f79a3fSErik Kaneda struct acpi_generic_address doorbell_register; 184671f79a3fSErik Kaneda u64 doorbell_preserve; 184771f79a3fSErik Kaneda u64 doorbell_write; 184871f79a3fSErik Kaneda struct acpi_generic_address cmd_complete_register; 184971f79a3fSErik Kaneda u64 cmd_complete_mask; 185071f79a3fSErik Kaneda struct acpi_generic_address error_status_register; 185171f79a3fSErik Kaneda u64 error_status_mask; 185271f79a3fSErik Kaneda u32 nominal_latency; 185371f79a3fSErik Kaneda u32 min_turnaround_time; 185471f79a3fSErik Kaneda }; 185571f79a3fSErik Kaneda 1856e62f8227SErik Schmauss /* Values for doorbell flags above */ 1857e62f8227SErik Schmauss 1858e62f8227SErik Schmauss #define ACPI_PCCT_INTERRUPT_POLARITY (1) 1859e62f8227SErik Schmauss #define ACPI_PCCT_INTERRUPT_MODE (1<<1) 1860e62f8227SErik Schmauss 1861e62f8227SErik Schmauss /* 1862e62f8227SErik Schmauss * PCC memory structures (not part of the ACPI table) 1863e62f8227SErik Schmauss */ 1864e62f8227SErik Schmauss 1865e62f8227SErik Schmauss /* Shared Memory Region */ 1866e62f8227SErik Schmauss 1867e62f8227SErik Schmauss struct acpi_pcct_shared_memory { 1868e62f8227SErik Schmauss u32 signature; 1869e62f8227SErik Schmauss u16 command; 1870e62f8227SErik Schmauss u16 status; 1871e62f8227SErik Schmauss }; 1872e62f8227SErik Schmauss 1873e62f8227SErik Schmauss /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */ 1874e62f8227SErik Schmauss 1875e62f8227SErik Schmauss struct acpi_pcct_ext_pcc_shared_memory { 1876e62f8227SErik Schmauss u32 signature; 1877e62f8227SErik Schmauss u32 flags; 1878e62f8227SErik Schmauss u32 length; 1879e62f8227SErik Schmauss u32 command; 1880e62f8227SErik Schmauss }; 1881e62f8227SErik Schmauss 1882e62f8227SErik Schmauss /******************************************************************************* 1883e62f8227SErik Schmauss * 1884e62f8227SErik Schmauss * PDTT - Platform Debug Trigger Table (ACPI 6.2) 1885e62f8227SErik Schmauss * Version 0 1886e62f8227SErik Schmauss * 1887e62f8227SErik Schmauss ******************************************************************************/ 1888e62f8227SErik Schmauss 1889e62f8227SErik Schmauss struct acpi_table_pdtt { 1890e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 1891e62f8227SErik Schmauss u8 trigger_count; 1892e62f8227SErik Schmauss u8 reserved[3]; 1893e62f8227SErik Schmauss u32 array_offset; 1894e62f8227SErik Schmauss }; 1895e62f8227SErik Schmauss 1896e62f8227SErik Schmauss /* 1897e62f8227SErik Schmauss * PDTT Communication Channel Identifier Structure. 1898e62f8227SErik Schmauss * The number of these structures is defined by trigger_count above, 1899e62f8227SErik Schmauss * starting at array_offset. 1900e62f8227SErik Schmauss */ 1901e62f8227SErik Schmauss struct acpi_pdtt_channel { 1902e62f8227SErik Schmauss u8 subchannel_id; 1903e62f8227SErik Schmauss u8 flags; 1904e62f8227SErik Schmauss }; 1905e62f8227SErik Schmauss 1906e62f8227SErik Schmauss /* Flags for above */ 1907e62f8227SErik Schmauss 1908e62f8227SErik Schmauss #define ACPI_PDTT_RUNTIME_TRIGGER (1) 1909e62f8227SErik Schmauss #define ACPI_PDTT_WAIT_COMPLETION (1<<1) 1910f00175d0SErik Schmauss #define ACPI_PDTT_TRIGGER_ORDER (1<<2) 1911e62f8227SErik Schmauss 1912e62f8227SErik Schmauss /******************************************************************************* 1913e62f8227SErik Schmauss * 19149f400337SErik Kaneda * PHAT - Platform Health Assessment Table (ACPI 6.4) 19159f400337SErik Kaneda * Version 1 19169f400337SErik Kaneda * 19179f400337SErik Kaneda ******************************************************************************/ 19189f400337SErik Kaneda 19199f400337SErik Kaneda struct acpi_table_phat { 19209f400337SErik Kaneda struct acpi_table_header header; /* Common ACPI table header */ 19219f400337SErik Kaneda }; 19229f400337SErik Kaneda 19239f400337SErik Kaneda /* Common header for PHAT subtables that follow main table */ 19249f400337SErik Kaneda 19259f400337SErik Kaneda struct acpi_phat_header { 19269f400337SErik Kaneda u16 type; 19279f400337SErik Kaneda u16 length; 19289f400337SErik Kaneda u8 revision; 19299f400337SErik Kaneda }; 19309f400337SErik Kaneda 19319f400337SErik Kaneda /* Values for Type field above */ 19329f400337SErik Kaneda 19339f400337SErik Kaneda #define ACPI_PHAT_TYPE_FW_VERSION_DATA 0 19349f400337SErik Kaneda #define ACPI_PHAT_TYPE_FW_HEALTH_DATA 1 19359f400337SErik Kaneda #define ACPI_PHAT_TYPE_RESERVED 2 /* 0x02-0xFFFF are reserved */ 19369f400337SErik Kaneda 19379f400337SErik Kaneda /* 19389f400337SErik Kaneda * PHAT subtables, correspond to Type in struct acpi_phat_header 19399f400337SErik Kaneda */ 19409f400337SErik Kaneda 19419f400337SErik Kaneda /* 0: Firmware Version Data Record */ 19429f400337SErik Kaneda 19439f400337SErik Kaneda struct acpi_phat_version_data { 19449f400337SErik Kaneda struct acpi_phat_header header; 19459f400337SErik Kaneda u8 reserved[3]; 19469f400337SErik Kaneda u32 element_count; 19479f400337SErik Kaneda }; 19489f400337SErik Kaneda 19499f400337SErik Kaneda struct acpi_phat_version_element { 19509f400337SErik Kaneda u8 guid[16]; 19519f400337SErik Kaneda u64 version_value; 19529f400337SErik Kaneda u32 producer_id; 19539f400337SErik Kaneda }; 19549f400337SErik Kaneda 19559f400337SErik Kaneda /* 1: Firmware Health Data Record */ 19569f400337SErik Kaneda 19579f400337SErik Kaneda struct acpi_phat_health_data { 19589f400337SErik Kaneda struct acpi_phat_header header; 19599f400337SErik Kaneda u8 reserved[2]; 19609f400337SErik Kaneda u8 health; 19619f400337SErik Kaneda u8 device_guid[16]; 19629f400337SErik Kaneda u32 device_specific_offset; /* Zero if no Device-specific data */ 19639f400337SErik Kaneda }; 19649f400337SErik Kaneda 19659f400337SErik Kaneda /* Values for Health field above */ 19669f400337SErik Kaneda 19679f400337SErik Kaneda #define ACPI_PHAT_ERRORS_FOUND 0 19689f400337SErik Kaneda #define ACPI_PHAT_NO_ERRORS 1 19699f400337SErik Kaneda #define ACPI_PHAT_UNKNOWN_ERRORS 2 19709f400337SErik Kaneda #define ACPI_PHAT_ADVISORY 3 19719f400337SErik Kaneda 19729f400337SErik Kaneda /******************************************************************************* 19739f400337SErik Kaneda * 1974e62f8227SErik Schmauss * PMTT - Platform Memory Topology Table (ACPI 5.0) 1975e62f8227SErik Schmauss * Version 1 1976e62f8227SErik Schmauss * 1977e62f8227SErik Schmauss ******************************************************************************/ 1978e62f8227SErik Schmauss 1979e62f8227SErik Schmauss struct acpi_table_pmtt { 1980e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 1981cca97d42SBob Moore u32 memory_device_count; 1982cca97d42SBob Moore /* 1983cca97d42SBob Moore * Immediately followed by: 1984cca97d42SBob Moore * MEMORY_DEVICE memory_device_struct[memory_device_count]; 1985cca97d42SBob Moore */ 1986e62f8227SErik Schmauss }; 1987e62f8227SErik Schmauss 1988e62f8227SErik Schmauss /* Common header for PMTT subtables that follow main table */ 1989e62f8227SErik Schmauss 1990e62f8227SErik Schmauss struct acpi_pmtt_header { 1991e62f8227SErik Schmauss u8 type; 1992e62f8227SErik Schmauss u8 reserved1; 1993e62f8227SErik Schmauss u16 length; 1994e62f8227SErik Schmauss u16 flags; 1995e62f8227SErik Schmauss u16 reserved2; 1996cca97d42SBob Moore u32 memory_device_count; /* Zero means no memory device structs follow */ 1997cca97d42SBob Moore /* 1998cca97d42SBob Moore * Immediately followed by: 1999cca97d42SBob Moore * u8 type_specific_data[] 2000cca97d42SBob Moore * MEMORY_DEVICE memory_device_struct[memory_device_count]; 2001cca97d42SBob Moore */ 2002e62f8227SErik Schmauss }; 2003e62f8227SErik Schmauss 2004e62f8227SErik Schmauss /* Values for Type field above */ 2005e62f8227SErik Schmauss 2006e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_SOCKET 0 2007e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_CONTROLLER 1 2008e62f8227SErik Schmauss #define ACPI_PMTT_TYPE_DIMM 2 2009cca97d42SBob Moore #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFE are reserved */ 2010cca97d42SBob Moore #define ACPI_PMTT_TYPE_VENDOR 0xFF 2011e62f8227SErik Schmauss 2012e62f8227SErik Schmauss /* Values for Flags field above */ 2013e62f8227SErik Schmauss 2014e62f8227SErik Schmauss #define ACPI_PMTT_TOP_LEVEL 0x0001 2015e62f8227SErik Schmauss #define ACPI_PMTT_PHYSICAL 0x0002 2016e62f8227SErik Schmauss #define ACPI_PMTT_MEMORY_TYPE 0x000C 2017e62f8227SErik Schmauss 2018e62f8227SErik Schmauss /* 2019e62f8227SErik Schmauss * PMTT subtables, correspond to Type in struct acpi_pmtt_header 2020e62f8227SErik Schmauss */ 2021e62f8227SErik Schmauss 2022e62f8227SErik Schmauss /* 0: Socket Structure */ 2023e62f8227SErik Schmauss 2024e62f8227SErik Schmauss struct acpi_pmtt_socket { 2025e62f8227SErik Schmauss struct acpi_pmtt_header header; 2026e62f8227SErik Schmauss u16 socket_id; 2027e62f8227SErik Schmauss u16 reserved; 2028e62f8227SErik Schmauss }; 2029cca97d42SBob Moore /* 2030cca97d42SBob Moore * Immediately followed by: 2031cca97d42SBob Moore * MEMORY_DEVICE memory_device_struct[memory_device_count]; 2032cca97d42SBob Moore */ 2033e62f8227SErik Schmauss 2034e62f8227SErik Schmauss /* 1: Memory Controller subtable */ 2035e62f8227SErik Schmauss 2036e62f8227SErik Schmauss struct acpi_pmtt_controller { 2037e62f8227SErik Schmauss struct acpi_pmtt_header header; 2038cca97d42SBob Moore u16 controller_id; 2039e62f8227SErik Schmauss u16 reserved; 2040e62f8227SErik Schmauss }; 2041cca97d42SBob Moore /* 2042cca97d42SBob Moore * Immediately followed by: 2043cca97d42SBob Moore * MEMORY_DEVICE memory_device_struct[memory_device_count]; 2044cca97d42SBob Moore */ 2045e62f8227SErik Schmauss 2046e62f8227SErik Schmauss /* 2: Physical Component Identifier (DIMM) */ 2047e62f8227SErik Schmauss 2048e62f8227SErik Schmauss struct acpi_pmtt_physical_component { 2049e62f8227SErik Schmauss struct acpi_pmtt_header header; 2050e62f8227SErik Schmauss u32 bios_handle; 2051e62f8227SErik Schmauss }; 2052e62f8227SErik Schmauss 2053cca97d42SBob Moore /* 0xFF: Vendor Specific Data */ 2054cca97d42SBob Moore 2055cca97d42SBob Moore struct acpi_pmtt_vendor_specific { 2056cca97d42SBob Moore struct acpi_pmtt_header header; 2057cca97d42SBob Moore u8 type_uuid[16]; 2058cca97d42SBob Moore u8 specific[]; 2059cca97d42SBob Moore /* 2060cca97d42SBob Moore * Immediately followed by: 2061cca97d42SBob Moore * u8 vendor_specific_data[]; 2062cca97d42SBob Moore * MEMORY_DEVICE memory_device_struct[memory_device_count]; 2063cca97d42SBob Moore */ 2064cca97d42SBob Moore }; 2065cca97d42SBob Moore 2066e62f8227SErik Schmauss /******************************************************************************* 2067e62f8227SErik Schmauss * 2068e62f8227SErik Schmauss * PPTT - Processor Properties Topology Table (ACPI 6.2) 2069e62f8227SErik Schmauss * Version 1 2070e62f8227SErik Schmauss * 2071e62f8227SErik Schmauss ******************************************************************************/ 2072e62f8227SErik Schmauss 2073e62f8227SErik Schmauss struct acpi_table_pptt { 2074e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 2075e62f8227SErik Schmauss }; 2076e62f8227SErik Schmauss 2077e62f8227SErik Schmauss /* Values for Type field above */ 2078e62f8227SErik Schmauss 2079e62f8227SErik Schmauss enum acpi_pptt_type { 2080e62f8227SErik Schmauss ACPI_PPTT_TYPE_PROCESSOR = 0, 2081e62f8227SErik Schmauss ACPI_PPTT_TYPE_CACHE = 1, 2082e62f8227SErik Schmauss ACPI_PPTT_TYPE_ID = 2, 2083e62f8227SErik Schmauss ACPI_PPTT_TYPE_RESERVED = 3 2084e62f8227SErik Schmauss }; 2085e62f8227SErik Schmauss 2086e62f8227SErik Schmauss /* 0: Processor Hierarchy Node Structure */ 2087e62f8227SErik Schmauss 2088e62f8227SErik Schmauss struct acpi_pptt_processor { 2089e62f8227SErik Schmauss struct acpi_subtable_header header; 2090e62f8227SErik Schmauss u16 reserved; 2091e62f8227SErik Schmauss u32 flags; 2092e62f8227SErik Schmauss u32 parent; 2093e62f8227SErik Schmauss u32 acpi_processor_id; 2094e62f8227SErik Schmauss u32 number_of_priv_resources; 2095e62f8227SErik Schmauss }; 2096e62f8227SErik Schmauss 2097e62f8227SErik Schmauss /* Flags */ 2098e62f8227SErik Schmauss 2099b5eab512SErik Schmauss #define ACPI_PPTT_PHYSICAL_PACKAGE (1) 2100b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (1<<1) 2101b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD (1<<2) /* ACPI 6.3 */ 2102b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_LEAF_NODE (1<<3) /* ACPI 6.3 */ 2103b5eab512SErik Schmauss #define ACPI_PPTT_ACPI_IDENTICAL (1<<4) /* ACPI 6.3 */ 2104e62f8227SErik Schmauss 2105e62f8227SErik Schmauss /* 1: Cache Type Structure */ 2106e62f8227SErik Schmauss 2107e62f8227SErik Schmauss struct acpi_pptt_cache { 2108e62f8227SErik Schmauss struct acpi_subtable_header header; 2109e62f8227SErik Schmauss u16 reserved; 2110e62f8227SErik Schmauss u32 flags; 2111e62f8227SErik Schmauss u32 next_level_of_cache; 2112e62f8227SErik Schmauss u32 size; 2113e62f8227SErik Schmauss u32 number_of_sets; 2114e62f8227SErik Schmauss u8 associativity; 2115e62f8227SErik Schmauss u8 attributes; 2116e62f8227SErik Schmauss u16 line_size; 2117e62f8227SErik Schmauss }; 2118e62f8227SErik Schmauss 21195e2e86c0SErik Kaneda /* 1: Cache Type Structure for PPTT version 3 */ 21205e2e86c0SErik Kaneda 21215e2e86c0SErik Kaneda struct acpi_pptt_cache_v1 { 21225e2e86c0SErik Kaneda u32 cache_id; 21235e2e86c0SErik Kaneda }; 21245e2e86c0SErik Kaneda 2125e62f8227SErik Schmauss /* Flags */ 2126e62f8227SErik Schmauss 2127e62f8227SErik Schmauss #define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */ 2128e62f8227SErik Schmauss #define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */ 2129e62f8227SErik Schmauss #define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */ 2130e62f8227SErik Schmauss #define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */ 2131e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */ 2132e62f8227SErik Schmauss #define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */ 2133e62f8227SErik Schmauss #define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */ 21345e2e86c0SErik Kaneda #define ACPI_PPTT_CACHE_ID_VALID (1<<7) /* Cache ID valid */ 2135e62f8227SErik Schmauss 2136e62f8227SErik Schmauss /* Masks for Attributes */ 2137e62f8227SErik Schmauss 2138e62f8227SErik Schmauss #define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */ 2139e62f8227SErik Schmauss #define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */ 2140e62f8227SErik Schmauss #define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */ 2141e62f8227SErik Schmauss 2142e62f8227SErik Schmauss /* Attributes describing cache */ 2143e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read */ 2144e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write */ 2145e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read and write */ 2146e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above */ 2147e62f8227SErik Schmauss 2148e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */ 2149e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */ 2150e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */ 2151e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of above */ 2152e62f8227SErik Schmauss 2153e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */ 2154e62f8227SErik Schmauss #define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */ 2155e62f8227SErik Schmauss 2156e62f8227SErik Schmauss /* 2: ID Structure */ 2157e62f8227SErik Schmauss 2158e62f8227SErik Schmauss struct acpi_pptt_id { 2159e62f8227SErik Schmauss struct acpi_subtable_header header; 2160e62f8227SErik Schmauss u16 reserved; 2161e62f8227SErik Schmauss u32 vendor_id; 2162e62f8227SErik Schmauss u64 level1_id; 2163e62f8227SErik Schmauss u64 level2_id; 2164e62f8227SErik Schmauss u16 major_rev; 2165e62f8227SErik Schmauss u16 minor_rev; 2166e62f8227SErik Schmauss u16 spin_rev; 2167e62f8227SErik Schmauss }; 2168e62f8227SErik Schmauss 2169e62f8227SErik Schmauss /******************************************************************************* 2170e62f8227SErik Schmauss * 2171d71df85aSErik Kaneda * PRMT - Platform Runtime Mechanism Table 2172d71df85aSErik Kaneda * Version 1 2173d71df85aSErik Kaneda * 2174d71df85aSErik Kaneda ******************************************************************************/ 2175d71df85aSErik Kaneda 2176d71df85aSErik Kaneda struct acpi_table_prmt { 2177d71df85aSErik Kaneda struct acpi_table_header header; /* Common ACPI table header */ 2178d71df85aSErik Kaneda }; 2179d71df85aSErik Kaneda 2180d71df85aSErik Kaneda struct acpi_table_prmt_header { 2181d71df85aSErik Kaneda u8 platform_guid[16]; 2182d71df85aSErik Kaneda u32 module_info_offset; 2183d71df85aSErik Kaneda u32 module_info_count; 2184d71df85aSErik Kaneda }; 2185d71df85aSErik Kaneda 21869f8c7baeSErik Kaneda struct acpi_prmt_module_header { 21879f8c7baeSErik Kaneda u16 revision; 21889f8c7baeSErik Kaneda u16 length; 21899f8c7baeSErik Kaneda }; 21909f8c7baeSErik Kaneda 2191d71df85aSErik Kaneda struct acpi_prmt_module_info { 2192d71df85aSErik Kaneda u16 revision; 2193d71df85aSErik Kaneda u16 length; 2194d71df85aSErik Kaneda u8 module_guid[16]; 2195d71df85aSErik Kaneda u16 major_rev; 2196d71df85aSErik Kaneda u16 minor_rev; 2197d71df85aSErik Kaneda u16 handler_info_count; 2198d71df85aSErik Kaneda u32 handler_info_offset; 2199d71df85aSErik Kaneda u64 mmio_list_pointer; 2200d71df85aSErik Kaneda }; 2201d71df85aSErik Kaneda 2202d71df85aSErik Kaneda struct acpi_prmt_handler_info { 2203d71df85aSErik Kaneda u16 revision; 2204d71df85aSErik Kaneda u16 length; 2205d71df85aSErik Kaneda u8 handler_guid[16]; 2206d71df85aSErik Kaneda u64 handler_address; 2207d71df85aSErik Kaneda u64 static_data_buffer_address; 2208d71df85aSErik Kaneda u64 acpi_param_buffer_address; 2209d71df85aSErik Kaneda }; 2210d71df85aSErik Kaneda 2211d71df85aSErik Kaneda /******************************************************************************* 2212d71df85aSErik Kaneda * 2213e62f8227SErik Schmauss * RASF - RAS Feature Table (ACPI 5.0) 2214e62f8227SErik Schmauss * Version 1 2215e62f8227SErik Schmauss * 2216e62f8227SErik Schmauss ******************************************************************************/ 2217e62f8227SErik Schmauss 2218e62f8227SErik Schmauss struct acpi_table_rasf { 2219e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 2220e62f8227SErik Schmauss u8 channel_id[12]; 2221e62f8227SErik Schmauss }; 2222e62f8227SErik Schmauss 2223e62f8227SErik Schmauss /* RASF Platform Communication Channel Shared Memory Region */ 2224e62f8227SErik Schmauss 2225e62f8227SErik Schmauss struct acpi_rasf_shared_memory { 2226e62f8227SErik Schmauss u32 signature; 2227e62f8227SErik Schmauss u16 command; 2228e62f8227SErik Schmauss u16 status; 2229e62f8227SErik Schmauss u16 version; 2230e62f8227SErik Schmauss u8 capabilities[16]; 2231e62f8227SErik Schmauss u8 set_capabilities[16]; 2232e62f8227SErik Schmauss u16 num_parameter_blocks; 2233e62f8227SErik Schmauss u32 set_capabilities_status; 2234e62f8227SErik Schmauss }; 2235e62f8227SErik Schmauss 2236e62f8227SErik Schmauss /* RASF Parameter Block Structure Header */ 2237e62f8227SErik Schmauss 2238e62f8227SErik Schmauss struct acpi_rasf_parameter_block { 2239e62f8227SErik Schmauss u16 type; 2240e62f8227SErik Schmauss u16 version; 2241e62f8227SErik Schmauss u16 length; 2242e62f8227SErik Schmauss }; 2243e62f8227SErik Schmauss 2244e62f8227SErik Schmauss /* RASF Parameter Block Structure for PATROL_SCRUB */ 2245e62f8227SErik Schmauss 2246e62f8227SErik Schmauss struct acpi_rasf_patrol_scrub_parameter { 2247e62f8227SErik Schmauss struct acpi_rasf_parameter_block header; 2248e62f8227SErik Schmauss u16 patrol_scrub_command; 2249e62f8227SErik Schmauss u64 requested_address_range[2]; 2250e62f8227SErik Schmauss u64 actual_address_range[2]; 2251e62f8227SErik Schmauss u16 flags; 2252e62f8227SErik Schmauss u8 requested_speed; 2253e62f8227SErik Schmauss }; 2254e62f8227SErik Schmauss 2255e62f8227SErik Schmauss /* Masks for Flags and Speed fields above */ 2256e62f8227SErik Schmauss 2257e62f8227SErik Schmauss #define ACPI_RASF_SCRUBBER_RUNNING 1 2258e62f8227SErik Schmauss #define ACPI_RASF_SPEED (7<<1) 2259e62f8227SErik Schmauss #define ACPI_RASF_SPEED_SLOW (0<<1) 2260e62f8227SErik Schmauss #define ACPI_RASF_SPEED_MEDIUM (4<<1) 2261e62f8227SErik Schmauss #define ACPI_RASF_SPEED_FAST (7<<1) 2262e62f8227SErik Schmauss 2263e62f8227SErik Schmauss /* Channel Commands */ 2264e62f8227SErik Schmauss 2265e62f8227SErik Schmauss enum acpi_rasf_commands { 2266e62f8227SErik Schmauss ACPI_RASF_EXECUTE_RASF_COMMAND = 1 2267e62f8227SErik Schmauss }; 2268e62f8227SErik Schmauss 2269e62f8227SErik Schmauss /* Platform RAS Capabilities */ 2270e62f8227SErik Schmauss 2271e62f8227SErik Schmauss enum acpi_rasf_capabiliities { 2272e62f8227SErik Schmauss ACPI_HW_PATROL_SCRUB_SUPPORTED = 0, 2273e62f8227SErik Schmauss ACPI_SW_PATROL_SCRUB_EXPOSED = 1 2274e62f8227SErik Schmauss }; 2275e62f8227SErik Schmauss 2276e62f8227SErik Schmauss /* Patrol Scrub Commands */ 2277e62f8227SErik Schmauss 2278e62f8227SErik Schmauss enum acpi_rasf_patrol_scrub_commands { 2279e62f8227SErik Schmauss ACPI_RASF_GET_PATROL_PARAMETERS = 1, 2280e62f8227SErik Schmauss ACPI_RASF_START_PATROL_SCRUBBER = 2, 2281e62f8227SErik Schmauss ACPI_RASF_STOP_PATROL_SCRUBBER = 3 2282e62f8227SErik Schmauss }; 2283e62f8227SErik Schmauss 2284e62f8227SErik Schmauss /* Channel Command flags */ 2285e62f8227SErik Schmauss 2286e62f8227SErik Schmauss #define ACPI_RASF_GENERATE_SCI (1<<15) 2287e62f8227SErik Schmauss 2288e62f8227SErik Schmauss /* Status values */ 2289e62f8227SErik Schmauss 2290e62f8227SErik Schmauss enum acpi_rasf_status { 2291e62f8227SErik Schmauss ACPI_RASF_SUCCESS = 0, 2292e62f8227SErik Schmauss ACPI_RASF_NOT_VALID = 1, 2293e62f8227SErik Schmauss ACPI_RASF_NOT_SUPPORTED = 2, 2294e62f8227SErik Schmauss ACPI_RASF_BUSY = 3, 2295e62f8227SErik Schmauss ACPI_RASF_FAILED = 4, 2296e62f8227SErik Schmauss ACPI_RASF_ABORTED = 5, 2297e62f8227SErik Schmauss ACPI_RASF_INVALID_DATA = 6 2298e62f8227SErik Schmauss }; 2299e62f8227SErik Schmauss 2300e62f8227SErik Schmauss /* Status flags */ 2301e62f8227SErik Schmauss 2302e62f8227SErik Schmauss #define ACPI_RASF_COMMAND_COMPLETE (1) 2303e62f8227SErik Schmauss #define ACPI_RASF_SCI_DOORBELL (1<<1) 2304e62f8227SErik Schmauss #define ACPI_RASF_ERROR (1<<2) 2305e62f8227SErik Schmauss #define ACPI_RASF_STATUS (0x1F<<3) 2306e62f8227SErik Schmauss 2307e62f8227SErik Schmauss /******************************************************************************* 2308e62f8227SErik Schmauss * 2309536e35c9SBob Moore * RGRT - Regulatory Graphics Resource Table 2310536e35c9SBob Moore * Version 1 2311536e35c9SBob Moore * 2312536e35c9SBob Moore * Conforms to "ACPI RGRT" available at: 2313536e35c9SBob Moore * https://microsoft.github.io/mu/dyn/mu_plus/ms_core_pkg/acpi_RGRT/feature_acpi_rgrt/ 2314536e35c9SBob Moore * 2315536e35c9SBob Moore ******************************************************************************/ 2316536e35c9SBob Moore 2317536e35c9SBob Moore struct acpi_table_rgrt { 2318536e35c9SBob Moore struct acpi_table_header header; /* Common ACPI table header */ 2319536e35c9SBob Moore u16 version; 2320536e35c9SBob Moore u8 image_type; 2321536e35c9SBob Moore u8 reserved; 2322536e35c9SBob Moore u8 image[0]; 2323536e35c9SBob Moore }; 2324536e35c9SBob Moore 2325536e35c9SBob Moore /* image_type values */ 2326536e35c9SBob Moore 2327536e35c9SBob Moore enum acpi_rgrt_image_type { 2328536e35c9SBob Moore ACPI_RGRT_TYPE_RESERVED0 = 0, 2329536e35c9SBob Moore ACPI_RGRT_IMAGE_TYPE_PNG = 1, 2330536e35c9SBob Moore ACPI_RGRT_TYPE_RESERVED = 2 /* 2 and greater are reserved */ 2331536e35c9SBob Moore }; 2332536e35c9SBob Moore 2333536e35c9SBob Moore /******************************************************************************* 2334536e35c9SBob Moore * 2335e62f8227SErik Schmauss * SBST - Smart Battery Specification Table 2336e62f8227SErik Schmauss * Version 1 2337e62f8227SErik Schmauss * 2338e62f8227SErik Schmauss ******************************************************************************/ 2339e62f8227SErik Schmauss 2340e62f8227SErik Schmauss struct acpi_table_sbst { 2341e62f8227SErik Schmauss struct acpi_table_header header; /* Common ACPI table header */ 2342e62f8227SErik Schmauss u32 warning_level; 2343e62f8227SErik Schmauss u32 low_level; 2344e62f8227SErik Schmauss u32 critical_level; 2345e62f8227SErik Schmauss }; 2346e62f8227SErik Schmauss 2347e62f8227SErik Schmauss /******************************************************************************* 2348e62f8227SErik Schmauss * 23493bd38469SJames Morse * SDEI - Software Delegated Exception Interface Descriptor Table 23503bd38469SJames Morse * 23513bd38469SJames Morse * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A, 23523bd38469SJames Morse * May 8th, 2017. Copyright 2017 ARM Ltd. 23533bd38469SJames Morse * 23543bd38469SJames Morse ******************************************************************************/ 23553bd38469SJames Morse 23563bd38469SJames Morse struct acpi_table_sdei { 23573bd38469SJames Morse struct acpi_table_header header; /* Common ACPI table header */ 23583bd38469SJames Morse }; 23593bd38469SJames Morse 23603bd38469SJames Morse /******************************************************************************* 23613bd38469SJames Morse * 2362e62f8227SErik Schmauss * SDEV - Secure Devices Table (ACPI 6.2) 2363e62f8227SErik Schmauss * Version 1 23645cf4d733SBob Moore * 23655cf4d733SBob Moore ******************************************************************************/ 23665cf4d733SBob Moore 2367e62f8227SErik Schmauss struct acpi_table_sdev { 23685cf4d733SBob Moore struct acpi_table_header header; /* Common ACPI table header */ 23695cf4d733SBob Moore }; 23705cf4d733SBob Moore 2371e62f8227SErik Schmauss struct acpi_sdev_header { 2372e62f8227SErik Schmauss u8 type; 2373e62f8227SErik Schmauss u8 flags; 2374e62f8227SErik Schmauss u16 length; 2375b24aad44SBob Moore }; 2376b24aad44SBob Moore 2377e62f8227SErik Schmauss /* Values for subtable type above */ 23786e2d5ebdSBob Moore 2379e62f8227SErik Schmauss enum acpi_sdev_type { 2380e62f8227SErik Schmauss ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0, 2381e62f8227SErik Schmauss ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1, 2382e62f8227SErik Schmauss ACPI_SDEV_TYPE_RESERVED = 2 /* 2 and greater are reserved */ 23836e2d5ebdSBob Moore }; 23846e2d5ebdSBob Moore 2385e62f8227SErik Schmauss /* Values for flags above */ 23866e2d5ebdSBob Moore 2387e62f8227SErik Schmauss #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1) 238814012d2fSErik Kaneda #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1) 238915a61aa1SBob Moore 239015a61aa1SBob Moore /* 2391e62f8227SErik Schmauss * SDEV subtables 239215a61aa1SBob Moore */ 239315a61aa1SBob Moore 2394e62f8227SErik Schmauss /* 0: Namespace Device Based Secure Device Structure */ 2395e62f8227SErik Schmauss 2396e62f8227SErik Schmauss struct acpi_sdev_namespace { 2397e62f8227SErik Schmauss struct acpi_sdev_header header; 2398e62f8227SErik Schmauss u16 device_id_offset; 2399e62f8227SErik Schmauss u16 device_id_length; 2400e62f8227SErik Schmauss u16 vendor_data_offset; 2401e62f8227SErik Schmauss u16 vendor_data_length; 2402b24aad44SBob Moore }; 2403b24aad44SBob Moore 240414012d2fSErik Kaneda struct acpi_sdev_secure_component { 240514012d2fSErik Kaneda u16 secure_component_offset; 240614012d2fSErik Kaneda u16 secure_component_length; 240714012d2fSErik Kaneda }; 240814012d2fSErik Kaneda 240914012d2fSErik Kaneda /* 241014012d2fSErik Kaneda * SDEV sub-subtables ("Components") for above 241114012d2fSErik Kaneda */ 241214012d2fSErik Kaneda struct acpi_sdev_component { 241314012d2fSErik Kaneda struct acpi_sdev_header header; 241414012d2fSErik Kaneda }; 241514012d2fSErik Kaneda 241614012d2fSErik Kaneda /* Values for sub-subtable type above */ 241714012d2fSErik Kaneda 241814012d2fSErik Kaneda enum acpi_sac_type { 241914012d2fSErik Kaneda ACPI_SDEV_TYPE_ID_COMPONENT = 0, 242014012d2fSErik Kaneda ACPI_SDEV_TYPE_MEM_COMPONENT = 1 242114012d2fSErik Kaneda }; 242214012d2fSErik Kaneda 242314012d2fSErik Kaneda struct acpi_sdev_id_component { 242414012d2fSErik Kaneda struct acpi_sdev_header header; 242514012d2fSErik Kaneda u16 hardware_id_offset; 242614012d2fSErik Kaneda u16 hardware_id_length; 242714012d2fSErik Kaneda u16 subsystem_id_offset; 242814012d2fSErik Kaneda u16 subsystem_id_length; 242914012d2fSErik Kaneda u16 hardware_revision; 243014012d2fSErik Kaneda u8 hardware_rev_present; 243114012d2fSErik Kaneda u8 class_code_present; 243214012d2fSErik Kaneda u8 pci_base_class; 243314012d2fSErik Kaneda u8 pci_sub_class; 243414012d2fSErik Kaneda u8 pci_programming_xface; 243514012d2fSErik Kaneda }; 243614012d2fSErik Kaneda 243714012d2fSErik Kaneda struct acpi_sdev_mem_component { 243814012d2fSErik Kaneda struct acpi_sdev_header header; 243914012d2fSErik Kaneda u32 reserved; 244014012d2fSErik Kaneda u64 memory_base_address; 244114012d2fSErik Kaneda u64 memory_length; 244214012d2fSErik Kaneda }; 244314012d2fSErik Kaneda 2444e62f8227SErik Schmauss /* 1: PCIe Endpoint Device Based Device Structure */ 2445e62f8227SErik Schmauss 2446e62f8227SErik Schmauss struct acpi_sdev_pcie { 2447e62f8227SErik Schmauss struct acpi_sdev_header header; 2448e62f8227SErik Schmauss u16 segment; 2449e62f8227SErik Schmauss u16 start_bus; 2450e62f8227SErik Schmauss u16 path_offset; 2451e62f8227SErik Schmauss u16 path_length; 2452e62f8227SErik Schmauss u16 vendor_data_offset; 2453e62f8227SErik Schmauss u16 vendor_data_length; 2454e62f8227SErik Schmauss }; 2455e62f8227SErik Schmauss 2456e62f8227SErik Schmauss /* 1a: PCIe Endpoint path entry */ 2457e62f8227SErik Schmauss 2458e62f8227SErik Schmauss struct acpi_sdev_pcie_path { 24599005694eSBob Moore u8 device; 24609005694eSBob Moore u8 function; 24619005694eSBob Moore }; 24629005694eSBob Moore 24638288f69eSKuppuswamy Sathyanarayanan /******************************************************************************* 24648288f69eSKuppuswamy Sathyanarayanan * 24658288f69eSKuppuswamy Sathyanarayanan * SVKL - Storage Volume Key Location Table (ACPI 6.4) 24666496f03eSBob Moore * From: "Guest-Host-Communication Interface (GHCI) for Intel 24676496f03eSBob Moore * Trust Domain Extensions (Intel TDX)". 24688288f69eSKuppuswamy Sathyanarayanan * Version 1 24698288f69eSKuppuswamy Sathyanarayanan * 24708288f69eSKuppuswamy Sathyanarayanan ******************************************************************************/ 24718288f69eSKuppuswamy Sathyanarayanan 24728288f69eSKuppuswamy Sathyanarayanan struct acpi_table_svkl { 24738288f69eSKuppuswamy Sathyanarayanan struct acpi_table_header header; /* Common ACPI table header */ 24748288f69eSKuppuswamy Sathyanarayanan u32 count; 24758288f69eSKuppuswamy Sathyanarayanan }; 24768288f69eSKuppuswamy Sathyanarayanan 24776496f03eSBob Moore struct acpi_svkl_key { 24788288f69eSKuppuswamy Sathyanarayanan u16 type; 24798288f69eSKuppuswamy Sathyanarayanan u16 format; 24808288f69eSKuppuswamy Sathyanarayanan u32 size; 24818288f69eSKuppuswamy Sathyanarayanan u64 address; 24828288f69eSKuppuswamy Sathyanarayanan }; 24838288f69eSKuppuswamy Sathyanarayanan 24848288f69eSKuppuswamy Sathyanarayanan enum acpi_svkl_type { 24858288f69eSKuppuswamy Sathyanarayanan ACPI_SVKL_TYPE_MAIN_STORAGE = 0, 24868288f69eSKuppuswamy Sathyanarayanan ACPI_SVKL_TYPE_RESERVED = 1 /* 1 and greater are reserved */ 24878288f69eSKuppuswamy Sathyanarayanan }; 24888288f69eSKuppuswamy Sathyanarayanan 24898288f69eSKuppuswamy Sathyanarayanan enum acpi_svkl_format { 24908288f69eSKuppuswamy Sathyanarayanan ACPI_SVKL_FORMAT_RAW_BINARY = 0, 24918288f69eSKuppuswamy Sathyanarayanan ACPI_SVKL_FORMAT_RESERVED = 1 /* 1 and greater are reserved */ 24928288f69eSKuppuswamy Sathyanarayanan }; 24938288f69eSKuppuswamy Sathyanarayanan 24942de6bb92SBob Moore /******************************************************************************* 24952de6bb92SBob Moore * 24962de6bb92SBob Moore * TDEL - TD-Event Log 24972de6bb92SBob Moore * From: "Guest-Host-Communication Interface (GHCI) for Intel 24982de6bb92SBob Moore * Trust Domain Extensions (Intel TDX)". 24992de6bb92SBob Moore * September 2020 25002de6bb92SBob Moore * 25012de6bb92SBob Moore ******************************************************************************/ 25022de6bb92SBob Moore 25032de6bb92SBob Moore struct acpi_table_tdel { 25042de6bb92SBob Moore struct acpi_table_header header; /* Common ACPI table header */ 25052de6bb92SBob Moore u32 reserved; 25062de6bb92SBob Moore u64 log_area_minimum_length; 25072de6bb92SBob Moore u64 log_area_start_address; 25082de6bb92SBob Moore }; 25092de6bb92SBob Moore 25106e596084SRobert Moore /* Reset to default packing */ 25116e596084SRobert Moore 25126e596084SRobert Moore #pragma pack() 2513b24aad44SBob Moore 2514b24aad44SBob Moore #endif /* __ACTBL2_H__ */ 2515