Home | History | Annotate | Line # | Download | only in include
actbl2.h revision 1.1.1.17
      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.17  christos  * Copyright (C) 2000 - 2020, 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.2    jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY 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.7  christos #define ACPI_SIG_IORT           "IORT"      /* IO Remapping Table */
     64       1.1    jruoho #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
     65   1.1.1.5  christos #define ACPI_SIG_LPIT           "LPIT"      /* Low Power Idle Table */
     66  1.1.1.14  christos #define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
     67       1.1    jruoho #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
     68       1.1    jruoho #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
     69  1.1.1.14  christos #define ACPI_SIG_MPST           "MPST"      /* Memory Power State Table */
     70  1.1.1.14  christos #define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
     71   1.1.1.6  christos #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
     72   1.1.1.4  christos #define ACPI_SIG_MTMR           "MTMR"      /* MID Timer table */
     73  1.1.1.14  christos #define ACPI_SIG_NFIT           "NFIT"      /* NVDIMM Firmware Interface Table */
     74  1.1.1.14  christos #define ACPI_SIG_PCCT           "PCCT"      /* Platform Communications Channel Table */
     75  1.1.1.14  christos #define ACPI_SIG_PDTT           "PDTT"      /* Platform Debug Trigger Table */
     76  1.1.1.14  christos #define ACPI_SIG_PMTT           "PMTT"      /* Platform Memory Topology Table */
     77  1.1.1.14  christos #define ACPI_SIG_PPTT           "PPTT"      /* Processor Properties Topology Table */
     78  1.1.1.14  christos #define ACPI_SIG_RASF           "RASF"      /* RAS Feature table */
     79  1.1.1.14  christos #define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
     80  1.1.1.12  christos #define ACPI_SIG_SDEI           "SDEI"      /* Software Delegated Exception Interface Table */
     81  1.1.1.14  christos #define ACPI_SIG_SDEV           "SDEV"      /* Secure Devices table */
     82  1.1.1.17  christos #define ACPI_SIG_NHLT           "NHLT"      /* Non-HDAudio Link Table */
     83       1.1    jruoho 
     84       1.1    jruoho 
     85       1.1    jruoho /*
     86       1.1    jruoho  * All tables must be byte-packed to match the ACPI specification, since
     87       1.1    jruoho  * the tables are provided by the system BIOS.
     88       1.1    jruoho  */
     89       1.1    jruoho #pragma pack(1)
     90       1.1    jruoho 
     91       1.1    jruoho /*
     92   1.1.1.4  christos  * Note: C bitfields are not used for this reason:
     93   1.1.1.4  christos  *
     94   1.1.1.4  christos  * "Bitfields are great and easy to read, but unfortunately the C language
     95   1.1.1.4  christos  * does not specify the layout of bitfields in memory, which means they are
     96   1.1.1.4  christos  * essentially useless for dealing with packed data in on-disk formats or
     97   1.1.1.4  christos  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
     98   1.1.1.4  christos  * this decision was a design error in C. Ritchie could have picked an order
     99   1.1.1.4  christos  * and stuck with it." Norman Ramsey.
    100   1.1.1.4  christos  * See http://stackoverflow.com/a/1053662/41661
    101       1.1    jruoho  */
    102       1.1    jruoho 
    103       1.1    jruoho 
    104       1.1    jruoho /*******************************************************************************
    105       1.1    jruoho  *
    106  1.1.1.14  christos  * IORT - IO Remapping Table
    107       1.1    jruoho  *
    108  1.1.1.14  christos  * Conforms to "IO Remapping Table System Software on ARM Platforms",
    109  1.1.1.15  christos  * Document number: ARM DEN 0049D, March 2018
    110       1.1    jruoho  *
    111       1.1    jruoho  ******************************************************************************/
    112       1.1    jruoho 
    113  1.1.1.14  christos typedef struct acpi_table_iort
    114       1.1    jruoho {
    115  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;
    116  1.1.1.14  christos     UINT32                  NodeCount;
    117  1.1.1.14  christos     UINT32                  NodeOffset;
    118  1.1.1.14  christos     UINT32                  Reserved;
    119       1.1    jruoho 
    120  1.1.1.14  christos } ACPI_TABLE_IORT;
    121       1.1    jruoho 
    122       1.1    jruoho 
    123  1.1.1.14  christos /*
    124  1.1.1.14  christos  * IORT subtables
    125  1.1.1.14  christos  */
    126  1.1.1.14  christos typedef struct acpi_iort_node
    127       1.1    jruoho {
    128       1.1    jruoho     UINT8                   Type;
    129       1.1    jruoho     UINT16                  Length;
    130  1.1.1.14  christos     UINT8                   Revision;
    131  1.1.1.14  christos     UINT32                  Reserved;
    132  1.1.1.14  christos     UINT32                  MappingCount;
    133  1.1.1.14  christos     UINT32                  MappingOffset;
    134  1.1.1.14  christos     char                    NodeData[1];
    135       1.1    jruoho 
    136  1.1.1.14  christos } ACPI_IORT_NODE;
    137       1.1    jruoho 
    138  1.1.1.14  christos /* Values for subtable Type above */
    139       1.1    jruoho 
    140  1.1.1.14  christos enum AcpiIortNodeType
    141       1.1    jruoho {
    142  1.1.1.14  christos     ACPI_IORT_NODE_ITS_GROUP            = 0x00,
    143  1.1.1.14  christos     ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
    144  1.1.1.14  christos     ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
    145  1.1.1.14  christos     ACPI_IORT_NODE_SMMU                 = 0x03,
    146  1.1.1.15  christos     ACPI_IORT_NODE_SMMU_V3              = 0x04,
    147  1.1.1.15  christos     ACPI_IORT_NODE_PMCG                 = 0x05
    148       1.1    jruoho };
    149       1.1    jruoho 
    150       1.1    jruoho 
    151  1.1.1.14  christos typedef struct acpi_iort_id_mapping
    152       1.1    jruoho {
    153  1.1.1.14  christos     UINT32                  InputBase;          /* Lowest value in input range */
    154  1.1.1.14  christos     UINT32                  IdCount;            /* Number of IDs */
    155  1.1.1.14  christos     UINT32                  OutputBase;         /* Lowest value in output range */
    156  1.1.1.14  christos     UINT32                  OutputReference;    /* A reference to the output node */
    157  1.1.1.14  christos     UINT32                  Flags;
    158       1.1    jruoho 
    159  1.1.1.14  christos } ACPI_IORT_ID_MAPPING;
    160       1.1    jruoho 
    161  1.1.1.14  christos /* Masks for Flags field above for IORT subtable */
    162       1.1    jruoho 
    163  1.1.1.14  christos #define ACPI_IORT_ID_SINGLE_MAPPING (1)
    164       1.1    jruoho 
    165       1.1    jruoho 
    166  1.1.1.14  christos typedef struct acpi_iort_memory_access
    167       1.1    jruoho {
    168  1.1.1.14  christos     UINT32                  CacheCoherency;
    169  1.1.1.14  christos     UINT8                   Hints;
    170  1.1.1.14  christos     UINT16                  Reserved;
    171  1.1.1.14  christos     UINT8                   MemoryFlags;
    172       1.1    jruoho 
    173  1.1.1.14  christos } ACPI_IORT_MEMORY_ACCESS;
    174       1.1    jruoho 
    175  1.1.1.14  christos /* Values for CacheCoherency field above */
    176       1.1    jruoho 
    177  1.1.1.14  christos #define ACPI_IORT_NODE_COHERENT         0x00000001  /* The device node is fully coherent */
    178  1.1.1.14  christos #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000  /* The device node is not coherent */
    179       1.1    jruoho 
    180  1.1.1.14  christos /* Masks for Hints field above */
    181       1.1    jruoho 
    182  1.1.1.14  christos #define ACPI_IORT_HT_TRANSIENT          (1)
    183  1.1.1.14  christos #define ACPI_IORT_HT_WRITE              (1<<1)
    184  1.1.1.14  christos #define ACPI_IORT_HT_READ               (1<<2)
    185  1.1.1.14  christos #define ACPI_IORT_HT_OVERRIDE           (1<<3)
    186       1.1    jruoho 
    187  1.1.1.14  christos /* Masks for MemoryFlags field above */
    188       1.1    jruoho 
    189  1.1.1.14  christos #define ACPI_IORT_MF_COHERENCY          (1)
    190  1.1.1.14  christos #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
    191       1.1    jruoho 
    192       1.1    jruoho 
    193  1.1.1.14  christos /*
    194  1.1.1.14  christos  * IORT node specific subtables
    195  1.1.1.14  christos  */
    196  1.1.1.14  christos typedef struct acpi_iort_its_group
    197       1.1    jruoho {
    198  1.1.1.14  christos     UINT32                  ItsCount;
    199  1.1.1.16  christos     UINT32                  Identifiers[1];         /* GIC ITS identifier array */
    200       1.1    jruoho 
    201  1.1.1.14  christos } ACPI_IORT_ITS_GROUP;
    202       1.1    jruoho 
    203       1.1    jruoho 
    204  1.1.1.14  christos typedef struct acpi_iort_named_component
    205       1.1    jruoho {
    206  1.1.1.14  christos     UINT32                  NodeFlags;
    207  1.1.1.14  christos     UINT64                  MemoryProperties;       /* Memory access properties */
    208  1.1.1.14  christos     UINT8                   MemoryAddressLimit;     /* Memory address size limit */
    209  1.1.1.14  christos     char                    DeviceName[1];          /* Path of namespace object */
    210       1.1    jruoho 
    211  1.1.1.14  christos } ACPI_IORT_NAMED_COMPONENT;
    212       1.1    jruoho 
    213  1.1.1.15  christos /* Masks for Flags field above */
    214  1.1.1.15  christos 
    215  1.1.1.15  christos #define ACPI_IORT_NC_STALL_SUPPORTED    (1)
    216  1.1.1.15  christos #define ACPI_IORT_NC_PASID_BITS         (31<<1)
    217       1.1    jruoho 
    218  1.1.1.14  christos typedef struct acpi_iort_root_complex
    219       1.1    jruoho {
    220  1.1.1.14  christos     UINT64                  MemoryProperties;       /* Memory access properties */
    221  1.1.1.14  christos     UINT32                  AtsAttribute;
    222  1.1.1.14  christos     UINT32                  PciSegmentNumber;
    223  1.1.1.15  christos     UINT8                   MemoryAddressLimit;     /* Memory address size limit */
    224  1.1.1.15  christos     UINT8                   Reserved[3];            /* Reserved, must be zero */
    225       1.1    jruoho 
    226  1.1.1.14  christos } ACPI_IORT_ROOT_COMPLEX;
    227       1.1    jruoho 
    228  1.1.1.14  christos /* Values for AtsAttribute field above */
    229       1.1    jruoho 
    230  1.1.1.14  christos #define ACPI_IORT_ATS_SUPPORTED         0x00000001  /* The root complex supports ATS */
    231  1.1.1.14  christos #define ACPI_IORT_ATS_UNSUPPORTED       0x00000000  /* The root complex doesn't support ATS */
    232   1.1.1.4  christos 
    233   1.1.1.4  christos 
    234  1.1.1.14  christos typedef struct acpi_iort_smmu
    235  1.1.1.14  christos {
    236  1.1.1.14  christos     UINT64                  BaseAddress;            /* SMMU base address */
    237  1.1.1.14  christos     UINT64                  Span;                   /* Length of memory range */
    238  1.1.1.14  christos     UINT32                  Model;
    239  1.1.1.14  christos     UINT32                  Flags;
    240  1.1.1.14  christos     UINT32                  GlobalInterruptOffset;
    241  1.1.1.14  christos     UINT32                  ContextInterruptCount;
    242  1.1.1.14  christos     UINT32                  ContextInterruptOffset;
    243  1.1.1.14  christos     UINT32                  PmuInterruptCount;
    244  1.1.1.14  christos     UINT32                  PmuInterruptOffset;
    245  1.1.1.14  christos     UINT64                  Interrupts[1];          /* Interrupt array */
    246   1.1.1.4  christos 
    247  1.1.1.14  christos } ACPI_IORT_SMMU;
    248   1.1.1.4  christos 
    249  1.1.1.14  christos /* Values for Model field above */
    250   1.1.1.4  christos 
    251  1.1.1.14  christos #define ACPI_IORT_SMMU_V1               0x00000000  /* Generic SMMUv1 */
    252  1.1.1.14  christos #define ACPI_IORT_SMMU_V2               0x00000001  /* Generic SMMUv2 */
    253  1.1.1.14  christos #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002  /* ARM Corelink MMU-400 */
    254  1.1.1.14  christos #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003  /* ARM Corelink MMU-500 */
    255  1.1.1.14  christos #define ACPI_IORT_SMMU_CORELINK_MMU401  0x00000004  /* ARM Corelink MMU-401 */
    256  1.1.1.14  christos #define ACPI_IORT_SMMU_CAVIUM_THUNDERX  0x00000005  /* Cavium ThunderX SMMUv2 */
    257   1.1.1.4  christos 
    258  1.1.1.14  christos /* Masks for Flags field above */
    259   1.1.1.4  christos 
    260  1.1.1.14  christos #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
    261  1.1.1.14  christos #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
    262   1.1.1.4  christos 
    263  1.1.1.14  christos /* Global interrupt format */
    264   1.1.1.4  christos 
    265  1.1.1.14  christos typedef struct acpi_iort_smmu_gsi
    266   1.1.1.4  christos {
    267  1.1.1.14  christos     UINT32                  NSgIrpt;
    268  1.1.1.14  christos     UINT32                  NSgIrptFlags;
    269  1.1.1.14  christos     UINT32                  NSgCfgIrpt;
    270  1.1.1.14  christos     UINT32                  NSgCfgIrptFlags;
    271   1.1.1.4  christos 
    272  1.1.1.14  christos } ACPI_IORT_SMMU_GSI;
    273   1.1.1.4  christos 
    274   1.1.1.4  christos 
    275  1.1.1.14  christos typedef struct acpi_iort_smmu_v3
    276   1.1.1.4  christos {
    277  1.1.1.14  christos     UINT64                  BaseAddress;            /* SMMUv3 base address */
    278  1.1.1.14  christos     UINT32                  Flags;
    279  1.1.1.14  christos     UINT32                  Reserved;
    280  1.1.1.14  christos     UINT64                  VatosAddress;
    281  1.1.1.14  christos     UINT32                  Model;
    282  1.1.1.14  christos     UINT32                  EventGsiv;
    283  1.1.1.14  christos     UINT32                  PriGsiv;
    284  1.1.1.14  christos     UINT32                  GerrGsiv;
    285  1.1.1.14  christos     UINT32                  SyncGsiv;
    286  1.1.1.15  christos     UINT32                  Pxm;
    287  1.1.1.14  christos     UINT32                  IdMappingIndex;
    288   1.1.1.4  christos 
    289  1.1.1.14  christos } ACPI_IORT_SMMU_V3;
    290   1.1.1.4  christos 
    291  1.1.1.14  christos /* Values for Model field above */
    292   1.1.1.4  christos 
    293  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_GENERIC           0x00000000  /* Generic SMMUv3 */
    294  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_HISILICON_HI161X  0x00000001  /* HiSilicon Hi161x SMMUv3 */
    295  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX     0x00000002  /* Cavium CN99xx SMMUv3 */
    296   1.1.1.4  christos 
    297  1.1.1.14  christos /* Masks for Flags field above */
    298   1.1.1.4  christos 
    299  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
    300  1.1.1.15  christos #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (3<<1)
    301  1.1.1.14  christos #define ACPI_IORT_SMMU_V3_PXM_VALID         (1<<3)
    302   1.1.1.4  christos 
    303  1.1.1.15  christos typedef struct acpi_iort_pmcg
    304  1.1.1.15  christos {
    305  1.1.1.15  christos     UINT64                  Page0BaseAddress;
    306  1.1.1.15  christos     UINT32                  OverflowGsiv;
    307  1.1.1.15  christos     UINT32                  NodeReference;
    308  1.1.1.15  christos     UINT64                  Page1BaseAddress;
    309  1.1.1.15  christos 
    310  1.1.1.15  christos } ACPI_IORT_PMCG;
    311  1.1.1.15  christos 
    312   1.1.1.4  christos 
    313   1.1.1.4  christos /*******************************************************************************
    314   1.1.1.4  christos  *
    315  1.1.1.14  christos  * IVRS - I/O Virtualization Reporting Structure
    316  1.1.1.14  christos  *        Version 1
    317   1.1.1.4  christos  *
    318  1.1.1.14  christos  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
    319  1.1.1.14  christos  * Revision 1.26, February 2009.
    320   1.1.1.4  christos  *
    321   1.1.1.4  christos  ******************************************************************************/
    322   1.1.1.4  christos 
    323  1.1.1.14  christos typedef struct acpi_table_ivrs
    324   1.1.1.4  christos {
    325   1.1.1.4  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    326  1.1.1.14  christos     UINT32                  Info;               /* Common virtualization info */
    327  1.1.1.14  christos     UINT64                  Reserved;
    328   1.1.1.4  christos 
    329  1.1.1.14  christos } ACPI_TABLE_IVRS;
    330   1.1.1.4  christos 
    331  1.1.1.14  christos /* Values for Info field above */
    332   1.1.1.4  christos 
    333  1.1.1.14  christos #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
    334  1.1.1.14  christos #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
    335  1.1.1.14  christos #define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
    336   1.1.1.4  christos 
    337   1.1.1.4  christos 
    338  1.1.1.14  christos /* IVRS subtable header */
    339   1.1.1.4  christos 
    340  1.1.1.14  christos typedef struct acpi_ivrs_header
    341   1.1.1.4  christos {
    342  1.1.1.14  christos     UINT8                   Type;               /* Subtable type */
    343  1.1.1.14  christos     UINT8                   Flags;
    344  1.1.1.14  christos     UINT16                  Length;             /* Subtable length */
    345  1.1.1.14  christos     UINT16                  DeviceId;           /* ID of IOMMU */
    346   1.1.1.4  christos 
    347  1.1.1.14  christos } ACPI_IVRS_HEADER;
    348   1.1.1.4  christos 
    349  1.1.1.14  christos /* Values for subtable Type above */
    350       1.1    jruoho 
    351  1.1.1.14  christos enum AcpiIvrsType
    352       1.1    jruoho {
    353  1.1.1.17  christos     ACPI_IVRS_TYPE_HARDWARE1        = 0x10,
    354  1.1.1.17  christos     ACPI_IVRS_TYPE_HARDWARE2        = 0x11,
    355  1.1.1.14  christos     ACPI_IVRS_TYPE_MEMORY1          = 0x20,
    356  1.1.1.14  christos     ACPI_IVRS_TYPE_MEMORY2          = 0x21,
    357  1.1.1.14  christos     ACPI_IVRS_TYPE_MEMORY3          = 0x22
    358  1.1.1.14  christos };
    359       1.1    jruoho 
    360  1.1.1.14  christos /* Masks for Flags field above for IVHD subtable */
    361       1.1    jruoho 
    362  1.1.1.14  christos #define ACPI_IVHD_TT_ENABLE         (1)
    363  1.1.1.14  christos #define ACPI_IVHD_PASS_PW           (1<<1)
    364  1.1.1.14  christos #define ACPI_IVHD_RES_PASS_PW       (1<<2)
    365  1.1.1.14  christos #define ACPI_IVHD_ISOC              (1<<3)
    366  1.1.1.14  christos #define ACPI_IVHD_IOTLB             (1<<4)
    367       1.1    jruoho 
    368  1.1.1.14  christos /* Masks for Flags field above for IVMD subtable */
    369       1.1    jruoho 
    370  1.1.1.14  christos #define ACPI_IVMD_UNITY             (1)
    371  1.1.1.14  christos #define ACPI_IVMD_READ              (1<<1)
    372  1.1.1.14  christos #define ACPI_IVMD_WRITE             (1<<2)
    373  1.1.1.14  christos #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
    374       1.1    jruoho 
    375       1.1    jruoho 
    376  1.1.1.14  christos /*
    377  1.1.1.14  christos  * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
    378  1.1.1.14  christos  */
    379       1.1    jruoho 
    380  1.1.1.14  christos /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
    381       1.1    jruoho 
    382  1.1.1.17  christos typedef struct acpi_ivrs_hardware_10
    383       1.1    jruoho {
    384  1.1.1.14  christos     ACPI_IVRS_HEADER        Header;
    385  1.1.1.14  christos     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
    386  1.1.1.14  christos     UINT64                  BaseAddress;        /* IOMMU control registers */
    387  1.1.1.14  christos     UINT16                  PciSegmentGroup;
    388  1.1.1.14  christos     UINT16                  Info;               /* MSI number and unit ID */
    389  1.1.1.17  christos     UINT32                  FeatureReporting;
    390  1.1.1.17  christos 
    391  1.1.1.17  christos } ACPI_IVRS_HARDWARE1;
    392  1.1.1.17  christos 
    393  1.1.1.17  christos /* 0x11: I/O Virtualization Hardware Definition Block (IVHD) */
    394       1.1    jruoho 
    395  1.1.1.17  christos typedef struct acpi_ivrs_hardware_11
    396  1.1.1.17  christos {
    397  1.1.1.17  christos     ACPI_IVRS_HEADER        Header;
    398  1.1.1.17  christos     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
    399  1.1.1.17  christos     UINT64                  BaseAddress;        /* IOMMU control registers */
    400  1.1.1.17  christos     UINT16                  PciSegmentGroup;
    401  1.1.1.17  christos     UINT16                  Info;               /* MSI number and unit ID */
    402  1.1.1.17  christos     UINT32                  Attributes;
    403  1.1.1.17  christos     UINT64                  EfrRegisterImage;
    404  1.1.1.17  christos     UINT64                  Reserved;
    405  1.1.1.17  christos } ACPI_IVRS_HARDWARE2;
    406       1.1    jruoho 
    407  1.1.1.14  christos /* Masks for Info field above */
    408       1.1    jruoho 
    409  1.1.1.14  christos #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
    410  1.1.1.14  christos #define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
    411       1.1    jruoho 
    412       1.1    jruoho 
    413  1.1.1.14  christos /*
    414  1.1.1.14  christos  * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
    415  1.1.1.14  christos  * Upper two bits of the Type field are the (encoded) length of the structure.
    416  1.1.1.14  christos  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
    417  1.1.1.14  christos  * are reserved for future use but not defined.
    418  1.1.1.14  christos  */
    419  1.1.1.14  christos typedef struct acpi_ivrs_de_header
    420       1.1    jruoho {
    421  1.1.1.14  christos     UINT8                   Type;
    422  1.1.1.14  christos     UINT16                  Id;
    423  1.1.1.14  christos     UINT8                   DataSetting;
    424       1.1    jruoho 
    425  1.1.1.14  christos } ACPI_IVRS_DE_HEADER;
    426       1.1    jruoho 
    427  1.1.1.14  christos /* Length of device entry is in the top two bits of Type field above */
    428       1.1    jruoho 
    429  1.1.1.14  christos #define ACPI_IVHD_ENTRY_LENGTH      0xC0
    430       1.1    jruoho 
    431  1.1.1.14  christos /* Values for device entry Type field above */
    432       1.1    jruoho 
    433  1.1.1.14  christos enum AcpiIvrsDeviceEntryType
    434  1.1.1.14  christos {
    435  1.1.1.14  christos     /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
    436       1.1    jruoho 
    437  1.1.1.14  christos     ACPI_IVRS_TYPE_PAD4             = 0,
    438  1.1.1.14  christos     ACPI_IVRS_TYPE_ALL              = 1,
    439  1.1.1.14  christos     ACPI_IVRS_TYPE_SELECT           = 2,
    440  1.1.1.14  christos     ACPI_IVRS_TYPE_START            = 3,
    441  1.1.1.14  christos     ACPI_IVRS_TYPE_END              = 4,
    442       1.1    jruoho 
    443  1.1.1.14  christos     /* 8-byte device entries */
    444       1.1    jruoho 
    445  1.1.1.14  christos     ACPI_IVRS_TYPE_PAD8             = 64,
    446  1.1.1.14  christos     ACPI_IVRS_TYPE_NOT_USED         = 65,
    447  1.1.1.14  christos     ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
    448  1.1.1.14  christos     ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
    449  1.1.1.14  christos     ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
    450  1.1.1.14  christos     ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
    451  1.1.1.14  christos     ACPI_IVRS_TYPE_SPECIAL          = 72  /* Uses ACPI_IVRS_DEVICE8C */
    452  1.1.1.14  christos };
    453       1.1    jruoho 
    454  1.1.1.14  christos /* Values for Data field above */
    455       1.1    jruoho 
    456  1.1.1.14  christos #define ACPI_IVHD_INIT_PASS         (1)
    457  1.1.1.14  christos #define ACPI_IVHD_EINT_PASS         (1<<1)
    458  1.1.1.14  christos #define ACPI_IVHD_NMI_PASS          (1<<2)
    459  1.1.1.14  christos #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
    460  1.1.1.14  christos #define ACPI_IVHD_LINT0_PASS        (1<<6)
    461  1.1.1.14  christos #define ACPI_IVHD_LINT1_PASS        (1<<7)
    462       1.1    jruoho 
    463       1.1    jruoho 
    464  1.1.1.14  christos /* Types 0-4: 4-byte device entry */
    465       1.1    jruoho 
    466  1.1.1.14  christos typedef struct acpi_ivrs_device4
    467       1.1    jruoho {
    468  1.1.1.14  christos     ACPI_IVRS_DE_HEADER     Header;
    469       1.1    jruoho 
    470  1.1.1.14  christos } ACPI_IVRS_DEVICE4;
    471       1.1    jruoho 
    472  1.1.1.14  christos /* Types 66-67: 8-byte device entry */
    473       1.1    jruoho 
    474  1.1.1.14  christos typedef struct acpi_ivrs_device8a
    475  1.1.1.14  christos {
    476  1.1.1.14  christos     ACPI_IVRS_DE_HEADER     Header;
    477  1.1.1.14  christos     UINT8                   Reserved1;
    478  1.1.1.14  christos     UINT16                  UsedId;
    479  1.1.1.14  christos     UINT8                   Reserved2;
    480       1.1    jruoho 
    481  1.1.1.14  christos } ACPI_IVRS_DEVICE8A;
    482       1.1    jruoho 
    483  1.1.1.14  christos /* Types 70-71: 8-byte device entry */
    484       1.1    jruoho 
    485  1.1.1.14  christos typedef struct acpi_ivrs_device8b
    486       1.1    jruoho {
    487  1.1.1.14  christos     ACPI_IVRS_DE_HEADER     Header;
    488  1.1.1.14  christos     UINT32                  ExtendedData;
    489       1.1    jruoho 
    490  1.1.1.14  christos } ACPI_IVRS_DEVICE8B;
    491       1.1    jruoho 
    492  1.1.1.14  christos /* Values for ExtendedData above */
    493       1.1    jruoho 
    494  1.1.1.14  christos #define ACPI_IVHD_ATS_DISABLED      (1<<31)
    495       1.1    jruoho 
    496  1.1.1.14  christos /* Type 72: 8-byte device entry */
    497       1.1    jruoho 
    498  1.1.1.14  christos typedef struct acpi_ivrs_device8c
    499       1.1    jruoho {
    500  1.1.1.14  christos     ACPI_IVRS_DE_HEADER     Header;
    501  1.1.1.14  christos     UINT8                   Handle;
    502  1.1.1.14  christos     UINT16                  UsedId;
    503  1.1.1.14  christos     UINT8                   Variety;
    504  1.1.1.14  christos 
    505  1.1.1.14  christos } ACPI_IVRS_DEVICE8C;
    506  1.1.1.14  christos 
    507  1.1.1.14  christos /* Values for Variety field above */
    508       1.1    jruoho 
    509  1.1.1.14  christos #define ACPI_IVHD_IOAPIC            1
    510  1.1.1.14  christos #define ACPI_IVHD_HPET              2
    511       1.1    jruoho 
    512       1.1    jruoho 
    513  1.1.1.14  christos /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
    514   1.1.1.5  christos 
    515  1.1.1.14  christos typedef struct acpi_ivrs_memory
    516   1.1.1.5  christos {
    517  1.1.1.14  christos     ACPI_IVRS_HEADER        Header;
    518  1.1.1.14  christos     UINT16                  AuxData;
    519  1.1.1.14  christos     UINT64                  Reserved;
    520  1.1.1.14  christos     UINT64                  StartAddress;
    521  1.1.1.14  christos     UINT64                  MemoryLength;
    522   1.1.1.5  christos 
    523  1.1.1.14  christos } ACPI_IVRS_MEMORY;
    524   1.1.1.5  christos 
    525   1.1.1.5  christos 
    526       1.1    jruoho /*******************************************************************************
    527       1.1    jruoho  *
    528  1.1.1.14  christos  * LPIT - Low Power Idle Table
    529       1.1    jruoho  *
    530  1.1.1.14  christos  * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
    531       1.1    jruoho  *
    532       1.1    jruoho  ******************************************************************************/
    533       1.1    jruoho 
    534  1.1.1.14  christos typedef struct acpi_table_lpit
    535       1.1    jruoho {
    536       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    537       1.1    jruoho 
    538  1.1.1.14  christos } ACPI_TABLE_LPIT;
    539  1.1.1.14  christos 
    540       1.1    jruoho 
    541  1.1.1.14  christos /* LPIT subtable header */
    542  1.1.1.14  christos 
    543  1.1.1.14  christos typedef struct acpi_lpit_header
    544  1.1.1.14  christos {
    545  1.1.1.14  christos     UINT32                  Type;               /* Subtable type */
    546  1.1.1.14  christos     UINT32                  Length;             /* Subtable length */
    547  1.1.1.14  christos     UINT16                  UniqueId;
    548  1.1.1.14  christos     UINT16                  Reserved;
    549  1.1.1.14  christos     UINT32                  Flags;
    550       1.1    jruoho 
    551  1.1.1.14  christos } ACPI_LPIT_HEADER;
    552       1.1    jruoho 
    553  1.1.1.14  christos /* Values for subtable Type above */
    554       1.1    jruoho 
    555  1.1.1.14  christos enum AcpiLpitType
    556       1.1    jruoho {
    557  1.1.1.14  christos     ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
    558  1.1.1.14  christos     ACPI_LPIT_TYPE_RESERVED         = 0x01      /* 1 and above are reserved */
    559       1.1    jruoho };
    560       1.1    jruoho 
    561  1.1.1.14  christos /* Masks for Flags field above  */
    562  1.1.1.14  christos 
    563  1.1.1.14  christos #define ACPI_LPIT_STATE_DISABLED    (1)
    564  1.1.1.14  christos #define ACPI_LPIT_NO_COUNTER        (1<<1)
    565  1.1.1.14  christos 
    566  1.1.1.14  christos /*
    567  1.1.1.14  christos  * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
    568  1.1.1.14  christos  */
    569  1.1.1.14  christos 
    570  1.1.1.14  christos /* 0x00: Native C-state instruction based LPI structure */
    571  1.1.1.14  christos 
    572  1.1.1.14  christos typedef struct acpi_lpit_native
    573  1.1.1.14  christos {
    574  1.1.1.14  christos     ACPI_LPIT_HEADER        Header;
    575  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    EntryTrigger;
    576  1.1.1.14  christos     UINT32                  Residency;
    577  1.1.1.14  christos     UINT32                  Latency;
    578  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    ResidencyCounter;
    579  1.1.1.14  christos     UINT64                  CounterFrequency;
    580  1.1.1.14  christos 
    581  1.1.1.14  christos } ACPI_LPIT_NATIVE;
    582  1.1.1.14  christos 
    583       1.1    jruoho 
    584       1.1    jruoho /*******************************************************************************
    585       1.1    jruoho  *
    586  1.1.1.14  christos  * MADT - Multiple APIC Description Table
    587  1.1.1.14  christos  *        Version 3
    588       1.1    jruoho  *
    589       1.1    jruoho  ******************************************************************************/
    590       1.1    jruoho 
    591  1.1.1.14  christos typedef struct acpi_table_madt
    592       1.1    jruoho {
    593       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    594  1.1.1.14  christos     UINT32                  Address;            /* Physical address of local APIC */
    595  1.1.1.14  christos     UINT32                  Flags;
    596       1.1    jruoho 
    597  1.1.1.14  christos } ACPI_TABLE_MADT;
    598       1.1    jruoho 
    599  1.1.1.14  christos /* Masks for Flags field above */
    600       1.1    jruoho 
    601  1.1.1.14  christos #define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
    602       1.1    jruoho 
    603  1.1.1.14  christos /* Values for PCATCompat flag */
    604       1.1    jruoho 
    605  1.1.1.14  christos #define ACPI_MADT_DUAL_PIC          1
    606  1.1.1.14  christos #define ACPI_MADT_MULTIPLE_APIC     0
    607       1.1    jruoho 
    608       1.1    jruoho 
    609  1.1.1.14  christos /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
    610  1.1.1.14  christos 
    611  1.1.1.14  christos enum AcpiMadtType
    612  1.1.1.14  christos {
    613  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_APIC               = 0,
    614  1.1.1.14  christos     ACPI_MADT_TYPE_IO_APIC                  = 1,
    615  1.1.1.14  christos     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
    616  1.1.1.14  christos     ACPI_MADT_TYPE_NMI_SOURCE               = 3,
    617  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
    618  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
    619  1.1.1.14  christos     ACPI_MADT_TYPE_IO_SAPIC                 = 6,
    620  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
    621  1.1.1.14  christos     ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
    622  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
    623  1.1.1.14  christos     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
    624  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
    625  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
    626  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
    627  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
    628  1.1.1.14  christos     ACPI_MADT_TYPE_GENERIC_TRANSLATOR       = 15,
    629  1.1.1.14  christos     ACPI_MADT_TYPE_RESERVED                 = 16    /* 16 and greater are reserved */
    630       1.1    jruoho };
    631       1.1    jruoho 
    632       1.1    jruoho 
    633  1.1.1.14  christos /*
    634  1.1.1.14  christos  * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
    635  1.1.1.14  christos  */
    636       1.1    jruoho 
    637  1.1.1.14  christos /* 0: Processor Local APIC */
    638  1.1.1.14  christos 
    639  1.1.1.14  christos typedef struct acpi_madt_local_apic
    640       1.1    jruoho {
    641  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    642  1.1.1.14  christos     UINT8                   ProcessorId;        /* ACPI processor id */
    643  1.1.1.14  christos     UINT8                   Id;                 /* Processor's local APIC id */
    644  1.1.1.14  christos     UINT32                  LapicFlags;
    645       1.1    jruoho 
    646  1.1.1.14  christos } ACPI_MADT_LOCAL_APIC;
    647       1.1    jruoho 
    648       1.1    jruoho 
    649  1.1.1.14  christos /* 1: IO APIC */
    650   1.1.1.7  christos 
    651  1.1.1.14  christos typedef struct acpi_madt_io_apic
    652   1.1.1.7  christos {
    653  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    654  1.1.1.14  christos     UINT8                   Id;                 /* I/O APIC ID */
    655  1.1.1.14  christos     UINT8                   Reserved;           /* Reserved - must be zero */
    656  1.1.1.14  christos     UINT32                  Address;            /* APIC physical address */
    657  1.1.1.14  christos     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
    658   1.1.1.7  christos 
    659  1.1.1.14  christos } ACPI_MADT_IO_APIC;
    660   1.1.1.7  christos 
    661   1.1.1.7  christos 
    662  1.1.1.14  christos /* 2: Interrupt Override */
    663   1.1.1.7  christos 
    664  1.1.1.14  christos typedef struct acpi_madt_interrupt_override
    665  1.1.1.14  christos {
    666  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    667  1.1.1.14  christos     UINT8                   Bus;                /* 0 - ISA */
    668  1.1.1.14  christos     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
    669  1.1.1.14  christos     UINT32                  GlobalIrq;          /* Global system interrupt */
    670  1.1.1.14  christos     UINT16                  IntiFlags;
    671   1.1.1.7  christos 
    672  1.1.1.14  christos } ACPI_MADT_INTERRUPT_OVERRIDE;
    673   1.1.1.7  christos 
    674   1.1.1.7  christos 
    675  1.1.1.14  christos /* 3: NMI Source */
    676   1.1.1.7  christos 
    677  1.1.1.14  christos typedef struct acpi_madt_nmi_source
    678   1.1.1.7  christos {
    679  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    680  1.1.1.14  christos     UINT16                  IntiFlags;
    681  1.1.1.14  christos     UINT32                  GlobalIrq;          /* Global system interrupt */
    682   1.1.1.7  christos 
    683  1.1.1.14  christos } ACPI_MADT_NMI_SOURCE;
    684   1.1.1.7  christos 
    685   1.1.1.7  christos 
    686  1.1.1.14  christos /* 4: Local APIC NMI */
    687   1.1.1.7  christos 
    688  1.1.1.14  christos typedef struct acpi_madt_local_apic_nmi
    689   1.1.1.7  christos {
    690  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    691  1.1.1.14  christos     UINT8                   ProcessorId;        /* ACPI processor id */
    692  1.1.1.14  christos     UINT16                  IntiFlags;
    693  1.1.1.14  christos     UINT8                   Lint;               /* LINTn to which NMI is connected */
    694   1.1.1.7  christos 
    695  1.1.1.14  christos } ACPI_MADT_LOCAL_APIC_NMI;
    696   1.1.1.7  christos 
    697   1.1.1.7  christos 
    698  1.1.1.14  christos /* 5: Address Override */
    699   1.1.1.7  christos 
    700  1.1.1.14  christos typedef struct acpi_madt_local_apic_override
    701  1.1.1.14  christos {
    702  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    703  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved, must be zero */
    704  1.1.1.14  christos     UINT64                  Address;            /* APIC physical address */
    705   1.1.1.7  christos 
    706  1.1.1.14  christos } ACPI_MADT_LOCAL_APIC_OVERRIDE;
    707   1.1.1.7  christos 
    708   1.1.1.7  christos 
    709  1.1.1.14  christos /* 6: I/O Sapic */
    710   1.1.1.7  christos 
    711  1.1.1.14  christos typedef struct acpi_madt_io_sapic
    712   1.1.1.7  christos {
    713  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    714  1.1.1.14  christos     UINT8                   Id;                 /* I/O SAPIC ID */
    715  1.1.1.14  christos     UINT8                   Reserved;           /* Reserved, must be zero */
    716  1.1.1.14  christos     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
    717  1.1.1.14  christos     UINT64                  Address;            /* SAPIC physical address */
    718   1.1.1.7  christos 
    719  1.1.1.14  christos } ACPI_MADT_IO_SAPIC;
    720   1.1.1.7  christos 
    721   1.1.1.7  christos 
    722  1.1.1.14  christos /* 7: Local Sapic */
    723  1.1.1.14  christos 
    724  1.1.1.14  christos typedef struct acpi_madt_local_sapic
    725   1.1.1.7  christos {
    726  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    727  1.1.1.14  christos     UINT8                   ProcessorId;        /* ACPI processor id */
    728  1.1.1.14  christos     UINT8                   Id;                 /* SAPIC ID */
    729  1.1.1.14  christos     UINT8                   Eid;                /* SAPIC EID */
    730  1.1.1.14  christos     UINT8                   Reserved[3];        /* Reserved, must be zero */
    731  1.1.1.14  christos     UINT32                  LapicFlags;
    732  1.1.1.14  christos     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
    733  1.1.1.14  christos     char                    UidString[1];       /* String UID  - ACPI 3.0 */
    734   1.1.1.7  christos 
    735  1.1.1.14  christos } ACPI_MADT_LOCAL_SAPIC;
    736   1.1.1.7  christos 
    737   1.1.1.7  christos 
    738  1.1.1.14  christos /* 8: Platform Interrupt Source */
    739  1.1.1.14  christos 
    740  1.1.1.14  christos typedef struct acpi_madt_interrupt_source
    741   1.1.1.7  christos {
    742  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    743  1.1.1.14  christos     UINT16                  IntiFlags;
    744  1.1.1.14  christos     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
    745  1.1.1.14  christos     UINT8                   Id;                 /* Processor ID */
    746  1.1.1.14  christos     UINT8                   Eid;                /* Processor EID */
    747  1.1.1.14  christos     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
    748  1.1.1.14  christos     UINT32                  GlobalIrq;          /* Global system interrupt */
    749  1.1.1.14  christos     UINT32                  Flags;              /* Interrupt Source Flags */
    750   1.1.1.7  christos 
    751  1.1.1.14  christos } ACPI_MADT_INTERRUPT_SOURCE;
    752   1.1.1.7  christos 
    753  1.1.1.14  christos /* Masks for Flags field above */
    754   1.1.1.7  christos 
    755  1.1.1.14  christos #define ACPI_MADT_CPEI_OVERRIDE     (1)
    756   1.1.1.7  christos 
    757   1.1.1.7  christos 
    758  1.1.1.14  christos /* 9: Processor Local X2APIC (ACPI 4.0) */
    759  1.1.1.14  christos 
    760  1.1.1.14  christos typedef struct acpi_madt_local_x2apic
    761   1.1.1.7  christos {
    762  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    763  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved - must be zero */
    764  1.1.1.14  christos     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
    765  1.1.1.14  christos     UINT32                  LapicFlags;
    766  1.1.1.14  christos     UINT32                  Uid;                /* ACPI processor UID */
    767   1.1.1.7  christos 
    768  1.1.1.14  christos } ACPI_MADT_LOCAL_X2APIC;
    769   1.1.1.7  christos 
    770   1.1.1.7  christos 
    771  1.1.1.14  christos /* 10: Local X2APIC NMI (ACPI 4.0) */
    772  1.1.1.14  christos 
    773  1.1.1.14  christos typedef struct acpi_madt_local_x2apic_nmi
    774  1.1.1.14  christos {
    775  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    776  1.1.1.14  christos     UINT16                  IntiFlags;
    777  1.1.1.14  christos     UINT32                  Uid;                /* ACPI processor UID */
    778  1.1.1.14  christos     UINT8                   Lint;               /* LINTn to which NMI is connected */
    779  1.1.1.14  christos     UINT8                   Reserved[3];        /* Reserved - must be zero */
    780  1.1.1.14  christos 
    781  1.1.1.14  christos } ACPI_MADT_LOCAL_X2APIC_NMI;
    782  1.1.1.14  christos 
    783  1.1.1.14  christos 
    784  1.1.1.16  christos /* 11: Generic Interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */
    785  1.1.1.14  christos 
    786  1.1.1.14  christos typedef struct acpi_madt_generic_interrupt
    787  1.1.1.14  christos {
    788  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    789  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved - must be zero */
    790  1.1.1.14  christos     UINT32                  CpuInterfaceNumber;
    791  1.1.1.14  christos     UINT32                  Uid;
    792  1.1.1.14  christos     UINT32                  Flags;
    793  1.1.1.14  christos     UINT32                  ParkingVersion;
    794  1.1.1.14  christos     UINT32                  PerformanceInterrupt;
    795  1.1.1.14  christos     UINT64                  ParkedAddress;
    796  1.1.1.14  christos     UINT64                  BaseAddress;
    797  1.1.1.14  christos     UINT64                  GicvBaseAddress;
    798  1.1.1.14  christos     UINT64                  GichBaseAddress;
    799  1.1.1.14  christos     UINT32                  VgicInterrupt;
    800  1.1.1.14  christos     UINT64                  GicrBaseAddress;
    801  1.1.1.14  christos     UINT64                  ArmMpidr;
    802  1.1.1.14  christos     UINT8                   EfficiencyClass;
    803  1.1.1.16  christos     UINT8                   Reserved2[1];
    804  1.1.1.16  christos     UINT16                  SpeInterrupt;       /* ACPI 6.3 */
    805  1.1.1.14  christos 
    806  1.1.1.14  christos } ACPI_MADT_GENERIC_INTERRUPT;
    807   1.1.1.7  christos 
    808   1.1.1.7  christos /* Masks for Flags field above */
    809   1.1.1.7  christos 
    810  1.1.1.14  christos /* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
    811  1.1.1.14  christos #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
    812  1.1.1.14  christos #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
    813   1.1.1.7  christos 
    814  1.1.1.11  christos 
    815  1.1.1.14  christos /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
    816  1.1.1.14  christos 
    817  1.1.1.14  christos typedef struct acpi_madt_generic_distributor
    818  1.1.1.11  christos {
    819  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    820  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved - must be zero */
    821  1.1.1.14  christos     UINT32                  GicId;
    822  1.1.1.14  christos     UINT64                  BaseAddress;
    823  1.1.1.14  christos     UINT32                  GlobalIrqBase;
    824  1.1.1.14  christos     UINT8                   Version;
    825  1.1.1.14  christos     UINT8                   Reserved2[3];       /* Reserved - must be zero */
    826  1.1.1.12  christos 
    827  1.1.1.14  christos } ACPI_MADT_GENERIC_DISTRIBUTOR;
    828  1.1.1.11  christos 
    829  1.1.1.14  christos /* Values for Version field above */
    830   1.1.1.7  christos 
    831  1.1.1.14  christos enum AcpiMadtGicVersion
    832   1.1.1.9  christos {
    833  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_NONE          = 0,
    834  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_V1            = 1,
    835  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_V2            = 2,
    836  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_V3            = 3,
    837  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_V4            = 4,
    838  1.1.1.14  christos     ACPI_MADT_GIC_VERSION_RESERVED      = 5     /* 5 and greater are reserved */
    839  1.1.1.14  christos };
    840   1.1.1.9  christos 
    841   1.1.1.9  christos 
    842  1.1.1.14  christos /* 13: Generic MSI Frame (ACPI 5.1) */
    843  1.1.1.12  christos 
    844  1.1.1.14  christos typedef struct acpi_madt_generic_msi_frame
    845  1.1.1.14  christos {
    846  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    847  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved - must be zero */
    848  1.1.1.14  christos     UINT32                  MsiFrameId;
    849  1.1.1.14  christos     UINT64                  BaseAddress;
    850  1.1.1.14  christos     UINT32                  Flags;
    851  1.1.1.14  christos     UINT16                  SpiCount;
    852  1.1.1.14  christos     UINT16                  SpiBase;
    853  1.1.1.14  christos 
    854  1.1.1.14  christos } ACPI_MADT_GENERIC_MSI_FRAME;
    855  1.1.1.12  christos 
    856   1.1.1.9  christos /* Masks for Flags field above */
    857   1.1.1.9  christos 
    858  1.1.1.14  christos #define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
    859  1.1.1.14  christos 
    860  1.1.1.14  christos 
    861  1.1.1.14  christos /* 14: Generic Redistributor (ACPI 5.1) */
    862  1.1.1.14  christos 
    863  1.1.1.14  christos typedef struct acpi_madt_generic_redistributor
    864  1.1.1.14  christos {
    865  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    866  1.1.1.14  christos     UINT16                  Reserved;           /* reserved - must be zero */
    867  1.1.1.14  christos     UINT64                  BaseAddress;
    868  1.1.1.14  christos     UINT32                  Length;
    869  1.1.1.14  christos 
    870  1.1.1.14  christos } ACPI_MADT_GENERIC_REDISTRIBUTOR;
    871  1.1.1.14  christos 
    872  1.1.1.14  christos 
    873  1.1.1.14  christos /* 15: Generic Translator (ACPI 6.0) */
    874  1.1.1.14  christos 
    875  1.1.1.14  christos typedef struct acpi_madt_generic_translator
    876  1.1.1.14  christos {
    877  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
    878  1.1.1.14  christos     UINT16                  Reserved;           /* reserved - must be zero */
    879  1.1.1.14  christos     UINT32                  TranslationId;
    880  1.1.1.14  christos     UINT64                  BaseAddress;
    881  1.1.1.14  christos     UINT32                  Reserved2;
    882  1.1.1.14  christos 
    883  1.1.1.14  christos } ACPI_MADT_GENERIC_TRANSLATOR;
    884  1.1.1.14  christos 
    885  1.1.1.14  christos 
    886  1.1.1.14  christos /*
    887  1.1.1.14  christos  * Common flags fields for MADT subtables
    888  1.1.1.14  christos  */
    889  1.1.1.14  christos 
    890  1.1.1.14  christos /* MADT Local APIC flags */
    891  1.1.1.14  christos 
    892  1.1.1.14  christos #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
    893  1.1.1.14  christos 
    894  1.1.1.14  christos /* MADT MPS INTI flags (IntiFlags) */
    895  1.1.1.14  christos 
    896  1.1.1.14  christos #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
    897  1.1.1.14  christos #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
    898  1.1.1.14  christos 
    899  1.1.1.14  christos /* Values for MPS INTI flags */
    900  1.1.1.14  christos 
    901  1.1.1.14  christos #define ACPI_MADT_POLARITY_CONFORMS       0
    902  1.1.1.14  christos #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
    903  1.1.1.14  christos #define ACPI_MADT_POLARITY_RESERVED       2
    904  1.1.1.14  christos #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
    905  1.1.1.14  christos 
    906  1.1.1.14  christos #define ACPI_MADT_TRIGGER_CONFORMS        (0)
    907  1.1.1.14  christos #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
    908  1.1.1.14  christos #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
    909  1.1.1.14  christos #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
    910   1.1.1.9  christos 
    911   1.1.1.9  christos 
    912   1.1.1.7  christos /*******************************************************************************
    913   1.1.1.7  christos  *
    914  1.1.1.14  christos  * MCFG - PCI Memory Mapped Configuration table and subtable
    915       1.1    jruoho  *        Version 1
    916       1.1    jruoho  *
    917  1.1.1.14  christos  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
    918       1.1    jruoho  *
    919       1.1    jruoho  ******************************************************************************/
    920       1.1    jruoho 
    921  1.1.1.14  christos typedef struct acpi_table_mcfg
    922       1.1    jruoho {
    923       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    924  1.1.1.14  christos     UINT8                   Reserved[8];
    925       1.1    jruoho 
    926  1.1.1.14  christos } ACPI_TABLE_MCFG;
    927       1.1    jruoho 
    928       1.1    jruoho 
    929  1.1.1.14  christos /* Subtable */
    930       1.1    jruoho 
    931  1.1.1.14  christos typedef struct acpi_mcfg_allocation
    932  1.1.1.14  christos {
    933  1.1.1.14  christos     UINT64                  Address;            /* Base address, processor-relative */
    934  1.1.1.14  christos     UINT16                  PciSegment;         /* PCI segment group number */
    935  1.1.1.14  christos     UINT8                   StartBusNumber;     /* Starting PCI Bus number */
    936  1.1.1.14  christos     UINT8                   EndBusNumber;       /* Final PCI Bus number */
    937  1.1.1.14  christos     UINT32                  Reserved;
    938       1.1    jruoho 
    939  1.1.1.14  christos } ACPI_MCFG_ALLOCATION;
    940       1.1    jruoho 
    941  1.1.1.14  christos 
    942  1.1.1.14  christos /*******************************************************************************
    943  1.1.1.14  christos  *
    944  1.1.1.14  christos  * MCHI - Management Controller Host Interface Table
    945  1.1.1.14  christos  *        Version 1
    946  1.1.1.14  christos  *
    947  1.1.1.14  christos  * Conforms to "Management Component Transport Protocol (MCTP) Host
    948  1.1.1.14  christos  * Interface Specification", Revision 1.0.0a, October 13, 2009
    949  1.1.1.14  christos  *
    950  1.1.1.14  christos  ******************************************************************************/
    951  1.1.1.14  christos 
    952  1.1.1.14  christos typedef struct acpi_table_mchi
    953       1.1    jruoho {
    954  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    955  1.1.1.14  christos     UINT8                   InterfaceType;
    956  1.1.1.14  christos     UINT8                   Protocol;
    957  1.1.1.14  christos     UINT64                  ProtocolData;
    958  1.1.1.14  christos     UINT8                   InterruptType;
    959  1.1.1.14  christos     UINT8                   Gpe;
    960  1.1.1.14  christos     UINT8                   PciDeviceFlag;
    961  1.1.1.14  christos     UINT32                  GlobalInterrupt;
    962  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    ControlRegister;
    963  1.1.1.14  christos     UINT8                   PciSegment;
    964  1.1.1.14  christos     UINT8                   PciBus;
    965  1.1.1.14  christos     UINT8                   PciDevice;
    966  1.1.1.14  christos     UINT8                   PciFunction;
    967       1.1    jruoho 
    968  1.1.1.14  christos } ACPI_TABLE_MCHI;
    969       1.1    jruoho 
    970       1.1    jruoho 
    971  1.1.1.14  christos /*******************************************************************************
    972  1.1.1.14  christos  *
    973  1.1.1.14  christos  * MPST - Memory Power State Table (ACPI 5.0)
    974  1.1.1.14  christos  *        Version 1
    975  1.1.1.14  christos  *
    976  1.1.1.14  christos  ******************************************************************************/
    977  1.1.1.14  christos 
    978  1.1.1.14  christos #define ACPI_MPST_CHANNEL_INFO \
    979  1.1.1.14  christos     UINT8                   ChannelId; \
    980  1.1.1.14  christos     UINT8                   Reserved1[3]; \
    981  1.1.1.14  christos     UINT16                  PowerNodeCount; \
    982  1.1.1.14  christos     UINT16                  Reserved2;
    983  1.1.1.14  christos 
    984  1.1.1.14  christos /* Main table */
    985  1.1.1.14  christos 
    986  1.1.1.14  christos typedef struct acpi_table_mpst
    987       1.1    jruoho {
    988  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    989  1.1.1.14  christos     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
    990       1.1    jruoho 
    991  1.1.1.14  christos } ACPI_TABLE_MPST;
    992       1.1    jruoho 
    993       1.1    jruoho 
    994  1.1.1.14  christos /* Memory Platform Communication Channel Info */
    995       1.1    jruoho 
    996  1.1.1.14  christos typedef struct acpi_mpst_channel
    997  1.1.1.14  christos {
    998  1.1.1.14  christos     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
    999       1.1    jruoho 
   1000  1.1.1.14  christos } ACPI_MPST_CHANNEL;
   1001       1.1    jruoho 
   1002       1.1    jruoho 
   1003  1.1.1.14  christos /* Memory Power Node Structure */
   1004       1.1    jruoho 
   1005  1.1.1.14  christos typedef struct acpi_mpst_power_node
   1006       1.1    jruoho {
   1007  1.1.1.14  christos     UINT8                   Flags;
   1008  1.1.1.14  christos     UINT8                   Reserved1;
   1009  1.1.1.14  christos     UINT16                  NodeId;
   1010  1.1.1.14  christos     UINT32                  Length;
   1011  1.1.1.14  christos     UINT64                  RangeAddress;
   1012  1.1.1.14  christos     UINT64                  RangeLength;
   1013  1.1.1.14  christos     UINT32                  NumPowerStates;
   1014  1.1.1.14  christos     UINT32                  NumPhysicalComponents;
   1015       1.1    jruoho 
   1016  1.1.1.14  christos } ACPI_MPST_POWER_NODE;
   1017       1.1    jruoho 
   1018  1.1.1.14  christos /* Values for Flags field above */
   1019       1.1    jruoho 
   1020  1.1.1.14  christos #define ACPI_MPST_ENABLED               1
   1021  1.1.1.14  christos #define ACPI_MPST_POWER_MANAGED         2
   1022  1.1.1.14  christos #define ACPI_MPST_HOT_PLUG_CAPABLE      4
   1023       1.1    jruoho 
   1024       1.1    jruoho 
   1025  1.1.1.14  christos /* Memory Power State Structure (follows POWER_NODE above) */
   1026  1.1.1.14  christos 
   1027  1.1.1.14  christos typedef struct acpi_mpst_power_state
   1028       1.1    jruoho {
   1029  1.1.1.14  christos     UINT8                   PowerState;
   1030  1.1.1.14  christos     UINT8                   InfoIndex;
   1031       1.1    jruoho 
   1032  1.1.1.14  christos } ACPI_MPST_POWER_STATE;
   1033       1.1    jruoho 
   1034       1.1    jruoho 
   1035  1.1.1.14  christos /* Physical Component ID Structure (follows POWER_STATE above) */
   1036       1.1    jruoho 
   1037  1.1.1.14  christos typedef struct acpi_mpst_component
   1038  1.1.1.14  christos {
   1039  1.1.1.14  christos     UINT16                  ComponentId;
   1040       1.1    jruoho 
   1041  1.1.1.14  christos } ACPI_MPST_COMPONENT;
   1042  1.1.1.14  christos 
   1043  1.1.1.14  christos 
   1044  1.1.1.14  christos /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
   1045  1.1.1.14  christos 
   1046  1.1.1.14  christos typedef struct acpi_mpst_data_hdr
   1047       1.1    jruoho {
   1048  1.1.1.14  christos     UINT16                  CharacteristicsCount;
   1049  1.1.1.14  christos     UINT16                  Reserved;
   1050       1.1    jruoho 
   1051  1.1.1.14  christos } ACPI_MPST_DATA_HDR;
   1052       1.1    jruoho 
   1053  1.1.1.14  christos typedef struct acpi_mpst_power_data
   1054  1.1.1.14  christos {
   1055  1.1.1.14  christos     UINT8                   StructureId;
   1056  1.1.1.14  christos     UINT8                   Flags;
   1057  1.1.1.14  christos     UINT16                  Reserved1;
   1058  1.1.1.14  christos     UINT32                  AveragePower;
   1059  1.1.1.14  christos     UINT32                  PowerSaving;
   1060  1.1.1.14  christos     UINT64                  ExitLatency;
   1061  1.1.1.14  christos     UINT64                  Reserved2;
   1062       1.1    jruoho 
   1063  1.1.1.14  christos } ACPI_MPST_POWER_DATA;
   1064       1.1    jruoho 
   1065  1.1.1.14  christos /* Values for Flags field above */
   1066       1.1    jruoho 
   1067  1.1.1.14  christos #define ACPI_MPST_PRESERVE              1
   1068  1.1.1.14  christos #define ACPI_MPST_AUTOENTRY             2
   1069  1.1.1.14  christos #define ACPI_MPST_AUTOEXIT              4
   1070       1.1    jruoho 
   1071       1.1    jruoho 
   1072  1.1.1.14  christos /* Shared Memory Region (not part of an ACPI table) */
   1073       1.1    jruoho 
   1074  1.1.1.14  christos typedef struct acpi_mpst_shared
   1075       1.1    jruoho {
   1076  1.1.1.14  christos     UINT32                  Signature;
   1077  1.1.1.14  christos     UINT16                  PccCommand;
   1078  1.1.1.14  christos     UINT16                  PccStatus;
   1079  1.1.1.14  christos     UINT32                  CommandRegister;
   1080  1.1.1.14  christos     UINT32                  StatusRegister;
   1081  1.1.1.14  christos     UINT32                  PowerStateId;
   1082  1.1.1.14  christos     UINT32                  PowerNodeId;
   1083  1.1.1.14  christos     UINT64                  EnergyConsumed;
   1084  1.1.1.14  christos     UINT64                  AveragePower;
   1085       1.1    jruoho 
   1086  1.1.1.14  christos } ACPI_MPST_SHARED;
   1087       1.1    jruoho 
   1088       1.1    jruoho 
   1089  1.1.1.14  christos /*******************************************************************************
   1090  1.1.1.14  christos  *
   1091  1.1.1.14  christos  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
   1092  1.1.1.14  christos  *        Version 1
   1093  1.1.1.14  christos  *
   1094  1.1.1.14  christos  ******************************************************************************/
   1095  1.1.1.14  christos 
   1096  1.1.1.14  christos typedef struct acpi_table_msct
   1097       1.1    jruoho {
   1098  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1099  1.1.1.14  christos     UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
   1100  1.1.1.14  christos     UINT32                  MaxProximityDomains;/* Max number of proximity domains */
   1101  1.1.1.14  christos     UINT32                  MaxClockDomains;    /* Max number of clock domains */
   1102  1.1.1.14  christos     UINT64                  MaxAddress;         /* Max physical address in system */
   1103       1.1    jruoho 
   1104  1.1.1.14  christos } ACPI_TABLE_MSCT;
   1105       1.1    jruoho 
   1106       1.1    jruoho 
   1107  1.1.1.14  christos /* Subtable - Maximum Proximity Domain Information. Version 1 */
   1108  1.1.1.14  christos 
   1109  1.1.1.14  christos typedef struct acpi_msct_proximity
   1110       1.1    jruoho {
   1111  1.1.1.14  christos     UINT8                   Revision;
   1112  1.1.1.14  christos     UINT8                   Length;
   1113  1.1.1.14  christos     UINT32                  RangeStart;         /* Start of domain range */
   1114  1.1.1.14  christos     UINT32                  RangeEnd;           /* End of domain range */
   1115  1.1.1.14  christos     UINT32                  ProcessorCapacity;
   1116  1.1.1.14  christos     UINT64                  MemoryCapacity;     /* In bytes */
   1117       1.1    jruoho 
   1118  1.1.1.14  christos } ACPI_MSCT_PROXIMITY;
   1119       1.1    jruoho 
   1120       1.1    jruoho 
   1121  1.1.1.14  christos /*******************************************************************************
   1122  1.1.1.14  christos  *
   1123  1.1.1.14  christos  * MSDM - Microsoft Data Management table
   1124  1.1.1.14  christos  *
   1125  1.1.1.14  christos  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
   1126  1.1.1.14  christos  * November 29, 2011. Copyright 2011 Microsoft
   1127  1.1.1.14  christos  *
   1128  1.1.1.14  christos  ******************************************************************************/
   1129       1.1    jruoho 
   1130  1.1.1.14  christos /* Basic MSDM table is only the common ACPI header */
   1131       1.1    jruoho 
   1132  1.1.1.14  christos typedef struct acpi_table_msdm
   1133       1.1    jruoho {
   1134  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1135       1.1    jruoho 
   1136  1.1.1.14  christos } ACPI_TABLE_MSDM;
   1137       1.1    jruoho 
   1138       1.1    jruoho 
   1139  1.1.1.14  christos /*******************************************************************************
   1140  1.1.1.14  christos  *
   1141  1.1.1.14  christos  * MTMR - MID Timer Table
   1142  1.1.1.14  christos  *        Version 1
   1143  1.1.1.14  christos  *
   1144  1.1.1.14  christos  * Conforms to "Simple Firmware Interface Specification",
   1145  1.1.1.14  christos  * Draft 0.8.2, Oct 19, 2010
   1146  1.1.1.14  christos  * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
   1147  1.1.1.14  christos  *
   1148  1.1.1.14  christos  ******************************************************************************/
   1149       1.1    jruoho 
   1150  1.1.1.14  christos typedef struct acpi_table_mtmr
   1151  1.1.1.14  christos {
   1152  1.1.1.14  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1153       1.1    jruoho 
   1154  1.1.1.14  christos } ACPI_TABLE_MTMR;
   1155       1.1    jruoho 
   1156  1.1.1.14  christos /* MTMR entry */
   1157  1.1.1.14  christos 
   1158  1.1.1.14  christos typedef struct acpi_mtmr_entry
   1159       1.1    jruoho {
   1160  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    PhysicalAddress;
   1161  1.1.1.14  christos     UINT32                  Frequency;
   1162  1.1.1.14  christos     UINT32                  Irq;
   1163       1.1    jruoho 
   1164  1.1.1.14  christos } ACPI_MTMR_ENTRY;
   1165       1.1    jruoho 
   1166       1.1    jruoho 
   1167       1.1    jruoho /*******************************************************************************
   1168       1.1    jruoho  *
   1169  1.1.1.14  christos  * NFIT - NVDIMM Interface Table (ACPI 6.0+)
   1170  1.1.1.14  christos  *        Version 1
   1171   1.1.1.5  christos  *
   1172   1.1.1.5  christos  ******************************************************************************/
   1173   1.1.1.5  christos 
   1174  1.1.1.14  christos typedef struct acpi_table_nfit
   1175   1.1.1.5  christos {
   1176   1.1.1.5  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1177  1.1.1.14  christos     UINT32                  Reserved;           /* Reserved, must be zero */
   1178   1.1.1.5  christos 
   1179  1.1.1.14  christos } ACPI_TABLE_NFIT;
   1180   1.1.1.5  christos 
   1181  1.1.1.14  christos /* Subtable header for NFIT */
   1182   1.1.1.5  christos 
   1183  1.1.1.14  christos typedef struct acpi_nfit_header
   1184   1.1.1.5  christos {
   1185  1.1.1.14  christos     UINT16                   Type;
   1186  1.1.1.14  christos     UINT16                   Length;
   1187   1.1.1.5  christos 
   1188  1.1.1.14  christos } ACPI_NFIT_HEADER;
   1189   1.1.1.5  christos 
   1190   1.1.1.5  christos 
   1191  1.1.1.14  christos /* Values for subtable type in ACPI_NFIT_HEADER */
   1192  1.1.1.14  christos 
   1193  1.1.1.14  christos enum AcpiNfitType
   1194   1.1.1.5  christos {
   1195  1.1.1.14  christos     ACPI_NFIT_TYPE_SYSTEM_ADDRESS       = 0,
   1196  1.1.1.14  christos     ACPI_NFIT_TYPE_MEMORY_MAP           = 1,
   1197  1.1.1.14  christos     ACPI_NFIT_TYPE_INTERLEAVE           = 2,
   1198  1.1.1.14  christos     ACPI_NFIT_TYPE_SMBIOS               = 3,
   1199  1.1.1.14  christos     ACPI_NFIT_TYPE_CONTROL_REGION       = 4,
   1200  1.1.1.14  christos     ACPI_NFIT_TYPE_DATA_REGION          = 5,
   1201  1.1.1.14  christos     ACPI_NFIT_TYPE_FLUSH_ADDRESS        = 6,
   1202  1.1.1.14  christos     ACPI_NFIT_TYPE_CAPABILITIES         = 7,
   1203  1.1.1.14  christos     ACPI_NFIT_TYPE_RESERVED             = 8     /* 8 and greater are reserved */
   1204   1.1.1.5  christos };
   1205   1.1.1.5  christos 
   1206   1.1.1.5  christos /*
   1207  1.1.1.14  christos  * NFIT Subtables
   1208   1.1.1.5  christos  */
   1209   1.1.1.5  christos 
   1210  1.1.1.14  christos /* 0: System Physical Address Range Structure */
   1211   1.1.1.5  christos 
   1212  1.1.1.14  christos typedef struct acpi_nfit_system_address
   1213   1.1.1.5  christos {
   1214  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1215  1.1.1.14  christos     UINT16                  RangeIndex;
   1216  1.1.1.14  christos     UINT16                  Flags;
   1217  1.1.1.14  christos     UINT32                  Reserved;           /* Reserved, must be zero */
   1218  1.1.1.14  christos     UINT32                  ProximityDomain;
   1219  1.1.1.14  christos     UINT8                   RangeGuid[16];
   1220  1.1.1.14  christos     UINT64                  Address;
   1221  1.1.1.14  christos     UINT64                  Length;
   1222  1.1.1.14  christos     UINT64                  MemoryMapping;
   1223   1.1.1.5  christos 
   1224  1.1.1.14  christos } ACPI_NFIT_SYSTEM_ADDRESS;
   1225   1.1.1.5  christos 
   1226  1.1.1.14  christos /* Flags */
   1227   1.1.1.5  christos 
   1228  1.1.1.14  christos #define ACPI_NFIT_ADD_ONLINE_ONLY       (1)     /* 00: Add/Online Operation Only */
   1229  1.1.1.14  christos #define ACPI_NFIT_PROXIMITY_VALID       (1<<1)  /* 01: Proximity Domain Valid */
   1230       1.1    jruoho 
   1231  1.1.1.14  christos /* Range Type GUIDs appear in the include/acuuid.h file */
   1232  1.1.1.14  christos 
   1233  1.1.1.14  christos 
   1234  1.1.1.14  christos /* 1: Memory Device to System Address Range Map Structure */
   1235  1.1.1.14  christos 
   1236  1.1.1.14  christos typedef struct acpi_nfit_memory_map
   1237       1.1    jruoho {
   1238  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1239  1.1.1.14  christos     UINT32                  DeviceHandle;
   1240  1.1.1.14  christos     UINT16                  PhysicalId;
   1241  1.1.1.14  christos     UINT16                  RegionId;
   1242  1.1.1.14  christos     UINT16                  RangeIndex;
   1243  1.1.1.14  christos     UINT16                  RegionIndex;
   1244  1.1.1.14  christos     UINT64                  RegionSize;
   1245  1.1.1.14  christos     UINT64                  RegionOffset;
   1246  1.1.1.14  christos     UINT64                  Address;
   1247  1.1.1.14  christos     UINT16                  InterleaveIndex;
   1248  1.1.1.14  christos     UINT16                  InterleaveWays;
   1249  1.1.1.14  christos     UINT16                  Flags;
   1250  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved, must be zero */
   1251       1.1    jruoho 
   1252  1.1.1.14  christos } ACPI_NFIT_MEMORY_MAP;
   1253       1.1    jruoho 
   1254  1.1.1.14  christos /* Flags */
   1255       1.1    jruoho 
   1256  1.1.1.14  christos #define ACPI_NFIT_MEM_SAVE_FAILED       (1)     /* 00: Last SAVE to Memory Device failed */
   1257  1.1.1.14  christos #define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)  /* 01: Last RESTORE from Memory Device failed */
   1258  1.1.1.14  christos #define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)  /* 02: Platform flush failed */
   1259  1.1.1.14  christos #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)  /* 03: Memory Device is not armed */
   1260  1.1.1.14  christos #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)  /* 04: Memory Device observed SMART/health events */
   1261  1.1.1.14  christos #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)  /* 05: SMART/health events enabled */
   1262  1.1.1.14  christos #define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)  /* 06: Mapping to SPA failed */
   1263       1.1    jruoho 
   1264  1.1.1.14  christos 
   1265  1.1.1.14  christos /* 2: Interleave Structure */
   1266  1.1.1.14  christos 
   1267  1.1.1.14  christos typedef struct acpi_nfit_interleave
   1268       1.1    jruoho {
   1269  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1270  1.1.1.14  christos     UINT16                  InterleaveIndex;
   1271  1.1.1.14  christos     UINT16                  Reserved;           /* Reserved, must be zero */
   1272  1.1.1.14  christos     UINT32                  LineCount;
   1273  1.1.1.14  christos     UINT32                  LineSize;
   1274  1.1.1.14  christos     UINT32                  LineOffset[1];      /* Variable length */
   1275       1.1    jruoho 
   1276  1.1.1.14  christos } ACPI_NFIT_INTERLEAVE;
   1277  1.1.1.14  christos 
   1278  1.1.1.14  christos 
   1279  1.1.1.14  christos /* 3: SMBIOS Management Information Structure */
   1280  1.1.1.14  christos 
   1281  1.1.1.14  christos typedef struct acpi_nfit_smbios
   1282  1.1.1.14  christos {
   1283  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1284  1.1.1.14  christos     UINT32                  Reserved;           /* Reserved, must be zero */
   1285  1.1.1.14  christos     UINT8                   Data[1];            /* Variable length */
   1286  1.1.1.14  christos 
   1287  1.1.1.14  christos } ACPI_NFIT_SMBIOS;
   1288  1.1.1.14  christos 
   1289  1.1.1.14  christos 
   1290  1.1.1.14  christos /* 4: NVDIMM Control Region Structure */
   1291  1.1.1.14  christos 
   1292  1.1.1.14  christos typedef struct acpi_nfit_control_region
   1293  1.1.1.14  christos {
   1294  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1295  1.1.1.14  christos     UINT16                  RegionIndex;
   1296  1.1.1.14  christos     UINT16                  VendorId;
   1297  1.1.1.14  christos     UINT16                  DeviceId;
   1298  1.1.1.14  christos     UINT16                  RevisionId;
   1299  1.1.1.14  christos     UINT16                  SubsystemVendorId;
   1300  1.1.1.14  christos     UINT16                  SubsystemDeviceId;
   1301  1.1.1.14  christos     UINT16                  SubsystemRevisionId;
   1302  1.1.1.14  christos     UINT8                   ValidFields;
   1303  1.1.1.14  christos     UINT8                   ManufacturingLocation;
   1304  1.1.1.14  christos     UINT16                  ManufacturingDate;
   1305  1.1.1.14  christos     UINT8                   Reserved[2];        /* Reserved, must be zero */
   1306  1.1.1.14  christos     UINT32                  SerialNumber;
   1307  1.1.1.14  christos     UINT16                  Code;
   1308  1.1.1.14  christos     UINT16                  Windows;
   1309  1.1.1.14  christos     UINT64                  WindowSize;
   1310  1.1.1.14  christos     UINT64                  CommandOffset;
   1311  1.1.1.14  christos     UINT64                  CommandSize;
   1312  1.1.1.14  christos     UINT64                  StatusOffset;
   1313  1.1.1.14  christos     UINT64                  StatusSize;
   1314  1.1.1.14  christos     UINT16                  Flags;
   1315  1.1.1.14  christos     UINT8                   Reserved1[6];       /* Reserved, must be zero */
   1316  1.1.1.14  christos 
   1317  1.1.1.14  christos } ACPI_NFIT_CONTROL_REGION;
   1318  1.1.1.14  christos 
   1319  1.1.1.14  christos /* Flags */
   1320  1.1.1.14  christos 
   1321  1.1.1.14  christos #define ACPI_NFIT_CONTROL_BUFFERED          (1)     /* Block Data Windows implementation is buffered */
   1322  1.1.1.14  christos 
   1323  1.1.1.14  christos /* ValidFields bits */
   1324  1.1.1.14  christos 
   1325  1.1.1.14  christos #define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)     /* Manufacturing fields are valid */
   1326  1.1.1.14  christos 
   1327  1.1.1.14  christos 
   1328  1.1.1.14  christos /* 5: NVDIMM Block Data Window Region Structure */
   1329  1.1.1.14  christos 
   1330  1.1.1.14  christos typedef struct acpi_nfit_data_region
   1331  1.1.1.14  christos {
   1332  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1333  1.1.1.14  christos     UINT16                  RegionIndex;
   1334  1.1.1.14  christos     UINT16                  Windows;
   1335  1.1.1.14  christos     UINT64                  Offset;
   1336  1.1.1.14  christos     UINT64                  Size;
   1337  1.1.1.14  christos     UINT64                  Capacity;
   1338  1.1.1.14  christos     UINT64                  StartAddress;
   1339  1.1.1.14  christos 
   1340  1.1.1.14  christos } ACPI_NFIT_DATA_REGION;
   1341  1.1.1.14  christos 
   1342  1.1.1.14  christos 
   1343  1.1.1.14  christos /* 6: Flush Hint Address Structure */
   1344  1.1.1.14  christos 
   1345  1.1.1.14  christos typedef struct acpi_nfit_flush_address
   1346  1.1.1.14  christos {
   1347  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1348  1.1.1.14  christos     UINT32                  DeviceHandle;
   1349  1.1.1.14  christos     UINT16                  HintCount;
   1350  1.1.1.14  christos     UINT8                   Reserved[6];        /* Reserved, must be zero */
   1351  1.1.1.14  christos     UINT64                  HintAddress[1];     /* Variable length */
   1352  1.1.1.14  christos 
   1353  1.1.1.14  christos } ACPI_NFIT_FLUSH_ADDRESS;
   1354  1.1.1.14  christos 
   1355  1.1.1.14  christos 
   1356  1.1.1.14  christos /* 7: Platform Capabilities Structure */
   1357  1.1.1.14  christos 
   1358  1.1.1.14  christos typedef struct acpi_nfit_capabilities
   1359  1.1.1.14  christos {
   1360  1.1.1.14  christos     ACPI_NFIT_HEADER        Header;
   1361  1.1.1.14  christos     UINT8                   HighestCapability;
   1362  1.1.1.14  christos     UINT8                   Reserved[3];       /* Reserved, must be zero */
   1363  1.1.1.14  christos     UINT32                  Capabilities;
   1364  1.1.1.14  christos     UINT32                  Reserved2;
   1365  1.1.1.14  christos 
   1366  1.1.1.14  christos } ACPI_NFIT_CAPABILITIES;
   1367  1.1.1.14  christos 
   1368  1.1.1.14  christos /* Capabilities Flags */
   1369  1.1.1.14  christos 
   1370  1.1.1.14  christos #define ACPI_NFIT_CAPABILITY_CACHE_FLUSH       (1)     /* 00: Cache Flush to NVDIMM capable */
   1371  1.1.1.14  christos #define ACPI_NFIT_CAPABILITY_MEM_FLUSH         (1<<1)  /* 01: Memory Flush to NVDIMM capable */
   1372  1.1.1.14  christos #define ACPI_NFIT_CAPABILITY_MEM_MIRRORING     (1<<2)  /* 02: Memory Mirroring capable */
   1373  1.1.1.14  christos 
   1374  1.1.1.14  christos 
   1375  1.1.1.14  christos /*
   1376  1.1.1.14  christos  * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
   1377  1.1.1.14  christos  */
   1378  1.1.1.14  christos typedef struct nfit_device_handle
   1379  1.1.1.14  christos {
   1380  1.1.1.14  christos     UINT32                  Handle;
   1381  1.1.1.14  christos 
   1382  1.1.1.14  christos } NFIT_DEVICE_HANDLE;
   1383  1.1.1.14  christos 
   1384  1.1.1.14  christos /* Device handle construction and extraction macros */
   1385  1.1.1.14  christos 
   1386  1.1.1.14  christos #define ACPI_NFIT_DIMM_NUMBER_MASK              0x0000000F
   1387  1.1.1.14  christos #define ACPI_NFIT_CHANNEL_NUMBER_MASK           0x000000F0
   1388  1.1.1.14  christos #define ACPI_NFIT_MEMORY_ID_MASK                0x00000F00
   1389  1.1.1.14  christos #define ACPI_NFIT_SOCKET_ID_MASK                0x0000F000
   1390  1.1.1.14  christos #define ACPI_NFIT_NODE_ID_MASK                  0x0FFF0000
   1391  1.1.1.14  christos 
   1392  1.1.1.14  christos #define ACPI_NFIT_DIMM_NUMBER_OFFSET            0
   1393  1.1.1.14  christos #define ACPI_NFIT_CHANNEL_NUMBER_OFFSET         4
   1394  1.1.1.14  christos #define ACPI_NFIT_MEMORY_ID_OFFSET              8
   1395  1.1.1.14  christos #define ACPI_NFIT_SOCKET_ID_OFFSET              12
   1396  1.1.1.14  christos #define ACPI_NFIT_NODE_ID_OFFSET                16
   1397  1.1.1.14  christos 
   1398  1.1.1.14  christos /* Macro to construct a NFIT/NVDIMM device handle */
   1399  1.1.1.14  christos 
   1400  1.1.1.14  christos #define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
   1401  1.1.1.14  christos     ((dimm)                                         | \
   1402  1.1.1.14  christos     ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET)  | \
   1403  1.1.1.14  christos     ((memory)  << ACPI_NFIT_MEMORY_ID_OFFSET)       | \
   1404  1.1.1.14  christos     ((socket)  << ACPI_NFIT_SOCKET_ID_OFFSET)       | \
   1405  1.1.1.14  christos     ((node)    << ACPI_NFIT_NODE_ID_OFFSET))
   1406  1.1.1.14  christos 
   1407  1.1.1.14  christos /* Macros to extract individual fields from a NFIT/NVDIMM device handle */
   1408  1.1.1.14  christos 
   1409  1.1.1.14  christos #define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
   1410  1.1.1.14  christos     ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
   1411  1.1.1.14  christos 
   1412  1.1.1.14  christos #define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
   1413  1.1.1.14  christos     (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
   1414  1.1.1.14  christos 
   1415  1.1.1.14  christos #define ACPI_NFIT_GET_MEMORY_ID(handle) \
   1416  1.1.1.14  christos     (((handle) & ACPI_NFIT_MEMORY_ID_MASK)      >> ACPI_NFIT_MEMORY_ID_OFFSET)
   1417  1.1.1.14  christos 
   1418  1.1.1.14  christos #define ACPI_NFIT_GET_SOCKET_ID(handle) \
   1419  1.1.1.14  christos     (((handle) & ACPI_NFIT_SOCKET_ID_MASK)      >> ACPI_NFIT_SOCKET_ID_OFFSET)
   1420  1.1.1.14  christos 
   1421  1.1.1.14  christos #define ACPI_NFIT_GET_NODE_ID(handle) \
   1422  1.1.1.14  christos     (((handle) & ACPI_NFIT_NODE_ID_MASK)        >> ACPI_NFIT_NODE_ID_OFFSET)
   1423       1.1    jruoho 
   1424       1.1    jruoho 
   1425       1.1    jruoho /*******************************************************************************
   1426       1.1    jruoho  *
   1427  1.1.1.14  christos  * PCCT - Platform Communications Channel Table (ACPI 5.0)
   1428  1.1.1.14  christos  *        Version 2 (ACPI 6.2)
   1429       1.1    jruoho  *
   1430       1.1    jruoho  ******************************************************************************/
   1431       1.1    jruoho 
   1432  1.1.1.14  christos typedef struct acpi_table_pcct
   1433       1.1    jruoho {
   1434       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1435  1.1.1.14  christos     UINT32                  Flags;
   1436  1.1.1.14  christos     UINT64                  Reserved;
   1437  1.1.1.14  christos 
   1438  1.1.1.14  christos } ACPI_TABLE_PCCT;
   1439  1.1.1.14  christos 
   1440  1.1.1.14  christos /* Values for Flags field above */
   1441  1.1.1.14  christos 
   1442  1.1.1.14  christos #define ACPI_PCCT_DOORBELL              1
   1443  1.1.1.14  christos 
   1444  1.1.1.14  christos /* Values for subtable type in ACPI_SUBTABLE_HEADER */
   1445  1.1.1.14  christos 
   1446  1.1.1.14  christos enum AcpiPcctType
   1447  1.1.1.14  christos {
   1448  1.1.1.14  christos     ACPI_PCCT_TYPE_GENERIC_SUBSPACE             = 0,
   1449  1.1.1.14  christos     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE          = 1,
   1450  1.1.1.14  christos     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2    = 2,    /* ACPI 6.1 */
   1451  1.1.1.14  christos     ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE      = 3,    /* ACPI 6.2 */
   1452  1.1.1.14  christos     ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE       = 4,    /* ACPI 6.2 */
   1453  1.1.1.14  christos     ACPI_PCCT_TYPE_RESERVED                     = 5     /* 5 and greater are reserved */
   1454  1.1.1.14  christos };
   1455       1.1    jruoho 
   1456  1.1.1.14  christos /*
   1457  1.1.1.14  christos  * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
   1458  1.1.1.14  christos  */
   1459       1.1    jruoho 
   1460  1.1.1.14  christos /* 0: Generic Communications Subspace */
   1461       1.1    jruoho 
   1462  1.1.1.14  christos typedef struct acpi_pcct_subspace
   1463  1.1.1.14  christos {
   1464  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1465  1.1.1.14  christos     UINT8                   Reserved[6];
   1466  1.1.1.14  christos     UINT64                  BaseAddress;
   1467  1.1.1.14  christos     UINT64                  Length;
   1468  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   1469  1.1.1.14  christos     UINT64                  PreserveMask;
   1470  1.1.1.14  christos     UINT64                  WriteMask;
   1471  1.1.1.14  christos     UINT32                  Latency;
   1472  1.1.1.14  christos     UINT32                  MaxAccessRate;
   1473  1.1.1.14  christos     UINT16                  MinTurnaroundTime;
   1474   1.1.1.6  christos 
   1475  1.1.1.14  christos } ACPI_PCCT_SUBSPACE;
   1476   1.1.1.6  christos 
   1477  1.1.1.14  christos 
   1478  1.1.1.14  christos /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
   1479  1.1.1.14  christos 
   1480  1.1.1.14  christos typedef struct acpi_pcct_hw_reduced
   1481   1.1.1.6  christos {
   1482  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1483  1.1.1.14  christos     UINT32                  PlatformInterrupt;
   1484  1.1.1.14  christos     UINT8                   Flags;
   1485  1.1.1.14  christos     UINT8                   Reserved;
   1486  1.1.1.14  christos     UINT64                  BaseAddress;
   1487  1.1.1.14  christos     UINT64                  Length;
   1488  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   1489  1.1.1.14  christos     UINT64                  PreserveMask;
   1490  1.1.1.14  christos     UINT64                  WriteMask;
   1491  1.1.1.14  christos     UINT32                  Latency;
   1492  1.1.1.14  christos     UINT32                  MaxAccessRate;
   1493  1.1.1.14  christos     UINT16                  MinTurnaroundTime;
   1494   1.1.1.6  christos 
   1495  1.1.1.14  christos } ACPI_PCCT_HW_REDUCED;
   1496   1.1.1.6  christos 
   1497   1.1.1.6  christos 
   1498  1.1.1.14  christos /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
   1499   1.1.1.4  christos 
   1500  1.1.1.14  christos typedef struct acpi_pcct_hw_reduced_type2
   1501   1.1.1.4  christos {
   1502  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1503  1.1.1.14  christos     UINT32                  PlatformInterrupt;
   1504  1.1.1.14  christos     UINT8                   Flags;
   1505  1.1.1.14  christos     UINT8                   Reserved;
   1506  1.1.1.14  christos     UINT64                  BaseAddress;
   1507  1.1.1.14  christos     UINT64                  Length;
   1508  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   1509  1.1.1.14  christos     UINT64                  PreserveMask;
   1510  1.1.1.14  christos     UINT64                  WriteMask;
   1511  1.1.1.14  christos     UINT32                  Latency;
   1512  1.1.1.14  christos     UINT32                  MaxAccessRate;
   1513  1.1.1.14  christos     UINT16                  MinTurnaroundTime;
   1514  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    PlatformAckRegister;
   1515  1.1.1.14  christos     UINT64                  AckPreserveMask;
   1516  1.1.1.14  christos     UINT64                  AckWriteMask;
   1517   1.1.1.4  christos 
   1518  1.1.1.14  christos } ACPI_PCCT_HW_REDUCED_TYPE2;
   1519   1.1.1.4  christos 
   1520   1.1.1.4  christos 
   1521  1.1.1.14  christos /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
   1522  1.1.1.14  christos 
   1523  1.1.1.14  christos typedef struct acpi_pcct_ext_pcc_master
   1524   1.1.1.4  christos {
   1525  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1526  1.1.1.14  christos     UINT32                  PlatformInterrupt;
   1527  1.1.1.14  christos     UINT8                   Flags;
   1528  1.1.1.14  christos     UINT8                   Reserved1;
   1529  1.1.1.14  christos     UINT64                  BaseAddress;
   1530  1.1.1.14  christos     UINT32                  Length;
   1531  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   1532  1.1.1.14  christos     UINT64                  PreserveMask;
   1533  1.1.1.14  christos     UINT64                  WriteMask;
   1534  1.1.1.14  christos     UINT32                  Latency;
   1535  1.1.1.14  christos     UINT32                  MaxAccessRate;
   1536  1.1.1.14  christos     UINT32                  MinTurnaroundTime;
   1537  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    PlatformAckRegister;
   1538  1.1.1.14  christos     UINT64                  AckPreserveMask;
   1539  1.1.1.14  christos     UINT64                  AckSetMask;
   1540  1.1.1.14  christos     UINT64                  Reserved2;
   1541  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
   1542  1.1.1.14  christos     UINT64                  CmdCompleteMask;
   1543  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    CmdUpdateRegister;
   1544  1.1.1.14  christos     UINT64                  CmdUpdatePreserveMask;
   1545  1.1.1.14  christos     UINT64                  CmdUpdateSetMask;
   1546  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
   1547  1.1.1.14  christos     UINT64                  ErrorStatusMask;
   1548  1.1.1.14  christos 
   1549  1.1.1.14  christos } ACPI_PCCT_EXT_PCC_MASTER;
   1550   1.1.1.4  christos 
   1551   1.1.1.4  christos 
   1552  1.1.1.14  christos /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
   1553  1.1.1.12  christos 
   1554  1.1.1.14  christos typedef struct acpi_pcct_ext_pcc_slave
   1555  1.1.1.12  christos {
   1556  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1557  1.1.1.14  christos     UINT32                  PlatformInterrupt;
   1558  1.1.1.14  christos     UINT8                   Flags;
   1559  1.1.1.14  christos     UINT8                   Reserved1;
   1560  1.1.1.14  christos     UINT64                  BaseAddress;
   1561  1.1.1.14  christos     UINT32                  Length;
   1562  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    DoorbellRegister;
   1563  1.1.1.14  christos     UINT64                  PreserveMask;
   1564  1.1.1.14  christos     UINT64                  WriteMask;
   1565  1.1.1.14  christos     UINT32                  Latency;
   1566  1.1.1.14  christos     UINT32                  MaxAccessRate;
   1567  1.1.1.14  christos     UINT32                  MinTurnaroundTime;
   1568  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    PlatformAckRegister;
   1569  1.1.1.14  christos     UINT64                  AckPreserveMask;
   1570  1.1.1.14  christos     UINT64                  AckSetMask;
   1571  1.1.1.14  christos     UINT64                  Reserved2;
   1572  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
   1573  1.1.1.14  christos     UINT64                  CmdCompleteMask;
   1574  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    CmdUpdateRegister;
   1575  1.1.1.14  christos     UINT64                  CmdUpdatePreserveMask;
   1576  1.1.1.14  christos     UINT64                  CmdUpdateSetMask;
   1577  1.1.1.14  christos     ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
   1578  1.1.1.14  christos     UINT64                  ErrorStatusMask;
   1579  1.1.1.12  christos 
   1580  1.1.1.14  christos } ACPI_PCCT_EXT_PCC_SLAVE;
   1581  1.1.1.12  christos 
   1582   1.1.1.4  christos 
   1583  1.1.1.14  christos /* Values for doorbell flags above */
   1584  1.1.1.14  christos 
   1585  1.1.1.14  christos #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
   1586  1.1.1.14  christos #define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
   1587  1.1.1.14  christos 
   1588  1.1.1.14  christos 
   1589  1.1.1.14  christos /*
   1590  1.1.1.14  christos  * PCC memory structures (not part of the ACPI table)
   1591  1.1.1.14  christos  */
   1592   1.1.1.3    jruoho 
   1593  1.1.1.14  christos /* Shared Memory Region */
   1594   1.1.1.3    jruoho 
   1595  1.1.1.14  christos typedef struct acpi_pcct_shared_memory
   1596   1.1.1.3    jruoho {
   1597  1.1.1.14  christos     UINT32                  Signature;
   1598  1.1.1.14  christos     UINT16                  Command;
   1599  1.1.1.14  christos     UINT16                  Status;
   1600  1.1.1.14  christos 
   1601  1.1.1.14  christos } ACPI_PCCT_SHARED_MEMORY;
   1602  1.1.1.14  christos 
   1603  1.1.1.14  christos 
   1604  1.1.1.14  christos /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
   1605  1.1.1.14  christos 
   1606  1.1.1.14  christos typedef struct acpi_pcct_ext_pcc_shared_memory
   1607  1.1.1.14  christos {
   1608  1.1.1.14  christos     UINT32                  Signature;
   1609  1.1.1.14  christos     UINT32                  Flags;
   1610  1.1.1.14  christos     UINT32                  Length;
   1611  1.1.1.14  christos     UINT32                  Command;
   1612   1.1.1.3    jruoho 
   1613  1.1.1.14  christos } ACPI_PCCT_EXT_PCC_SHARED_MEMORY;
   1614   1.1.1.3    jruoho 
   1615   1.1.1.3    jruoho 
   1616   1.1.1.3    jruoho /*******************************************************************************
   1617   1.1.1.3    jruoho  *
   1618  1.1.1.14  christos  * PDTT - Platform Debug Trigger Table (ACPI 6.2)
   1619  1.1.1.14  christos  *        Version 0
   1620       1.1    jruoho  *
   1621       1.1    jruoho  ******************************************************************************/
   1622       1.1    jruoho 
   1623  1.1.1.14  christos typedef struct acpi_table_pdtt
   1624       1.1    jruoho {
   1625       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1626  1.1.1.14  christos     UINT8                   TriggerCount;
   1627       1.1    jruoho     UINT8                   Reserved[3];
   1628  1.1.1.14  christos     UINT32                  ArrayOffset;
   1629  1.1.1.14  christos 
   1630  1.1.1.14  christos } ACPI_TABLE_PDTT;
   1631       1.1    jruoho 
   1632       1.1    jruoho 
   1633  1.1.1.14  christos /*
   1634  1.1.1.14  christos  * PDTT Communication Channel Identifier Structure.
   1635  1.1.1.14  christos  * The number of these structures is defined by TriggerCount above,
   1636  1.1.1.14  christos  * starting at ArrayOffset.
   1637  1.1.1.14  christos  */
   1638  1.1.1.14  christos typedef struct acpi_pdtt_channel
   1639  1.1.1.14  christos {
   1640  1.1.1.14  christos     UINT8                   SubchannelId;
   1641  1.1.1.14  christos     UINT8                   Flags;
   1642  1.1.1.14  christos 
   1643  1.1.1.14  christos } ACPI_PDTT_CHANNEL;
   1644       1.1    jruoho 
   1645  1.1.1.14  christos /* Flags for above */
   1646       1.1    jruoho 
   1647  1.1.1.14  christos #define ACPI_PDTT_RUNTIME_TRIGGER           (1)
   1648  1.1.1.14  christos #define ACPI_PDTT_WAIT_COMPLETION           (1<<1)
   1649  1.1.1.16  christos #define ACPI_PDTT_TRIGGER_ORDER             (1<<2)
   1650   1.1.1.9  christos 
   1651       1.1    jruoho 
   1652       1.1    jruoho /*******************************************************************************
   1653       1.1    jruoho  *
   1654  1.1.1.14  christos  * PMTT - Platform Memory Topology Table (ACPI 5.0)
   1655  1.1.1.14  christos  *        Version 1
   1656       1.1    jruoho  *
   1657       1.1    jruoho  ******************************************************************************/
   1658       1.1    jruoho 
   1659  1.1.1.14  christos typedef struct acpi_table_pmtt
   1660       1.1    jruoho {
   1661       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1662  1.1.1.14  christos     UINT32                  Reserved;
   1663  1.1.1.14  christos 
   1664  1.1.1.14  christos } ACPI_TABLE_PMTT;
   1665       1.1    jruoho 
   1666       1.1    jruoho 
   1667  1.1.1.14  christos /* Common header for PMTT subtables that follow main table */
   1668       1.1    jruoho 
   1669  1.1.1.14  christos typedef struct acpi_pmtt_header
   1670       1.1    jruoho {
   1671  1.1.1.14  christos     UINT8                   Type;
   1672  1.1.1.14  christos     UINT8                   Reserved1;
   1673  1.1.1.14  christos     UINT16                  Length;
   1674  1.1.1.14  christos     UINT16                  Flags;
   1675  1.1.1.14  christos     UINT16                  Reserved2;
   1676       1.1    jruoho 
   1677  1.1.1.14  christos } ACPI_PMTT_HEADER;
   1678       1.1    jruoho 
   1679  1.1.1.14  christos /* Values for Type field above */
   1680       1.1    jruoho 
   1681  1.1.1.14  christos #define ACPI_PMTT_TYPE_SOCKET           0
   1682  1.1.1.14  christos #define ACPI_PMTT_TYPE_CONTROLLER       1
   1683  1.1.1.14  christos #define ACPI_PMTT_TYPE_DIMM             2
   1684  1.1.1.14  christos #define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
   1685  1.1.1.14  christos 
   1686  1.1.1.14  christos /* Values for Flags field above */
   1687  1.1.1.14  christos 
   1688  1.1.1.14  christos #define ACPI_PMTT_TOP_LEVEL             0x0001
   1689  1.1.1.14  christos #define ACPI_PMTT_PHYSICAL              0x0002
   1690  1.1.1.14  christos #define ACPI_PMTT_MEMORY_TYPE           0x000C
   1691   1.1.1.7  christos 
   1692   1.1.1.7  christos 
   1693   1.1.1.7  christos /*
   1694  1.1.1.14  christos  * PMTT subtables, correspond to Type in acpi_pmtt_header
   1695   1.1.1.7  christos  */
   1696   1.1.1.7  christos 
   1697   1.1.1.7  christos 
   1698  1.1.1.14  christos /* 0: Socket Structure */
   1699  1.1.1.14  christos 
   1700  1.1.1.14  christos typedef struct acpi_pmtt_socket
   1701   1.1.1.7  christos {
   1702  1.1.1.14  christos     ACPI_PMTT_HEADER        Header;
   1703  1.1.1.14  christos     UINT16                  SocketId;
   1704  1.1.1.14  christos     UINT16                  Reserved;
   1705  1.1.1.14  christos 
   1706  1.1.1.14  christos } ACPI_PMTT_SOCKET;
   1707  1.1.1.14  christos 
   1708   1.1.1.7  christos 
   1709  1.1.1.14  christos /* 1: Memory Controller subtable */
   1710   1.1.1.7  christos 
   1711  1.1.1.14  christos typedef struct acpi_pmtt_controller
   1712   1.1.1.7  christos {
   1713  1.1.1.14  christos     ACPI_PMTT_HEADER        Header;
   1714  1.1.1.14  christos     UINT32                  ReadLatency;
   1715  1.1.1.14  christos     UINT32                  WriteLatency;
   1716  1.1.1.14  christos     UINT32                  ReadBandwidth;
   1717  1.1.1.14  christos     UINT32                  WriteBandwidth;
   1718  1.1.1.14  christos     UINT16                  AccessWidth;
   1719  1.1.1.14  christos     UINT16                  Alignment;
   1720       1.1    jruoho     UINT16                  Reserved;
   1721  1.1.1.14  christos     UINT16                  DomainCount;
   1722  1.1.1.14  christos 
   1723  1.1.1.14  christos } ACPI_PMTT_CONTROLLER;
   1724  1.1.1.14  christos 
   1725  1.1.1.14  christos /* 1a: Proximity Domain substructure */
   1726  1.1.1.14  christos 
   1727  1.1.1.14  christos typedef struct acpi_pmtt_domain
   1728  1.1.1.14  christos {
   1729  1.1.1.14  christos     UINT32                  ProximityDomain;
   1730   1.1.1.7  christos 
   1731  1.1.1.14  christos } ACPI_PMTT_DOMAIN;
   1732   1.1.1.7  christos 
   1733   1.1.1.7  christos 
   1734  1.1.1.14  christos /* 2: Physical Component Identifier (DIMM) */
   1735   1.1.1.7  christos 
   1736  1.1.1.14  christos typedef struct acpi_pmtt_physical_component
   1737  1.1.1.14  christos {
   1738  1.1.1.14  christos     ACPI_PMTT_HEADER        Header;
   1739  1.1.1.14  christos     UINT16                  ComponentId;
   1740  1.1.1.14  christos     UINT16                  Reserved;
   1741  1.1.1.14  christos     UINT32                  MemorySize;
   1742  1.1.1.14  christos     UINT32                  BiosHandle;
   1743   1.1.1.7  christos 
   1744  1.1.1.14  christos } ACPI_PMTT_PHYSICAL_COMPONENT;
   1745   1.1.1.7  christos 
   1746   1.1.1.7  christos 
   1747   1.1.1.7  christos /*******************************************************************************
   1748   1.1.1.7  christos  *
   1749  1.1.1.14  christos  * PPTT - Processor Properties Topology Table (ACPI 6.2)
   1750  1.1.1.14  christos  *        Version 1
   1751   1.1.1.7  christos  *
   1752   1.1.1.7  christos  ******************************************************************************/
   1753   1.1.1.7  christos 
   1754  1.1.1.14  christos typedef struct acpi_table_pptt
   1755   1.1.1.7  christos {
   1756   1.1.1.7  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1757   1.1.1.7  christos 
   1758  1.1.1.14  christos } ACPI_TABLE_PPTT;
   1759   1.1.1.7  christos 
   1760  1.1.1.14  christos /* Values for Type field above */
   1761       1.1    jruoho 
   1762  1.1.1.14  christos enum AcpiPpttType
   1763  1.1.1.14  christos {
   1764  1.1.1.14  christos     ACPI_PPTT_TYPE_PROCESSOR            = 0,
   1765  1.1.1.14  christos     ACPI_PPTT_TYPE_CACHE                = 1,
   1766  1.1.1.14  christos     ACPI_PPTT_TYPE_ID                   = 2,
   1767  1.1.1.14  christos     ACPI_PPTT_TYPE_RESERVED             = 3
   1768  1.1.1.14  christos };
   1769  1.1.1.12  christos 
   1770  1.1.1.12  christos 
   1771  1.1.1.14  christos /* 0: Processor Hierarchy Node Structure */
   1772  1.1.1.12  christos 
   1773  1.1.1.14  christos typedef struct acpi_pptt_processor
   1774  1.1.1.12  christos {
   1775  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1776  1.1.1.14  christos     UINT16                  Reserved;
   1777  1.1.1.14  christos     UINT32                  Flags;
   1778  1.1.1.14  christos     UINT32                  Parent;
   1779  1.1.1.14  christos     UINT32                  AcpiProcessorId;
   1780  1.1.1.14  christos     UINT32                  NumberOfPrivResources;
   1781  1.1.1.12  christos 
   1782  1.1.1.14  christos } ACPI_PPTT_PROCESSOR;
   1783  1.1.1.12  christos 
   1784  1.1.1.14  christos /* Flags */
   1785  1.1.1.14  christos 
   1786  1.1.1.16  christos #define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
   1787  1.1.1.16  christos #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1<<1)
   1788  1.1.1.16  christos #define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1<<2)  /* ACPI 6.3 */
   1789  1.1.1.16  christos #define ACPI_PPTT_ACPI_LEAF_NODE            (1<<3)  /* ACPI 6.3 */
   1790  1.1.1.16  christos #define ACPI_PPTT_ACPI_IDENTICAL            (1<<4)  /* ACPI 6.3 */
   1791  1.1.1.12  christos 
   1792  1.1.1.12  christos 
   1793  1.1.1.14  christos /* 1: Cache Type Structure */
   1794  1.1.1.12  christos 
   1795  1.1.1.14  christos typedef struct acpi_pptt_cache
   1796  1.1.1.12  christos {
   1797  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1798  1.1.1.12  christos     UINT16                  Reserved;
   1799  1.1.1.14  christos     UINT32                  Flags;
   1800  1.1.1.14  christos     UINT32                  NextLevelOfCache;
   1801  1.1.1.14  christos     UINT32                  Size;
   1802  1.1.1.14  christos     UINT32                  NumberOfSets;
   1803  1.1.1.14  christos     UINT8                   Associativity;
   1804  1.1.1.14  christos     UINT8                   Attributes;
   1805  1.1.1.14  christos     UINT16                  LineSize;
   1806  1.1.1.14  christos 
   1807  1.1.1.14  christos } ACPI_PPTT_CACHE;
   1808  1.1.1.14  christos 
   1809  1.1.1.14  christos /* Flags */
   1810  1.1.1.14  christos 
   1811  1.1.1.14  christos #define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)     /* Physical property valid */
   1812  1.1.1.14  christos #define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)  /* Number of sets valid */
   1813  1.1.1.14  christos #define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)  /* Associativity valid */
   1814  1.1.1.14  christos #define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)  /* Allocation type valid */
   1815  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)  /* Cache type valid */
   1816  1.1.1.14  christos #define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)  /* Write policy valid */
   1817  1.1.1.14  christos #define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)  /* Line size valid */
   1818  1.1.1.14  christos 
   1819  1.1.1.14  christos /* Masks for Attributes */
   1820  1.1.1.14  christos 
   1821  1.1.1.14  christos #define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)  /* Allocation type */
   1822  1.1.1.14  christos #define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)  /* Cache type */
   1823  1.1.1.14  christos #define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)  /* Write policy */
   1824  1.1.1.14  christos 
   1825  1.1.1.14  christos /* Attributes describing cache */
   1826  1.1.1.14  christos #define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)   /* Cache line is allocated on read */
   1827  1.1.1.14  christos #define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)  /* Cache line is allocated on write */
   1828  1.1.1.14  christos #define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)  /* Cache line is allocated on read and write */
   1829  1.1.1.14  christos #define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)  /* Alternate representation of above */
   1830  1.1.1.14  christos 
   1831  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)   /* Data cache */
   1832  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)  /* Instruction cache */
   1833  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)  /* Unified I & D cache */
   1834  1.1.1.14  christos #define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)  /* Alternate representation of above */
   1835  1.1.1.12  christos 
   1836  1.1.1.14  christos #define ACPI_PPTT_CACHE_POLICY_WB           (0x0)   /* Cache is write back */
   1837  1.1.1.14  christos #define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)  /* Cache is write through */
   1838  1.1.1.12  christos 
   1839  1.1.1.14  christos /* 2: ID Structure */
   1840  1.1.1.12  christos 
   1841  1.1.1.14  christos typedef struct acpi_pptt_id
   1842  1.1.1.14  christos {
   1843  1.1.1.14  christos     ACPI_SUBTABLE_HEADER    Header;
   1844  1.1.1.14  christos     UINT16                  Reserved;
   1845  1.1.1.14  christos     UINT32                  VendorId;
   1846  1.1.1.14  christos     UINT64                  Level1Id;
   1847  1.1.1.14  christos     UINT64                  Level2Id;
   1848  1.1.1.14  christos     UINT16                  MajorRev;
   1849  1.1.1.14  christos     UINT16                  MinorRev;
   1850  1.1.1.14  christos     UINT16                  SpinRev;
   1851  1.1.1.12  christos 
   1852  1.1.1.14  christos } ACPI_PPTT_ID;
   1853       1.1    jruoho 
   1854       1.1    jruoho 
   1855       1.1    jruoho /*******************************************************************************
   1856       1.1    jruoho  *
   1857  1.1.1.14  christos  * RASF - RAS Feature Table (ACPI 5.0)
   1858       1.1    jruoho  *        Version 1
   1859       1.1    jruoho  *
   1860       1.1    jruoho  ******************************************************************************/
   1861       1.1    jruoho 
   1862  1.1.1.14  christos typedef struct acpi_table_rasf
   1863       1.1    jruoho {
   1864       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1865  1.1.1.14  christos     UINT8                   ChannelId[12];
   1866       1.1    jruoho 
   1867  1.1.1.14  christos } ACPI_TABLE_RASF;
   1868       1.1    jruoho 
   1869  1.1.1.14  christos /* RASF Platform Communication Channel Shared Memory Region */
   1870   1.1.1.4  christos 
   1871  1.1.1.14  christos typedef struct acpi_rasf_shared_memory
   1872   1.1.1.4  christos {
   1873  1.1.1.14  christos     UINT32                  Signature;
   1874  1.1.1.14  christos     UINT16                  Command;
   1875  1.1.1.14  christos     UINT16                  Status;
   1876  1.1.1.14  christos     UINT16                  Version;
   1877  1.1.1.14  christos     UINT8                   Capabilities[16];
   1878  1.1.1.14  christos     UINT8                   SetCapabilities[16];
   1879  1.1.1.14  christos     UINT16                  NumParameterBlocks;
   1880  1.1.1.14  christos     UINT32                  SetCapabilitiesStatus;
   1881   1.1.1.4  christos 
   1882  1.1.1.14  christos } ACPI_RASF_SHARED_MEMORY;
   1883   1.1.1.4  christos 
   1884  1.1.1.14  christos /* RASF Parameter Block Structure Header */
   1885   1.1.1.4  christos 
   1886  1.1.1.14  christos typedef struct acpi_rasf_parameter_block
   1887   1.1.1.4  christos {
   1888  1.1.1.14  christos     UINT16                  Type;
   1889  1.1.1.14  christos     UINT16                  Version;
   1890  1.1.1.14  christos     UINT16                  Length;
   1891   1.1.1.4  christos 
   1892  1.1.1.14  christos } ACPI_RASF_PARAMETER_BLOCK;
   1893   1.1.1.4  christos 
   1894  1.1.1.14  christos /* RASF Parameter Block Structure for PATROL_SCRUB */
   1895       1.1    jruoho 
   1896  1.1.1.14  christos typedef struct acpi_rasf_patrol_scrub_parameter
   1897       1.1    jruoho {
   1898  1.1.1.14  christos     ACPI_RASF_PARAMETER_BLOCK   Header;
   1899  1.1.1.14  christos     UINT16                      PatrolScrubCommand;
   1900  1.1.1.14  christos     UINT64                      RequestedAddressRange[2];
   1901  1.1.1.14  christos     UINT64                      ActualAddressRange[2];
   1902  1.1.1.14  christos     UINT16                      Flags;
   1903  1.1.1.14  christos     UINT8                       RequestedSpeed;
   1904       1.1    jruoho 
   1905  1.1.1.14  christos } ACPI_RASF_PATROL_SCRUB_PARAMETER;
   1906       1.1    jruoho 
   1907  1.1.1.14  christos /* Masks for Flags and Speed fields above */
   1908       1.1    jruoho 
   1909  1.1.1.14  christos #define ACPI_RASF_SCRUBBER_RUNNING      1
   1910  1.1.1.14  christos #define ACPI_RASF_SPEED                 (7<<1)
   1911  1.1.1.14  christos #define ACPI_RASF_SPEED_SLOW            (0<<1)
   1912  1.1.1.14  christos #define ACPI_RASF_SPEED_MEDIUM          (4<<1)
   1913  1.1.1.14  christos #define ACPI_RASF_SPEED_FAST            (7<<1)
   1914       1.1    jruoho 
   1915  1.1.1.14  christos /* Channel Commands */
   1916       1.1    jruoho 
   1917  1.1.1.14  christos enum AcpiRasfCommands
   1918  1.1.1.14  christos {
   1919  1.1.1.14  christos     ACPI_RASF_EXECUTE_RASF_COMMAND      = 1
   1920  1.1.1.14  christos };
   1921       1.1    jruoho 
   1922  1.1.1.14  christos /* Platform RAS Capabilities */
   1923  1.1.1.14  christos 
   1924  1.1.1.14  christos enum AcpiRasfCapabiliities
   1925       1.1    jruoho {
   1926  1.1.1.14  christos     ACPI_HW_PATROL_SCRUB_SUPPORTED      = 0,
   1927  1.1.1.14  christos     ACPI_SW_PATROL_SCRUB_EXPOSED        = 1
   1928  1.1.1.14  christos };
   1929       1.1    jruoho 
   1930  1.1.1.14  christos /* Patrol Scrub Commands */
   1931       1.1    jruoho 
   1932  1.1.1.14  christos enum AcpiRasfPatrolScrubCommands
   1933  1.1.1.14  christos {
   1934  1.1.1.14  christos     ACPI_RASF_GET_PATROL_PARAMETERS     = 1,
   1935  1.1.1.14  christos     ACPI_RASF_START_PATROL_SCRUBBER     = 2,
   1936  1.1.1.14  christos     ACPI_RASF_STOP_PATROL_SCRUBBER      = 3
   1937  1.1.1.14  christos };
   1938       1.1    jruoho 
   1939  1.1.1.14  christos /* Channel Command flags */
   1940       1.1    jruoho 
   1941  1.1.1.14  christos #define ACPI_RASF_GENERATE_SCI          (1<<15)
   1942       1.1    jruoho 
   1943  1.1.1.14  christos /* Status values */
   1944       1.1    jruoho 
   1945  1.1.1.14  christos enum AcpiRasfStatus
   1946       1.1    jruoho {
   1947  1.1.1.14  christos     ACPI_RASF_SUCCESS                   = 0,
   1948  1.1.1.14  christos     ACPI_RASF_NOT_VALID                 = 1,
   1949  1.1.1.14  christos     ACPI_RASF_NOT_SUPPORTED             = 2,
   1950  1.1.1.14  christos     ACPI_RASF_BUSY                      = 3,
   1951  1.1.1.14  christos     ACPI_RASF_FAILED                    = 4,
   1952  1.1.1.14  christos     ACPI_RASF_ABORTED                   = 5,
   1953  1.1.1.14  christos     ACPI_RASF_INVALID_DATA              = 6
   1954       1.1    jruoho };
   1955       1.1    jruoho 
   1956  1.1.1.14  christos /* Status flags */
   1957       1.1    jruoho 
   1958  1.1.1.14  christos #define ACPI_RASF_COMMAND_COMPLETE      (1)
   1959  1.1.1.14  christos #define ACPI_RASF_SCI_DOORBELL          (1<<1)
   1960  1.1.1.14  christos #define ACPI_RASF_ERROR                 (1<<2)
   1961  1.1.1.14  christos #define ACPI_RASF_STATUS                (0x1F<<3)
   1962       1.1    jruoho 
   1963       1.1    jruoho 
   1964       1.1    jruoho /*******************************************************************************
   1965       1.1    jruoho  *
   1966  1.1.1.14  christos  * SBST - Smart Battery Specification Table
   1967   1.1.1.2    jruoho  *        Version 1
   1968   1.1.1.2    jruoho  *
   1969   1.1.1.2    jruoho  ******************************************************************************/
   1970   1.1.1.2    jruoho 
   1971  1.1.1.14  christos typedef struct acpi_table_sbst
   1972   1.1.1.2    jruoho {
   1973   1.1.1.2    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1974  1.1.1.14  christos     UINT32                  WarningLevel;
   1975  1.1.1.14  christos     UINT32                  LowLevel;
   1976  1.1.1.14  christos     UINT32                  CriticalLevel;
   1977   1.1.1.2    jruoho 
   1978  1.1.1.14  christos } ACPI_TABLE_SBST;
   1979   1.1.1.2    jruoho 
   1980   1.1.1.2    jruoho 
   1981   1.1.1.2    jruoho /*******************************************************************************
   1982   1.1.1.2    jruoho  *
   1983  1.1.1.14  christos  * SDEI - Software Delegated Exception Interface Descriptor Table
   1984       1.1    jruoho  *
   1985  1.1.1.14  christos  * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
   1986  1.1.1.14  christos  * May 8th, 2017. Copyright 2017 ARM Ltd.
   1987       1.1    jruoho  *
   1988       1.1    jruoho  ******************************************************************************/
   1989       1.1    jruoho 
   1990  1.1.1.14  christos typedef struct acpi_table_sdei
   1991       1.1    jruoho {
   1992       1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1993       1.1    jruoho 
   1994  1.1.1.14  christos } ACPI_TABLE_SDEI;
   1995       1.1    jruoho 
   1996       1.1    jruoho 
   1997  1.1.1.12  christos /*******************************************************************************
   1998  1.1.1.12  christos  *
   1999  1.1.1.14  christos  * SDEV - Secure Devices Table (ACPI 6.2)
   2000  1.1.1.12  christos  *        Version 1
   2001  1.1.1.12  christos  *
   2002  1.1.1.12  christos  ******************************************************************************/
   2003  1.1.1.12  christos 
   2004  1.1.1.14  christos typedef struct acpi_table_sdev
   2005  1.1.1.12  christos {
   2006  1.1.1.12  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   2007  1.1.1.12  christos 
   2008  1.1.1.14  christos } ACPI_TABLE_SDEV;
   2009  1.1.1.14  christos 
   2010  1.1.1.14  christos 
   2011  1.1.1.14  christos typedef struct acpi_sdev_header
   2012  1.1.1.14  christos {
   2013  1.1.1.14  christos     UINT8                   Type;
   2014  1.1.1.14  christos     UINT8                   Flags;
   2015  1.1.1.14  christos     UINT16                  Length;
   2016  1.1.1.14  christos 
   2017  1.1.1.14  christos } ACPI_SDEV_HEADER;
   2018  1.1.1.14  christos 
   2019  1.1.1.14  christos 
   2020  1.1.1.14  christos /* Values for subtable type above */
   2021  1.1.1.14  christos 
   2022  1.1.1.14  christos enum AcpiSdevType
   2023  1.1.1.14  christos {
   2024  1.1.1.14  christos     ACPI_SDEV_TYPE_NAMESPACE_DEVICE     = 0,
   2025  1.1.1.14  christos     ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
   2026  1.1.1.14  christos     ACPI_SDEV_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
   2027  1.1.1.14  christos };
   2028  1.1.1.14  christos 
   2029  1.1.1.14  christos /* Values for flags above */
   2030  1.1.1.14  christos 
   2031  1.1.1.14  christos #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS    (1)
   2032  1.1.1.12  christos 
   2033  1.1.1.14  christos /*
   2034  1.1.1.14  christos  * SDEV subtables
   2035  1.1.1.14  christos  */
   2036  1.1.1.14  christos 
   2037  1.1.1.14  christos /* 0: Namespace Device Based Secure Device Structure */
   2038  1.1.1.14  christos 
   2039  1.1.1.14  christos typedef struct acpi_sdev_namespace
   2040  1.1.1.14  christos {
   2041  1.1.1.14  christos     ACPI_SDEV_HEADER        Header;
   2042  1.1.1.14  christos     UINT16                  DeviceIdOffset;
   2043  1.1.1.14  christos     UINT16                  DeviceIdLength;
   2044  1.1.1.14  christos     UINT16                  VendorDataOffset;
   2045  1.1.1.14  christos     UINT16                  VendorDataLength;
   2046  1.1.1.14  christos 
   2047  1.1.1.14  christos } ACPI_SDEV_NAMESPACE;
   2048  1.1.1.14  christos 
   2049  1.1.1.14  christos /* 1: PCIe Endpoint Device Based Device Structure */
   2050  1.1.1.14  christos 
   2051  1.1.1.14  christos typedef struct acpi_sdev_pcie
   2052  1.1.1.14  christos {
   2053  1.1.1.14  christos     ACPI_SDEV_HEADER        Header;
   2054  1.1.1.14  christos     UINT16                  Segment;
   2055  1.1.1.14  christos     UINT16                  StartBus;
   2056  1.1.1.14  christos     UINT16                  PathOffset;
   2057  1.1.1.14  christos     UINT16                  PathLength;
   2058  1.1.1.14  christos     UINT16                  VendorDataOffset;
   2059  1.1.1.14  christos     UINT16                  VendorDataLength;
   2060  1.1.1.14  christos 
   2061  1.1.1.14  christos } ACPI_SDEV_PCIE;
   2062  1.1.1.14  christos 
   2063  1.1.1.14  christos /* 1a: PCIe Endpoint path entry */
   2064  1.1.1.14  christos 
   2065  1.1.1.14  christos typedef struct acpi_sdev_pcie_path
   2066  1.1.1.14  christos {
   2067  1.1.1.14  christos     UINT8                   Device;
   2068  1.1.1.14  christos     UINT8                   Function;
   2069  1.1.1.12  christos 
   2070  1.1.1.14  christos } ACPI_SDEV_PCIE_PATH;
   2071  1.1.1.12  christos 
   2072  1.1.1.12  christos 
   2073       1.1    jruoho /* Reset to default packing */
   2074       1.1    jruoho 
   2075       1.1    jruoho #pragma pack()
   2076       1.1    jruoho 
   2077       1.1    jruoho #endif /* __ACTBL2_H__ */
   2078