Home | History | Annotate | Line # | Download | only in include
actbl2.h revision 1.1.1.22
      1       1.1    jruoho /******************************************************************************
      2       1.1    jruoho  *
      3   1.1.1.3    jruoho  * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
      4       1.1    jruoho  *
      5       1.1    jruoho  *****************************************************************************/
      6       1.1    jruoho 
      7   1.1.1.2    jruoho /*
      8  1.1.1.22  christos  * Copyright (C) 2000 - 2022, Intel Corp.
      9       1.1    jruoho  * All rights reserved.
     10       1.1    jruoho  *
     11   1.1.1.2    jruoho  * Redistribution and use in source and binary forms, with or without
     12   1.1.1.2    jruoho  * modification, are permitted provided that the following conditions
     13   1.1.1.2    jruoho  * are met:
     14   1.1.1.2    jruoho  * 1. Redistributions of source code must retain the above copyright
     15   1.1.1.2    jruoho  *    notice, this list of conditions, and the following disclaimer,
     16   1.1.1.2    jruoho  *    without modification.
     17   1.1.1.2    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18   1.1.1.2    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19   1.1.1.2    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20   1.1.1.2    jruoho  *    including a substantially similar Disclaimer requirement for further
     21   1.1.1.2    jruoho  *    binary redistribution.
     22   1.1.1.2    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23   1.1.1.2    jruoho  *    of any contributors may be used to endorse or promote products derived
     24   1.1.1.2    jruoho  *    from this software without specific prior written permission.
     25   1.1.1.2    jruoho  *
     26   1.1.1.2    jruoho  * Alternatively, this software may be distributed under the terms of the
     27   1.1.1.2    jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28   1.1.1.2    jruoho  * Software Foundation.
     29   1.1.1.2    jruoho  *
     30   1.1.1.2    jruoho  * NO WARRANTY
     31   1.1.1.2    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32   1.1.1.2    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33  1.1.1.18  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     34   1.1.1.2    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35   1.1.1.2    jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36   1.1.1.2    jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37   1.1.1.2    jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38   1.1.1.2    jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39   1.1.1.2    jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40   1.1.1.2    jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41   1.1.1.2    jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42   1.1.1.2    jruoho  */
     43       1.1    jruoho 
     44       1.1    jruoho #ifndef __ACTBL2_H__
     45       1.1    jruoho #define __ACTBL2_H__
     46       1.1    jruoho 
     47       1.1    jruoho 
     48       1.1    jruoho /*******************************************************************************
     49       1.1    jruoho  *
     50       1.1    jruoho  * Additional ACPI Tables (2)
     51       1.1    jruoho  *
     52       1.1    jruoho  * These tables are not consumed directly by the ACPICA subsystem, but are
     53       1.1    jruoho  * included here to support device drivers and the AML disassembler.
     54       1.1    jruoho  *
     55       1.1    jruoho  ******************************************************************************/
     56       1.1    jruoho 
     57       1.1    jruoho 
     58       1.1    jruoho /*
     59       1.1    jruoho  * Values for description table header signatures for tables defined in this
     60       1.1    jruoho  * file. Useful because they make it more difficult to inadvertently type in
     61       1.1    jruoho  * the wrong signature.
     62       1.1    jruoho  */
     63  1.1.1.21  christos #define ACPI_SIG_AGDI           "AGDI"      /* Arm Generic Diagnostic Dump and Reset Device Interface */
     64  1.1.1.22  christos #define ACPI_SIG_APMT           "APMT"      /* Arm Performance Monitoring Unit table */
     65  1.1.1.19  christos #define ACPI_SIG_BDAT           "BDAT"      /* BIOS Data ACPI Table */
     66   1.1.1.7  christos #define ACPI_SIG_IORT           "IORT"      /* IO Remapping Table */
     67       1.1    jruoho #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
     68   1.1.1.5  christos #define ACPI_SIG_LPIT           "LPIT"      /* Low Power Idle Table */
     69  1.1.1.14  christos #define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
     70       1.1    jruoho #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
     71       1.1    jruoho #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
     72  1.1.1.14  christos #define ACPI_SIG_MPST           "MPST"      /* Memory Power State Table */
     73  1.1.1.14  christos #define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
     74   1.1.1.6  christos #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
     75  1.1.1.14  christos #define ACPI_SIG_NFIT           "NFIT"      /* NVDIMM Firmware Interface Table */
     76  1.1.1.20  christos #define ACPI_SIG_NHLT           "NHLT"      /* Non HD Audio Link Table */
     77  1.1.1.14  christos #define ACPI_SIG_PCCT           "PCCT"      /* Platform Communications Channel Table */
     78  1.1.1.14  christos #define ACPI_SIG_PDTT           "PDTT"      /* Platform Debug Trigger Table */
     79  1.1.1.18  christos #define ACPI_SIG_PHAT           "PHAT"      /* Platform Health Assessment Table */
     80  1.1.1.14  christos #define ACPI_SIG_PMTT           "PMTT"      /* Platform Memory Topology Table */
     81  1.1.1.14  christos #define ACPI_SIG_PPTT           "PPTT"      /* Processor Properties Topology Table */
     82  1.1.1.19  christos #define ACPI_SIG_PRMT           "PRMT"      /* Platform Runtime Mechanism Table */
     83  1.1.1.14  christos #define ACPI_SIG_RASF           "RASF"      /* RAS Feature table */
     84  1.1.1.19  christos #define ACPI_SIG_RGRT           "RGRT"      /* Regulatory Graphics Resource Table */
     85  1.1.1.14  christos #define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
     86  1.1.1.12  christos #define ACPI_SIG_SDEI           "SDEI"      /* Software Delegated Exception Interface Table */
     87  1.1.1.14  christos #define ACPI_SIG_SDEV           "SDEV"      /* Secure Devices table */
     88  1.1.1.19  christos #define ACPI_SIG_SVKL           "SVKL"      /* Storage Volume Key Location Table */
     89  1.1.1.21  christos #define ACPI_SIG_TDEL           "TDEL"      /* TD Event Log Table */
     90       1.1    jruoho 
     91       1.1    jruoho 
     92       1.1    jruoho /*
     93       1.1    jruoho  * All tables must be byte-packed to match the ACPI specification, since
     94       1.1    jruoho  * the tables are provided by the system BIOS.
     95       1.1    jruoho  */
     96       1.1    jruoho #pragma pack(1)
     97       1.1    jruoho 
     98       1.1    jruoho /*
     99   1.1.1.4  christos  * Note: C bitfields are not used for this reason:
    100   1.1.1.4  christos  *
    101   1.1.1.4  christos  * "Bitfields are great and easy to read, but unfortunately the C language
    102   1.1.1.4  christos  * does not specify the layout of bitfields in memory, which means they are
    103   1.1.1.4  christos  * essentially useless for dealing with packed data in on-disk formats or
    104   1.1.1.4  christos  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
    105   1.1.1.4  christos  * this decision was a design error in C. Ritchie could have picked an order
    106   1.1.1.4  christos  * and stuck with it." Norman Ramsey.
    107   1.1.1.4  christos  * See http://stackoverflow.com/a/1053662/41661
    108       1.1    jruoho  */
    109       1.1    jruoho 
    110       1.1    jruoho 
    111       1.1    jruoho /*******************************************************************************
    112       1.1    jruoho  *
    113  1.1.1.20  christos  * AEST - Arm Error Source Table
    114  1.1.1.20  christos  *
    115  1.1.1.20  christos  * Conforms to: ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document
    116  1.1.1.20  christos  * September 2020.
    117  1.1.1.20  christos  *
    118  1.1.1.20  christos  ******************************************************************************/
    119  1.1.1.20  christos 
    120  1.1.1.20  christos typedef struct acpi_table_aest
    121  1.1.1.20  christos {
    122  1.1.1.20  christos     ACPI_TABLE_HEADER       Header;
    123  1.1.1.20  christos     void                    *NodeArray[];
    124  1.1.1.20  christos 
    125  1.1.1.20  christos } ACPI_TABLE_AEST;
    126  1.1.1.20  christos 
    127  1.1.1.20  christos /* Common Subtable header - one per Node Structure (Subtable) */
    128  1.1.1.20  christos 
    129  1.1.1.20  christos typedef struct              acpi_aest_hdr
    130  1.1.1.20  christos {
    131  1.1.1.20  christos     UINT8                   Type;
    132  1.1.1.20  christos     UINT16                  Length;
    133  1.1.1.20  christos     UINT8                   Reserved;
    134  1.1.1.20  christos     UINT32                  NodeSpecificOffset;
    135  1.1.1.20  christos     UINT32                  NodeInterfaceOffset;
    136  1.1.1.20  christos     UINT32                  NodeInterruptOffset;
    137  1.1.1.20  christos     UINT32                  NodeInterruptCount;
    138  1.1.1.20  christos     UINT64                  TimestampRate;
    139  1.1.1.20  christos     UINT64                  Reserved1;
    140  1.1.1.20  christos     UINT64                  ErrorInjectionRate;
    141  1.1.1.20  christos 
    142  1.1.1.20  christos } ACPI_AEST_HEADER;
    143  1.1.1.20  christos 
    144  1.1.1.20  christos /* Values for Type above */
    145  1.1.1.20  christos 
    146  1.1.1.20  christos #define ACPI_AEST_PROCESSOR_ERROR_NODE      0
    147  1.1.1.20  christos #define ACPI_AEST_MEMORY_ERROR_NODE         1
    148  1.1.1.20  christos #define ACPI_AEST_SMMU_ERROR_NODE           2
    149  1.1.1.20  christos #define ACPI_AEST_VENDOR_ERROR_NODE         3
    150  1.1.1.20  christos #define ACPI_AEST_GIC_ERROR_NODE            4
    151  1.1.1.20  christos #define ACPI_AEST_NODE_TYPE_RESERVED        5 /* 5 and above are reserved */
    152  1.1.1.20  christos 
    153  1.1.1.20  christos 
    154  1.1.1.20  christos /*
    155  1.1.1.20  christos  * AEST subtables (Error nodes)
    156  1.1.1.20  christos  */
    157  1.1.1.20  christos 
    158  1.1.1.20  christos /* 0: Processor Error */
    159  1.1.1.20  christos 
    160  1.1.1.20  christos typedef struct              acpi_aest_processor
    161  1.1.1.20  christos {
    162  1.1.1.20  christos     UINT32                  ProcessorId;
    163  1.1.1.20  christos     UINT8                   ResourceType;
    164  1.1.1.20  christos     UINT8                   Reserved;
    165  1.1.1.20  christos     UINT8                   Flags;
    166  1.1.1.20  christos     UINT8                   Revision;
    167  1.1.1.20  christos     UINT64                  ProcessorAffinity;
    168  1.1.1.20  christos 
    169  1.1.1.20  christos } ACPI_AEST_PROCESSOR;
    170  1.1.1.20  christos 
    171  1.1.1.20  christos /* Values for ResourceType above, related structs below */
    172  1.1.1.20  christos 
    173  1.1.1.20  christos #define ACPI_AEST_CACHE_RESOURCE            0
    174  1.1.1.20  christos #define ACPI_AEST_TLB_RESOURCE              1
    175  1.1.1.20  christos #define ACPI_AEST_GENERIC_RESOURCE          2
    176  1.1.1.20  christos #define ACPI_AEST_RESOURCE_RESERVED         3   /* 3 and above are reserved */
    177  1.1.1.20  christos 
    178  1.1.1.20  christos /* 0R: Processor Cache Resource Substructure */
    179  1.1.1.20  christos 
    180  1.1.1.20  christos typedef struct              acpi_aest_processor_cache
    181  1.1.1.20  christos {
    182  1.1.1.20  christos     UINT32                  CacheReference;
    183  1.1.1.20  christos     UINT32                  Reserved;
    184  1.1.1.20  christos 
    185  1.1.1.20  christos } ACPI_AEST_PROCESSOR_CACHE;
    186  1.1.1.20  christos 
    187  1.1.1.20  christos /* Values for CacheType above */
    188  1.1.1.20  christos 
    189  1.1.1.20  christos #define ACPI_AEST_CACHE_DATA                0
    190  1.1.1.20  christos #define ACPI_AEST_CACHE_INSTRUCTION         1
    191  1.1.1.20  christos #define ACPI_AEST_CACHE_UNIFIED             2
    192  1.1.1.20  christos #define ACPI_AEST_CACHE_RESERVED            3   /* 3 and above are reserved */
    193  1.1.1.20  christos 
    194  1.1.1.20  christos /* 1R: Processor TLB Resource Substructure */
    195  1.1.1.20  christos 
    196  1.1.1.20  christos typedef struct              acpi_aest_processor_tlb
    197  1.1.1.20  christos {
    198  1.1.1.20  christos     UINT32                  TlbLevel;
    199  1.1.1.20  christos     UINT32                  Reserved;
    200  1.1.1.20  christos 
    201  1.1.1.20  christos } ACPI_AEST_PROCESSOR_TLB;
    202  1.1.1.20  christos 
    203  1.1.1.20  christos /* 2R: Processor Generic Resource Substructure */
    204  1.1.1.20  christos 
    205  1.1.1.20  christos typedef struct              acpi_aest_processor_generic
    206  1.1.1.20  christos {
    207  1.1.1.21  christos     UINT32                   Resource;
    208  1.1.1.20  christos 
    209  1.1.1.20  christos } ACPI_AEST_PROCESSOR_GENERIC;
    210  1.1.1.20  christos 
    211  1.1.1.20  christos /* 1: Memory Error */
    212  1.1.1.20  christos 
    213  1.1.1.20  christos typedef struct              acpi_aest_memory
    214  1.1.1.20  christos {
    215  1.1.1.20  christos     UINT32                  SratProximityDomain;
    216  1.1.1.20  christos 
    217  1.1.1.20  christos } ACPI_AEST_MEMORY;
    218  1.1.1.20  christos 
    219  1.1.1.20  christos /* 2: Smmu Error */
    220  1.1.1.20  christos 
    221  1.1.1.20  christos typedef struct              acpi_aest_smmu
    222  1.1.1.20  christos {
    223  1.1.1.20  christos     UINT32                  IortNodeReference;
    224  1.1.1.20  christos     UINT32                  SubcomponentReference;
    225  1.1.1.20  christos 
    226  1.1.1.20  christos } ACPI_AEST_SMMU;
    227  1.1.1.20  christos 
    228  1.1.1.20  christos /* 3: Vendor Defined */
    229  1.1.1.20  christos 
    230  1.1.1.20  christos typedef struct              acpi_aest_vendor
    231  1.1.1.20  christos {
    232  1.1.1.20  christos     UINT32                  AcpiHid;
    233  1.1.1.20  christos     UINT32                  AcpiUid;
    234  1.1.1.20  christos     UINT8                   VendorSpecificData[16];
    235  1.1.1.20  christos 
    236  1.1.1.20  christos } ACPI_AEST_VENDOR;
    237  1.1.1.20  christos 
    238  1.1.1.20  christos /* 4: Gic Error */
    239  1.1.1.20  christos 
    240  1.1.1.20  christos typedef struct              acpi_aest_gic
    241  1.1.1.20  christos {
    242  1.1.1.20  christos     UINT32                  InterfaceType;
    243  1.1.1.20  christos     UINT32                  InstanceId;
    244  1.1.1.20  christos 
    245  1.1.1.20  christos } ACPI_AEST_GIC;
    246  1.1.1.20  christos 
    247  1.1.1.20  christos /* Values for InterfaceType above */
    248  1.1.1.20  christos 
    249  1.1.1.20  christos #define ACPI_AEST_GIC_CPU                   0
    250  1.1.1.20  christos #define ACPI_AEST_GIC_DISTRIBUTOR           1
    251  1.1.1.20  christos #define ACPI_AEST_GIC_REDISTRIBUTOR         2
    252  1.1.1.20  christos #define ACPI_AEST_GIC_ITS                   3
    253  1.1.1.20  christos #define ACPI_AEST_GIC_RESERVED              4   /* 4 and above are reserved */
    254  1.1.1.20  christos 
    255  1.1.1.20  christos 
    256  1.1.1.20  christos /* Node Interface Structure */
    257  1.1.1.20  christos 
    258  1.1.1.20  christos typedef struct              acpi_aest_node_interface
    259  1.1.1.20  christos {
    260  1.1.1.20  christos     UINT8                   Type;
    261  1.1.1.20  christos     UINT8                   Reserved[3];
    262  1.1.1.20  christos     UINT32                  Flags;
    263  1.1.1.20  christos     UINT64                  Address;
    264  1.1.1.20  christos     UINT32                  ErrorRecordIndex;
    265  1.1.1.20  christos     UINT32                  ErrorRecordCount;
    266  1.1.1.20  christos     UINT64                  ErrorRecordImplemented;
    267  1.1.1.20  christos     UINT64                  ErrorStatusReporting;
    268  1.1.1.20  christos     UINT64                  AddressingMode;
    269  1.1.1.20  christos 
    270  1.1.1.20  christos } ACPI_AEST_NODE_INTERFACE;
    271  1.1.1.20  christos 
    272  1.1.1.20  christos /* Values for Type field above */
    273  1.1.1.20  christos 
    274  1.1.1.20  christos #define ACPI_AEST_NODE_SYSTEM_REGISTER      0
    275  1.1.1.20  christos #define ACPI_AEST_NODE_MEMORY_MAPPED        1
    276  1.1.1.20  christos #define ACPI_AEST_XFACE_RESERVED            2   /* 2 and above are reserved */
    277  1.1.1.20  christos 
    278  1.1.1.20  christos /* Node Interrupt Structure */
    279  1.1.1.20  christos 
    280  1.1.1.20  christos typedef struct              acpi_aest_node_interrupt
    281  1.1.1.20  christos {
    282  1.1.1.20  christos     UINT8                   Type;
    283  1.1.1.20  christos     UINT8                   Reserved[2];
    284  1.1.1.20  christos     UINT8                   Flags;
    285  1.1.1.20  christos     UINT32                  Gsiv;
    286  1.1.1.20  christos     UINT8                   IortId;
    287  1.1.1.20  christos     UINT8                   Reserved1[3];
    288  1.1.1.20  christos 
    289  1.1.1.20  christos } ACPI_AEST_NODE_INTERRUPT;
    290  1.1.1.20  christos 
    291  1.1.1.20  christos /* Values for Type field above */
    292  1.1.1.20  christos 
    293  1.1.1.20  christos #define ACPI_AEST_NODE_FAULT_HANDLING       0
    294  1.1.1.20  christos #define ACPI_AEST_NODE_ERROR_RECOVERY       1
    295  1.1.1.20  christos #define ACPI_AEST_XRUPT_RESERVED            2   /* 2 and above are reserved */
    296  1.1.1.20  christos 
    297  1.1.1.20  christos 
    298  1.1.1.20  christos /*******************************************************************************
    299  1.1.1.21  christos  * AGDI - Arm Generic Diagnostic Dump and Reset Device Interface
    300  1.1.1.21  christos  *
    301  1.1.1.21  christos  * Conforms to "ACPI for Arm Components 1.1, Platform Design Document"
    302  1.1.1.21  christos  * ARM DEN0093 v1.1
    303  1.1.1.21  christos  *
    304  1.1.1.21  christos  ******************************************************************************/
    305  1.1.1.21  christos typedef struct acpi_table_agdi
    306  1.1.1.21  christos {
    307  1.1.1.21  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    308  1.1.1.21  christos     UINT8                   Flags;
    309  1.1.1.21  christos     UINT8                   Reserved[3];
    310  1.1.1.21  christos     UINT32                  SdeiEvent;
    311  1.1.1.21  christos     UINT32                  Gsiv;
    312  1.1.1.21  christos 
    313  1.1.1.21  christos } ACPI_TABLE_AGDI;
    314  1.1.1.21  christos 
    315  1.1.1.21  christos /* Mask for Flags field above */
    316  1.1.1.21  christos 
    317  1.1.1.21  christos #define ACPI_AGDI_SIGNALING_MODE (1)
    318  1.1.1.21  christos 
    319  1.1.1.21  christos 
    320  1.1.1.21  christos /*******************************************************************************
    321  1.1.1.20  christos  *
    322  1.1.1.22  christos  * APMT - ARM Performance Monitoring Unit Table
    323  1.1.1.22  christos  *
    324  1.1.1.22  christos  * Conforms to:
    325  1.1.1.22  christos  * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document
    326  1.1.1.22  christos  * ARM DEN0117 v1.0 November 25, 2021
    327  1.1.1.22  christos  *
    328  1.1.1.22  christos  ******************************************************************************/
    329  1.1.1.22  christos 
    330  1.1.1.22  christos typedef struct acpi_table_apmt {
    331  1.1.1.22  christos     ACPI_TABLE_HEADER Header;    /* Common ACPI table header */
    332  1.1.1.22  christos } ACPI_TABLE_APMT;
    333  1.1.1.22  christos 
    334  1.1.1.22  christos #define ACPI_APMT_NODE_ID_LENGTH                4
    335  1.1.1.22  christos 
    336  1.1.1.22  christos /*
    337  1.1.1.22  christos  * APMT subtables
    338  1.1.1.22  christos  */
    339  1.1.1.22  christos typedef struct acpi_apmt_node {
    340  1.1.1.22  christos     UINT16                       Length;
    341  1.1.1.22  christos     UINT8                        Flags;
    342  1.1.1.22  christos     UINT8                        Type;
    343  1.1.1.22  christos     UINT32                       Id;
    344  1.1.1.22  christos     UINT64                       InstPrimary;
    345  1.1.1.22  christos     UINT32                       InstSecondary;
    346  1.1.1.22  christos     UINT64                       BaseAddress0;
    347  1.1.1.22  christos     UINT64                       BaseAddress1;
    348  1.1.1.22  christos     UINT32                       OvflwIrq;
    349  1.1.1.22  christos     UINT32                       Reserved;
    350  1.1.1.22  christos     UINT32                       OvflwIrqFlags;
    351  1.1.1.22  christos     UINT32                       ProcAffinity;
    352  1.1.1.22  christos     UINT32                       ImplId;
    353  1.1.1.22  christos } ACPI_APMT_NODE;
    354  1.1.1.22  christos 
    355  1.1.1.22  christos /* Masks for Flags field above */
    356  1.1.1.22  christos 
    357  1.1.1.22  christos #define ACPI_APMT_FLAGS_DUAL_PAGE               (1<<0)
    358  1.1.1.22  christos #define ACPI_APMT_FLAGS_AFFINITY                (1<<1)
    359  1.1.1.22  christos #define ACPI_APMT_FLAGS_ATOMIC                  (1<<2)
    360  1.1.1.22  christos 
    361  1.1.1.22  christos /* Values for Flags dual page field above */
    362  1.1.1.22  christos 
    363  1.1.1.22  christos #define ACPI_APMT_FLAGS_DUAL_PAGE_NSUPP         (0<<0)
    364  1.1.1.22  christos #define ACPI_APMT_FLAGS_DUAL_PAGE_SUPP          (1<<0)
    365  1.1.1.22  christos 
    366  1.1.1.22  christos /* Values for Flags processor affinity field above */
    367  1.1.1.22  christos #define ACPI_APMT_FLAGS_AFFINITY_PROC           (0<<1)
    368  1.1.1.22  christos #define ACPI_APMT_FLAGS_AFFINITY_PROC_CONTAINER (1<<1)
    369  1.1.1.22  christos 
    370  1.1.1.22  christos /* Values for Flags 64-bit atomic field above */
    371  1.1.1.22  christos #define ACPI_APMT_FLAGS_ATOMIC_NSUPP            (0<<2)
    372  1.1.1.22  christos #define ACPI_APMT_FLAGS_ATOMIC_SUPP             (1<<2)
    373  1.1.1.22  christos 
    374  1.1.1.22  christos /* Values for Type field above */
    375  1.1.1.22  christos 
    376  1.1.1.22  christos enum acpi_apmt_node_type {
    377  1.1.1.22  christos     ACPI_APMT_NODE_TYPE_MC                      = 0x00,
    378  1.1.1.22  christos     ACPI_APMT_NODE_TYPE_SMMU                    = 0x01,
    379  1.1.1.22  christos     ACPI_APMT_NODE_TYPE_PCIE_ROOT               = 0x02,
    380  1.1.1.22  christos     ACPI_APMT_NODE_TYPE_ACPI                    = 0x03,
    381  1.1.1.22  christos     ACPI_APMT_NODE_TYPE_CACHE                   = 0x04,
    382  1.1.1.22  christos     ACPI_APMT_NODE_TYPE_COUNT
    383  1.1.1.22  christos };
    384  1.1.1.22  christos 
    385  1.1.1.22  christos /* Masks for ovflw_irq_flags field above */
    386  1.1.1.22  christos 
    387  1.1.1.22  christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE          (1<<0)
    388  1.1.1.22  christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE          (1<<1)
    389  1.1.1.22  christos 
    390  1.1.1.22  christos /* Values for ovflw_irq_flags mode field above */
    391  1.1.1.22  christos 
    392  1.1.1.22  christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_LEVEL    (0<<0)
    393  1.1.1.22  christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_MODE_EDGE     (1<<0)
    394  1.1.1.22  christos 
    395  1.1.1.22  christos /* Values for ovflw_irq_flags type field above */
    396  1.1.1.22  christos 
    397  1.1.1.22  christos #define ACPI_APMT_OVFLW_IRQ_FLAGS_TYPE_WIRED    (0<<1)
    398  1.1.1.22  christos 
    399  1.1.1.22  christos 
    400  1.1.1.22  christos /*******************************************************************************
    401  1.1.1.22  christos  *
    402  1.1.1.19  christos  * BDAT - BIOS Data ACPI Table
    403  1.1.1.19  christos  *
    404  1.1.1.19  christos  * Conforms to "BIOS Data ACPI Table", Interface Specification v4.0 Draft 5
    405  1.1.1.19  christos  * Nov 2020
    406  1.1.1.19  christos  *
    407  1.1.1.19  christos  ******************************************************************************/
    408  1.1.1.19  christos 
    409  1.1.1.19  christos typedef struct acpi_table_bdat
    410  1.1.1.19  christos {
    411  1.1.1.19  christos     ACPI_TABLE_HEADER       Header;
    412  1.1.1.19  christos     ACPI_GENERIC_ADDRESS    Gas;
    413  1.1.1.19  christos 
    414  1.1.1.19  christos } ACPI_TABLE_BDAT;
    415  1.1.1.19  christos 
    416  1.1.1.19  christos 
    417  1.1.1.19  christos /*******************************************************************************
    418  1.1.1.19  christos  *
    419  1.1.1.14  christos  * IORT - IO Remapping Table
    420       1.1    jruoho  *
    421  1.1.1.14  christos  * Conforms to "IO Remapping Table System Software on ARM Platforms",
    422  1.1.1.22  christos  * Document number: ARM DEN 0049E.d, Feb 2022
    423       1.1    jruoho  *
    424       1.1    jruoho  ******************************************************************************/
    425       1.1    jruoho 
    426  1.1.1.14  christos typedef struct acpi_table_iort
    427       1.1    jruoho {
    428  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;
    429  1.1.1.14  christos     UINT32                  NodeCount;
    430  1.1.1.14  christos     UINT32                  NodeOffset;
    431  1.1.1.14  christos     UINT32                  Reserved;
    432       1.1    jruoho 
    433  1.1.1.14  christos } ACPI_TABLE_IORT;
    434       1.1    jruoho 
    435       1.1    jruoho 
    436  1.1.1.14  christos /*
    437  1.1.1.14  christos  * IORT subtables
    438  1.1.1.14  christos  */
    439  1.1.1.14  christos typedef struct acpi_iort_node
    440       1.1    jruoho {
    441       1.1    jruoho     UINT8                   Type;
    442       1.1    jruoho     UINT16                  Length;
    443  1.1.1.14  christos     UINT8                   Revision;
    444  1.1.1.18  christos     UINT32                  Identifier;
    445  1.1.1.14  christos     UINT32                  MappingCount;
    446  1.1.1.14  christos     UINT32                  MappingOffset;
    447  1.1.1.14  christos     char                    NodeData[1];
    448       1.1    jruoho 
    449  1.1.1.14  christos } ACPI_IORT_NODE;
    450       1.1    jruoho 
    451  1.1.1.14  christos /* Values for subtable Type above */
    452       1.1    jruoho 
    453  1.1.1.14  christos enum AcpiIortNodeType
    454       1.1    jruoho {
    455  1.1.1.14  christos     ACPI_IORT_NODE_ITS_GROUP            = 0x00,
    456  1.1.1.14  christos     ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
    457  1.1.1.14  christos     ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
    458  1.1.1.14  christos     ACPI_IORT_NODE_SMMU                 = 0x03,
    459  1.1.1.15  christos     ACPI_IORT_NODE_SMMU_V3              = 0x04,
    460  1.1.1.18  christos     ACPI_IORT_NODE_PMCG                 = 0x05,
    461  1.1.1.18  christos     ACPI_IORT_NODE_RMR                  = 0x06,
    462       1.1    jruoho };
    463       1.1    jruoho 
    464       1.1    jruoho 
    465  1.1.1.14  christos typedef struct acpi_iort_id_mapping
    466       1.1    jruoho {
    467  1.1.1.14  christos     UINT32                  InputBase;          /* Lowest value in input range */
    468  1.1.1.14  christos     UINT32                  IdCount;            /* Number of IDs */
    469  1.1.1.14  christos     UINT32                  OutputBase;         /* Lowest value in output range */
    470  1.1.1.14  christos     UINT32                  OutputReference;    /* A reference to the output node */
    471  1.1.1.14  christos     UINT32                  Flags;
    472       1.1    jruoho 
    473  1.1.1.14  christos } ACPI_IORT_ID_MAPPING;
    474       1.1    jruoho 
    475  1.1.1.14  christos /* Masks for Flags field above for IORT subtable */
    476       1.1    jruoho 
    477  1.1.1.14  christos #define ACPI_IORT_ID_SINGLE_MAPPING (1)
    478       1.1    jruoho 
    479       1.1    jruoho 
    480  1.1.1.14  christos typedef struct acpi_iort_memory_access
    481       1.1    jruoho {
    482  1.1.1.14  christos     UINT32                  CacheCoherency;
    483  1.1.1.14  christos     UINT8                   Hints;
    484  1.1.1.14  christos     UINT16                  Reserved;
    485  1.1.1.14  christos     UINT8                   MemoryFlags;
    486       1.1    jruoho 
    487  1.1.1.14  christos } ACPI_IORT_MEMORY_ACCESS;
    488       1.1    jruoho 
    489  1.1.1.14  christos /* Values for CacheCoherency field above */
    490       1.1    jruoho 
    491  1.1.1.14  christos #define ACPI_IORT_NODE_COHERENT         0x00000001  /* The device node is fully coherent */
    492  1.1.1.14  christos #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000  /* The device node is not coherent */
    493       1.1    jruoho 
    494  1.1.1.14  christos /* Masks for Hints field above */
    495       1.1    jruoho 
    496  1.1.1.14  christos #define ACPI_IORT_HT_TRANSIENT          (1)
    497  1.1.1.14  christos #define ACPI_IORT_HT_WRITE              (1<<1)
    498  1.1.1.14  christos #define ACPI_IORT_HT_READ               (1<<2)
    499  1.1.1.14  christos #define ACPI_IORT_HT_OVERRIDE           (1<<3)
    500       1.1    jruoho 
    501  1.1.1.14  christos /* Masks for MemoryFlags field above */
    502       1.1    jruoho 
    503  1.1.1.14  christos #define ACPI_IORT_MF_COHERENCY          (1)
    504  1.1.1.14  christos #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
    505       1.1    jruoho 
    506       1.1    jruoho 
    507  1.1.1.14  christos /*
    508  1.1.1.14  christos  * IORT node specific subtables
    509  1.1.1.14  christos  */
    510  1.1.1.14  christos typedef struct acpi_iort_its_group
    511       1.1    jruoho {
    512  1.1.1.14  christos     UINT32                  ItsCount;
    513  1.1.1.16  christos     UINT32                  Identifiers[1];         /* GIC ITS identifier array */
    514       1.1    jruoho 
    515  1.1.1.14  christos } ACPI_IORT_ITS_GROUP;
    516       1.1    jruoho 
    517       1.1    jruoho 
    518  1.1.1.14  christos typedef struct acpi_iort_named_component
    519       1.1    jruoho {
    520  1.1.1.14  christos     UINT32                  NodeFlags;
    521  1.1.1.14  christos     UINT64                  MemoryProperties;       /* Memory access properties */
    522  1.1.1.14  christos     UINT8                   MemoryAddressLimit;     /* Memory address size limit */
    523  1.1.1.14  christos     char                    DeviceName[1];          /* Path of namespace object */
    524       1.1    jruoho 
    525  1.1.1.14  christos } ACPI_IORT_NAMED_COMPONENT;
    526       1.1    jruoho 
    527  1.1.1.15  christos /* Masks for Flags field above */
    528  1.1.1.15  christos 
    529  1.1.1.15  christos #define ACPI_IORT_NC_STALL_SUPPORTED    (1)
    530  1.1.1.15  christos #define ACPI_IORT_NC_PASID_BITS         (31<<1)
    531       1.1    jruoho 
    532  1.1.1.14  christos typedef struct acpi_iort_root_complex
    533       1.1    jruoho {
    534  1.1.1.14  christos     UINT64                  MemoryProperties;       /* Memory access properties */
    535  1.1.1.14  christos     UINT32                  AtsAttribute;
    536  1.1.1.14  christos     UINT32                  PciSegmentNumber;
    537  1.1.1.15  christos     UINT8                   MemoryAddressLimit;     /* Memory address size limit */
    538  1.1.1.22  christos     UINT16                  PasidCapabilities;      /* PASID Capabilities */
    539  1.1.1.22  christos     UINT8                   Reserved[1];            /* Reserved, must be zero */
    540       1.1    jruoho 
    541  1.1.1.14  christos } ACPI_IORT_ROOT_COMPLEX;
    542       1.1    jruoho 
    543  1.1.1.18  christos /* Masks for AtsAttribute field above */
    544       1.1    jruoho 
    545  1.1.1.18  christos #define ACPI_IORT_ATS_SUPPORTED         (1)     /* The root complex ATS support */
    546  1.1.1.18  christos #define ACPI_IORT_PRI_SUPPORTED         (1<<1)  /* The root complex PRI support */
    547  1.1.1.18  christos #define ACPI_IORT_PASID_FWD_SUPPORTED   (1<<2)  /* The root complex PASID forward support */
    548   1.1.1.4  christos 
    549  1.1.1.22  christos /* Masks for PasidCapabilities field above */
    550  1.1.1.22  christos #define ACPI_IORT_PASID_MAX_WIDTH       (0x1F)  /* Bits 0-4 */
    551   1.1.1.4  christos 
    552  1.1.1.14  christos typedef struct acpi_iort_smmu
    553  1.1.1.14  christos {
    554  1.1.1.14  christos     UINT64                  BaseAddress;            /* SMMU base address */
    555  1.1.1.14  christos     UINT64                  Span;                   /* Length of memory range */
    556  1.1.1.14  christos     UINT32                  Model;
    557  1.1.1.14  christos     UINT32                  Flags;
    558  1.1.1.14  christos     UINT32                  GlobalInterruptOffset;
    559  1.1.1.14  christos     UINT32                  ContextInterruptCount;
    560  1.1.1.14  christos     UINT32                  ContextInterruptOffset;
    561  1.1.1.14  christos     UINT32                  PmuInterruptCount;
    562  1.1.1.14  christos     UINT32                  PmuInterruptOffset;
    563  1.1.1.14  christos     UINT64                  Interrupts[1];          /* Interrupt array */
    564   1.1.1.4  christos 
    565  1.1.1.14  christos } ACPI_IORT_SMMU;
    566   1.1.1.4  christos 
    567  1.1.1.14  christos /* Values for Model field above */
    568   1.1.1.4  christos 
    569  1.1.1.14  christos #define ACPI_IORT_SMMU_V1               0x00000000  /* Generic SMMUv1 */
    570  1.1.1.14  christos #define ACPI_IORT_SMMU_V2               0x00000001  /* Generic SMMUv2 */
    571  1.1.1.14  christos #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002  /* ARM Corelink MMU-400 */
    572  1.1.1.14  christos #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003  /* ARM Corelink MMU-500 */
    573  1.1.1.14  christos #define ACPI_IORT_SMMU_CORELINK_MMU401  0x00000004  /* ARM Corelink MMU-401 */
    574  1.1.1.14  christos #define ACPI_IORT_SMMU_CAVIUM_THUNDERX  0x00000005  /* Cavium ThunderX SMMUv2 */
    575   1.1.1.4  christos 
    576  1.1.1.14  christos /* Masks for Flags field above */
    577   1.1.1.4  christos 
    578  1.1.1.14  christos #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
    579  1.1.1.14  christos #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
    580   1.1.1.4  christos 
    581  1.1.1.14  christos /* Global interrupt format */
    582   1.1.1.4  christos 
    583  1.1.1.14  christos typedef struct acpi_iort_smmu_gsi
    584   1.1.1.4  christos {
    585  1.1.1.14  christos     UINT32                  NSgIrpt;
    586  1.1.1.14  christos     UINT32                  NSgIrptFlags;
    587  1.1.1.14  christos     UINT32                  NSgCfgIrpt;
    588  1.1.1.14  christos     UINT32                  NSgCfgIrptFlags;
    589   1.1.1.4  christos 
    590  1.1.1.14  christos } ACPI_IORT_SMMU_GSI;
    591   1.1.1.4  christos 
    592   1.1.1.4  christos 
    593  1.1.1.14  christos typedef struct acpi_iort_smmu_v3
    594   1.1.1.4  christos {
    595  1.1.1.14  christos     UINT64                  BaseAddress;            /* SMMUv3 base address */
    596  1.1.1.14  christos     UINT32                  Flags;
    597  1.1.1.14  christos     UINT32                  Reserved;
    598  1.1.1.14  christos     UINT64                  VatosAddress;
    599  1.1.1.14  christos     UINT32                  Model;
    600  1.1.1.14  christos     UINT32                  EventGsiv;
    601  1.1.1.14  christos     UINT32                  PriGsiv;
    602  1.1.1.14  christos     UINT32                  GerrGsiv;
    603  1.1.1.14  christos     UINT32                  SyncGsiv;
    604  1.1.1.15  christos     UINT32                  Pxm;
    605  1.1.1.14  christos     UINT32                  IdMappingIndex;
    606   1.1.1.4  christos 
    607  1.1.1.14  christos } ACPI_IORT_SMMU_V3;
    608   1.1.1.4  christos 
    609  1.1.1.14  christos /* Values for Model field above */
    610   1.1.1.4  christos 
    611  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_GENERIC           0x00000000  /* Generic SMMUv3 */
    612  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_HISILICON_HI161X  0x00000001  /* HiSilicon Hi161x SMMUv3 */
    613  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX     0x00000002  /* Cavium CN99xx SMMUv3 */
    614   1.1.1.4  christos 
    615  1.1.1.14  christos /* Masks for Flags field above */
    616   1.1.1.4  christos 
    617  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
    618  1.1.1.15  christos #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (3<<1)
    619  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_PXM_VALID         (1<<3)
    620   1.1.1.4  christos 
    621  1.1.1.15  christos typedef struct acpi_iort_pmcg
    622  1.1.1.15  christos {
    623  1.1.1.15  christos     UINT64                  Page0BaseAddress;
    624  1.1.1.15  christos     UINT32                  OverflowGsiv;
    625  1.1.1.15  christos     UINT32                  NodeReference;
    626  1.1.1.15  christos     UINT64                  Page1BaseAddress;
    627  1.1.1.15  christos 
    628  1.1.1.15  christos } ACPI_IORT_PMCG;
    629  1.1.1.15  christos 
    630  1.1.1.18  christos typedef struct acpi_iort_rmr {
    631  1.1.1.18  christos     UINT32 Flags;
    632  1.1.1.18  christos     UINT32 RmrCount;
    633  1.1.1.18  christos     UINT32 RmrOffset;
    634  1.1.1.18  christos 
    635  1.1.1.18  christos } ACPI_IORT_RMR;
    636  1.1.1.18  christos 
    637  1.1.1.22  christos /* Masks for Flags field above */
    638  1.1.1.22  christos #define ACPI_IORT_RMR_REMAP_PERMITTED      (1)
    639  1.1.1.22  christos #define ACPI_IORT_RMR_ACCESS_PRIVILEGE     (1<<1)
    640  1.1.1.22  christos 
    641  1.1.1.22  christos /*
    642  1.1.1.22  christos  * Macro to access the Access Attributes in flags field above:
    643  1.1.1.22  christos  *  Access Attributes is encoded in bits 9:2
    644  1.1.1.22  christos  */
    645  1.1.1.22  christos #define ACPI_IORT_RMR_ACCESS_ATTRIBUTES(flags)          (((flags) >> 2) & 0xFF)
    646  1.1.1.22  christos 
    647  1.1.1.22  christos /* Values for above Access Attributes */
    648  1.1.1.22  christos 
    649  1.1.1.22  christos #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRNE   0x00
    650  1.1.1.22  christos #define ACPI_IORT_RMR_ATTR_DEVICE_NGNRE    0x01
    651  1.1.1.22  christos #define ACPI_IORT_RMR_ATTR_DEVICE_NGRE     0x02
    652  1.1.1.22  christos #define ACPI_IORT_RMR_ATTR_DEVICE_GRE      0x03
    653  1.1.1.22  christos #define ACPI_IORT_RMR_ATTR_NORMAL_NC       0x04
    654  1.1.1.22  christos #define ACPI_IORT_RMR_ATTR_NORMAL_IWB_OWB  0x05
    655  1.1.1.22  christos 
    656  1.1.1.18  christos typedef struct acpi_iort_rmr_desc {
    657  1.1.1.18  christos     UINT64 BaseAddress;
    658  1.1.1.18  christos     UINT64 Length;
    659  1.1.1.18  christos     UINT32 Reserved;
    660  1.1.1.18  christos 
    661  1.1.1.18  christos } ACPI_IORT_RMR_DESC;
    662   1.1.1.4  christos 
    663   1.1.1.4  christos /*******************************************************************************
    664   1.1.1.4  christos  *
    665  1.1.1.14  christos  * IVRS - I/O Virtualization Reporting Structure
    666  1.1.1.14  christos  *        Version 1
    667   1.1.1.4  christos  *
    668  1.1.1.14  christos  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
    669  1.1.1.14  christos  * Revision 1.26, February 2009.
    670   1.1.1.4  christos  *
    671   1.1.1.4  christos  ******************************************************************************/
    672   1.1.1.4  christos 
    673  1.1.1.14  christos typedef struct acpi_table_ivrs
    674   1.1.1.4  christos {
    675   1.1.1.4  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    676  1.1.1.14  christos     UINT32                  Info;               /* Common virtualization info */
    677  1.1.1.14  christos     UINT64                  Reserved;
    678   1.1.1.4  christos 
    679  1.1.1.14  christos } ACPI_TABLE_IVRS;
    680   1.1.1.4  christos 
    681  1.1.1.14  christos /* Values for Info field above */
    682   1.1.1.4  christos 
    683  1.1.1.14  christos #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
    684  1.1.1.14  christos #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
    685  1.1.1.14  christos #define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
    686   1.1.1.4  christos 
    687   1.1.1.4  christos 
    688  1.1.1.14  christos /* IVRS subtable header */
    689   1.1.1.4  christos 
    690  1.1.1.14  christos typedef struct acpi_ivrs_header
    691   1.1.1.4  christos {
    692  1.1.1.14  christos     UINT8                   Type;               /* Subtable type */
    693  1.1.1.14  christos     UINT8                   Flags;
    694  1.1.1.14  christos     UINT16                  Length;             /* Subtable length */
    695  1.1.1.14  christos     UINT16                  DeviceId;           /* ID of IOMMU */
    696   1.1.1.4  christos 
    697  1.1.1.14  christos } ACPI_IVRS_HEADER;
    698   1.1.1.4  christos 
    699  1.1.1.14  christos /* Values for subtable Type above */
    700       1.1    jruoho 
    701  1.1.1.14  christos enum AcpiIvrsType
    702       1.1    jruoho {
    703  1.1.1.17  christos     ACPI_IVRS_TYPE_HARDWARE1        = 0x10,
    704  1.1.1.17  christos     ACPI_IVRS_TYPE_HARDWARE2        = 0x11,
    705  1.1.1.18  christos     ACPI_IVRS_TYPE_HARDWARE3        = 0x40,
    706  1.1.1.14  christos     ACPI_IVRS_TYPE_MEMORY1          = 0x20,
    707  1.1.1.14  christos     ACPI_IVRS_TYPE_MEMORY2          = 0x21,
    708  1.1.1.14  christos     ACPI_IVRS_TYPE_MEMORY3          = 0x22
    709  1.1.1.14  christos };
    710       1.1    jruoho 
    711  1.1.1.14  christos /* Masks for Flags field above for IVHD subtable */
    712       1.1    jruoho 
    713  1.1.1.14  christos #define ACPI_IVHD_TT_ENABLE         (1)
    714  1.1.1.14  christos #define ACPI_IVHD_PASS_PW           (1<<1)
    715  1.1.1.14  christos #define ACPI_IVHD_RES_PASS_PW       (1<<2)
    716  1.1.1.14  christos #define ACPI_IVHD_ISOC              (1<<3)
    717  1.1.1.14  christos #define ACPI_IVHD_IOTLB             (1<<4)
    718       1.1    jruoho 
    719  1.1.1.14  christos /* Masks for Flags field above for IVMD subtable */
    720       1.1    jruoho 
    721  1.1.1.14  christos #define ACPI_IVMD_UNITY             (1)
    722  1.1.1.14  christos #define ACPI_IVMD_READ              (1<<1)
    723  1.1.1.14  christos #define ACPI_IVMD_WRITE             (1<<2)
    724  1.1.1.14  christos #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
    725       1.1    jruoho 
    726       1.1    jruoho 
    727  1.1.1.14  christos /*
    728  1.1.1.14  christos  * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
    729  1.1.1.14  christos  */
    730       1.1    jruoho 
    731  1.1.1.14  christos /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
    732       1.1    jruoho 
    733  1.1.1.17  christos typedef struct acpi_ivrs_hardware_10
    734       1.1    jruoho {
    735  1.1.1.14  christos     ACPI_IVRS_HEADER        Header;
    736  1.1.1.14  christos     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
    737  1.1.1.14  christos     UINT64                  BaseAddress;        /* IOMMU control registers */
    738  1.1.1.14  christos     UINT16                  PciSegmentGroup;
    739  1.1.1.14  christos     UINT16                  Info;               /* MSI number and unit ID */
    740  1.1.1.17  christos     UINT32                  FeatureReporting;
    741  1.1.1.17  christos 
    742  1.1.1.17  christos } ACPI_IVRS_HARDWARE1;
    743  1.1.1.17  christos 
    744  1.1.1.17  christos /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
    745       1.1    jruoho 
    746  1.1.1.17  christos typedef struct acpi_ivrs_hardware_11
    747  1.1.1.17  christos {
    748  1.1.1.17  christos     ACPI_IVRS_HEADER        Header;
    749  1.1.1.17  christos     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
    750  1.1.1.17  christos     UINT64                  BaseAddress;        /* IOMMU control registers */
    751  1.1.1.17  christos     UINT16                  PciSegmentGroup;
    752  1.1.1.17  christos     UINT16                  Info;               /* MSI number and unit ID */
    753  1.1.1.17  christos     UINT32                  Attributes;
    754  1.1.1.17  christos     UINT64                  EfrRegisterImage;
    755  1.1.1.17  christos     UINT64                  Reserved;
    756  1.1.1.17  christos } ACPI_IVRS_HARDWARE2;
    757       1.1    jruoho 
    758  1.1.1.14  christos /* Masks for Info field above */
    759       1.1    jruoho 
    760  1.1.1.14  christos #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
    761  1.1.1.14  christos #define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
    762       1.1    jruoho 
    763       1.1    jruoho 
    764  1.1.1.14  christos /*
    765  1.1.1.14  christos  * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
    766  1.1.1.14  christos  * Upper two bits of the Type field are the (encoded) length of the structure.
    767  1.1.1.14  christos  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
    768  1.1.1.14  christos  * are reserved for future use but not defined.
    769  1.1.1.14  christos  */
    770  1.1.1.14  christos typedef struct acpi_ivrs_de_header
    771       1.1    jruoho {
    772  1.1.1.14  christos     UINT8                   Type;
    773  1.1.1.14  christos     UINT16                  Id;
    774  1.1.1.14  christos     UINT8                   DataSetting;
    775       1.1    jruoho 
    776  1.1.1.14  christos } ACPI_IVRS_DE_HEADER;
    777       1.1    jruoho 
    778  1.1.1.14  christos /* Length of device entry is in the top two bits of Type field above */
    779       1.1    jruoho 
    780  1.1.1.14  christos #define ACPI_IVHD_ENTRY_LENGTH      0xC0
    781       1.1    jruoho 
    782  1.1.1.14  christos /* Values for device entry Type field above */
    783       1.1    jruoho 
    784  1.1.1.14  christos enum AcpiIvrsDeviceEntryType
    785  1.1.1.14  christos {
    786  1.1.1.14  christos     /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
    787       1.1    jruoho 
    788  1.1.1.14  christos     ACPI_IVRS_TYPE_PAD4             = 0,
    789  1.1.1.14  christos     ACPI_IVRS_TYPE_ALL              = 1,
    790  1.1.1.14  christos     ACPI_IVRS_TYPE_SELECT           = 2,
    791  1.1.1.14  christos     ACPI_IVRS_TYPE_START            = 3,
    792  1.1.1.14  christos     ACPI_IVRS_TYPE_END              = 4,
    793       1.1    jruoho 
    794  1.1.1.14  christos     /* 8-byte device entries */
    795       1.1    jruoho 
    796  1.1.1.14  christos     ACPI_IVRS_TYPE_PAD8             = 64,
    797  1.1.1.14  christos     ACPI_IVRS_TYPE_NOT_USED         = 65,
    798  1.1.1.14  christos     ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
    799  1.1.1.14  christos     ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
    800  1.1.1.14  christos     ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
    801  1.1.1.14  christos     ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
    802  1.1.1.18  christos     ACPI_IVRS_TYPE_SPECIAL          = 72, /* Uses ACPI_IVRS_DEVICE8C */
    803  1.1.1.18  christos 
    804  1.1.1.18  christos     /* Variable-length device entries */
    805  1.1.1.18  christos 
    806  1.1.1.18  christos     ACPI_IVRS_TYPE_HID              = 240 /* Uses ACPI_IVRS_DEVICE_HID */
    807  1.1.1.14  christos };
    808       1.1    jruoho 
    809  1.1.1.14  christos /* Values for Data field above */
    810       1.1    jruoho 
    811  1.1.1.14  christos #define ACPI_IVHD_INIT_PASS         (1)
    812  1.1.1.14  christos #define ACPI_IVHD_EINT_PASS         (1<<1)
    813  1.1.1.14  christos #define ACPI_IVHD_NMI_PASS          (1<<2)
    814  1.1.1.14  christos #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
    815  1.1.1.14  christos #define ACPI_IVHD_LINT0_PASS        (1<<6)
    816  1.1.1.14  christos #define ACPI_IVHD_LINT1_PASS        (1<<7)
    817       1.1    jruoho 
    818       1.1    jruoho 
    819  1.1.1.14  christos /* Types 0-4: 4-byte device entry */
    820       1.1    jruoho 
    821  1.1.1.14  christos typedef struct acpi_ivrs_device4
    822       1.1    jruoho {
    823  1.1.1.14  christos     ACPI_IVRS_DE_HEADER     Header;
    824       1.1    jruoho 
    825  1.1.1.14  christos } ACPI_IVRS_DEVICE4;
    826       1.1    jruoho 
    827  1.1.1.14  christos /* Types 66-67: 8-byte device entry */
    828       1.1    jruoho 
    829  1.1.1.14  christos typedef struct acpi_ivrs_device8a
    830  1.1.1.14  christos {
    831  1.1.1.14  christos     ACPI_IVRS_DE_HEADER     Header;
    832  1.1.1.14  christos     UINT8                   Reserved1;
    833  1.1.1.14  christos     UINT16                  UsedId;
    834  1.1.1.14  christos     UINT8                   Reserved2;
    835       1.1    jruoho 
    836  1.1.1.14  christos } ACPI_IVRS_DEVICE8A;
    837       1.1    jruoho 
    838  1.1.1.14  christos /* Types 70-71: 8-byte device entry */
    839       1.1    jruoho 
    840  1.1.1.14  christos typedef struct acpi_ivrs_device8b
    841       1.1    jruoho {
    842  1.1.1.14  christos     ACPI_IVRS_DE_HEADER     Header;
    843  1.1.1.14  christos     UINT32                  ExtendedData;
    844       1.1    jruoho 
    845  1.1.1.14  christos } ACPI_IVRS_DEVICE8B;
    846       1.1    jruoho 
    847  1.1.1.14  christos /* Values for ExtendedData above */
    848       1.1    jruoho 
    849  1.1.1.14  christos #define ACPI_IVHD_ATS_DISABLED      (1<<31)
    850       1.1    jruoho 
    851  1.1.1.14  christos /* Type 72: 8-byte device entry */
    852       1.1    jruoho 
    853  1.1.1.14  christos typedef struct acpi_ivrs_device8c
    854       1.1    jruoho {
    855  1.1.1.14  christos     ACPI_IVRS_DE_HEADER     Header;
    856  1.1.1.14  christos     UINT8                   Handle;
    857  1.1.1.14  christos     UINT16                  UsedId;
    858  1.1.1.14  christos     UINT8                   Variety;
    859  1.1.1.14  christos 
    860  1.1.1.14  christos } ACPI_IVRS_DEVICE8C;
    861  1.1.1.14  christos 
    862  1.1.1.14  christos /* Values for Variety field above */
    863       1.1    jruoho 
    864  1.1.1.14  christos #define ACPI_IVHD_IOAPIC            1
    865  1.1.1.14  christos #define ACPI_IVHD_HPET              2
    866       1.1    jruoho 
    867  1.1.1.18  christos /* Type 240: variable-length device entry */
    868  1.1.1.18  christos 
    869  1.1.1.18  christos typedef struct acpi_ivrs_device_hid
    870  1.1.1.18  christos {
    871  1.1.1.18  christos     ACPI_IVRS_DE_HEADER     Header;
    872  1.1.1.18  christos     UINT64                  AcpiHid;
    873  1.1.1.18  christos     UINT64                  AcpiCid;
    874  1.1.1.18  christos     UINT8                   UidType;
    875  1.1.1.18  christos     UINT8                   UidLength;
    876  1.1.1.18  christos 
    877  1.1.1.18  christos } ACPI_IVRS_DEVICE_HID;
    878  1.1.1.18  christos 
    879  1.1.1.19  christos /* Values for UidType above */
    880  1.1.1.19  christos 
    881  1.1.1.19  christos #define ACPI_IVRS_UID_NOT_PRESENT   0
    882  1.1.1.19  christos #define ACPI_IVRS_UID_IS_INTEGER    1
    883  1.1.1.19  christos #define ACPI_IVRS_UID_IS_STRING     2
    884       1.1    jruoho 
    885  1.1.1.14  christos /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
    886   1.1.1.5  christos 
    887  1.1.1.14  christos typedef struct acpi_ivrs_memory
    888   1.1.1.5  christos {
    889  1.1.1.14  christos     ACPI_IVRS_HEADER        Header;
    890  1.1.1.14  christos     UINT16                  AuxData;
    891  1.1.1.14  christos     UINT64                  Reserved;
    892  1.1.1.14  christos     UINT64                  StartAddress;
    893  1.1.1.14  christos     UINT64                  MemoryLength;
    894   1.1.1.5  christos 
    895  1.1.1.14  christos } ACPI_IVRS_MEMORY;
    896   1.1.1.5  christos 
    897   1.1.1.5  christos 
    898       1.1    jruoho /*******************************************************************************
    899       1.1    jruoho  *
    900  1.1.1.14  christos  * LPIT - Low Power Idle Table
    901       1.1    jruoho  *
    902  1.1.1.14  christos  * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
    903       1.1    jruoho  *
    904       1.1    jruoho  ******************************************************************************/
    905       1.1    jruoho 
    906  1.1.1.14  christos typedef struct acpi_table_lpit
    907       1.1    jruoho {
    908       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    909       1.1    jruoho 
    910  1.1.1.14  christos } ACPI_TABLE_LPIT;
    911  1.1.1.14  christos 
    912       1.1    jruoho 
    913  1.1.1.14  christos /* LPIT subtable header */
    914  1.1.1.14  christos 
    915  1.1.1.14  christos typedef struct acpi_lpit_header
    916  1.1.1.14  christos {
    917  1.1.1.14  christos     UINT32                  Type;               /* Subtable type */
    918  1.1.1.14  christos     UINT32                  Length;             /* Subtable length */
    919  1.1.1.14  christos     UINT16                  UniqueId;
    920  1.1.1.14  christos     UINT16                  Reserved;
    921  1.1.1.14  christos     UINT32                  Flags;
    922       1.1    jruoho 
    923  1.1.1.14  christos } ACPI_LPIT_HEADER;
    924       1.1    jruoho 
    925  1.1.1.14  christos /* Values for subtable Type above */
    926       1.1    jruoho 
    927  1.1.1.14  christos enum AcpiLpitType
    928       1.1    jruoho {
    929  1.1.1.14  christos     ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
    930  1.1.1.14  christos     ACPI_LPIT_TYPE_RESERVED         = 0x01      /* 1 and above are reserved */
    931       1.1    jruoho };
    932       1.1    jruoho 
    933  1.1.1.14  christos /* Masks for Flags field above  */
    934  1.1.1.14  christos 
    935  1.1.1.14  christos #define ACPI_LPIT_STATE_DISABLED    (1)
    936  1.1.1.14  christos #define ACPI_LPIT_NO_COUNTER        (1<<1)
    937  1.1.1.14  christos 
    938  1.1.1.14  christos /*
    939  1.1.1.14  christos  * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
    940  1.1.1.14  christos  */
    941  1.1.1.14  christos 
    942  1.1.1.14  christos /* 0x00: Native C-state instruction based LPI structure */
    943  1.1.1.14  christos 
    944  1.1.1.14  christos typedef struct acpi_lpit_native
    945  1.1.1.14  christos {
    946  1.1.1.14  christos     ACPI_LPIT_HEADER        Header;
    947  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    EntryTrigger;
    948  1.1.1.14  christos     UINT32                  Residency;
    949  1.1.1.14  christos     UINT32                  Latency;
    950  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    ResidencyCounter;
    951  1.1.1.14  christos     UINT64                  CounterFrequency;
    952  1.1.1.14  christos 
    953  1.1.1.14  christos } ACPI_LPIT_NATIVE;
    954  1.1.1.14  christos 
    955       1.1    jruoho 
    956       1.1    jruoho /*******************************************************************************
    957       1.1    jruoho  *
    958  1.1.1.14  christos  * MADT - Multiple APIC Description Table
    959  1.1.1.14  christos  *        Version 3
    960       1.1    jruoho  *
    961       1.1    jruoho  ******************************************************************************/
    962       1.1    jruoho 
    963  1.1.1.14  christos typedef struct acpi_table_madt
    964       1.1    jruoho {
    965       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    966  1.1.1.14  christos     UINT32                  Address;            /* Physical address of local APIC */
    967  1.1.1.14  christos     UINT32                  Flags;
    968       1.1    jruoho 
    969  1.1.1.14  christos } ACPI_TABLE_MADT;
    970       1.1    jruoho 
    971  1.1.1.14  christos /* Masks for Flags field above */
    972       1.1    jruoho 
    973  1.1.1.14  christos #define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
    974       1.1    jruoho 
    975  1.1.1.14  christos /* Values for PCATCompat flag */
    976       1.1    jruoho 
    977  1.1.1.14  christos #define ACPI_MADT_DUAL_PIC          1
    978  1.1.1.14  christos #define ACPI_MADT_MULTIPLE_APIC     0
    979       1.1    jruoho 
    980       1.1    jruoho 
    981  1.1.1.14  christos /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
    982  1.1.1.14  christos 
    983  1.1.1.14  christos enum AcpiMadtType
    984  1.1.1.14  christos {
    985  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_APIC               = 0,
    986  1.1.1.14  christos     ACPI_MADT_TYPE_IO_APIC                  = 1,
    987  1.1.1.14  christos     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
    988  1.1.1.14  christos     ACPI_MADT_TYPE_NMI_SOURCE               = 3,
    989  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
    990  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
    991  1.1.1.14  christos     ACPI_MADT_TYPE_IO_SAPIC                 = 6,
    992  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
    993  1.1.1.14  christos     ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
    994  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
    995  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
    996  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
    997  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
    998  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
    999  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
   1000  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_TRANSLATOR       = 15,
   1001  1.1.1.18  christos     ACPI_MADT_TYPE_MULTIPROC_WAKEUP         = 16,
   1002  1.1.1.22  christos     ACPI_MADT_TYPE_RESERVED                 = 17,   /* 17 to 0x7F are reserved */
   1003  1.1.1.22  christos     ACPI_MADT_TYPE_OEM_RESERVED             = 0x80  /* 0x80 to 0xFF are reserved for OEM use */
   1004       1.1    jruoho };
   1005       1.1    jruoho 
   1006       1.1    jruoho 
   1007  1.1.1.14  christos /*
   1008  1.1.1.14  christos  * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
   1009  1.1.1.14  christos  */
   1010       1.1    jruoho 
   1011  1.1.1.14  christos /* 0: Processor Local APIC */
   1012  1.1.1.14  christos 
   1013  1.1.1.14  christos typedef struct acpi_madt_local_apic
   1014       1.1    jruoho {
   1015  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1016  1.1.1.14  christos     UINT8                   ProcessorId;        /* ACPI processor id */
   1017  1.1.1.14  christos     UINT8                   Id;                 /* Processor's local APIC id */
   1018  1.1.1.14  christos     UINT32                  LapicFlags;
   1019       1.1    jruoho 
   1020  1.1.1.14  christos } ACPI_MADT_LOCAL_APIC;
   1021       1.1    jruoho 
   1022       1.1    jruoho 
   1023  1.1.1.14  christos /* 1: IO APIC */
   1024   1.1.1.7  christos 
   1025  1.1.1.14  christos typedef struct acpi_madt_io_apic
   1026   1.1.1.7  christos {
   1027  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1028  1.1.1.14  christos     UINT8                   Id;                 /* I/O APIC ID */
   1029  1.1.1.14  christos     UINT8                   Reserved;           /* Reserved - must be zero */
   1030  1.1.1.14  christos     UINT32                  Address;            /* APIC physical address */
   1031  1.1.1.14  christos     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
   1032   1.1.1.7  christos 
   1033  1.1.1.14  christos } ACPI_MADT_IO_APIC;
   1034   1.1.1.7  christos 
   1035   1.1.1.7  christos 
   1036  1.1.1.14  christos /* 2: Interrupt Override */
   1037   1.1.1.7  christos 
   1038  1.1.1.14  christos typedef struct acpi_madt_interrupt_override
   1039  1.1.1.14  christos {
   1040  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1041  1.1.1.14  christos     UINT8                   Bus;                /* 0 - ISA */
   1042  1.1.1.14  christos     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
   1043  1.1.1.14  christos     UINT32                  GlobalIrq;          /* Global system interrupt */
   1044  1.1.1.14  christos     UINT16                  IntiFlags;
   1045   1.1.1.7  christos 
   1046  1.1.1.14  christos } ACPI_MADT_INTERRUPT_OVERRIDE;
   1047   1.1.1.7  christos 
   1048   1.1.1.7  christos 
   1049  1.1.1.14  christos /* 3: NMI Source */
   1050   1.1.1.7  christos 
   1051  1.1.1.14  christos typedef struct acpi_madt_nmi_source
   1052   1.1.1.7  christos {
   1053  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1054  1.1.1.14  christos     UINT16                  IntiFlags;
   1055  1.1.1.14  christos     UINT32                  GlobalIrq;          /* Global system interrupt */
   1056   1.1.1.7  christos 
   1057  1.1.1.14  christos } ACPI_MADT_NMI_SOURCE;
   1058   1.1.1.7  christos 
   1059   1.1.1.7  christos 
   1060  1.1.1.14  christos /* 4: Local APIC NMI */
   1061   1.1.1.7  christos 
   1062  1.1.1.14  christos typedef struct acpi_madt_local_apic_nmi
   1063   1.1.1.7  christos {
   1064  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1065  1.1.1.14  christos     UINT8                   ProcessorId;        /* ACPI processor id */
   1066  1.1.1.14  christos     UINT16                  IntiFlags;
   1067  1.1.1.14  christos     UINT8                   Lint;               /* LINTn to which NMI is connected */
   1068   1.1.1.7  christos 
   1069  1.1.1.14  christos } ACPI_MADT_LOCAL_APIC_NMI;
   1070   1.1.1.7  christos 
   1071   1.1.1.7  christos 
   1072  1.1.1.14  christos /* 5: Address Override */
   1073   1.1.1.7  christos 
   1074  1.1.1.14  christos typedef struct acpi_madt_local_apic_override
   1075  1.1.1.14  christos {
   1076  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1077  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved, must be zero */
   1078  1.1.1.14  christos     UINT64                  Address;            /* APIC physical address */
   1079   1.1.1.7  christos 
   1080  1.1.1.14  christos } ACPI_MADT_LOCAL_APIC_OVERRIDE;
   1081   1.1.1.7  christos 
   1082   1.1.1.7  christos 
   1083  1.1.1.14  christos /* 6: I/O Sapic */
   1084   1.1.1.7  christos 
   1085  1.1.1.14  christos typedef struct acpi_madt_io_sapic
   1086   1.1.1.7  christos {
   1087  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1088  1.1.1.14  christos     UINT8                   Id;                 /* I/O SAPIC ID */
   1089  1.1.1.14  christos     UINT8                   Reserved;           /* Reserved, must be zero */
   1090  1.1.1.14  christos     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
   1091  1.1.1.14  christos     UINT64                  Address;            /* SAPIC physical address */
   1092   1.1.1.7  christos 
   1093  1.1.1.14  christos } ACPI_MADT_IO_SAPIC;
   1094   1.1.1.7  christos 
   1095   1.1.1.7  christos 
   1096  1.1.1.14  christos /* 7: Local Sapic */
   1097  1.1.1.14  christos 
   1098  1.1.1.14  christos typedef struct acpi_madt_local_sapic
   1099   1.1.1.7  christos {
   1100  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1101  1.1.1.14  christos     UINT8                   ProcessorId;        /* ACPI processor id */
   1102  1.1.1.14  christos     UINT8                   Id;                 /* SAPIC ID */
   1103  1.1.1.14  christos     UINT8                   Eid;                /* SAPIC EID */
   1104  1.1.1.14  christos     UINT8                   Reserved[3];        /* Reserved, must be zero */
   1105  1.1.1.14  christos     UINT32                  LapicFlags;
   1106  1.1.1.14  christos     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
   1107  1.1.1.14  christos     char                    UidString[1];       /* String UID  - ACPI 3.0 */
   1108   1.1.1.7  christos 
   1109  1.1.1.14  christos } ACPI_MADT_LOCAL_SAPIC;
   1110   1.1.1.7  christos 
   1111   1.1.1.7  christos 
   1112  1.1.1.14  christos /* 8: Platform Interrupt Source */
   1113  1.1.1.14  christos 
   1114  1.1.1.14  christos typedef struct acpi_madt_interrupt_source
   1115   1.1.1.7  christos {
   1116  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1117  1.1.1.14  christos     UINT16                  IntiFlags;
   1118  1.1.1.14  christos     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
   1119  1.1.1.14  christos     UINT8                   Id;                 /* Processor ID */
   1120  1.1.1.14  christos     UINT8                   Eid;                /* Processor EID */
   1121  1.1.1.14  christos     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
   1122  1.1.1.14  christos     UINT32                  GlobalIrq;          /* Global system interrupt */
   1123  1.1.1.14  christos     UINT32                  Flags;              /* Interrupt Source Flags */
   1124   1.1.1.7  christos 
   1125  1.1.1.14  christos } ACPI_MADT_INTERRUPT_SOURCE;
   1126   1.1.1.7  christos 
   1127  1.1.1.14  christos /* Masks for Flags field above */
   1128   1.1.1.7  christos 
   1129  1.1.1.14  christos #define ACPI_MADT_CPEI_OVERRIDE     (1)
   1130   1.1.1.7  christos 
   1131   1.1.1.7  christos 
   1132  1.1.1.14  christos /* 9: Processor Local X2APIC (ACPI 4.0) */
   1133  1.1.1.14  christos 
   1134  1.1.1.14  christos typedef struct acpi_madt_local_x2apic
   1135   1.1.1.7  christos {
   1136  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1137  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved - must be zero */
   1138  1.1.1.14  christos     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
   1139  1.1.1.14  christos     UINT32                  LapicFlags;
   1140  1.1.1.14  christos     UINT32                  Uid;                /* ACPI processor UID */
   1141   1.1.1.7  christos 
   1142  1.1.1.14  christos } ACPI_MADT_LOCAL_X2APIC;
   1143   1.1.1.7  christos 
   1144   1.1.1.7  christos 
   1145  1.1.1.14  christos /* 10: Local X2APIC NMI (ACPI 4.0) */
   1146  1.1.1.14  christos 
   1147  1.1.1.14  christos typedef struct acpi_madt_local_x2apic_nmi
   1148  1.1.1.14  christos {
   1149  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1150  1.1.1.14  christos     UINT16                  IntiFlags;
   1151  1.1.1.14  christos     UINT32                  Uid;                /* ACPI processor UID */
   1152  1.1.1.14  christos     UINT8                   Lint;               /* LINTn to which NMI is connected */
   1153  1.1.1.14  christos     UINT8                   Reserved[3];        /* Reserved - must be zero */
   1154  1.1.1.14  christos 
   1155  1.1.1.14  christos } ACPI_MADT_LOCAL_X2APIC_NMI;
   1156  1.1.1.14  christos 
   1157  1.1.1.14  christos 
   1158  1.1.1.16  christos /* 11: Generic Interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */
   1159  1.1.1.14  christos 
   1160  1.1.1.14  christos typedef struct acpi_madt_generic_interrupt
   1161  1.1.1.14  christos {
   1162  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1163  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved - must be zero */
   1164  1.1.1.14  christos     UINT32                  CpuInterfaceNumber;
   1165  1.1.1.14  christos     UINT32                  Uid;
   1166  1.1.1.14  christos     UINT32                  Flags;
   1167  1.1.1.14  christos     UINT32                  ParkingVersion;
   1168  1.1.1.14  christos     UINT32                  PerformanceInterrupt;
   1169  1.1.1.14  christos     UINT64                  ParkedAddress;
   1170  1.1.1.14  christos     UINT64                  BaseAddress;
   1171  1.1.1.14  christos     UINT64                  GicvBaseAddress;
   1172  1.1.1.14  christos     UINT64                  GichBaseAddress;
   1173  1.1.1.14  christos     UINT32                  VgicInterrupt;
   1174  1.1.1.14  christos     UINT64                  GicrBaseAddress;
   1175  1.1.1.14  christos     UINT64                  ArmMpidr;
   1176  1.1.1.14  christos     UINT8                   EfficiencyClass;
   1177  1.1.1.16  christos     UINT8                   Reserved2[1];
   1178  1.1.1.16  christos     UINT16                  SpeInterrupt;       /* ACPI 6.3 */
   1179  1.1.1.14  christos 
   1180  1.1.1.14  christos } ACPI_MADT_GENERIC_INTERRUPT;
   1181   1.1.1.7  christos 
   1182   1.1.1.7  christos /* Masks for Flags field above */
   1183   1.1.1.7  christos 
   1184  1.1.1.14  christos /* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
   1185  1.1.1.14  christos #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
   1186  1.1.1.14  christos #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
   1187   1.1.1.7  christos 
   1188  1.1.1.11  christos 
   1189  1.1.1.14  christos /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
   1190  1.1.1.14  christos 
   1191  1.1.1.14  christos typedef struct acpi_madt_generic_distributor
   1192  1.1.1.11  christos {
   1193  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1194  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved - must be zero */
   1195  1.1.1.14  christos     UINT32                  GicId;
   1196  1.1.1.14  christos     UINT64                  BaseAddress;
   1197  1.1.1.14  christos     UINT32                  GlobalIrqBase;
   1198  1.1.1.14  christos     UINT8                   Version;
   1199  1.1.1.14  christos     UINT8                   Reserved2[3];       /* Reserved - must be zero */
   1200  1.1.1.12  christos 
   1201  1.1.1.14  christos } ACPI_MADT_GENERIC_DISTRIBUTOR;
   1202  1.1.1.11  christos 
   1203  1.1.1.14  christos /* Values for Version field above */
   1204   1.1.1.7  christos 
   1205  1.1.1.14  christos enum AcpiMadtGicVersion
   1206   1.1.1.9  christos {
   1207  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_NONE          = 0,
   1208  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_V1            = 1,
   1209  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_V2            = 2,
   1210  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_V3            = 3,
   1211  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_V4            = 4,
   1212  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_RESERVED      = 5     /* 5 and greater are reserved */
   1213  1.1.1.14  christos };
   1214   1.1.1.9  christos 
   1215   1.1.1.9  christos 
   1216  1.1.1.14  christos /* 13: Generic MSI Frame (ACPI 5.1) */
   1217  1.1.1.12  christos 
   1218  1.1.1.14  christos typedef struct acpi_madt_generic_msi_frame
   1219  1.1.1.14  christos {
   1220  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1221  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved - must be zero */
   1222  1.1.1.14  christos     UINT32                  MsiFrameId;
   1223  1.1.1.14  christos     UINT64                  BaseAddress;
   1224  1.1.1.14  christos     UINT32                  Flags;
   1225  1.1.1.14  christos     UINT16                  SpiCount;
   1226  1.1.1.14  christos     UINT16                  SpiBase;
   1227  1.1.1.14  christos 
   1228  1.1.1.14  christos } ACPI_MADT_GENERIC_MSI_FRAME;
   1229  1.1.1.12  christos 
   1230   1.1.1.9  christos /* Masks for Flags field above */
   1231   1.1.1.9  christos 
   1232  1.1.1.14  christos #define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
   1233  1.1.1.14  christos 
   1234  1.1.1.14  christos 
   1235  1.1.1.14  christos /* 14: Generic Redistributor (ACPI 5.1) */
   1236  1.1.1.14  christos 
   1237  1.1.1.14  christos typedef struct acpi_madt_generic_redistributor
   1238  1.1.1.14  christos {
   1239  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1240  1.1.1.14  christos     UINT16                  Reserved;           /* reserved - must be zero */
   1241  1.1.1.14  christos     UINT64                  BaseAddress;
   1242  1.1.1.14  christos     UINT32                  Length;
   1243  1.1.1.14  christos 
   1244  1.1.1.14  christos } ACPI_MADT_GENERIC_REDISTRIBUTOR;
   1245  1.1.1.14  christos 
   1246  1.1.1.14  christos 
   1247  1.1.1.14  christos /* 15: Generic Translator (ACPI 6.0) */
   1248  1.1.1.14  christos 
   1249  1.1.1.14  christos typedef struct acpi_madt_generic_translator
   1250  1.1.1.14  christos {
   1251  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1252  1.1.1.14  christos     UINT16                  Reserved;           /* reserved - must be zero */
   1253  1.1.1.14  christos     UINT32                  TranslationId;
   1254  1.1.1.14  christos     UINT64                  BaseAddress;
   1255  1.1.1.14  christos     UINT32                  Reserved2;
   1256  1.1.1.14  christos 
   1257  1.1.1.14  christos } ACPI_MADT_GENERIC_TRANSLATOR;
   1258  1.1.1.14  christos 
   1259  1.1.1.18  christos /* 16: Multiprocessor wakeup (ACPI 6.4) */
   1260  1.1.1.18  christos 
   1261  1.1.1.18  christos typedef struct acpi_madt_multiproc_wakeup
   1262  1.1.1.18  christos {
   1263  1.1.1.18  christos     ACPI_SUBTABLE_HEADER    Header;
   1264  1.1.1.18  christos     UINT16                  MailboxVersion;
   1265  1.1.1.18  christos     UINT32                  Reserved;           /* reserved - must be zero */
   1266  1.1.1.18  christos     UINT64                  BaseAddress;
   1267  1.1.1.18  christos 
   1268  1.1.1.18  christos } ACPI_MADT_MULTIPROC_WAKEUP;
   1269  1.1.1.18  christos 
   1270  1.1.1.22  christos #define ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE        2032
   1271  1.1.1.22  christos #define ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE  2048
   1272  1.1.1.19  christos 
   1273  1.1.1.19  christos typedef struct acpi_madt_multiproc_wakeup_mailbox
   1274  1.1.1.19  christos {
   1275  1.1.1.19  christos     UINT16                  Command;
   1276  1.1.1.19  christos     UINT16                  Reserved; /* reserved - must be zero */
   1277  1.1.1.19  christos     UINT32                  ApicId;
   1278  1.1.1.19  christos     UINT64                  WakeupVector;
   1279  1.1.1.19  christos     UINT8                   ReservedOs[ACPI_MULTIPROC_WAKEUP_MB_OS_SIZE]; /* reserved for OS use */
   1280  1.1.1.19  christos     UINT8                   ReservedFirmware[ACPI_MULTIPROC_WAKEUP_MB_FIRMWARE_SIZE]; /* reserved for firmware use */
   1281  1.1.1.19  christos 
   1282  1.1.1.19  christos } ACPI_MADT_MULTIPROC_WAKEUP_MAILBOX;
   1283  1.1.1.19  christos 
   1284  1.1.1.19  christos #define ACPI_MP_WAKE_COMMAND_WAKEUP    1
   1285  1.1.1.19  christos 
   1286  1.1.1.22  christos /* 17: OEM data */
   1287  1.1.1.22  christos 
   1288  1.1.1.22  christos typedef struct acpi_madt_oem_data
   1289  1.1.1.22  christos {
   1290  1.1.1.22  christos     UINT8                   OemData[0];
   1291  1.1.1.22  christos } ACPI_MADT_OEM_DATA;
   1292  1.1.1.22  christos 
   1293  1.1.1.14  christos 
   1294  1.1.1.14  christos /*
   1295  1.1.1.14  christos  * Common flags fields for MADT subtables
   1296  1.1.1.14  christos  */
   1297  1.1.1.14  christos 
   1298  1.1.1.14  christos /* MADT Local APIC flags */
   1299  1.1.1.14  christos 
   1300  1.1.1.14  christos #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
   1301  1.1.1.20  christos #define ACPI_MADT_ONLINE_CAPABLE    (2)         /* 01: System HW supports enabling processor at runtime */
   1302  1.1.1.14  christos 
   1303  1.1.1.14  christos /* MADT MPS INTI flags (IntiFlags) */
   1304  1.1.1.14  christos 
   1305  1.1.1.14  christos #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
   1306  1.1.1.14  christos #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
   1307  1.1.1.14  christos 
   1308  1.1.1.14  christos /* Values for MPS INTI flags */
   1309  1.1.1.14  christos 
   1310  1.1.1.14  christos #define ACPI_MADT_POLARITY_CONFORMS       0
   1311  1.1.1.14  christos #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
   1312  1.1.1.14  christos #define ACPI_MADT_POLARITY_RESERVED       2
   1313  1.1.1.14  christos #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
   1314  1.1.1.14  christos 
   1315  1.1.1.14  christos #define ACPI_MADT_TRIGGER_CONFORMS        (0)
   1316  1.1.1.14  christos #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
   1317  1.1.1.14  christos #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
   1318  1.1.1.14  christos #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
   1319   1.1.1.9  christos 
   1320   1.1.1.9  christos 
   1321   1.1.1.7  christos /*******************************************************************************
   1322   1.1.1.7  christos  *
   1323  1.1.1.14  christos  * MCFG - PCI Memory Mapped Configuration table and subtable
   1324       1.1    jruoho  *        Version 1
   1325       1.1    jruoho  *
   1326  1.1.1.14  christos  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
   1327       1.1    jruoho  *
   1328       1.1    jruoho  ******************************************************************************/
   1329       1.1    jruoho 
   1330  1.1.1.14  christos typedef struct acpi_table_mcfg
   1331       1.1    jruoho {
   1332       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1333  1.1.1.14  christos     UINT8                   Reserved[8];
   1334       1.1    jruoho 
   1335  1.1.1.14  christos } ACPI_TABLE_MCFG;
   1336       1.1    jruoho 
   1337       1.1    jruoho 
   1338  1.1.1.14  christos /* Subtable */
   1339       1.1    jruoho 
   1340  1.1.1.14  christos typedef struct acpi_mcfg_allocation
   1341  1.1.1.14  christos {
   1342  1.1.1.14  christos     UINT64                  Address;            /* Base address, processor-relative */
   1343  1.1.1.14  christos     UINT16                  PciSegment;         /* PCI segment group number */
   1344  1.1.1.14  christos     UINT8                   StartBusNumber;     /* Starting PCI Bus number */
   1345  1.1.1.14  christos     UINT8                   EndBusNumber;       /* Final PCI Bus number */
   1346  1.1.1.14  christos     UINT32                  Reserved;
   1347       1.1    jruoho 
   1348  1.1.1.14  christos } ACPI_MCFG_ALLOCATION;
   1349       1.1    jruoho 
   1350  1.1.1.14  christos 
   1351  1.1.1.14  christos /*******************************************************************************
   1352  1.1.1.14  christos  *
   1353  1.1.1.14  christos  * MCHI - Management Controller Host Interface Table
   1354  1.1.1.14  christos  *        Version 1
   1355  1.1.1.14  christos  *
   1356  1.1.1.14  christos  * Conforms to "Management Component Transport Protocol (MCTP) Host
   1357  1.1.1.14  christos  * Interface Specification", Revision 1.0.0a, October 13, 2009
   1358  1.1.1.14  christos  *
   1359  1.1.1.14  christos  ******************************************************************************/
   1360  1.1.1.14  christos 
   1361  1.1.1.14  christos typedef struct acpi_table_mchi
   1362       1.1    jruoho {
   1363  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1364  1.1.1.14  christos     UINT8                   InterfaceType;
   1365  1.1.1.14  christos     UINT8                   Protocol;
   1366  1.1.1.14  christos     UINT64                  ProtocolData;
   1367  1.1.1.14  christos     UINT8                   InterruptType;
   1368  1.1.1.14  christos     UINT8                   Gpe;
   1369  1.1.1.14  christos     UINT8                   PciDeviceFlag;
   1370  1.1.1.14  christos     UINT32                  GlobalInterrupt;
   1371  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    ControlRegister;
   1372  1.1.1.14  christos     UINT8                   PciSegment;
   1373  1.1.1.14  christos     UINT8                   PciBus;
   1374  1.1.1.14  christos     UINT8                   PciDevice;
   1375  1.1.1.14  christos     UINT8                   PciFunction;
   1376       1.1    jruoho 
   1377  1.1.1.14  christos } ACPI_TABLE_MCHI;
   1378       1.1    jruoho 
   1379       1.1    jruoho 
   1380  1.1.1.14  christos /*******************************************************************************
   1381  1.1.1.14  christos  *
   1382  1.1.1.14  christos  * MPST - Memory Power State Table (ACPI 5.0)
   1383  1.1.1.14  christos  *        Version 1
   1384  1.1.1.14  christos  *
   1385  1.1.1.14  christos  ******************************************************************************/
   1386  1.1.1.14  christos 
   1387  1.1.1.14  christos #define ACPI_MPST_CHANNEL_INFO \
   1388  1.1.1.14  christos     UINT8                   ChannelId; \
   1389  1.1.1.14  christos     UINT8                   Reserved1[3]; \
   1390  1.1.1.14  christos     UINT16                  PowerNodeCount; \
   1391  1.1.1.14  christos     UINT16                  Reserved2;
   1392  1.1.1.14  christos 
   1393  1.1.1.14  christos /* Main table */
   1394  1.1.1.14  christos 
   1395  1.1.1.14  christos typedef struct acpi_table_mpst
   1396       1.1    jruoho {
   1397  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1398  1.1.1.14  christos     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
   1399       1.1    jruoho 
   1400  1.1.1.14  christos } ACPI_TABLE_MPST;
   1401       1.1    jruoho 
   1402       1.1    jruoho 
   1403  1.1.1.14  christos /* Memory Platform Communication Channel Info */
   1404       1.1    jruoho 
   1405  1.1.1.14  christos typedef struct acpi_mpst_channel
   1406  1.1.1.14  christos {
   1407  1.1.1.14  christos     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
   1408       1.1    jruoho 
   1409  1.1.1.14  christos } ACPI_MPST_CHANNEL;
   1410       1.1    jruoho 
   1411       1.1    jruoho 
   1412  1.1.1.14  christos /* Memory Power Node Structure */
   1413       1.1    jruoho 
   1414  1.1.1.14  christos typedef struct acpi_mpst_power_node
   1415       1.1    jruoho {
   1416  1.1.1.14  christos     UINT8                   Flags;
   1417  1.1.1.14  christos     UINT8                   Reserved1;
   1418  1.1.1.14  christos     UINT16                  NodeId;
   1419  1.1.1.14  christos     UINT32                  Length;
   1420  1.1.1.14  christos     UINT64                  RangeAddress;
   1421  1.1.1.14  christos     UINT64                  RangeLength;
   1422  1.1.1.14  christos     UINT32                  NumPowerStates;
   1423  1.1.1.14  christos     UINT32                  NumPhysicalComponents;
   1424       1.1    jruoho 
   1425  1.1.1.14  christos } ACPI_MPST_POWER_NODE;
   1426       1.1    jruoho 
   1427  1.1.1.14  christos /* Values for Flags field above */
   1428       1.1    jruoho 
   1429  1.1.1.14  christos #define ACPI_MPST_ENABLED               1
   1430  1.1.1.14  christos #define ACPI_MPST_POWER_MANAGED         2
   1431  1.1.1.14  christos #define ACPI_MPST_HOT_PLUG_CAPABLE      4
   1432       1.1    jruoho 
   1433       1.1    jruoho 
   1434  1.1.1.14  christos /* Memory Power State Structure (follows POWER_NODE above) */
   1435  1.1.1.14  christos 
   1436  1.1.1.14  christos typedef struct acpi_mpst_power_state
   1437       1.1    jruoho {
   1438  1.1.1.14  christos     UINT8                   PowerState;
   1439  1.1.1.14  christos     UINT8                   InfoIndex;
   1440       1.1    jruoho 
   1441  1.1.1.14  christos } ACPI_MPST_POWER_STATE;
   1442       1.1    jruoho 
   1443       1.1    jruoho 
   1444  1.1.1.14  christos /* Physical Component ID Structure (follows POWER_STATE above) */
   1445       1.1    jruoho 
   1446  1.1.1.14  christos typedef struct acpi_mpst_component
   1447  1.1.1.14  christos {
   1448  1.1.1.14  christos     UINT16                  ComponentId;
   1449       1.1    jruoho 
   1450  1.1.1.14  christos } ACPI_MPST_COMPONENT;
   1451  1.1.1.14  christos 
   1452  1.1.1.14  christos 
   1453  1.1.1.14  christos /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
   1454  1.1.1.14  christos 
   1455  1.1.1.14  christos typedef struct acpi_mpst_data_hdr
   1456       1.1    jruoho {
   1457  1.1.1.14  christos     UINT16                  CharacteristicsCount;
   1458  1.1.1.14  christos     UINT16                  Reserved;
   1459       1.1    jruoho 
   1460  1.1.1.14  christos } ACPI_MPST_DATA_HDR;
   1461       1.1    jruoho 
   1462  1.1.1.14  christos typedef struct acpi_mpst_power_data
   1463  1.1.1.14  christos {
   1464  1.1.1.14  christos     UINT8                   StructureId;
   1465  1.1.1.14  christos     UINT8                   Flags;
   1466  1.1.1.14  christos     UINT16                  Reserved1;
   1467  1.1.1.14  christos     UINT32                  AveragePower;
   1468  1.1.1.14  christos     UINT32                  PowerSaving;
   1469  1.1.1.14  christos     UINT64                  ExitLatency;
   1470  1.1.1.14  christos     UINT64                  Reserved2;
   1471       1.1    jruoho 
   1472  1.1.1.14  christos } ACPI_MPST_POWER_DATA;
   1473       1.1    jruoho 
   1474  1.1.1.14  christos /* Values for Flags field above */
   1475       1.1    jruoho 
   1476  1.1.1.14  christos #define ACPI_MPST_PRESERVE              1
   1477  1.1.1.14  christos #define ACPI_MPST_AUTOENTRY             2
   1478  1.1.1.14  christos #define ACPI_MPST_AUTOEXIT              4
   1479       1.1    jruoho 
   1480       1.1    jruoho 
   1481  1.1.1.14  christos /* Shared Memory Region (not part of an ACPI table) */
   1482       1.1    jruoho 
   1483  1.1.1.14  christos typedef struct acpi_mpst_shared
   1484       1.1    jruoho {
   1485  1.1.1.14  christos     UINT32                  Signature;
   1486  1.1.1.14  christos     UINT16                  PccCommand;
   1487  1.1.1.14  christos     UINT16                  PccStatus;
   1488  1.1.1.14  christos     UINT32                  CommandRegister;
   1489  1.1.1.14  christos     UINT32                  StatusRegister;
   1490  1.1.1.14  christos     UINT32                  PowerStateId;
   1491  1.1.1.14  christos     UINT32                  PowerNodeId;
   1492  1.1.1.14  christos     UINT64                  EnergyConsumed;
   1493  1.1.1.14  christos     UINT64                  AveragePower;
   1494       1.1    jruoho 
   1495  1.1.1.14  christos } ACPI_MPST_SHARED;
   1496       1.1    jruoho 
   1497       1.1    jruoho 
   1498  1.1.1.14  christos /*******************************************************************************
   1499  1.1.1.14  christos  *
   1500  1.1.1.14  christos  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
   1501  1.1.1.14  christos  *        Version 1
   1502  1.1.1.14  christos  *
   1503  1.1.1.14  christos  ******************************************************************************/
   1504  1.1.1.14  christos 
   1505  1.1.1.14  christos typedef struct acpi_table_msct
   1506       1.1    jruoho {
   1507  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1508  1.1.1.14  christos     UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
   1509  1.1.1.14  christos     UINT32                  MaxProximityDomains;/* Max number of proximity domains */
   1510  1.1.1.14  christos     UINT32                  MaxClockDomains;    /* Max number of clock domains */
   1511  1.1.1.14  christos     UINT64                  MaxAddress;         /* Max physical address in system */
   1512       1.1    jruoho 
   1513  1.1.1.14  christos } ACPI_TABLE_MSCT;
   1514       1.1    jruoho 
   1515       1.1    jruoho 
   1516  1.1.1.14  christos /* Subtable - Maximum Proximity Domain Information. Version 1 */
   1517  1.1.1.14  christos 
   1518  1.1.1.14  christos typedef struct acpi_msct_proximity
   1519       1.1    jruoho {
   1520  1.1.1.14  christos     UINT8                   Revision;
   1521  1.1.1.14  christos     UINT8                   Length;
   1522  1.1.1.14  christos     UINT32                  RangeStart;         /* Start of domain range */
   1523  1.1.1.14  christos     UINT32                  RangeEnd;           /* End of domain range */
   1524  1.1.1.14  christos     UINT32                  ProcessorCapacity;
   1525  1.1.1.14  christos     UINT64                  MemoryCapacity;     /* In bytes */
   1526       1.1    jruoho 
   1527  1.1.1.14  christos } ACPI_MSCT_PROXIMITY;
   1528       1.1    jruoho 
   1529       1.1    jruoho 
   1530  1.1.1.14  christos /*******************************************************************************
   1531  1.1.1.14  christos  *
   1532  1.1.1.14  christos  * MSDM - Microsoft Data Management table
   1533  1.1.1.14  christos  *
   1534  1.1.1.14  christos  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
   1535  1.1.1.14  christos  * November 29, 2011. Copyright 2011 Microsoft
   1536  1.1.1.14  christos  *
   1537  1.1.1.14  christos  ******************************************************************************/
   1538       1.1    jruoho 
   1539  1.1.1.14  christos /* Basic MSDM table is only the common ACPI header */
   1540       1.1    jruoho 
   1541  1.1.1.14  christos typedef struct acpi_table_msdm
   1542       1.1    jruoho {
   1543  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1544       1.1    jruoho 
   1545  1.1.1.14  christos } ACPI_TABLE_MSDM;
   1546       1.1    jruoho 
   1547       1.1    jruoho 
   1548  1.1.1.14  christos /*******************************************************************************
   1549  1.1.1.14  christos  *
   1550  1.1.1.14  christos  * NFIT - NVDIMM Interface Table (ACPI 6.0+)
   1551  1.1.1.14  christos  *        Version 1
   1552   1.1.1.5  christos  *
   1553   1.1.1.5  christos  ******************************************************************************/
   1554   1.1.1.5  christos 
   1555  1.1.1.14  christos typedef struct acpi_table_nfit
   1556   1.1.1.5  christos {
   1557   1.1.1.5  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1558  1.1.1.14  christos     UINT32                  Reserved;           /* Reserved, must be zero */
   1559   1.1.1.5  christos 
   1560  1.1.1.14  christos } ACPI_TABLE_NFIT;
   1561   1.1.1.5  christos 
   1562  1.1.1.14  christos /* Subtable header for NFIT */
   1563   1.1.1.5  christos 
   1564  1.1.1.14  christos typedef struct acpi_nfit_header
   1565   1.1.1.5  christos {
   1566  1.1.1.14  christos     UINT16                   Type;
   1567  1.1.1.14  christos     UINT16                   Length;
   1568   1.1.1.5  christos 
   1569  1.1.1.14  christos } ACPI_NFIT_HEADER;
   1570   1.1.1.5  christos 
   1571   1.1.1.5  christos 
   1572  1.1.1.14  christos /* Values for subtable type in ACPI_NFIT_HEADER */
   1573  1.1.1.14  christos 
   1574  1.1.1.14  christos enum AcpiNfitType
   1575   1.1.1.5  christos {
   1576  1.1.1.14  christos     ACPI_NFIT_TYPE_SYSTEM_ADDRESS       = 0,
   1577  1.1.1.14  christos     ACPI_NFIT_TYPE_MEMORY_MAP           = 1,
   1578  1.1.1.14  christos     ACPI_NFIT_TYPE_INTERLEAVE           = 2,
   1579  1.1.1.14  christos     ACPI_NFIT_TYPE_SMBIOS               = 3,
   1580  1.1.1.14  christos     ACPI_NFIT_TYPE_CONTROL_REGION       = 4,
   1581  1.1.1.14  christos     ACPI_NFIT_TYPE_DATA_REGION          = 5,
   1582  1.1.1.14  christos     ACPI_NFIT_TYPE_FLUSH_ADDRESS        = 6,
   1583  1.1.1.14  christos     ACPI_NFIT_TYPE_CAPABILITIES         = 7,
   1584  1.1.1.14  christos     ACPI_NFIT_TYPE_RESERVED             = 8     /* 8 and greater are reserved */
   1585   1.1.1.5  christos };
   1586   1.1.1.5  christos 
   1587   1.1.1.5  christos /*
   1588  1.1.1.14  christos  * NFIT Subtables
   1589   1.1.1.5  christos  */
   1590   1.1.1.5  christos 
   1591  1.1.1.14  christos /* 0: System Physical Address Range Structure */
   1592   1.1.1.5  christos 
   1593  1.1.1.14  christos typedef struct acpi_nfit_system_address
   1594   1.1.1.5  christos {
   1595  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1596  1.1.1.14  christos     UINT16                  RangeIndex;
   1597  1.1.1.14  christos     UINT16                  Flags;
   1598  1.1.1.14  christos     UINT32                  Reserved;           /* Reserved, must be zero */
   1599  1.1.1.14  christos     UINT32                  ProximityDomain;
   1600  1.1.1.14  christos     UINT8                   RangeGuid[16];
   1601  1.1.1.14  christos     UINT64                  Address;
   1602  1.1.1.14  christos     UINT64                  Length;
   1603  1.1.1.14  christos     UINT64                  MemoryMapping;
   1604  1.1.1.18  christos     UINT64                  LocationCookie;     /* ACPI 6.4 */
   1605   1.1.1.5  christos 
   1606  1.1.1.14  christos } ACPI_NFIT_SYSTEM_ADDRESS;
   1607   1.1.1.5  christos 
   1608  1.1.1.14  christos /* Flags */
   1609   1.1.1.5  christos 
   1610  1.1.1.14  christos #define ACPI_NFIT_ADD_ONLINE_ONLY       (1)     /* 00: Add/Online Operation Only */
   1611  1.1.1.14  christos #define ACPI_NFIT_PROXIMITY_VALID       (1<<1)  /* 01: Proximity Domain Valid */
   1612  1.1.1.18  christos #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2)  /* 02: SPA location cookie valid (ACPI 6.4) */
   1613       1.1    jruoho 
   1614  1.1.1.14  christos /* Range Type GUIDs appear in the include/acuuid.h file */
   1615  1.1.1.14  christos 
   1616  1.1.1.14  christos 
   1617  1.1.1.14  christos /* 1: Memory Device to System Address Range Map Structure */
   1618  1.1.1.14  christos 
   1619  1.1.1.14  christos typedef struct acpi_nfit_memory_map
   1620       1.1    jruoho {
   1621  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1622  1.1.1.14  christos     UINT32                  DeviceHandle;
   1623  1.1.1.14  christos     UINT16                  PhysicalId;
   1624  1.1.1.14  christos     UINT16                  RegionId;
   1625  1.1.1.14  christos     UINT16                  RangeIndex;
   1626  1.1.1.14  christos     UINT16                  RegionIndex;
   1627  1.1.1.14  christos     UINT64                  RegionSize;
   1628  1.1.1.14  christos     UINT64                  RegionOffset;
   1629  1.1.1.14  christos     UINT64                  Address;
   1630  1.1.1.14  christos     UINT16                  InterleaveIndex;
   1631  1.1.1.14  christos     UINT16                  InterleaveWays;
   1632  1.1.1.14  christos     UINT16                  Flags;
   1633  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved, must be zero */
   1634       1.1    jruoho 
   1635  1.1.1.14  christos } ACPI_NFIT_MEMORY_MAP;
   1636       1.1    jruoho 
   1637  1.1.1.14  christos /* Flags */
   1638       1.1    jruoho 
   1639  1.1.1.14  christos #define ACPI_NFIT_MEM_SAVE_FAILED       (1)     /* 00: Last SAVE to Memory Device failed */
   1640  1.1.1.14  christos #define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)  /* 01: Last RESTORE from Memory Device failed */
   1641  1.1.1.14  christos #define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)  /* 02: Platform flush failed */
   1642  1.1.1.14  christos #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)  /* 03: Memory Device is not armed */
   1643  1.1.1.14  christos #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)  /* 04: Memory Device observed SMART/health events */
   1644  1.1.1.14  christos #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)  /* 05: SMART/health events enabled */
   1645  1.1.1.14  christos #define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)  /* 06: Mapping to SPA failed */
   1646       1.1    jruoho 
   1647  1.1.1.14  christos 
   1648  1.1.1.14  christos /* 2: Interleave Structure */
   1649  1.1.1.14  christos 
   1650  1.1.1.14  christos typedef struct acpi_nfit_interleave
   1651       1.1    jruoho {
   1652  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1653  1.1.1.14  christos     UINT16                  InterleaveIndex;
   1654  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved, must be zero */
   1655  1.1.1.14  christos     UINT32                  LineCount;
   1656  1.1.1.14  christos     UINT32                  LineSize;
   1657  1.1.1.14  christos     UINT32                  LineOffset[1];      /* Variable length */
   1658       1.1    jruoho 
   1659  1.1.1.14  christos } ACPI_NFIT_INTERLEAVE;
   1660  1.1.1.14  christos 
   1661  1.1.1.14  christos 
   1662  1.1.1.14  christos /* 3: SMBIOS Management Information Structure */
   1663  1.1.1.14  christos 
   1664  1.1.1.14  christos typedef struct acpi_nfit_smbios
   1665  1.1.1.14  christos {
   1666  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1667  1.1.1.14  christos     UINT32                  Reserved;           /* Reserved, must be zero */
   1668  1.1.1.14  christos     UINT8                   Data[1];            /* Variable length */
   1669  1.1.1.14  christos 
   1670  1.1.1.14  christos } ACPI_NFIT_SMBIOS;
   1671  1.1.1.14  christos 
   1672  1.1.1.14  christos 
   1673  1.1.1.14  christos /* 4: NVDIMM Control Region Structure */
   1674  1.1.1.14  christos 
   1675  1.1.1.14  christos typedef struct acpi_nfit_control_region
   1676  1.1.1.14  christos {
   1677  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1678  1.1.1.14  christos     UINT16                  RegionIndex;
   1679  1.1.1.14  christos     UINT16                  VendorId;
   1680  1.1.1.14  christos     UINT16                  DeviceId;
   1681  1.1.1.14  christos     UINT16                  RevisionId;
   1682  1.1.1.14  christos     UINT16                  SubsystemVendorId;
   1683  1.1.1.14  christos     UINT16                  SubsystemDeviceId;
   1684  1.1.1.14  christos     UINT16                  SubsystemRevisionId;
   1685  1.1.1.14  christos     UINT8                   ValidFields;
   1686  1.1.1.14  christos     UINT8                   ManufacturingLocation;
   1687  1.1.1.14  christos     UINT16                  ManufacturingDate;
   1688  1.1.1.14  christos     UINT8                   Reserved[2];        /* Reserved, must be zero */
   1689  1.1.1.14  christos     UINT32                  SerialNumber;
   1690  1.1.1.14  christos     UINT16                  Code;
   1691  1.1.1.14  christos     UINT16                  Windows;
   1692  1.1.1.14  christos     UINT64                  WindowSize;
   1693  1.1.1.14  christos     UINT64                  CommandOffset;
   1694  1.1.1.14  christos     UINT64                  CommandSize;
   1695  1.1.1.14  christos     UINT64                  StatusOffset;
   1696  1.1.1.14  christos     UINT64                  StatusSize;
   1697  1.1.1.14  christos     UINT16                  Flags;
   1698  1.1.1.14  christos     UINT8                   Reserved1[6];       /* Reserved, must be zero */
   1699  1.1.1.14  christos 
   1700  1.1.1.14  christos } ACPI_NFIT_CONTROL_REGION;
   1701  1.1.1.14  christos 
   1702  1.1.1.14  christos /* Flags */
   1703  1.1.1.14  christos 
   1704  1.1.1.14  christos #define ACPI_NFIT_CONTROL_BUFFERED          (1)     /* Block Data Windows implementation is buffered */
   1705  1.1.1.14  christos 
   1706  1.1.1.14  christos /* ValidFields bits */
   1707  1.1.1.14  christos 
   1708  1.1.1.14  christos #define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)     /* Manufacturing fields are valid */
   1709  1.1.1.14  christos 
   1710  1.1.1.14  christos 
   1711  1.1.1.14  christos /* 5: NVDIMM Block Data Window Region Structure */
   1712  1.1.1.14  christos 
   1713  1.1.1.14  christos typedef struct acpi_nfit_data_region
   1714  1.1.1.14  christos {
   1715  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1716  1.1.1.14  christos     UINT16                  RegionIndex;
   1717  1.1.1.14  christos     UINT16                  Windows;
   1718  1.1.1.14  christos     UINT64                  Offset;
   1719  1.1.1.14  christos     UINT64                  Size;
   1720  1.1.1.14  christos     UINT64                  Capacity;
   1721  1.1.1.14  christos     UINT64                  StartAddress;
   1722  1.1.1.14  christos 
   1723  1.1.1.14  christos } ACPI_NFIT_DATA_REGION;
   1724  1.1.1.14  christos 
   1725  1.1.1.14  christos 
   1726  1.1.1.14  christos /* 6: Flush Hint Address Structure */
   1727  1.1.1.14  christos 
   1728  1.1.1.14  christos typedef struct acpi_nfit_flush_address
   1729  1.1.1.14  christos {
   1730  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1731  1.1.1.14  christos     UINT32                  DeviceHandle;
   1732  1.1.1.14  christos     UINT16                  HintCount;
   1733  1.1.1.14  christos     UINT8                   Reserved[6];        /* Reserved, must be zero */
   1734  1.1.1.14  christos     UINT64                  HintAddress[1];     /* Variable length */
   1735  1.1.1.14  christos 
   1736  1.1.1.14  christos } ACPI_NFIT_FLUSH_ADDRESS;
   1737  1.1.1.14  christos 
   1738  1.1.1.14  christos 
   1739  1.1.1.14  christos /* 7: Platform Capabilities Structure */
   1740  1.1.1.14  christos 
   1741  1.1.1.14  christos typedef struct acpi_nfit_capabilities
   1742  1.1.1.14  christos {
   1743  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1744  1.1.1.14  christos     UINT8                   HighestCapability;
   1745  1.1.1.14  christos     UINT8                   Reserved[3];       /* Reserved, must be zero */
   1746  1.1.1.14  christos     UINT32                  Capabilities;
   1747  1.1.1.14  christos     UINT32                  Reserved2;
   1748  1.1.1.14  christos 
   1749  1.1.1.14  christos } ACPI_NFIT_CAPABILITIES;
   1750  1.1.1.14  christos 
   1751  1.1.1.14  christos /* Capabilities Flags */
   1752  1.1.1.14  christos 
   1753  1.1.1.14  christos #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH       (1)     /* 00: Cache Flush to NVDIMM capable */
   1754  1.1.1.14  christos #define ACPI_NFIT_CAPABILITY_MEM_FLUSH         (1<<1)  /* 01: Memory Flush to NVDIMM capable */
   1755  1.1.1.14  christos #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING     (1<<2)  /* 02: Memory Mirroring capable */
   1756  1.1.1.14  christos 
   1757  1.1.1.14  christos 
   1758  1.1.1.14  christos /*
   1759  1.1.1.14  christos  * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
   1760  1.1.1.14  christos  */
   1761  1.1.1.14  christos typedef struct nfit_device_handle
   1762  1.1.1.14  christos {
   1763  1.1.1.14  christos     UINT32                  Handle;
   1764  1.1.1.14  christos 
   1765  1.1.1.14  christos } NFIT_DEVICE_HANDLE;
   1766  1.1.1.14  christos 
   1767  1.1.1.14  christos /* Device handle construction and extraction macros */
   1768  1.1.1.14  christos 
   1769  1.1.1.14  christos #define ACPI_NFIT_DIMM_NUMBER_MASK              0x0000000F
   1770  1.1.1.14  christos #define ACPI_NFIT_CHANNEL_NUMBER_MASK           0x000000F0
   1771  1.1.1.14  christos #define ACPI_NFIT_MEMORY_ID_MASK                0x00000F00
   1772  1.1.1.14  christos #define ACPI_NFIT_SOCKET_ID_MASK                0x0000F000
   1773  1.1.1.14  christos #define ACPI_NFIT_NODE_ID_MASK                  0x0FFF0000
   1774  1.1.1.14  christos 
   1775  1.1.1.14  christos #define ACPI_NFIT_DIMM_NUMBER_OFFSET            0
   1776  1.1.1.14  christos #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET         4
   1777  1.1.1.14  christos #define ACPI_NFIT_MEMORY_ID_OFFSET              8
   1778  1.1.1.14  christos #define ACPI_NFIT_SOCKET_ID_OFFSET              12
   1779  1.1.1.14  christos #define ACPI_NFIT_NODE_ID_OFFSET                16
   1780  1.1.1.14  christos 
   1781  1.1.1.14  christos /* Macro to construct a NFIT/NVDIMM device handle */
   1782  1.1.1.14  christos 
   1783  1.1.1.14  christos #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
   1784  1.1.1.14  christos     ((dimm)                                         | \
   1785  1.1.1.14  christos     ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET)  | \
   1786  1.1.1.14  christos     ((memory)  << ACPI_NFIT_MEMORY_ID_OFFSET)       | \
   1787  1.1.1.14  christos     ((socket)  << ACPI_NFIT_SOCKET_ID_OFFSET)       | \
   1788  1.1.1.14  christos     ((node)    << ACPI_NFIT_NODE_ID_OFFSET))
   1789  1.1.1.14  christos 
   1790  1.1.1.14  christos /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
   1791  1.1.1.14  christos 
   1792  1.1.1.14  christos #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
   1793  1.1.1.14  christos     ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
   1794  1.1.1.14  christos 
   1795  1.1.1.14  christos #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
   1796  1.1.1.14  christos     (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
   1797  1.1.1.14  christos 
   1798  1.1.1.14  christos #define ACPI_NFIT_GET_MEMORY_ID(handle) \
   1799  1.1.1.14  christos     (((handle) & ACPI_NFIT_MEMORY_ID_MASK)      >> ACPI_NFIT_MEMORY_ID_OFFSET)
   1800  1.1.1.14  christos 
   1801  1.1.1.14  christos #define ACPI_NFIT_GET_SOCKET_ID(handle) \
   1802  1.1.1.14  christos     (((handle) & ACPI_NFIT_SOCKET_ID_MASK)      >> ACPI_NFIT_SOCKET_ID_OFFSET)
   1803  1.1.1.14  christos 
   1804  1.1.1.14  christos #define ACPI_NFIT_GET_NODE_ID(handle) \
   1805  1.1.1.14  christos     (((handle) & ACPI_NFIT_NODE_ID_MASK)        >> ACPI_NFIT_NODE_ID_OFFSET)
   1806       1.1    jruoho 
   1807       1.1    jruoho 
   1808       1.1    jruoho /*******************************************************************************
   1809       1.1    jruoho  *
   1810  1.1.1.20  christos  * NHLT - Non HD Audio Link Table
   1811  1.1.1.20  christos  *
   1812  1.1.1.20  christos  * Conforms to: Intel Smart Sound Technology NHLT Specification
   1813  1.1.1.20  christos  * Version 0.8.1, January 2020.
   1814  1.1.1.20  christos  *
   1815  1.1.1.20  christos  ******************************************************************************/
   1816  1.1.1.20  christos 
   1817  1.1.1.20  christos /* Main table */
   1818  1.1.1.20  christos 
   1819  1.1.1.20  christos typedef struct acpi_table_nhlt
   1820  1.1.1.20  christos {
   1821  1.1.1.20  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1822  1.1.1.20  christos     UINT8                   EndpointCount;
   1823  1.1.1.20  christos 
   1824  1.1.1.20  christos } ACPI_TABLE_NHLT;
   1825  1.1.1.20  christos 
   1826  1.1.1.21  christos typedef struct acpi_table_nhlt_endpoint_count
   1827  1.1.1.21  christos {
   1828  1.1.1.21  christos     UINT8                   EndpointCount;
   1829  1.1.1.21  christos 
   1830  1.1.1.21  christos } ACPI_TABLE_NHLT_ENDPOINT_COUNT;
   1831  1.1.1.21  christos 
   1832  1.1.1.20  christos typedef struct acpi_nhlt_endpoint
   1833  1.1.1.20  christos {
   1834  1.1.1.20  christos     UINT32                  DescriptorLength;
   1835  1.1.1.20  christos     UINT8                   LinkType;
   1836  1.1.1.20  christos     UINT8                   InstanceId;
   1837  1.1.1.20  christos     UINT16                  VendorId;
   1838  1.1.1.20  christos     UINT16                  DeviceId;
   1839  1.1.1.20  christos     UINT16                  RevisionId;
   1840  1.1.1.20  christos     UINT32                  SubsystemId;
   1841  1.1.1.20  christos     UINT8                   DeviceType;
   1842  1.1.1.20  christos     UINT8                   Direction;
   1843  1.1.1.20  christos     UINT8                   VirtualBusId;
   1844  1.1.1.20  christos 
   1845  1.1.1.20  christos } ACPI_NHLT_ENDPOINT;
   1846  1.1.1.20  christos 
   1847  1.1.1.20  christos /* Types for LinkType field above */
   1848  1.1.1.20  christos 
   1849  1.1.1.20  christos #define ACPI_NHLT_RESERVED_HD_AUDIO         0
   1850  1.1.1.20  christos #define ACPI_NHLT_RESERVED_DSP              1
   1851  1.1.1.20  christos #define ACPI_NHLT_PDM                       2
   1852  1.1.1.20  christos #define ACPI_NHLT_SSP                       3
   1853  1.1.1.20  christos #define ACPI_NHLT_RESERVED_SLIMBUS          4
   1854  1.1.1.20  christos #define ACPI_NHLT_RESERVED_SOUNDWIRE        5
   1855  1.1.1.20  christos #define ACPI_NHLT_TYPE_RESERVED             6 /* 6 and above are reserved */
   1856  1.1.1.20  christos 
   1857  1.1.1.20  christos /* All other values above are reserved */
   1858  1.1.1.20  christos 
   1859  1.1.1.20  christos /* Values for DeviceId field above */
   1860  1.1.1.20  christos 
   1861  1.1.1.20  christos #define ACPI_NHLT_PDM_DMIC                  0xAE20
   1862  1.1.1.20  christos #define ACPI_NHLT_BT_SIDEBAND               0xAE30
   1863  1.1.1.20  christos #define ACPI_NHLT_I2S_TDM_CODECS            0xAE23
   1864  1.1.1.20  christos 
   1865  1.1.1.20  christos /* Values for DeviceType field above */
   1866  1.1.1.20  christos 
   1867  1.1.1.20  christos /* SSP Link */
   1868  1.1.1.20  christos 
   1869  1.1.1.20  christos #define ACPI_NHLT_LINK_BT_SIDEBAND          0
   1870  1.1.1.20  christos #define ACPI_NHLT_LINK_FM                   1
   1871  1.1.1.20  christos #define ACPI_NHLT_LINK_MODEM                2
   1872  1.1.1.20  christos /* 3 is reserved */
   1873  1.1.1.20  christos #define ACPI_NHLT_LINK_SSP_ANALOG_CODEC     4
   1874  1.1.1.20  christos 
   1875  1.1.1.20  christos /* PDM Link */
   1876  1.1.1.20  christos 
   1877  1.1.1.20  christos #define ACPI_NHLT_PDM_ON_CAVS_1P8           0
   1878  1.1.1.20  christos #define ACPI_NHLT_PDM_ON_CAVS_1P5           1
   1879  1.1.1.20  christos 
   1880  1.1.1.20  christos /* Values for Direction field above */
   1881  1.1.1.20  christos 
   1882  1.1.1.20  christos #define ACPI_NHLT_DIR_RENDER                0
   1883  1.1.1.20  christos #define ACPI_NHLT_DIR_CAPTURE               1
   1884  1.1.1.20  christos #define ACPI_NHLT_DIR_RENDER_LOOPBACK       2
   1885  1.1.1.20  christos #define ACPI_NHLT_DIR_RENDER_FEEDBACK       3
   1886  1.1.1.20  christos #define ACPI_NHLT_DIR_RESERVED              4   /* 4 and above are reserved */
   1887  1.1.1.20  christos 
   1888  1.1.1.21  christos /* Capabilities = 2 */
   1889  1.1.1.21  christos 
   1890  1.1.1.20  christos typedef struct acpi_nhlt_device_specific_config
   1891  1.1.1.20  christos {
   1892  1.1.1.20  christos     UINT32                  CapabilitiesSize;
   1893  1.1.1.20  christos     UINT8                   VirtualSlot;
   1894  1.1.1.20  christos     UINT8                   ConfigType;
   1895  1.1.1.20  christos 
   1896  1.1.1.20  christos } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG;
   1897  1.1.1.20  christos 
   1898  1.1.1.21  christos /* Capabilities = 3 */
   1899  1.1.1.21  christos 
   1900  1.1.1.20  christos typedef struct acpi_nhlt_device_specific_config_a
   1901  1.1.1.20  christos {
   1902  1.1.1.20  christos     UINT32                  CapabilitiesSize;
   1903  1.1.1.20  christos     UINT8                   VirtualSlot;
   1904  1.1.1.20  christos     UINT8                   ConfigType;
   1905  1.1.1.20  christos     UINT8                   ArrayType;
   1906  1.1.1.20  christos 
   1907  1.1.1.20  christos } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_A;
   1908  1.1.1.20  christos 
   1909  1.1.1.21  christos /* Capabilities = 3 */
   1910  1.1.1.21  christos 
   1911  1.1.1.21  christos typedef struct acpi_nhlt_device_specific_config_d
   1912  1.1.1.21  christos {
   1913  1.1.1.21  christos     UINT8                   VirtualSlot;
   1914  1.1.1.21  christos     UINT8                   ConfigType;
   1915  1.1.1.21  christos     UINT8                   ArrayType;
   1916  1.1.1.20  christos 
   1917  1.1.1.21  christos } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D;
   1918  1.1.1.20  christos 
   1919  1.1.1.21  christos /* Values for Config Type above */
   1920  1.1.1.21  christos 
   1921  1.1.1.21  christos #define ACPI_NHLT_CONFIG_TYPE_GENERIC              0x00
   1922  1.1.1.21  christos #define ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY            0x01
   1923  1.1.1.21  christos #define ACPI_NHLT_CONFIG_TYPE_RENDER_FEEDBACK      0x03
   1924  1.1.1.21  christos #define ACPI_NHLT_CONFIG_TYPE_RESERVED             0x04   /* 4 and above are reserved */
   1925  1.1.1.20  christos 
   1926  1.1.1.21  christos /* Capabilities = 0 */
   1927  1.1.1.20  christos 
   1928  1.1.1.20  christos typedef struct acpi_nhlt_device_specific_config_b
   1929  1.1.1.20  christos {
   1930  1.1.1.20  christos     UINT32                  CapabilitiesSize;
   1931  1.1.1.20  christos 
   1932  1.1.1.20  christos } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B;
   1933  1.1.1.20  christos 
   1934  1.1.1.21  christos /* Capabilities = 1 */
   1935  1.1.1.21  christos 
   1936  1.1.1.20  christos typedef struct acpi_nhlt_device_specific_config_c
   1937  1.1.1.20  christos {
   1938  1.1.1.20  christos     UINT32                  CapabilitiesSize;
   1939  1.1.1.20  christos     UINT8                   VirtualSlot;
   1940  1.1.1.20  christos 
   1941  1.1.1.20  christos } ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_C;
   1942  1.1.1.20  christos 
   1943  1.1.1.21  christos typedef struct acpi_nhlt_render_device_specific_config
   1944  1.1.1.21  christos {
   1945  1.1.1.21  christos     UINT32                  CapabilitiesSize;
   1946  1.1.1.21  christos     UINT8                   VirtualSlot;
   1947  1.1.1.21  christos 
   1948  1.1.1.21  christos } ACPI_NHLT_RENDER_DEVICE_SPECIFIC_CONFIG;
   1949  1.1.1.21  christos 
   1950  1.1.1.20  christos typedef struct acpi_nhlt_wave_extensible
   1951  1.1.1.20  christos {
   1952  1.1.1.20  christos     UINT16                  FormatTag;
   1953  1.1.1.20  christos     UINT16                  ChannelCount;
   1954  1.1.1.20  christos     UINT32                  SamplesPerSec;
   1955  1.1.1.20  christos     UINT32                  AvgBytesPerSec;
   1956  1.1.1.20  christos     UINT16                  BlockAlign;
   1957  1.1.1.20  christos     UINT16                  BitsPerSample;
   1958  1.1.1.20  christos     UINT16                  ExtraFormatSize;
   1959  1.1.1.20  christos     UINT16                  ValidBitsPerSample;
   1960  1.1.1.20  christos     UINT32                  ChannelMask;
   1961  1.1.1.20  christos     UINT8                   SubFormatGuid[16];
   1962  1.1.1.20  christos 
   1963  1.1.1.20  christos } ACPI_NHLT_WAVE_EXTENSIBLE;
   1964  1.1.1.20  christos 
   1965  1.1.1.20  christos /* Values for ChannelMask above */
   1966  1.1.1.20  christos 
   1967  1.1.1.20  christos #define ACPI_NHLT_SPKR_FRONT_LEFT             0x1
   1968  1.1.1.20  christos #define ACPI_NHLT_SPKR_FRONT_RIGHT            0x2
   1969  1.1.1.20  christos #define ACPI_NHLT_SPKR_FRONT_CENTER           0x4
   1970  1.1.1.20  christos #define ACPI_NHLT_SPKR_LOW_FREQ               0x8
   1971  1.1.1.20  christos #define ACPI_NHLT_SPKR_BACK_LEFT              0x10
   1972  1.1.1.20  christos #define ACPI_NHLT_SPKR_BACK_RIGHT             0x20
   1973  1.1.1.20  christos #define ACPI_NHLT_SPKR_FRONT_LEFT_OF_CENTER   0x40
   1974  1.1.1.20  christos #define ACPI_NHLT_SPKR_FRONT_RIGHT_OF_CENTER  0x80
   1975  1.1.1.20  christos #define ACPI_NHLT_SPKR_BACK_CENTER            0x100
   1976  1.1.1.20  christos #define ACPI_NHLT_SPKR_SIDE_LEFT              0x200
   1977  1.1.1.20  christos #define ACPI_NHLT_SPKR_SIDE_RIGHT             0x400
   1978  1.1.1.20  christos #define ACPI_NHLT_SPKR_TOP_CENTER             0x800
   1979  1.1.1.20  christos #define ACPI_NHLT_SPKR_TOP_FRONT_LEFT         0x1000
   1980  1.1.1.20  christos #define ACPI_NHLT_SPKR_TOP_FRONT_CENTER       0x2000
   1981  1.1.1.20  christos #define ACPI_NHLT_SPKR_TOP_FRONT_RIGHT        0x4000
   1982  1.1.1.20  christos #define ACPI_NHLT_SPKR_TOP_BACK_LEFT          0x8000
   1983  1.1.1.20  christos #define ACPI_NHLT_SPKR_TOP_BACK_CENTER        0x10000
   1984  1.1.1.20  christos #define ACPI_NHLT_SPKR_TOP_BACK_RIGHT         0x20000
   1985  1.1.1.20  christos 
   1986  1.1.1.20  christos typedef struct acpi_nhlt_format_config
   1987  1.1.1.20  christos {
   1988  1.1.1.20  christos     ACPI_NHLT_WAVE_EXTENSIBLE   Format;
   1989  1.1.1.20  christos     UINT32                      CapabilitySize;
   1990  1.1.1.20  christos     UINT8                       Capabilities[];
   1991  1.1.1.20  christos 
   1992  1.1.1.20  christos } ACPI_NHLT_FORMAT_CONFIG;
   1993  1.1.1.20  christos 
   1994  1.1.1.20  christos typedef struct acpi_nhlt_formats_config
   1995  1.1.1.20  christos {
   1996  1.1.1.20  christos     UINT8                   FormatsCount;
   1997  1.1.1.20  christos 
   1998  1.1.1.20  christos } ACPI_NHLT_FORMATS_CONFIG;
   1999  1.1.1.20  christos 
   2000  1.1.1.20  christos typedef struct acpi_nhlt_device_specific_hdr
   2001  1.1.1.20  christos {
   2002  1.1.1.20  christos     UINT8                   VirtualSlot;
   2003  1.1.1.20  christos     UINT8                   ConfigType;
   2004  1.1.1.20  christos 
   2005  1.1.1.20  christos } ACPI_NHLT_DEVICE_SPECIFIC_HDR;
   2006  1.1.1.20  christos 
   2007  1.1.1.20  christos /* Types for ConfigType above */
   2008  1.1.1.20  christos 
   2009  1.1.1.20  christos #define ACPI_NHLT_GENERIC                   0
   2010  1.1.1.20  christos #define ACPI_NHLT_MIC                       1
   2011  1.1.1.20  christos #define ACPI_NHLT_RENDER                    3
   2012  1.1.1.20  christos 
   2013  1.1.1.20  christos typedef struct acpi_nhlt_mic_device_specific_config
   2014  1.1.1.20  christos {
   2015  1.1.1.20  christos     ACPI_NHLT_DEVICE_SPECIFIC_HDR   DeviceConfig;
   2016  1.1.1.20  christos     UINT8                           ArrayTypeExt;
   2017  1.1.1.20  christos 
   2018  1.1.1.20  christos } ACPI_NHLT_MIC_DEVICE_SPECIFIC_CONFIG;
   2019  1.1.1.20  christos 
   2020  1.1.1.20  christos /* Values for ArrayTypeExt above */
   2021  1.1.1.20  christos 
   2022  1.1.1.22  christos #define ACPI_NHLT_ARRAY_TYPE_RESERVED               0x09    /* 9 and below are reserved */
   2023  1.1.1.21  christos #define ACPI_NHLT_SMALL_LINEAR_2ELEMENT             0x0A
   2024  1.1.1.21  christos #define ACPI_NHLT_BIG_LINEAR_2ELEMENT               0x0B
   2025  1.1.1.21  christos #define ACPI_NHLT_FIRST_GEOMETRY_LINEAR_4ELEMENT    0x0C
   2026  1.1.1.21  christos #define ACPI_NHLT_PLANAR_LSHAPED_4ELEMENT           0x0D
   2027  1.1.1.21  christos #define ACPI_NHLT_SECOND_GEOMETRY_LINEAR_4ELEMENT   0x0E
   2028  1.1.1.21  christos #define ACPI_NHLT_VENDOR_DEFINED                    0x0F
   2029  1.1.1.21  christos #define ACPI_NHLT_ARRAY_TYPE_MASK                   0x0F
   2030  1.1.1.21  christos #define ACPI_NHLT_ARRAY_TYPE_EXT_MASK               0x10
   2031  1.1.1.21  christos 
   2032  1.1.1.21  christos #define ACPI_NHLT_NO_EXTENSION                      0x0
   2033  1.1.1.21  christos #define ACPI_NHLT_MIC_SNR_SENSITIVITY_EXT           (1<<4)
   2034  1.1.1.20  christos 
   2035  1.1.1.21  christos typedef struct acpi_nhlt_vendor_mic_count
   2036  1.1.1.21  christos {
   2037  1.1.1.21  christos     UINT8                           MicrophoneCount;
   2038  1.1.1.20  christos 
   2039  1.1.1.21  christos } ACPI_NHLT_VENDOR_MIC_COUNT;
   2040  1.1.1.20  christos 
   2041  1.1.1.20  christos typedef struct acpi_nhlt_vendor_mic_config
   2042  1.1.1.20  christos {
   2043  1.1.1.20  christos     UINT8                   Type;
   2044  1.1.1.20  christos     UINT8                   Panel;
   2045  1.1.1.22  christos     UINT16                  SpeakerPositionDistance;    /* mm */
   2046  1.1.1.22  christos     UINT16                  HorizontalOffset;           /* mm */
   2047  1.1.1.22  christos     UINT16                  VerticalOffset;             /* mm */
   2048  1.1.1.22  christos     UINT8                   FrequencyLowBand;           /* 5*Hz */
   2049  1.1.1.22  christos     UINT8                   FrequencyHighBand;          /* 500*Hz */
   2050  1.1.1.22  christos     UINT16                  DirectionAngle;             /* -180 - + 180 */
   2051  1.1.1.22  christos     UINT16                  ElevationAngle;             /* -180 - + 180 */
   2052  1.1.1.22  christos     UINT16                  WorkVerticalAngleBegin;     /* -180 - + 180 with 2 deg step */
   2053  1.1.1.22  christos     UINT16                  WorkVerticalAngleEnd;       /* -180 - + 180 with 2 deg step */
   2054  1.1.1.22  christos     UINT16                  WorkHorizontalAngleBegin;   /* -180 - + 180 with 2 deg step */
   2055  1.1.1.22  christos     UINT16                  WorkHorizontalAngleEnd;     /* -180 - + 180 with 2 deg step */
   2056  1.1.1.20  christos 
   2057  1.1.1.20  christos } ACPI_NHLT_VENDOR_MIC_CONFIG;
   2058  1.1.1.20  christos 
   2059  1.1.1.20  christos /* Values for Type field above */
   2060  1.1.1.20  christos 
   2061  1.1.1.21  christos #define ACPI_NHLT_MIC_OMNIDIRECTIONAL       0
   2062  1.1.1.21  christos #define ACPI_NHLT_MIC_SUBCARDIOID           1
   2063  1.1.1.21  christos #define ACPI_NHLT_MIC_CARDIOID              2
   2064  1.1.1.21  christos #define ACPI_NHLT_MIC_SUPER_CARDIOID        3
   2065  1.1.1.21  christos #define ACPI_NHLT_MIC_HYPER_CARDIOID        4
   2066  1.1.1.21  christos #define ACPI_NHLT_MIC_8_SHAPED              5
   2067  1.1.1.22  christos #define ACPI_NHLT_MIC_RESERVED6             6   /* 6 is reserved */
   2068  1.1.1.21  christos #define ACPI_NHLT_MIC_VENDOR_DEFINED        7
   2069  1.1.1.22  christos #define ACPI_NHLT_MIC_RESERVED              8   /* 8 and above are reserved */
   2070  1.1.1.20  christos 
   2071  1.1.1.20  christos /* Values for Panel field above */
   2072  1.1.1.20  christos 
   2073  1.1.1.21  christos #define ACPI_NHLT_MIC_POSITION_TOP          0
   2074  1.1.1.21  christos #define ACPI_NHLT_MIC_POSITION_BOTTOM       1
   2075  1.1.1.21  christos #define ACPI_NHLT_MIC_POSITION_LEFT         2
   2076  1.1.1.21  christos #define ACPI_NHLT_MIC_POSITION_RIGHT        3
   2077  1.1.1.21  christos #define ACPI_NHLT_MIC_POSITION_FRONT        4
   2078  1.1.1.21  christos #define ACPI_NHLT_MIC_POSITION_BACK         5
   2079  1.1.1.22  christos #define ACPI_NHLT_MIC_POSITION_RESERVED     6   /* 6 and above are reserved */
   2080  1.1.1.20  christos 
   2081  1.1.1.20  christos typedef struct acpi_nhlt_vendor_mic_device_specific_config
   2082  1.1.1.20  christos {
   2083  1.1.1.20  christos     ACPI_NHLT_MIC_DEVICE_SPECIFIC_CONFIG    MicArrayDeviceConfig;
   2084  1.1.1.20  christos     UINT8                                   NumberOfMicrophones;
   2085  1.1.1.22  christos     ACPI_NHLT_VENDOR_MIC_CONFIG             MicConfig[];            /* Indexed by NumberOfMicrophones */
   2086  1.1.1.20  christos 
   2087  1.1.1.20  christos } ACPI_NHLT_VENDOR_MIC_DEVICE_SPECIFIC_CONFIG;
   2088  1.1.1.20  christos 
   2089  1.1.1.20  christos /* Microphone SNR and Sensitivity extension */
   2090  1.1.1.20  christos 
   2091  1.1.1.20  christos typedef struct acpi_nhlt_mic_snr_sensitivity_extension
   2092  1.1.1.20  christos {
   2093  1.1.1.20  christos     UINT32                  SNR;
   2094  1.1.1.20  christos     UINT32                  Sensitivity;
   2095  1.1.1.20  christos 
   2096  1.1.1.20  christos } ACPI_NHLT_MIC_SNR_SENSITIVITY_EXTENSION;
   2097  1.1.1.20  christos 
   2098  1.1.1.21  christos /* Render device with feedback */
   2099  1.1.1.21  christos 
   2100  1.1.1.20  christos typedef struct acpi_nhlt_render_feedback_device_specific_config
   2101  1.1.1.20  christos {
   2102  1.1.1.22  christos     UINT8                               FeedbackVirtualSlot;        /* Render slot in case of capture */
   2103  1.1.1.22  christos     UINT16                              FeedbackChannels;           /* Informative only */
   2104  1.1.1.20  christos     UINT16                              FeedbackValidBitsPerSample;
   2105  1.1.1.20  christos 
   2106  1.1.1.20  christos } ACPI_NHLT_RENDER_FEEDBACK_DEVICE_SPECIFIC_CONFIG;
   2107  1.1.1.20  christos 
   2108  1.1.1.22  christos /* Non documented structures */
   2109  1.1.1.20  christos 
   2110  1.1.1.22  christos typedef struct acpi_nhlt_device_info_count
   2111  1.1.1.20  christos {
   2112  1.1.1.20  christos     UINT8                               StructureCount;
   2113  1.1.1.20  christos 
   2114  1.1.1.22  christos } ACPI_NHLT_DEVICE_INFO_COUNT;
   2115  1.1.1.20  christos 
   2116  1.1.1.22  christos typedef struct acpi_nhlt_device_info
   2117  1.1.1.20  christos {
   2118  1.1.1.20  christos     UINT8                               DeviceId[16];
   2119  1.1.1.20  christos     UINT8                               DeviceInstanceId;
   2120  1.1.1.20  christos     UINT8                               DevicePortId;
   2121  1.1.1.20  christos 
   2122  1.1.1.22  christos } ACPI_NHLT_DEVICE_INFO;
   2123  1.1.1.20  christos 
   2124  1.1.1.20  christos 
   2125  1.1.1.20  christos /*******************************************************************************
   2126  1.1.1.20  christos  *
   2127  1.1.1.14  christos  * PCCT - Platform Communications Channel Table (ACPI 5.0)
   2128  1.1.1.14  christos  *        Version 2 (ACPI 6.2)
   2129       1.1    jruoho  *
   2130       1.1    jruoho  ******************************************************************************/
   2131       1.1    jruoho 
   2132  1.1.1.14  christos typedef struct acpi_table_pcct
   2133       1.1    jruoho {
   2134       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2135  1.1.1.14  christos     UINT32                  Flags;
   2136  1.1.1.14  christos     UINT64                  Reserved;
   2137  1.1.1.14  christos 
   2138  1.1.1.14  christos } ACPI_TABLE_PCCT;
   2139  1.1.1.14  christos 
   2140  1.1.1.14  christos /* Values for Flags field above */
   2141  1.1.1.14  christos 
   2142  1.1.1.14  christos #define ACPI_PCCT_DOORBELL              1
   2143  1.1.1.14  christos 
   2144  1.1.1.14  christos /* Values for subtable type in ACPI_SUBTABLE_HEADER */
   2145  1.1.1.14  christos 
   2146  1.1.1.14  christos enum AcpiPcctType
   2147  1.1.1.14  christos {
   2148  1.1.1.14  christos     ACPI_PCCT_TYPE_GENERIC_SUBSPACE             = 0,
   2149  1.1.1.14  christos     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE          = 1,
   2150  1.1.1.14  christos     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2    = 2,    /* ACPI 6.1 */
   2151  1.1.1.14  christos     ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE      = 3,    /* ACPI 6.2 */
   2152  1.1.1.14  christos     ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE       = 4,    /* ACPI 6.2 */
   2153  1.1.1.18  christos     ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE         = 5,    /* ACPI 6.4 */
   2154  1.1.1.18  christos     ACPI_PCCT_TYPE_RESERVED                     = 6     /* 6 and greater are reserved */
   2155  1.1.1.14  christos };
   2156       1.1    jruoho 
   2157  1.1.1.14  christos /*
   2158  1.1.1.14  christos  * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
   2159  1.1.1.14  christos  */
   2160       1.1    jruoho 
   2161  1.1.1.14  christos /* 0: Generic Communications Subspace */
   2162       1.1    jruoho 
   2163  1.1.1.14  christos typedef struct acpi_pcct_subspace
   2164  1.1.1.14  christos {
   2165  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   2166  1.1.1.14  christos     UINT8                   Reserved[6];
   2167  1.1.1.14  christos     UINT64                  BaseAddress;
   2168  1.1.1.14  christos     UINT64                  Length;
   2169  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   2170  1.1.1.14  christos     UINT64                  PreserveMask;
   2171  1.1.1.14  christos     UINT64                  WriteMask;
   2172  1.1.1.14  christos     UINT32                  Latency;
   2173  1.1.1.14  christos     UINT32                  MaxAccessRate;
   2174  1.1.1.14  christos     UINT16                  MinTurnaroundTime;
   2175   1.1.1.6  christos 
   2176  1.1.1.14  christos } ACPI_PCCT_SUBSPACE;
   2177   1.1.1.6  christos 
   2178  1.1.1.14  christos 
   2179  1.1.1.14  christos /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
   2180  1.1.1.14  christos 
   2181  1.1.1.14  christos typedef struct acpi_pcct_hw_reduced
   2182   1.1.1.6  christos {
   2183  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   2184  1.1.1.14  christos     UINT32                  PlatformInterrupt;
   2185  1.1.1.14  christos     UINT8                   Flags;
   2186  1.1.1.14  christos     UINT8                   Reserved;
   2187  1.1.1.14  christos     UINT64                  BaseAddress;
   2188  1.1.1.14  christos     UINT64                  Length;
   2189  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   2190  1.1.1.14  christos     UINT64                  PreserveMask;
   2191  1.1.1.14  christos     UINT64                  WriteMask;
   2192  1.1.1.14  christos     UINT32                  Latency;
   2193  1.1.1.14  christos     UINT32                  MaxAccessRate;
   2194  1.1.1.14  christos     UINT16                  MinTurnaroundTime;
   2195   1.1.1.6  christos 
   2196  1.1.1.14  christos } ACPI_PCCT_HW_REDUCED;
   2197   1.1.1.6  christos 
   2198   1.1.1.6  christos 
   2199  1.1.1.14  christos /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
   2200   1.1.1.4  christos 
   2201  1.1.1.14  christos typedef struct acpi_pcct_hw_reduced_type2
   2202   1.1.1.4  christos {
   2203  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   2204  1.1.1.14  christos     UINT32                  PlatformInterrupt;
   2205  1.1.1.14  christos     UINT8                   Flags;
   2206  1.1.1.14  christos     UINT8                   Reserved;
   2207  1.1.1.14  christos     UINT64                  BaseAddress;
   2208  1.1.1.14  christos     UINT64                  Length;
   2209  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   2210  1.1.1.14  christos     UINT64                  PreserveMask;
   2211  1.1.1.14  christos     UINT64                  WriteMask;
   2212  1.1.1.14  christos     UINT32                  Latency;
   2213  1.1.1.14  christos     UINT32                  MaxAccessRate;
   2214  1.1.1.14  christos     UINT16                  MinTurnaroundTime;
   2215  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    PlatformAckRegister;
   2216  1.1.1.14  christos     UINT64                  AckPreserveMask;
   2217  1.1.1.14  christos     UINT64                  AckWriteMask;
   2218   1.1.1.4  christos 
   2219  1.1.1.14  christos } ACPI_PCCT_HW_REDUCED_TYPE2;
   2220   1.1.1.4  christos 
   2221   1.1.1.4  christos 
   2222  1.1.1.14  christos /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
   2223  1.1.1.14  christos 
   2224  1.1.1.14  christos typedef struct acpi_pcct_ext_pcc_master
   2225   1.1.1.4  christos {
   2226  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   2227  1.1.1.14  christos     UINT32                  PlatformInterrupt;
   2228  1.1.1.14  christos     UINT8                   Flags;
   2229  1.1.1.14  christos     UINT8                   Reserved1;
   2230  1.1.1.14  christos     UINT64                  BaseAddress;
   2231  1.1.1.14  christos     UINT32                  Length;
   2232  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   2233  1.1.1.14  christos     UINT64                  PreserveMask;
   2234  1.1.1.14  christos     UINT64                  WriteMask;
   2235  1.1.1.14  christos     UINT32                  Latency;
   2236  1.1.1.14  christos     UINT32                  MaxAccessRate;
   2237  1.1.1.14  christos     UINT32                  MinTurnaroundTime;
   2238  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    PlatformAckRegister;
   2239  1.1.1.14  christos     UINT64                  AckPreserveMask;
   2240  1.1.1.14  christos     UINT64                  AckSetMask;
   2241  1.1.1.14  christos     UINT64                  Reserved2;
   2242  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
   2243  1.1.1.14  christos     UINT64                  CmdCompleteMask;
   2244  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    CmdUpdateRegister;
   2245  1.1.1.14  christos     UINT64                  CmdUpdatePreserveMask;
   2246  1.1.1.14  christos     UINT64                  CmdUpdateSetMask;
   2247  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
   2248  1.1.1.14  christos     UINT64                  ErrorStatusMask;
   2249  1.1.1.14  christos 
   2250  1.1.1.14  christos } ACPI_PCCT_EXT_PCC_MASTER;
   2251   1.1.1.4  christos 
   2252   1.1.1.4  christos 
   2253  1.1.1.14  christos /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
   2254  1.1.1.12  christos 
   2255  1.1.1.14  christos typedef struct acpi_pcct_ext_pcc_slave
   2256  1.1.1.12  christos {
   2257  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   2258  1.1.1.14  christos     UINT32                  PlatformInterrupt;
   2259  1.1.1.14  christos     UINT8                   Flags;
   2260  1.1.1.14  christos     UINT8                   Reserved1;
   2261  1.1.1.14  christos     UINT64                  BaseAddress;
   2262  1.1.1.14  christos     UINT32                  Length;
   2263  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   2264  1.1.1.14  christos     UINT64                  PreserveMask;
   2265  1.1.1.14  christos     UINT64                  WriteMask;
   2266  1.1.1.14  christos     UINT32                  Latency;
   2267  1.1.1.14  christos     UINT32                  MaxAccessRate;
   2268  1.1.1.14  christos     UINT32                  MinTurnaroundTime;
   2269  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    PlatformAckRegister;
   2270  1.1.1.14  christos     UINT64                  AckPreserveMask;
   2271  1.1.1.14  christos     UINT64                  AckSetMask;
   2272  1.1.1.14  christos     UINT64                  Reserved2;
   2273  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
   2274  1.1.1.14  christos     UINT64                  CmdCompleteMask;
   2275  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    CmdUpdateRegister;
   2276  1.1.1.14  christos     UINT64                  CmdUpdatePreserveMask;
   2277  1.1.1.14  christos     UINT64                  CmdUpdateSetMask;
   2278  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
   2279  1.1.1.14  christos     UINT64                  ErrorStatusMask;
   2280  1.1.1.12  christos 
   2281  1.1.1.14  christos } ACPI_PCCT_EXT_PCC_SLAVE;
   2282  1.1.1.12  christos 
   2283  1.1.1.18  christos /* 5: HW Registers based Communications Subspace */
   2284  1.1.1.18  christos 
   2285  1.1.1.18  christos typedef struct acpi_pcct_hw_reg
   2286  1.1.1.18  christos {
   2287  1.1.1.18  christos     ACPI_SUBTABLE_HEADER    Header;
   2288  1.1.1.18  christos     UINT16                  Version;
   2289  1.1.1.18  christos     UINT64                  BaseAddress;
   2290  1.1.1.18  christos     UINT64                  Length;
   2291  1.1.1.18  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   2292  1.1.1.18  christos     UINT64                  DoorbellPreserve;
   2293  1.1.1.18  christos     UINT64                  DoorbellWrite;
   2294  1.1.1.18  christos     ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
   2295  1.1.1.18  christos     UINT64                  CmdCompleteMask;
   2296  1.1.1.18  christos     ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
   2297  1.1.1.18  christos     UINT64                  ErrorStatusMask;
   2298  1.1.1.18  christos     UINT32                  NominalLatency;
   2299  1.1.1.18  christos     UINT32                  MinTurnaroundTime;
   2300  1.1.1.18  christos 
   2301  1.1.1.18  christos } ACPI_PCCT_HW_REG;
   2302  1.1.1.18  christos 
   2303   1.1.1.4  christos 
   2304  1.1.1.14  christos /* Values for doorbell flags above */
   2305  1.1.1.14  christos 
   2306  1.1.1.14  christos #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
   2307  1.1.1.14  christos #define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
   2308  1.1.1.14  christos 
   2309  1.1.1.14  christos 
   2310  1.1.1.14  christos /*
   2311  1.1.1.14  christos  * PCC memory structures (not part of the ACPI table)
   2312  1.1.1.14  christos  */
   2313   1.1.1.3    jruoho 
   2314  1.1.1.14  christos /* Shared Memory Region */
   2315   1.1.1.3    jruoho 
   2316  1.1.1.14  christos typedef struct acpi_pcct_shared_memory
   2317   1.1.1.3    jruoho {
   2318  1.1.1.14  christos     UINT32                  Signature;
   2319  1.1.1.14  christos     UINT16                  Command;
   2320  1.1.1.14  christos     UINT16                  Status;
   2321  1.1.1.14  christos 
   2322  1.1.1.14  christos } ACPI_PCCT_SHARED_MEMORY;
   2323  1.1.1.14  christos 
   2324  1.1.1.14  christos 
   2325  1.1.1.14  christos /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
   2326  1.1.1.14  christos 
   2327  1.1.1.14  christos typedef struct acpi_pcct_ext_pcc_shared_memory
   2328  1.1.1.14  christos {
   2329  1.1.1.14  christos     UINT32                  Signature;
   2330  1.1.1.14  christos     UINT32                  Flags;
   2331  1.1.1.14  christos     UINT32                  Length;
   2332  1.1.1.14  christos     UINT32                  Command;
   2333   1.1.1.3    jruoho 
   2334  1.1.1.14  christos } ACPI_PCCT_EXT_PCC_SHARED_MEMORY;
   2335   1.1.1.3    jruoho 
   2336   1.1.1.3    jruoho 
   2337   1.1.1.3    jruoho /*******************************************************************************
   2338   1.1.1.3    jruoho  *
   2339  1.1.1.14  christos  * PDTT - Platform Debug Trigger Table (ACPI 6.2)
   2340  1.1.1.14  christos  *        Version 0
   2341       1.1    jruoho  *
   2342       1.1    jruoho  ******************************************************************************/
   2343       1.1    jruoho 
   2344  1.1.1.14  christos typedef struct acpi_table_pdtt
   2345       1.1    jruoho {
   2346       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2347  1.1.1.14  christos     UINT8                   TriggerCount;
   2348       1.1    jruoho     UINT8                   Reserved[3];
   2349  1.1.1.14  christos     UINT32                  ArrayOffset;
   2350  1.1.1.14  christos 
   2351  1.1.1.14  christos } ACPI_TABLE_PDTT;
   2352       1.1    jruoho 
   2353       1.1    jruoho 
   2354  1.1.1.14  christos /*
   2355  1.1.1.14  christos  * PDTT Communication Channel Identifier Structure.
   2356  1.1.1.14  christos  * The number of these structures is defined by TriggerCount above,
   2357  1.1.1.14  christos  * starting at ArrayOffset.
   2358  1.1.1.14  christos  */
   2359  1.1.1.14  christos typedef struct acpi_pdtt_channel
   2360  1.1.1.14  christos {
   2361  1.1.1.14  christos     UINT8                   SubchannelId;
   2362  1.1.1.14  christos     UINT8                   Flags;
   2363  1.1.1.14  christos 
   2364  1.1.1.14  christos } ACPI_PDTT_CHANNEL;
   2365       1.1    jruoho 
   2366  1.1.1.14  christos /* Flags for above */
   2367       1.1    jruoho 
   2368  1.1.1.14  christos #define ACPI_PDTT_RUNTIME_TRIGGER           (1)
   2369  1.1.1.14  christos #define ACPI_PDTT_WAIT_COMPLETION           (1<<1)
   2370  1.1.1.16  christos #define ACPI_PDTT_TRIGGER_ORDER             (1<<2)
   2371   1.1.1.9  christos 
   2372       1.1    jruoho 
   2373       1.1    jruoho /*******************************************************************************
   2374       1.1    jruoho  *
   2375  1.1.1.18  christos  * PHAT - Platform Health Assessment Table (ACPI 6.4)
   2376  1.1.1.18  christos  *        Version 1
   2377  1.1.1.18  christos  *
   2378  1.1.1.18  christos  ******************************************************************************/
   2379  1.1.1.18  christos 
   2380  1.1.1.18  christos typedef struct acpi_table_phat
   2381  1.1.1.18  christos {
   2382  1.1.1.18  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2383  1.1.1.18  christos 
   2384  1.1.1.18  christos } ACPI_TABLE_PHAT;
   2385  1.1.1.18  christos 
   2386  1.1.1.18  christos /* Common header for PHAT subtables that follow main table */
   2387  1.1.1.18  christos 
   2388  1.1.1.18  christos typedef struct acpi_phat_header
   2389  1.1.1.18  christos {
   2390  1.1.1.18  christos     UINT16                  Type;
   2391  1.1.1.18  christos     UINT16                  Length;
   2392  1.1.1.18  christos     UINT8                   Revision;
   2393  1.1.1.18  christos 
   2394  1.1.1.18  christos } ACPI_PHAT_HEADER;
   2395  1.1.1.18  christos 
   2396  1.1.1.18  christos 
   2397  1.1.1.18  christos /* Values for Type field above */
   2398  1.1.1.18  christos 
   2399  1.1.1.18  christos #define ACPI_PHAT_TYPE_FW_VERSION_DATA  0
   2400  1.1.1.18  christos #define ACPI_PHAT_TYPE_FW_HEALTH_DATA   1
   2401  1.1.1.18  christos #define ACPI_PHAT_TYPE_RESERVED         2 /* 0x02-0xFFFF are reserved */
   2402  1.1.1.18  christos 
   2403  1.1.1.18  christos /*
   2404  1.1.1.18  christos  * PHAT subtables, correspond to Type in ACPI_PHAT_HEADER
   2405  1.1.1.18  christos  */
   2406  1.1.1.18  christos 
   2407  1.1.1.18  christos /* 0: Firmware Version Data Record */
   2408  1.1.1.18  christos 
   2409  1.1.1.18  christos typedef struct acpi_phat_version_data
   2410  1.1.1.18  christos {
   2411  1.1.1.18  christos     ACPI_PHAT_HEADER        Header;
   2412  1.1.1.18  christos     UINT8                   Reserved[3];
   2413  1.1.1.18  christos     UINT32                  ElementCount;
   2414  1.1.1.18  christos 
   2415  1.1.1.18  christos } ACPI_PHAT_VERSION_DATA;
   2416  1.1.1.18  christos 
   2417  1.1.1.18  christos typedef struct acpi_phat_version_element
   2418  1.1.1.18  christos {
   2419  1.1.1.18  christos     UINT8                   Guid[16];
   2420  1.1.1.18  christos     UINT64                  VersionValue;
   2421  1.1.1.18  christos     UINT32                  ProducerId;
   2422  1.1.1.18  christos 
   2423  1.1.1.18  christos } ACPI_PHAT_VERSION_ELEMENT;
   2424  1.1.1.18  christos 
   2425  1.1.1.18  christos 
   2426  1.1.1.18  christos /* 1: Firmware Health Data Record */
   2427  1.1.1.18  christos 
   2428  1.1.1.18  christos typedef struct acpi_phat_health_data
   2429  1.1.1.18  christos {
   2430  1.1.1.18  christos     ACPI_PHAT_HEADER        Header;
   2431  1.1.1.18  christos     UINT8                   Reserved[2];
   2432  1.1.1.18  christos     UINT8                   Health;
   2433  1.1.1.18  christos     UINT8                   DeviceGuid[16];
   2434  1.1.1.18  christos     UINT32                  DeviceSpecificOffset; /* Zero if no Device-specific data */
   2435  1.1.1.18  christos 
   2436  1.1.1.18  christos } ACPI_PHAT_HEALTH_DATA;
   2437  1.1.1.18  christos 
   2438  1.1.1.18  christos /* Values for Health field above */
   2439  1.1.1.18  christos 
   2440  1.1.1.18  christos #define ACPI_PHAT_ERRORS_FOUND          0
   2441  1.1.1.18  christos #define ACPI_PHAT_NO_ERRORS             1
   2442  1.1.1.18  christos #define ACPI_PHAT_UNKNOWN_ERRORS        2
   2443  1.1.1.18  christos #define ACPI_PHAT_ADVISORY              3
   2444  1.1.1.18  christos 
   2445  1.1.1.18  christos 
   2446  1.1.1.18  christos /*******************************************************************************
   2447  1.1.1.18  christos  *
   2448  1.1.1.14  christos  * PMTT - Platform Memory Topology Table (ACPI 5.0)
   2449  1.1.1.14  christos  *        Version 1
   2450       1.1    jruoho  *
   2451       1.1    jruoho  ******************************************************************************/
   2452       1.1    jruoho 
   2453  1.1.1.14  christos typedef struct acpi_table_pmtt
   2454       1.1    jruoho {
   2455       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2456  1.1.1.18  christos     UINT32                  MemoryDeviceCount;
   2457  1.1.1.18  christos     /*
   2458  1.1.1.18  christos      * Immediately followed by:
   2459  1.1.1.18  christos      * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
   2460  1.1.1.18  christos      */
   2461  1.1.1.14  christos 
   2462  1.1.1.14  christos } ACPI_TABLE_PMTT;
   2463       1.1    jruoho 
   2464       1.1    jruoho 
   2465  1.1.1.14  christos /* Common header for PMTT subtables that follow main table */
   2466       1.1    jruoho 
   2467  1.1.1.14  christos typedef struct acpi_pmtt_header
   2468       1.1    jruoho {
   2469  1.1.1.14  christos     UINT8                   Type;
   2470  1.1.1.14  christos     UINT8                   Reserved1;
   2471  1.1.1.14  christos     UINT16                  Length;
   2472  1.1.1.14  christos     UINT16                  Flags;
   2473  1.1.1.14  christos     UINT16                  Reserved2;
   2474  1.1.1.18  christos     UINT32                  MemoryDeviceCount;  /* Zero means no memory device structs follow */
   2475  1.1.1.18  christos     /*
   2476  1.1.1.18  christos      * Immediately followed by:
   2477  1.1.1.18  christos      * UINT8 TypeSpecificData[]
   2478  1.1.1.18  christos      * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
   2479  1.1.1.18  christos      */
   2480       1.1    jruoho 
   2481  1.1.1.14  christos } ACPI_PMTT_HEADER;
   2482       1.1    jruoho 
   2483  1.1.1.14  christos /* Values for Type field above */
   2484       1.1    jruoho 
   2485  1.1.1.14  christos #define ACPI_PMTT_TYPE_SOCKET           0
   2486  1.1.1.14  christos #define ACPI_PMTT_TYPE_CONTROLLER       1
   2487  1.1.1.14  christos #define ACPI_PMTT_TYPE_DIMM             2
   2488  1.1.1.18  christos #define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFE are reserved */
   2489  1.1.1.18  christos #define ACPI_PMTT_TYPE_VENDOR           0xFF
   2490  1.1.1.14  christos 
   2491  1.1.1.14  christos /* Values for Flags field above */
   2492  1.1.1.14  christos 
   2493  1.1.1.14  christos #define ACPI_PMTT_TOP_LEVEL             0x0001
   2494  1.1.1.14  christos #define ACPI_PMTT_PHYSICAL              0x0002
   2495  1.1.1.14  christos #define ACPI_PMTT_MEMORY_TYPE           0x000C
   2496   1.1.1.7  christos 
   2497   1.1.1.7  christos 
   2498   1.1.1.7  christos /*
   2499  1.1.1.14  christos  * PMTT subtables, correspond to Type in acpi_pmtt_header
   2500   1.1.1.7  christos  */
   2501   1.1.1.7  christos 
   2502   1.1.1.7  christos 
   2503  1.1.1.14  christos /* 0: Socket Structure */
   2504  1.1.1.14  christos 
   2505  1.1.1.14  christos typedef struct acpi_pmtt_socket
   2506   1.1.1.7  christos {
   2507  1.1.1.14  christos     ACPI_PMTT_HEADER        Header;
   2508  1.1.1.14  christos     UINT16                  SocketId;
   2509  1.1.1.14  christos     UINT16                  Reserved;
   2510  1.1.1.14  christos 
   2511  1.1.1.14  christos } ACPI_PMTT_SOCKET;
   2512  1.1.1.18  christos     /*
   2513  1.1.1.18  christos      * Immediately followed by:
   2514  1.1.1.18  christos      * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
   2515  1.1.1.18  christos      */
   2516  1.1.1.14  christos 
   2517   1.1.1.7  christos 
   2518  1.1.1.14  christos /* 1: Memory Controller subtable */
   2519   1.1.1.7  christos 
   2520  1.1.1.14  christos typedef struct acpi_pmtt_controller
   2521   1.1.1.7  christos {
   2522  1.1.1.14  christos     ACPI_PMTT_HEADER        Header;
   2523  1.1.1.18  christos     UINT16                  ControllerId;
   2524       1.1    jruoho     UINT16                  Reserved;
   2525  1.1.1.14  christos 
   2526  1.1.1.14  christos } ACPI_PMTT_CONTROLLER;
   2527  1.1.1.18  christos     /*
   2528  1.1.1.18  christos      * Immediately followed by:
   2529  1.1.1.18  christos      * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
   2530  1.1.1.18  christos      */
   2531   1.1.1.7  christos 
   2532   1.1.1.7  christos 
   2533  1.1.1.14  christos /* 2: Physical Component Identifier (DIMM) */
   2534   1.1.1.7  christos 
   2535  1.1.1.14  christos typedef struct acpi_pmtt_physical_component
   2536  1.1.1.14  christos {
   2537  1.1.1.14  christos     ACPI_PMTT_HEADER        Header;
   2538  1.1.1.14  christos     UINT32                  BiosHandle;
   2539   1.1.1.7  christos 
   2540  1.1.1.14  christos } ACPI_PMTT_PHYSICAL_COMPONENT;
   2541   1.1.1.7  christos 
   2542   1.1.1.7  christos 
   2543  1.1.1.18  christos /* 0xFF: Vendor Specific Data */
   2544  1.1.1.18  christos 
   2545  1.1.1.18  christos typedef struct acpi_pmtt_vendor_specific
   2546  1.1.1.18  christos {
   2547  1.1.1.18  christos     ACPI_PMTT_HEADER        Header;
   2548  1.1.1.18  christos     UINT8                   TypeUuid[16];
   2549  1.1.1.18  christos     UINT8                   Specific[];
   2550  1.1.1.18  christos     /*
   2551  1.1.1.18  christos      * Immediately followed by:
   2552  1.1.1.18  christos      * UINT8 VendorSpecificData[];
   2553  1.1.1.18  christos      * MEMORY_DEVICE MemoryDeviceStruct[MemoryDeviceCount];
   2554  1.1.1.18  christos      */
   2555  1.1.1.18  christos 
   2556  1.1.1.18  christos } ACPI_PMTT_VENDOR_SPECIFIC;
   2557  1.1.1.18  christos 
   2558  1.1.1.18  christos 
   2559   1.1.1.7  christos /*******************************************************************************
   2560   1.1.1.7  christos  *
   2561  1.1.1.14  christos  * PPTT - Processor Properties Topology Table (ACPI 6.2)
   2562  1.1.1.14  christos  *        Version 1
   2563   1.1.1.7  christos  *
   2564   1.1.1.7  christos  ******************************************************************************/
   2565   1.1.1.7  christos 
   2566  1.1.1.14  christos typedef struct acpi_table_pptt
   2567   1.1.1.7  christos {
   2568   1.1.1.7  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2569   1.1.1.7  christos 
   2570  1.1.1.14  christos } ACPI_TABLE_PPTT;
   2571   1.1.1.7  christos 
   2572  1.1.1.14  christos /* Values for Type field above */
   2573       1.1    jruoho 
   2574  1.1.1.14  christos enum AcpiPpttType
   2575  1.1.1.14  christos {
   2576  1.1.1.14  christos     ACPI_PPTT_TYPE_PROCESSOR            = 0,
   2577  1.1.1.14  christos     ACPI_PPTT_TYPE_CACHE                = 1,
   2578  1.1.1.14  christos     ACPI_PPTT_TYPE_ID                   = 2,
   2579  1.1.1.14  christos     ACPI_PPTT_TYPE_RESERVED             = 3
   2580  1.1.1.14  christos };
   2581  1.1.1.12  christos 
   2582  1.1.1.12  christos 
   2583  1.1.1.14  christos /* 0: Processor Hierarchy Node Structure */
   2584  1.1.1.12  christos 
   2585  1.1.1.14  christos typedef struct acpi_pptt_processor
   2586  1.1.1.12  christos {
   2587  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   2588  1.1.1.14  christos     UINT16                  Reserved;
   2589  1.1.1.14  christos     UINT32                  Flags;
   2590  1.1.1.14  christos     UINT32                  Parent;
   2591  1.1.1.14  christos     UINT32                  AcpiProcessorId;
   2592  1.1.1.14  christos     UINT32                  NumberOfPrivResources;
   2593  1.1.1.12  christos 
   2594  1.1.1.14  christos } ACPI_PPTT_PROCESSOR;
   2595  1.1.1.12  christos 
   2596  1.1.1.14  christos /* Flags */
   2597  1.1.1.14  christos 
   2598  1.1.1.16  christos #define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
   2599  1.1.1.16  christos #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1<<1)
   2600  1.1.1.16  christos #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1<<2)  /* ACPI 6.3 */
   2601  1.1.1.16  christos #define ACPI_PPTT_ACPI_LEAF_NODE            (1<<3)  /* ACPI 6.3 */
   2602  1.1.1.16  christos #define ACPI_PPTT_ACPI_IDENTICAL            (1<<4)  /* ACPI 6.3 */
   2603  1.1.1.12  christos 
   2604  1.1.1.12  christos 
   2605  1.1.1.14  christos /* 1: Cache Type Structure */
   2606  1.1.1.12  christos 
   2607  1.1.1.14  christos typedef struct acpi_pptt_cache
   2608  1.1.1.12  christos {
   2609  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   2610  1.1.1.12  christos     UINT16                  Reserved;
   2611  1.1.1.14  christos     UINT32                  Flags;
   2612  1.1.1.14  christos     UINT32                  NextLevelOfCache;
   2613  1.1.1.14  christos     UINT32                  Size;
   2614  1.1.1.14  christos     UINT32                  NumberOfSets;
   2615  1.1.1.14  christos     UINT8                   Associativity;
   2616  1.1.1.14  christos     UINT8                   Attributes;
   2617  1.1.1.14  christos     UINT16                  LineSize;
   2618  1.1.1.14  christos 
   2619  1.1.1.14  christos } ACPI_PPTT_CACHE;
   2620  1.1.1.14  christos 
   2621  1.1.1.18  christos /* 1: Cache Type Structure for PPTT version 3 */
   2622  1.1.1.18  christos 
   2623  1.1.1.18  christos typedef struct acpi_pptt_cache_v1
   2624  1.1.1.18  christos {
   2625  1.1.1.18  christos     UINT32                  CacheId;
   2626  1.1.1.18  christos 
   2627  1.1.1.18  christos } ACPI_PPTT_CACHE_V1;
   2628  1.1.1.18  christos 
   2629  1.1.1.18  christos 
   2630  1.1.1.14  christos /* Flags */
   2631  1.1.1.14  christos 
   2632  1.1.1.14  christos #define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)     /* Physical property valid */
   2633  1.1.1.14  christos #define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)  /* Number of sets valid */
   2634  1.1.1.14  christos #define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)  /* Associativity valid */
   2635  1.1.1.14  christos #define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)  /* Allocation type valid */
   2636  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)  /* Cache type valid */
   2637  1.1.1.14  christos #define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)  /* Write policy valid */
   2638  1.1.1.14  christos #define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)  /* Line size valid */
   2639  1.1.1.18  christos #define ACPI_PPTT_CACHE_ID_VALID            (1<<7)  /* Cache ID valid */
   2640  1.1.1.14  christos 
   2641  1.1.1.14  christos /* Masks for Attributes */
   2642  1.1.1.14  christos 
   2643  1.1.1.14  christos #define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)  /* Allocation type */
   2644  1.1.1.14  christos #define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)  /* Cache type */
   2645  1.1.1.14  christos #define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)  /* Write policy */
   2646  1.1.1.14  christos 
   2647  1.1.1.14  christos /* Attributes describing cache */
   2648  1.1.1.14  christos #define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)   /* Cache line is allocated on read */
   2649  1.1.1.14  christos #define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)  /* Cache line is allocated on write */
   2650  1.1.1.14  christos #define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)  /* Cache line is allocated on read and write */
   2651  1.1.1.14  christos #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)  /* Alternate representation of above */
   2652  1.1.1.14  christos 
   2653  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)   /* Data cache */
   2654  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)  /* Instruction cache */
   2655  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)  /* Unified I & D cache */
   2656  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)  /* Alternate representation of above */
   2657  1.1.1.12  christos 
   2658  1.1.1.14  christos #define ACPI_PPTT_CACHE_POLICY_WB           (0x0)   /* Cache is write back */
   2659  1.1.1.14  christos #define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)  /* Cache is write through */
   2660  1.1.1.12  christos 
   2661  1.1.1.14  christos /* 2: ID Structure */
   2662  1.1.1.12  christos 
   2663  1.1.1.14  christos typedef struct acpi_pptt_id
   2664  1.1.1.14  christos {
   2665  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   2666  1.1.1.14  christos     UINT16                  Reserved;
   2667  1.1.1.14  christos     UINT32                  VendorId;
   2668  1.1.1.14  christos     UINT64                  Level1Id;
   2669  1.1.1.14  christos     UINT64                  Level2Id;
   2670  1.1.1.14  christos     UINT16                  MajorRev;
   2671  1.1.1.14  christos     UINT16                  MinorRev;
   2672  1.1.1.14  christos     UINT16                  SpinRev;
   2673  1.1.1.12  christos 
   2674  1.1.1.14  christos } ACPI_PPTT_ID;
   2675       1.1    jruoho 
   2676       1.1    jruoho 
   2677       1.1    jruoho /*******************************************************************************
   2678       1.1    jruoho  *
   2679  1.1.1.19  christos  * PRMT - Platform Runtime Mechanism Table
   2680  1.1.1.19  christos  *        Version 1
   2681  1.1.1.19  christos  *
   2682  1.1.1.19  christos  ******************************************************************************/
   2683  1.1.1.19  christos 
   2684  1.1.1.19  christos typedef struct acpi_table_prmt
   2685  1.1.1.19  christos {
   2686  1.1.1.19  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2687  1.1.1.19  christos 
   2688  1.1.1.19  christos } ACPI_TABLE_PRMT;
   2689  1.1.1.19  christos 
   2690  1.1.1.19  christos typedef struct acpi_table_prmt_header
   2691  1.1.1.19  christos {
   2692  1.1.1.19  christos     UINT8                   PlatformGuid[16];
   2693  1.1.1.19  christos     UINT32                  ModuleInfoOffset;
   2694  1.1.1.19  christos     UINT32                  ModuleInfoCount;
   2695  1.1.1.19  christos 
   2696  1.1.1.19  christos } ACPI_TABLE_PRMT_HEADER;
   2697  1.1.1.19  christos 
   2698  1.1.1.20  christos typedef struct acpi_prmt_module_header
   2699  1.1.1.20  christos {
   2700  1.1.1.22  christos     UINT16                  Revision;
   2701  1.1.1.22  christos     UINT16                  Length;
   2702  1.1.1.20  christos 
   2703  1.1.1.20  christos } ACPI_PRMT_MODULE_HEADER;
   2704  1.1.1.20  christos 
   2705  1.1.1.19  christos typedef struct acpi_prmt_module_info
   2706  1.1.1.19  christos {
   2707  1.1.1.19  christos     UINT16                  Revision;
   2708  1.1.1.19  christos     UINT16                  Length;
   2709  1.1.1.19  christos     UINT8                   ModuleGuid[16];
   2710  1.1.1.19  christos     UINT16                  MajorRev;
   2711  1.1.1.19  christos     UINT16                  MinorRev;
   2712  1.1.1.19  christos     UINT16                  HandlerInfoCount;
   2713  1.1.1.19  christos     UINT32                  HandlerInfoOffset;
   2714  1.1.1.19  christos     UINT64                  MmioListPointer;
   2715  1.1.1.19  christos 
   2716  1.1.1.19  christos } ACPI_PRMT_MODULE_INFO;
   2717  1.1.1.19  christos 
   2718  1.1.1.19  christos typedef struct acpi_prmt_handler_info
   2719  1.1.1.19  christos {
   2720  1.1.1.19  christos     UINT16                  Revision;
   2721  1.1.1.19  christos     UINT16                  Length;
   2722  1.1.1.19  christos     UINT8                   HandlerGuid[16];
   2723  1.1.1.19  christos     UINT64                  HandlerAddress;
   2724  1.1.1.19  christos     UINT64                  StaticDataBufferAddress;
   2725  1.1.1.19  christos     UINT64                  AcpiParamBufferAddress;
   2726  1.1.1.19  christos 
   2727  1.1.1.19  christos } ACPI_PRMT_HANDLER_INFO;
   2728  1.1.1.19  christos 
   2729  1.1.1.19  christos 
   2730  1.1.1.19  christos /*******************************************************************************
   2731  1.1.1.19  christos  *
   2732  1.1.1.14  christos  * RASF - RAS Feature Table (ACPI 5.0)
   2733       1.1    jruoho  *        Version 1
   2734       1.1    jruoho  *
   2735       1.1    jruoho  ******************************************************************************/
   2736       1.1    jruoho 
   2737  1.1.1.14  christos typedef struct acpi_table_rasf
   2738       1.1    jruoho {
   2739       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2740  1.1.1.14  christos     UINT8                   ChannelId[12];
   2741       1.1    jruoho 
   2742  1.1.1.14  christos } ACPI_TABLE_RASF;
   2743       1.1    jruoho 
   2744  1.1.1.14  christos /* RASF Platform Communication Channel Shared Memory Region */
   2745   1.1.1.4  christos 
   2746  1.1.1.14  christos typedef struct acpi_rasf_shared_memory
   2747   1.1.1.4  christos {
   2748  1.1.1.14  christos     UINT32                  Signature;
   2749  1.1.1.14  christos     UINT16                  Command;
   2750  1.1.1.14  christos     UINT16                  Status;
   2751  1.1.1.14  christos     UINT16                  Version;
   2752  1.1.1.14  christos     UINT8                   Capabilities[16];
   2753  1.1.1.14  christos     UINT8                   SetCapabilities[16];
   2754  1.1.1.14  christos     UINT16                  NumParameterBlocks;
   2755  1.1.1.14  christos     UINT32                  SetCapabilitiesStatus;
   2756   1.1.1.4  christos 
   2757  1.1.1.14  christos } ACPI_RASF_SHARED_MEMORY;
   2758   1.1.1.4  christos 
   2759  1.1.1.14  christos /* RASF Parameter Block Structure Header */
   2760   1.1.1.4  christos 
   2761  1.1.1.14  christos typedef struct acpi_rasf_parameter_block
   2762   1.1.1.4  christos {
   2763  1.1.1.14  christos     UINT16                  Type;
   2764  1.1.1.14  christos     UINT16                  Version;
   2765  1.1.1.14  christos     UINT16                  Length;
   2766   1.1.1.4  christos 
   2767  1.1.1.14  christos } ACPI_RASF_PARAMETER_BLOCK;
   2768   1.1.1.4  christos 
   2769  1.1.1.14  christos /* RASF Parameter Block Structure for PATROL_SCRUB */
   2770       1.1    jruoho 
   2771  1.1.1.14  christos typedef struct acpi_rasf_patrol_scrub_parameter
   2772       1.1    jruoho {
   2773  1.1.1.14  christos     ACPI_RASF_PARAMETER_BLOCK   Header;
   2774  1.1.1.14  christos     UINT16                      PatrolScrubCommand;
   2775  1.1.1.14  christos     UINT64                      RequestedAddressRange[2];
   2776  1.1.1.14  christos     UINT64                      ActualAddressRange[2];
   2777  1.1.1.14  christos     UINT16                      Flags;
   2778  1.1.1.14  christos     UINT8                       RequestedSpeed;
   2779       1.1    jruoho 
   2780  1.1.1.14  christos } ACPI_RASF_PATROL_SCRUB_PARAMETER;
   2781       1.1    jruoho 
   2782  1.1.1.14  christos /* Masks for Flags and Speed fields above */
   2783       1.1    jruoho 
   2784  1.1.1.14  christos #define ACPI_RASF_SCRUBBER_RUNNING      1
   2785  1.1.1.14  christos #define ACPI_RASF_SPEED                 (7<<1)
   2786  1.1.1.14  christos #define ACPI_RASF_SPEED_SLOW            (0<<1)
   2787  1.1.1.14  christos #define ACPI_RASF_SPEED_MEDIUM          (4<<1)
   2788  1.1.1.14  christos #define ACPI_RASF_SPEED_FAST            (7<<1)
   2789       1.1    jruoho 
   2790  1.1.1.14  christos /* Channel Commands */
   2791       1.1    jruoho 
   2792  1.1.1.14  christos enum AcpiRasfCommands
   2793  1.1.1.14  christos {
   2794  1.1.1.14  christos     ACPI_RASF_EXECUTE_RASF_COMMAND      = 1
   2795  1.1.1.14  christos };
   2796       1.1    jruoho 
   2797  1.1.1.14  christos /* Platform RAS Capabilities */
   2798  1.1.1.14  christos 
   2799  1.1.1.14  christos enum AcpiRasfCapabiliities
   2800       1.1    jruoho {
   2801  1.1.1.14  christos     ACPI_HW_PATROL_SCRUB_SUPPORTED      = 0,
   2802  1.1.1.14  christos     ACPI_SW_PATROL_SCRUB_EXPOSED        = 1
   2803  1.1.1.14  christos };
   2804       1.1    jruoho 
   2805  1.1.1.14  christos /* Patrol Scrub Commands */
   2806       1.1    jruoho 
   2807  1.1.1.14  christos enum AcpiRasfPatrolScrubCommands
   2808  1.1.1.14  christos {
   2809  1.1.1.14  christos     ACPI_RASF_GET_PATROL_PARAMETERS     = 1,
   2810  1.1.1.14  christos     ACPI_RASF_START_PATROL_SCRUBBER     = 2,
   2811  1.1.1.14  christos     ACPI_RASF_STOP_PATROL_SCRUBBER      = 3
   2812  1.1.1.14  christos };
   2813       1.1    jruoho 
   2814  1.1.1.14  christos /* Channel Command flags */
   2815       1.1    jruoho 
   2816  1.1.1.14  christos #define ACPI_RASF_GENERATE_SCI          (1<<15)
   2817       1.1    jruoho 
   2818  1.1.1.14  christos /* Status values */
   2819       1.1    jruoho 
   2820  1.1.1.14  christos enum AcpiRasfStatus
   2821       1.1    jruoho {
   2822  1.1.1.14  christos     ACPI_RASF_SUCCESS                   = 0,
   2823  1.1.1.14  christos     ACPI_RASF_NOT_VALID                 = 1,
   2824  1.1.1.14  christos     ACPI_RASF_NOT_SUPPORTED             = 2,
   2825  1.1.1.14  christos     ACPI_RASF_BUSY                      = 3,
   2826  1.1.1.14  christos     ACPI_RASF_FAILED                    = 4,
   2827  1.1.1.14  christos     ACPI_RASF_ABORTED                   = 5,
   2828  1.1.1.14  christos     ACPI_RASF_INVALID_DATA              = 6
   2829       1.1    jruoho };
   2830       1.1    jruoho 
   2831  1.1.1.14  christos /* Status flags */
   2832       1.1    jruoho 
   2833  1.1.1.14  christos #define ACPI_RASF_COMMAND_COMPLETE      (1)
   2834  1.1.1.14  christos #define ACPI_RASF_SCI_DOORBELL          (1<<1)
   2835  1.1.1.14  christos #define ACPI_RASF_ERROR                 (1<<2)
   2836  1.1.1.14  christos #define ACPI_RASF_STATUS                (0x1F<<3)
   2837       1.1    jruoho 
   2838       1.1    jruoho 
   2839       1.1    jruoho /*******************************************************************************
   2840       1.1    jruoho  *
   2841  1.1.1.19  christos  * RGRT - Regulatory Graphics Resource Table
   2842  1.1.1.19  christos  *        Version 1
   2843  1.1.1.19  christos  *
   2844  1.1.1.19  christos  * Conforms to "ACPI RGRT" available at:
   2845  1.1.1.19  christos  * https://microsoft.github.io/mu/dyn/mu_plus/MsCorePkg/AcpiRGRT/feature_acpi_rgrt/
   2846  1.1.1.19  christos  *
   2847  1.1.1.19  christos  ******************************************************************************/
   2848  1.1.1.19  christos 
   2849  1.1.1.19  christos typedef struct acpi_table_rgrt
   2850  1.1.1.19  christos {
   2851  1.1.1.19  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2852  1.1.1.19  christos     UINT16                  Version;
   2853  1.1.1.19  christos     UINT8                   ImageType;
   2854  1.1.1.19  christos     UINT8                   Reserved;
   2855  1.1.1.22  christos     UINT8                   Image[];
   2856  1.1.1.19  christos 
   2857  1.1.1.19  christos } ACPI_TABLE_RGRT;
   2858  1.1.1.19  christos 
   2859  1.1.1.19  christos /* ImageType values */
   2860  1.1.1.19  christos 
   2861  1.1.1.19  christos enum AcpiRgrtImageType
   2862  1.1.1.19  christos {
   2863  1.1.1.19  christos     ACPI_RGRT_TYPE_RESERVED0            = 0,
   2864  1.1.1.19  christos     ACPI_RGRT_IMAGE_TYPE_PNG            = 1,
   2865  1.1.1.19  christos     ACPI_RGRT_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
   2866  1.1.1.19  christos };
   2867  1.1.1.19  christos 
   2868  1.1.1.19  christos 
   2869  1.1.1.19  christos /*******************************************************************************
   2870  1.1.1.19  christos  *
   2871  1.1.1.14  christos  * SBST - Smart Battery Specification Table
   2872   1.1.1.2    jruoho  *        Version 1
   2873   1.1.1.2    jruoho  *
   2874   1.1.1.2    jruoho  ******************************************************************************/
   2875   1.1.1.2    jruoho 
   2876  1.1.1.14  christos typedef struct acpi_table_sbst
   2877   1.1.1.2    jruoho {
   2878   1.1.1.2    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2879  1.1.1.14  christos     UINT32                  WarningLevel;
   2880  1.1.1.14  christos     UINT32                  LowLevel;
   2881  1.1.1.14  christos     UINT32                  CriticalLevel;
   2882   1.1.1.2    jruoho 
   2883  1.1.1.14  christos } ACPI_TABLE_SBST;
   2884   1.1.1.2    jruoho 
   2885   1.1.1.2    jruoho 
   2886   1.1.1.2    jruoho /*******************************************************************************
   2887   1.1.1.2    jruoho  *
   2888  1.1.1.14  christos  * SDEI - Software Delegated Exception Interface Descriptor Table
   2889       1.1    jruoho  *
   2890  1.1.1.14  christos  * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
   2891  1.1.1.14  christos  * May 8th, 2017. Copyright 2017 ARM Ltd.
   2892       1.1    jruoho  *
   2893       1.1    jruoho  ******************************************************************************/
   2894       1.1    jruoho 
   2895  1.1.1.14  christos typedef struct acpi_table_sdei
   2896       1.1    jruoho {
   2897       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2898       1.1    jruoho 
   2899  1.1.1.14  christos } ACPI_TABLE_SDEI;
   2900       1.1    jruoho 
   2901       1.1    jruoho 
   2902  1.1.1.12  christos /*******************************************************************************
   2903  1.1.1.12  christos  *
   2904  1.1.1.14  christos  * SDEV - Secure Devices Table (ACPI 6.2)
   2905  1.1.1.12  christos  *        Version 1
   2906  1.1.1.12  christos  *
   2907  1.1.1.12  christos  ******************************************************************************/
   2908  1.1.1.12  christos 
   2909  1.1.1.14  christos typedef struct acpi_table_sdev
   2910  1.1.1.12  christos {
   2911  1.1.1.12  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2912  1.1.1.12  christos 
   2913  1.1.1.14  christos } ACPI_TABLE_SDEV;
   2914  1.1.1.14  christos 
   2915  1.1.1.14  christos 
   2916  1.1.1.14  christos typedef struct acpi_sdev_header
   2917  1.1.1.14  christos {
   2918  1.1.1.14  christos     UINT8                   Type;
   2919  1.1.1.14  christos     UINT8                   Flags;
   2920  1.1.1.14  christos     UINT16                  Length;
   2921  1.1.1.14  christos 
   2922  1.1.1.14  christos } ACPI_SDEV_HEADER;
   2923  1.1.1.14  christos 
   2924  1.1.1.14  christos 
   2925  1.1.1.14  christos /* Values for subtable type above */
   2926  1.1.1.14  christos 
   2927  1.1.1.14  christos enum AcpiSdevType
   2928  1.1.1.14  christos {
   2929  1.1.1.14  christos     ACPI_SDEV_TYPE_NAMESPACE_DEVICE     = 0,
   2930  1.1.1.14  christos     ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
   2931  1.1.1.14  christos     ACPI_SDEV_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
   2932  1.1.1.14  christos };
   2933  1.1.1.14  christos 
   2934  1.1.1.14  christos /* Values for flags above */
   2935  1.1.1.14  christos 
   2936  1.1.1.14  christos #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS    (1)
   2937  1.1.1.18  christos #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1)
   2938  1.1.1.12  christos 
   2939  1.1.1.14  christos /*
   2940  1.1.1.14  christos  * SDEV subtables
   2941  1.1.1.14  christos  */
   2942  1.1.1.14  christos 
   2943  1.1.1.14  christos /* 0: Namespace Device Based Secure Device Structure */
   2944  1.1.1.14  christos 
   2945  1.1.1.14  christos typedef struct acpi_sdev_namespace
   2946  1.1.1.14  christos {
   2947  1.1.1.14  christos     ACPI_SDEV_HEADER        Header;
   2948  1.1.1.14  christos     UINT16                  DeviceIdOffset;
   2949  1.1.1.14  christos     UINT16                  DeviceIdLength;
   2950  1.1.1.14  christos     UINT16                  VendorDataOffset;
   2951  1.1.1.14  christos     UINT16                  VendorDataLength;
   2952  1.1.1.14  christos 
   2953  1.1.1.14  christos } ACPI_SDEV_NAMESPACE;
   2954  1.1.1.14  christos 
   2955  1.1.1.18  christos typedef struct acpi_sdev_secure_component
   2956  1.1.1.18  christos {
   2957  1.1.1.18  christos     UINT16                  SecureComponentOffset;
   2958  1.1.1.18  christos     UINT16                  SecureComponentLength;
   2959  1.1.1.18  christos 
   2960  1.1.1.18  christos } ACPI_SDEV_SECURE_COMPONENT;
   2961  1.1.1.18  christos 
   2962  1.1.1.18  christos 
   2963  1.1.1.18  christos /*
   2964  1.1.1.18  christos  * SDEV sub-subtables ("Components") for above
   2965  1.1.1.18  christos  */
   2966  1.1.1.18  christos typedef struct acpi_sdev_component
   2967  1.1.1.18  christos {
   2968  1.1.1.18  christos     ACPI_SDEV_HEADER        Header;
   2969  1.1.1.18  christos 
   2970  1.1.1.18  christos } ACPI_SDEV_COMPONENT;
   2971  1.1.1.18  christos 
   2972  1.1.1.18  christos 
   2973  1.1.1.18  christos /* Values for sub-subtable type above */
   2974  1.1.1.18  christos 
   2975  1.1.1.18  christos enum AcpiSacType
   2976  1.1.1.18  christos {
   2977  1.1.1.18  christos     ACPI_SDEV_TYPE_ID_COMPONENT     = 0,
   2978  1.1.1.18  christos     ACPI_SDEV_TYPE_MEM_COMPONENT    = 1
   2979  1.1.1.18  christos };
   2980  1.1.1.18  christos 
   2981  1.1.1.18  christos typedef struct acpi_sdev_id_component
   2982  1.1.1.18  christos {
   2983  1.1.1.18  christos     ACPI_SDEV_HEADER        Header;
   2984  1.1.1.18  christos     UINT16                  HardwareIdOffset;
   2985  1.1.1.18  christos     UINT16                  HardwareIdLength;
   2986  1.1.1.18  christos     UINT16                  SubsystemIdOffset;
   2987  1.1.1.18  christos     UINT16                  SubsystemIdLength;
   2988  1.1.1.18  christos     UINT16                  HardwareRevision;
   2989  1.1.1.18  christos     UINT8                   HardwareRevPresent;
   2990  1.1.1.18  christos     UINT8                   ClassCodePresent;
   2991  1.1.1.18  christos     UINT8                   PciBaseClass;
   2992  1.1.1.18  christos     UINT8                   PciSubClass;
   2993  1.1.1.18  christos     UINT8                   PciProgrammingXface;
   2994  1.1.1.18  christos 
   2995  1.1.1.18  christos } ACPI_SDEV_ID_COMPONENT;
   2996  1.1.1.18  christos 
   2997  1.1.1.18  christos typedef struct acpi_sdev_mem_component
   2998  1.1.1.18  christos {
   2999  1.1.1.18  christos     ACPI_SDEV_HEADER        Header;
   3000  1.1.1.18  christos     UINT32                  Reserved;
   3001  1.1.1.18  christos     UINT64                  MemoryBaseAddress;
   3002  1.1.1.18  christos     UINT64                  MemoryLength;
   3003  1.1.1.18  christos 
   3004  1.1.1.18  christos } ACPI_SDEV_MEM_COMPONENT;
   3005  1.1.1.18  christos 
   3006  1.1.1.18  christos 
   3007  1.1.1.14  christos /* 1: PCIe Endpoint Device Based Device Structure */
   3008  1.1.1.14  christos 
   3009  1.1.1.14  christos typedef struct acpi_sdev_pcie
   3010  1.1.1.14  christos {
   3011  1.1.1.14  christos     ACPI_SDEV_HEADER        Header;
   3012  1.1.1.14  christos     UINT16                  Segment;
   3013  1.1.1.14  christos     UINT16                  StartBus;
   3014  1.1.1.14  christos     UINT16                  PathOffset;
   3015  1.1.1.14  christos     UINT16                  PathLength;
   3016  1.1.1.14  christos     UINT16                  VendorDataOffset;
   3017  1.1.1.14  christos     UINT16                  VendorDataLength;
   3018  1.1.1.14  christos 
   3019  1.1.1.14  christos } ACPI_SDEV_PCIE;
   3020  1.1.1.14  christos 
   3021  1.1.1.14  christos /* 1a: PCIe Endpoint path entry */
   3022  1.1.1.14  christos 
   3023  1.1.1.14  christos typedef struct acpi_sdev_pcie_path
   3024  1.1.1.14  christos {
   3025  1.1.1.14  christos     UINT8                   Device;
   3026  1.1.1.14  christos     UINT8                   Function;
   3027  1.1.1.12  christos 
   3028  1.1.1.14  christos } ACPI_SDEV_PCIE_PATH;
   3029  1.1.1.12  christos 
   3030  1.1.1.12  christos 
   3031  1.1.1.19  christos /*******************************************************************************
   3032  1.1.1.19  christos  *
   3033  1.1.1.19  christos  * SVKL - Storage Volume Key Location Table (ACPI 6.4)
   3034  1.1.1.19  christos  *        From: "Guest-Host-Communication Interface (GHCI) for Intel
   3035  1.1.1.19  christos  *        Trust Domain Extensions (Intel TDX)".
   3036  1.1.1.19  christos  *        Version 1
   3037  1.1.1.19  christos  *
   3038  1.1.1.19  christos  ******************************************************************************/
   3039  1.1.1.19  christos 
   3040  1.1.1.19  christos typedef struct acpi_table_svkl
   3041  1.1.1.19  christos {
   3042  1.1.1.19  christos     ACPI_TABLE_HEADER       Header; /* Common ACPI table header */
   3043  1.1.1.19  christos     UINT32                  Count;
   3044  1.1.1.19  christos 
   3045  1.1.1.19  christos } ACPI_TABLE_SVKL;
   3046  1.1.1.19  christos 
   3047  1.1.1.19  christos typedef struct acpi_svkl_key
   3048  1.1.1.19  christos {
   3049  1.1.1.19  christos     UINT16                  Type;
   3050  1.1.1.19  christos     UINT16                  Format;
   3051  1.1.1.19  christos     UINT32                  Size;
   3052  1.1.1.19  christos     UINT64                  Address;
   3053  1.1.1.19  christos 
   3054  1.1.1.19  christos } ACPI_SVKL_KEY;
   3055  1.1.1.19  christos 
   3056  1.1.1.19  christos enum acpi_svkl_type
   3057  1.1.1.19  christos {
   3058  1.1.1.19  christos     ACPI_SVKL_TYPE_MAIN_STORAGE = 0,
   3059  1.1.1.19  christos     ACPI_SVKL_TYPE_RESERVED     = 1 /* 1 and greater are reserved */
   3060  1.1.1.19  christos };
   3061  1.1.1.19  christos 
   3062  1.1.1.19  christos enum acpi_svkl_format
   3063  1.1.1.19  christos {
   3064  1.1.1.19  christos     ACPI_SVKL_FORMAT_RAW_BINARY = 0,
   3065  1.1.1.19  christos     ACPI_SVKL_FORMAT_RESERVED   = 1 /* 1 and greater are reserved */
   3066  1.1.1.19  christos };
   3067  1.1.1.19  christos 
   3068  1.1.1.19  christos 
   3069  1.1.1.21  christos /*******************************************************************************
   3070  1.1.1.21  christos  *
   3071  1.1.1.21  christos  * TDEL - TD-Event Log
   3072  1.1.1.21  christos  *        From: "Guest-Host-Communication Interface (GHCI) for Intel
   3073  1.1.1.21  christos  *        Trust Domain Extensions (Intel TDX)".
   3074  1.1.1.21  christos  *        September 2020
   3075  1.1.1.21  christos  *
   3076  1.1.1.21  christos  ******************************************************************************/
   3077  1.1.1.21  christos 
   3078  1.1.1.21  christos typedef struct acpi_table_tdel
   3079  1.1.1.21  christos {
   3080  1.1.1.21  christos     ACPI_TABLE_HEADER       Header; /* Common ACPI table header */
   3081  1.1.1.21  christos     UINT32                  Reserved;
   3082  1.1.1.21  christos     UINT64                  LogAreaMinimumLength;
   3083  1.1.1.21  christos     UINT64                  LogAreaStartAddress;
   3084  1.1.1.21  christos 
   3085  1.1.1.21  christos } ACPI_TABLE_TDEL;
   3086  1.1.1.21  christos 
   3087       1.1    jruoho /* Reset to default packing */
   3088       1.1    jruoho 
   3089       1.1    jruoho #pragma pack()
   3090       1.1    jruoho 
   3091       1.1    jruoho #endif /* __ACTBL2_H__ */
   3092