Home | History | Annotate | Line # | Download | only in include
amlresrc.h revision 1.7
      1  1.1    jruoho /******************************************************************************
      2  1.1    jruoho  *
      3  1.1    jruoho  * Module Name: amlresrc.h - AML resource descriptors
      4  1.1    jruoho  *
      5  1.1    jruoho  *****************************************************************************/
      6  1.1    jruoho 
      7  1.7  christos /******************************************************************************
      8  1.7  christos  *
      9  1.7  christos  * 1. Copyright Notice
     10  1.7  christos  *
     11  1.7  christos  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
     12  1.1    jruoho  * All rights reserved.
     13  1.1    jruoho  *
     14  1.7  christos  * 2. License
     15  1.7  christos  *
     16  1.7  christos  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  1.7  christos  * rights. You may have additional license terms from the party that provided
     18  1.7  christos  * you this software, covering your right to use that party's intellectual
     19  1.7  christos  * property rights.
     20  1.7  christos  *
     21  1.7  christos  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  1.7  christos  * copy of the source code appearing in this file ("Covered Code") an
     23  1.7  christos  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  1.7  christos  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  1.7  christos  * make derivatives, distribute, use and display any portion of the Covered
     26  1.7  christos  * Code in any form, with the right to sublicense such rights; and
     27  1.7  christos  *
     28  1.7  christos  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  1.7  christos  * license (with the right to sublicense), under only those claims of Intel
     30  1.7  christos  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  1.7  christos  * offer to sell, and import the Covered Code and derivative works thereof
     32  1.7  christos  * solely to the minimum extent necessary to exercise the above copyright
     33  1.7  christos  * license, and in no event shall the patent license extend to any additions
     34  1.7  christos  * to or modifications of the Original Intel Code. No other license or right
     35  1.7  christos  * is granted directly or by implication, estoppel or otherwise;
     36  1.7  christos  *
     37  1.7  christos  * The above copyright and patent license is granted only if the following
     38  1.7  christos  * conditions are met:
     39  1.7  christos  *
     40  1.7  christos  * 3. Conditions
     41  1.7  christos  *
     42  1.7  christos  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  1.7  christos  * Redistribution of source code of any substantial portion of the Covered
     44  1.7  christos  * Code or modification with rights to further distribute source must include
     45  1.7  christos  * the above Copyright Notice, the above License, this list of Conditions,
     46  1.7  christos  * and the following Disclaimer and Export Compliance provision. In addition,
     47  1.7  christos  * Licensee must cause all Covered Code to which Licensee contributes to
     48  1.7  christos  * contain a file documenting the changes Licensee made to create that Covered
     49  1.7  christos  * Code and the date of any change. Licensee must include in that file the
     50  1.7  christos  * documentation of any changes made by any predecessor Licensee. Licensee
     51  1.7  christos  * must include a prominent statement that the modification is derived,
     52  1.7  christos  * directly or indirectly, from Original Intel Code.
     53  1.7  christos  *
     54  1.7  christos  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  1.7  christos  * Redistribution of source code of any substantial portion of the Covered
     56  1.7  christos  * Code or modification without rights to further distribute source must
     57  1.7  christos  * include the following Disclaimer and Export Compliance provision in the
     58  1.7  christos  * documentation and/or other materials provided with distribution. In
     59  1.7  christos  * addition, Licensee may not authorize further sublicense of source of any
     60  1.7  christos  * portion of the Covered Code, and must include terms to the effect that the
     61  1.7  christos  * license from Licensee to its licensee is limited to the intellectual
     62  1.7  christos  * property embodied in the software Licensee provides to its licensee, and
     63  1.7  christos  * not to intellectual property embodied in modifications its licensee may
     64  1.7  christos  * make.
     65  1.7  christos  *
     66  1.7  christos  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  1.7  christos  * substantial portion of the Covered Code or modification must reproduce the
     68  1.7  christos  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  1.7  christos  * provision in the documentation and/or other materials provided with the
     70  1.7  christos  * distribution.
     71  1.7  christos  *
     72  1.7  christos  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  1.7  christos  * Intel Code.
     74  1.7  christos  *
     75  1.7  christos  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  1.7  christos  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  1.7  christos  * other dealings in products derived from or relating to the Covered Code
     78  1.7  christos  * without prior written authorization from Intel.
     79  1.7  christos  *
     80  1.7  christos  * 4. Disclaimer and Export Compliance
     81  1.7  christos  *
     82  1.7  christos  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  1.7  christos  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  1.7  christos  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  1.7  christos  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  1.7  christos  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  1.7  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  1.7  christos  * PARTICULAR PURPOSE.
     89  1.7  christos  *
     90  1.7  christos  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  1.7  christos  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  1.7  christos  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  1.7  christos  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  1.7  christos  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  1.7  christos  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  1.7  christos  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  1.7  christos  * LIMITED REMEDY.
     98  1.7  christos  *
     99  1.7  christos  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  1.7  christos  * software or system incorporating such software without first obtaining any
    101  1.7  christos  * required license or other approval from the U. S. Department of Commerce or
    102  1.7  christos  * any other agency or department of the United States Government. In the
    103  1.7  christos  * event Licensee exports any such software from the United States or
    104  1.7  christos  * re-exports any such software from a foreign destination, Licensee shall
    105  1.7  christos  * ensure that the distribution and export/re-export of the software is in
    106  1.7  christos  * compliance with all laws, regulations, orders, or other restrictions of the
    107  1.7  christos  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  1.7  christos  * any of its subsidiaries will export/re-export any technical data, process,
    109  1.7  christos  * software, or service, directly or indirectly, to any country for which the
    110  1.7  christos  * United States government or any agency thereof requires an export license,
    111  1.7  christos  * other governmental approval, or letter of assurance, without first obtaining
    112  1.7  christos  * such license, approval or letter.
    113  1.7  christos  *
    114  1.7  christos  *****************************************************************************
    115  1.7  christos  *
    116  1.7  christos  * Alternatively, you may choose to be licensed under the terms of the
    117  1.7  christos  * following license:
    118  1.7  christos  *
    119  1.2     kamil  * Redistribution and use in source and binary forms, with or without
    120  1.2     kamil  * modification, are permitted provided that the following conditions
    121  1.2     kamil  * are met:
    122  1.2     kamil  * 1. Redistributions of source code must retain the above copyright
    123  1.2     kamil  *    notice, this list of conditions, and the following disclaimer,
    124  1.2     kamil  *    without modification.
    125  1.2     kamil  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126  1.2     kamil  *    substantially similar to the "NO WARRANTY" disclaimer below
    127  1.2     kamil  *    ("Disclaimer") and any redistribution must be conditioned upon
    128  1.2     kamil  *    including a substantially similar Disclaimer requirement for further
    129  1.2     kamil  *    binary redistribution.
    130  1.2     kamil  * 3. Neither the names of the above-listed copyright holders nor the names
    131  1.2     kamil  *    of any contributors may be used to endorse or promote products derived
    132  1.2     kamil  *    from this software without specific prior written permission.
    133  1.2     kamil  *
    134  1.2     kamil  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135  1.2     kamil  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136  1.4  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137  1.2     kamil  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  1.7  christos  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  1.7  christos  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  1.7  christos  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  1.7  christos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  1.7  christos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  1.7  christos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  1.7  christos  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  1.7  christos  *
    146  1.7  christos  * Alternatively, you may choose to be licensed under the terms of the
    147  1.7  christos  * GNU General Public License ("GPL") version 2 as published by the Free
    148  1.7  christos  * Software Foundation.
    149  1.7  christos  *
    150  1.7  christos  *****************************************************************************/
    151  1.1    jruoho 
    152  1.1    jruoho /* acpisrc:StructDefs -- for acpisrc conversion */
    153  1.1    jruoho 
    154  1.1    jruoho #ifndef __AMLRESRC_H
    155  1.1    jruoho #define __AMLRESRC_H
    156  1.1    jruoho 
    157  1.1    jruoho 
    158  1.1    jruoho /*
    159  1.1    jruoho  * Resource descriptor tags, as defined in the ACPI specification.
    160  1.1    jruoho  * Used to symbolically reference fields within a descriptor.
    161  1.1    jruoho  */
    162  1.1    jruoho #define ACPI_RESTAG_ADDRESS                     "_ADR"
    163  1.1    jruoho #define ACPI_RESTAG_ALIGNMENT                   "_ALN"
    164  1.1    jruoho #define ACPI_RESTAG_ADDRESSSPACE                "_ASI"
    165  1.1    jruoho #define ACPI_RESTAG_ACCESSSIZE                  "_ASZ"
    166  1.1    jruoho #define ACPI_RESTAG_TYPESPECIFICATTRIBUTES      "_ATT"
    167  1.1    jruoho #define ACPI_RESTAG_BASEADDRESS                 "_BAS"
    168  1.1    jruoho #define ACPI_RESTAG_BUSMASTER                   "_BM_"  /* Master(1), Slave(0) */
    169  1.2     kamil #define ACPI_RESTAG_DEBOUNCETIME                "_DBT"
    170  1.1    jruoho #define ACPI_RESTAG_DECODE                      "_DEC"
    171  1.2     kamil #define ACPI_RESTAG_DEVICEPOLARITY              "_DPL"
    172  1.1    jruoho #define ACPI_RESTAG_DMA                         "_DMA"
    173  1.1    jruoho #define ACPI_RESTAG_DMATYPE                     "_TYP"  /* Compatible(0), A(1), B(2), F(3) */
    174  1.2     kamil #define ACPI_RESTAG_DRIVESTRENGTH               "_DRS"
    175  1.2     kamil #define ACPI_RESTAG_ENDIANNESS                  "_END"
    176  1.2     kamil #define ACPI_RESTAG_FLOWCONTROL                 "_FLC"
    177  1.2     kamil #define ACPI_RESTAG_FUNCTION                    "_FUN"
    178  1.1    jruoho #define ACPI_RESTAG_GRANULARITY                 "_GRA"
    179  1.1    jruoho #define ACPI_RESTAG_INTERRUPT                   "_INT"
    180  1.1    jruoho #define ACPI_RESTAG_INTERRUPTLEVEL              "_LL_"  /* ActiveLo(1), ActiveHi(0) */
    181  1.1    jruoho #define ACPI_RESTAG_INTERRUPTSHARE              "_SHR"  /* Shareable(1), NoShare(0) */
    182  1.1    jruoho #define ACPI_RESTAG_INTERRUPTTYPE               "_HE_"  /* Edge(1), Level(0) */
    183  1.2     kamil #define ACPI_RESTAG_IORESTRICTION               "_IOR"
    184  1.1    jruoho #define ACPI_RESTAG_LENGTH                      "_LEN"
    185  1.2     kamil #define ACPI_RESTAG_LINE                        "_LIN"
    186  1.4  christos #define ACPI_RESTAG_LOCALPORT                   "_PRT"
    187  1.1    jruoho #define ACPI_RESTAG_MEMATTRIBUTES               "_MTP"  /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
    188  1.1    jruoho #define ACPI_RESTAG_MEMTYPE                     "_MEM"  /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
    189  1.1    jruoho #define ACPI_RESTAG_MAXADDR                     "_MAX"
    190  1.1    jruoho #define ACPI_RESTAG_MINADDR                     "_MIN"
    191  1.1    jruoho #define ACPI_RESTAG_MAXTYPE                     "_MAF"
    192  1.1    jruoho #define ACPI_RESTAG_MINTYPE                     "_MIF"
    193  1.2     kamil #define ACPI_RESTAG_MODE                        "_MOD"
    194  1.2     kamil #define ACPI_RESTAG_PARITY                      "_PAR"
    195  1.2     kamil #define ACPI_RESTAG_PHASE                       "_PHA"
    196  1.4  christos #define ACPI_RESTAG_PHYTYPE                     "_PHY"
    197  1.2     kamil #define ACPI_RESTAG_PIN                         "_PIN"
    198  1.2     kamil #define ACPI_RESTAG_PINCONFIG                   "_PPI"
    199  1.2     kamil #define ACPI_RESTAG_PINCONFIG_TYPE              "_TYP"
    200  1.2     kamil #define ACPI_RESTAG_PINCONFIG_VALUE             "_VAL"
    201  1.2     kamil #define ACPI_RESTAG_POLARITY                    "_POL"
    202  1.1    jruoho #define ACPI_RESTAG_REGISTERBITOFFSET           "_RBO"
    203  1.1    jruoho #define ACPI_RESTAG_REGISTERBITWIDTH            "_RBW"
    204  1.1    jruoho #define ACPI_RESTAG_RANGETYPE                   "_RNG"
    205  1.1    jruoho #define ACPI_RESTAG_READWRITETYPE               "_RW_"  /* ReadOnly(0), Writeable (1) */
    206  1.2     kamil #define ACPI_RESTAG_LENGTH_RX                   "_RXL"
    207  1.2     kamil #define ACPI_RESTAG_LENGTH_TX                   "_TXL"
    208  1.2     kamil #define ACPI_RESTAG_SLAVEMODE                   "_SLV"
    209  1.2     kamil #define ACPI_RESTAG_SPEED                       "_SPE"
    210  1.2     kamil #define ACPI_RESTAG_STOPBITS                    "_STB"
    211  1.1    jruoho #define ACPI_RESTAG_TRANSLATION                 "_TRA"
    212  1.1    jruoho #define ACPI_RESTAG_TRANSTYPE                   "_TRS"  /* Sparse(1), Dense(0) */
    213  1.1    jruoho #define ACPI_RESTAG_TYPE                        "_TTP"  /* Translation(1), Static (0) */
    214  1.1    jruoho #define ACPI_RESTAG_XFERTYPE                    "_SIZ"  /* 8(0), 8And16(1), 16(2) */
    215  1.2     kamil #define ACPI_RESTAG_VENDORDATA                  "_VEN"
    216  1.6  christos #define ACPI_RESTAG_FQN                         "_FQN"
    217  1.6  christos #define ACPI_RESTAG_FQD                         "_FQD"
    218  1.1    jruoho 
    219  1.1    jruoho 
    220  1.1    jruoho /* Default sizes for "small" resource descriptors */
    221  1.1    jruoho 
    222  1.1    jruoho #define ASL_RDESC_IRQ_SIZE                      0x02
    223  1.1    jruoho #define ASL_RDESC_DMA_SIZE                      0x02
    224  1.1    jruoho #define ASL_RDESC_ST_DEPEND_SIZE                0x00
    225  1.1    jruoho #define ASL_RDESC_END_DEPEND_SIZE               0x00
    226  1.1    jruoho #define ASL_RDESC_IO_SIZE                       0x07
    227  1.1    jruoho #define ASL_RDESC_FIXED_IO_SIZE                 0x03
    228  1.2     kamil #define ASL_RDESC_FIXED_DMA_SIZE                0x05
    229  1.1    jruoho #define ASL_RDESC_END_TAG_SIZE                  0x01
    230  1.1    jruoho 
    231  1.1    jruoho 
    232  1.1    jruoho typedef struct asl_resource_node
    233  1.1    jruoho {
    234  1.1    jruoho     UINT32                          BufferLength;
    235  1.1    jruoho     void                            *Buffer;
    236  1.1    jruoho     struct asl_resource_node        *Next;
    237  1.1    jruoho 
    238  1.1    jruoho } ASL_RESOURCE_NODE;
    239  1.1    jruoho 
    240  1.2     kamil typedef struct asl_resource_info
    241  1.2     kamil {
    242  1.2     kamil     ACPI_PARSE_OBJECT               *DescriptorTypeOp;  /* Resource descriptor parse node */
    243  1.2     kamil     ACPI_PARSE_OBJECT               *MappingOp;         /* Used for mapfile support */
    244  1.2     kamil     UINT32                          CurrentByteOffset;  /* Offset in resource template */
    245  1.2     kamil 
    246  1.2     kamil } ASL_RESOURCE_INFO;
    247  1.2     kamil 
    248  1.1    jruoho 
    249  1.1    jruoho /* Macros used to generate AML resource length fields */
    250  1.1    jruoho 
    251  1.1    jruoho #define ACPI_AML_SIZE_LARGE(r)      (sizeof (r) - sizeof (AML_RESOURCE_LARGE_HEADER))
    252  1.1    jruoho #define ACPI_AML_SIZE_SMALL(r)      (sizeof (r) - sizeof (AML_RESOURCE_SMALL_HEADER))
    253  1.1    jruoho 
    254  1.1    jruoho /*
    255  1.1    jruoho  * Resource descriptors defined in the ACPI specification.
    256  1.1    jruoho  *
    257  1.1    jruoho  * Packing/alignment must be BYTE because these descriptors
    258  1.1    jruoho  * are used to overlay the raw AML byte stream.
    259  1.1    jruoho  */
    260  1.1    jruoho #pragma pack(1)
    261  1.1    jruoho 
    262  1.1    jruoho /*
    263  1.1    jruoho  * SMALL descriptors
    264  1.1    jruoho  */
    265  1.1    jruoho #define AML_RESOURCE_SMALL_HEADER_COMMON \
    266  1.1    jruoho     UINT8                           DescriptorType;
    267  1.1    jruoho 
    268  1.1    jruoho typedef struct aml_resource_small_header
    269  1.1    jruoho {
    270  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    271  1.1    jruoho 
    272  1.1    jruoho } AML_RESOURCE_SMALL_HEADER;
    273  1.1    jruoho 
    274  1.1    jruoho 
    275  1.1    jruoho typedef struct aml_resource_irq
    276  1.1    jruoho {
    277  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    278  1.1    jruoho     UINT16                          IrqMask;
    279  1.1    jruoho     UINT8                           Flags;
    280  1.1    jruoho 
    281  1.1    jruoho } AML_RESOURCE_IRQ;
    282  1.1    jruoho 
    283  1.1    jruoho 
    284  1.1    jruoho typedef struct aml_resource_irq_noflags
    285  1.1    jruoho {
    286  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    287  1.1    jruoho     UINT16                          IrqMask;
    288  1.1    jruoho 
    289  1.1    jruoho } AML_RESOURCE_IRQ_NOFLAGS;
    290  1.1    jruoho 
    291  1.1    jruoho 
    292  1.1    jruoho typedef struct aml_resource_dma
    293  1.1    jruoho {
    294  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    295  1.1    jruoho     UINT8                           DmaChannelMask;
    296  1.1    jruoho     UINT8                           Flags;
    297  1.1    jruoho 
    298  1.1    jruoho } AML_RESOURCE_DMA;
    299  1.1    jruoho 
    300  1.1    jruoho 
    301  1.1    jruoho typedef struct aml_resource_start_dependent
    302  1.1    jruoho {
    303  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    304  1.1    jruoho     UINT8                           Flags;
    305  1.1    jruoho 
    306  1.1    jruoho } AML_RESOURCE_START_DEPENDENT;
    307  1.1    jruoho 
    308  1.1    jruoho 
    309  1.1    jruoho typedef struct aml_resource_start_dependent_noprio
    310  1.1    jruoho {
    311  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    312  1.1    jruoho 
    313  1.1    jruoho } AML_RESOURCE_START_DEPENDENT_NOPRIO;
    314  1.1    jruoho 
    315  1.1    jruoho 
    316  1.1    jruoho typedef struct aml_resource_end_dependent
    317  1.1    jruoho {
    318  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    319  1.1    jruoho 
    320  1.1    jruoho } AML_RESOURCE_END_DEPENDENT;
    321  1.1    jruoho 
    322  1.1    jruoho 
    323  1.1    jruoho typedef struct aml_resource_io
    324  1.1    jruoho {
    325  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    326  1.1    jruoho     UINT8                           Flags;
    327  1.1    jruoho     UINT16                          Minimum;
    328  1.1    jruoho     UINT16                          Maximum;
    329  1.1    jruoho     UINT8                           Alignment;
    330  1.1    jruoho     UINT8                           AddressLength;
    331  1.1    jruoho 
    332  1.1    jruoho } AML_RESOURCE_IO;
    333  1.1    jruoho 
    334  1.1    jruoho 
    335  1.1    jruoho typedef struct aml_resource_fixed_io
    336  1.1    jruoho {
    337  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    338  1.1    jruoho     UINT16                          Address;
    339  1.1    jruoho     UINT8                           AddressLength;
    340  1.1    jruoho 
    341  1.1    jruoho } AML_RESOURCE_FIXED_IO;
    342  1.1    jruoho 
    343  1.1    jruoho 
    344  1.1    jruoho typedef struct aml_resource_vendor_small
    345  1.1    jruoho {
    346  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    347  1.1    jruoho 
    348  1.1    jruoho } AML_RESOURCE_VENDOR_SMALL;
    349  1.1    jruoho 
    350  1.1    jruoho 
    351  1.1    jruoho typedef struct aml_resource_end_tag
    352  1.1    jruoho {
    353  1.1    jruoho     AML_RESOURCE_SMALL_HEADER_COMMON
    354  1.1    jruoho     UINT8                           Checksum;
    355  1.1    jruoho 
    356  1.1    jruoho } AML_RESOURCE_END_TAG;
    357  1.1    jruoho 
    358  1.1    jruoho 
    359  1.2     kamil typedef struct aml_resource_fixed_dma
    360  1.2     kamil {
    361  1.2     kamil     AML_RESOURCE_SMALL_HEADER_COMMON
    362  1.2     kamil     UINT16                          RequestLines;
    363  1.2     kamil     UINT16                          Channels;
    364  1.2     kamil     UINT8                           Width;
    365  1.2     kamil 
    366  1.2     kamil } AML_RESOURCE_FIXED_DMA;
    367  1.2     kamil 
    368  1.2     kamil 
    369  1.1    jruoho /*
    370  1.1    jruoho  * LARGE descriptors
    371  1.1    jruoho  */
    372  1.1    jruoho #define AML_RESOURCE_LARGE_HEADER_COMMON \
    373  1.1    jruoho     UINT8                           DescriptorType;\
    374  1.1    jruoho     UINT16                          ResourceLength;
    375  1.1    jruoho 
    376  1.1    jruoho typedef struct aml_resource_large_header
    377  1.1    jruoho {
    378  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    379  1.1    jruoho 
    380  1.1    jruoho } AML_RESOURCE_LARGE_HEADER;
    381  1.1    jruoho 
    382  1.1    jruoho 
    383  1.1    jruoho /* General Flags for address space resource descriptors */
    384  1.1    jruoho 
    385  1.1    jruoho #define ACPI_RESOURCE_FLAG_DEC      2
    386  1.1    jruoho #define ACPI_RESOURCE_FLAG_MIF      4
    387  1.1    jruoho #define ACPI_RESOURCE_FLAG_MAF      8
    388  1.1    jruoho 
    389  1.1    jruoho typedef struct aml_resource_memory24
    390  1.1    jruoho {
    391  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    392  1.1    jruoho     UINT8                           Flags;
    393  1.1    jruoho     UINT16                          Minimum;
    394  1.1    jruoho     UINT16                          Maximum;
    395  1.1    jruoho     UINT16                          Alignment;
    396  1.1    jruoho     UINT16                          AddressLength;
    397  1.1    jruoho 
    398  1.1    jruoho } AML_RESOURCE_MEMORY24;
    399  1.1    jruoho 
    400  1.1    jruoho 
    401  1.1    jruoho typedef struct aml_resource_vendor_large
    402  1.1    jruoho {
    403  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    404  1.1    jruoho 
    405  1.1    jruoho } AML_RESOURCE_VENDOR_LARGE;
    406  1.1    jruoho 
    407  1.1    jruoho 
    408  1.1    jruoho typedef struct aml_resource_memory32
    409  1.1    jruoho {
    410  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    411  1.1    jruoho     UINT8                           Flags;
    412  1.1    jruoho     UINT32                          Minimum;
    413  1.1    jruoho     UINT32                          Maximum;
    414  1.1    jruoho     UINT32                          Alignment;
    415  1.1    jruoho     UINT32                          AddressLength;
    416  1.1    jruoho 
    417  1.1    jruoho } AML_RESOURCE_MEMORY32;
    418  1.1    jruoho 
    419  1.1    jruoho 
    420  1.1    jruoho typedef struct aml_resource_fixed_memory32
    421  1.1    jruoho {
    422  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    423  1.1    jruoho     UINT8                           Flags;
    424  1.1    jruoho     UINT32                          Address;
    425  1.1    jruoho     UINT32                          AddressLength;
    426  1.1    jruoho 
    427  1.1    jruoho } AML_RESOURCE_FIXED_MEMORY32;
    428  1.1    jruoho 
    429  1.1    jruoho 
    430  1.1    jruoho #define AML_RESOURCE_ADDRESS_COMMON \
    431  1.1    jruoho     UINT8                           ResourceType; \
    432  1.1    jruoho     UINT8                           Flags; \
    433  1.1    jruoho     UINT8                           SpecificFlags;
    434  1.1    jruoho 
    435  1.1    jruoho 
    436  1.1    jruoho typedef struct aml_resource_address
    437  1.1    jruoho {
    438  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    439  1.1    jruoho     AML_RESOURCE_ADDRESS_COMMON
    440  1.1    jruoho 
    441  1.1    jruoho } AML_RESOURCE_ADDRESS;
    442  1.1    jruoho 
    443  1.1    jruoho 
    444  1.1    jruoho typedef struct aml_resource_extended_address64
    445  1.1    jruoho {
    446  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    447  1.1    jruoho     AML_RESOURCE_ADDRESS_COMMON
    448  1.1    jruoho     UINT8                           RevisionID;
    449  1.1    jruoho     UINT8                           Reserved;
    450  1.1    jruoho     UINT64                          Granularity;
    451  1.1    jruoho     UINT64                          Minimum;
    452  1.1    jruoho     UINT64                          Maximum;
    453  1.1    jruoho     UINT64                          TranslationOffset;
    454  1.1    jruoho     UINT64                          AddressLength;
    455  1.1    jruoho     UINT64                          TypeSpecific;
    456  1.1    jruoho 
    457  1.1    jruoho } AML_RESOURCE_EXTENDED_ADDRESS64;
    458  1.1    jruoho 
    459  1.1    jruoho #define AML_RESOURCE_EXTENDED_ADDRESS_REVISION          1       /* ACPI 3.0 */
    460  1.1    jruoho 
    461  1.1    jruoho 
    462  1.1    jruoho typedef struct aml_resource_address64
    463  1.1    jruoho {
    464  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    465  1.1    jruoho     AML_RESOURCE_ADDRESS_COMMON
    466  1.1    jruoho     UINT64                          Granularity;
    467  1.1    jruoho     UINT64                          Minimum;
    468  1.1    jruoho     UINT64                          Maximum;
    469  1.1    jruoho     UINT64                          TranslationOffset;
    470  1.1    jruoho     UINT64                          AddressLength;
    471  1.1    jruoho 
    472  1.1    jruoho } AML_RESOURCE_ADDRESS64;
    473  1.1    jruoho 
    474  1.1    jruoho 
    475  1.1    jruoho typedef struct aml_resource_address32
    476  1.1    jruoho {
    477  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    478  1.1    jruoho     AML_RESOURCE_ADDRESS_COMMON
    479  1.1    jruoho     UINT32                          Granularity;
    480  1.1    jruoho     UINT32                          Minimum;
    481  1.1    jruoho     UINT32                          Maximum;
    482  1.1    jruoho     UINT32                          TranslationOffset;
    483  1.1    jruoho     UINT32                          AddressLength;
    484  1.1    jruoho 
    485  1.1    jruoho } AML_RESOURCE_ADDRESS32;
    486  1.1    jruoho 
    487  1.1    jruoho 
    488  1.1    jruoho typedef struct aml_resource_address16
    489  1.1    jruoho {
    490  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    491  1.1    jruoho     AML_RESOURCE_ADDRESS_COMMON
    492  1.1    jruoho     UINT16                          Granularity;
    493  1.1    jruoho     UINT16                          Minimum;
    494  1.1    jruoho     UINT16                          Maximum;
    495  1.1    jruoho     UINT16                          TranslationOffset;
    496  1.1    jruoho     UINT16                          AddressLength;
    497  1.1    jruoho 
    498  1.1    jruoho } AML_RESOURCE_ADDRESS16;
    499  1.1    jruoho 
    500  1.1    jruoho 
    501  1.1    jruoho typedef struct aml_resource_extended_irq
    502  1.1    jruoho {
    503  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    504  1.1    jruoho     UINT8                           Flags;
    505  1.1    jruoho     UINT8                           InterruptCount;
    506  1.6  christos     union {
    507  1.6  christos         UINT32                      Interrupt;
    508  1.6  christos         ACPI_FLEX_ARRAY(UINT32,     Interrupts);
    509  1.6  christos     };
    510  1.1    jruoho     /* ResSourceIndex, ResSource optional fields follow */
    511  1.1    jruoho 
    512  1.1    jruoho } AML_RESOURCE_EXTENDED_IRQ;
    513  1.1    jruoho 
    514  1.1    jruoho 
    515  1.1    jruoho typedef struct aml_resource_generic_register
    516  1.1    jruoho {
    517  1.1    jruoho     AML_RESOURCE_LARGE_HEADER_COMMON
    518  1.1    jruoho     UINT8                           AddressSpaceId;
    519  1.1    jruoho     UINT8                           BitWidth;
    520  1.1    jruoho     UINT8                           BitOffset;
    521  1.1    jruoho     UINT8                           AccessSize; /* ACPI 3.0, was previously Reserved */
    522  1.1    jruoho     UINT64                          Address;
    523  1.1    jruoho 
    524  1.1    jruoho } AML_RESOURCE_GENERIC_REGISTER;
    525  1.1    jruoho 
    526  1.1    jruoho 
    527  1.2     kamil /* Common descriptor for GpioInt and GpioIo (ACPI 5.0) */
    528  1.2     kamil 
    529  1.2     kamil typedef struct aml_resource_gpio
    530  1.2     kamil {
    531  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    532  1.2     kamil     UINT8                           RevisionId;
    533  1.2     kamil     UINT8                           ConnectionType;
    534  1.2     kamil     UINT16                          Flags;
    535  1.2     kamil     UINT16                          IntFlags;
    536  1.2     kamil     UINT8                           PinConfig;
    537  1.2     kamil     UINT16                          DriveStrength;
    538  1.2     kamil     UINT16                          DebounceTimeout;
    539  1.2     kamil     UINT16                          PinTableOffset;
    540  1.2     kamil     UINT8                           ResSourceIndex;
    541  1.2     kamil     UINT16                          ResSourceOffset;
    542  1.2     kamil     UINT16                          VendorOffset;
    543  1.2     kamil     UINT16                          VendorLength;
    544  1.2     kamil     /*
    545  1.2     kamil      * Optional fields follow immediately:
    546  1.2     kamil      * 1) PIN list (Words)
    547  1.2     kamil      * 2) Resource Source String
    548  1.2     kamil      * 3) Vendor Data bytes
    549  1.2     kamil      */
    550  1.2     kamil 
    551  1.2     kamil } AML_RESOURCE_GPIO;
    552  1.2     kamil 
    553  1.2     kamil #define AML_RESOURCE_GPIO_REVISION              1       /* ACPI 5.0 */
    554  1.2     kamil 
    555  1.2     kamil /* Values for ConnectionType above */
    556  1.2     kamil 
    557  1.2     kamil #define AML_RESOURCE_GPIO_TYPE_INT              0
    558  1.2     kamil #define AML_RESOURCE_GPIO_TYPE_IO               1
    559  1.2     kamil #define AML_RESOURCE_MAX_GPIOTYPE               1
    560  1.2     kamil 
    561  1.2     kamil 
    562  1.2     kamil /* Common preamble for all serial descriptors (ACPI 5.0) */
    563  1.2     kamil 
    564  1.2     kamil #define AML_RESOURCE_SERIAL_COMMON \
    565  1.2     kamil     UINT8                           RevisionId; \
    566  1.2     kamil     UINT8                           ResSourceIndex; \
    567  1.2     kamil     UINT8                           Type; \
    568  1.2     kamil     UINT8                           Flags; \
    569  1.2     kamil     UINT16                          TypeSpecificFlags; \
    570  1.2     kamil     UINT8                           TypeRevisionId; \
    571  1.2     kamil     UINT16                          TypeDataLength; \
    572  1.2     kamil 
    573  1.2     kamil /* Values for the type field above */
    574  1.2     kamil 
    575  1.2     kamil #define AML_RESOURCE_I2C_SERIALBUSTYPE          1
    576  1.2     kamil #define AML_RESOURCE_SPI_SERIALBUSTYPE          2
    577  1.2     kamil #define AML_RESOURCE_UART_SERIALBUSTYPE         3
    578  1.4  christos #define AML_RESOURCE_CSI2_SERIALBUSTYPE         4
    579  1.4  christos #define AML_RESOURCE_MAX_SERIALBUSTYPE          4
    580  1.2     kamil #define AML_RESOURCE_VENDOR_SERIALBUSTYPE       192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */
    581  1.2     kamil 
    582  1.2     kamil typedef struct aml_resource_common_serialbus
    583  1.2     kamil {
    584  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    585  1.2     kamil     AML_RESOURCE_SERIAL_COMMON
    586  1.2     kamil 
    587  1.2     kamil } AML_RESOURCE_COMMON_SERIALBUS;
    588  1.2     kamil 
    589  1.4  christos 
    590  1.4  christos typedef struct aml_resource_csi2_serialbus
    591  1.4  christos {
    592  1.4  christos     AML_RESOURCE_LARGE_HEADER_COMMON
    593  1.4  christos     AML_RESOURCE_SERIAL_COMMON
    594  1.4  christos 
    595  1.4  christos     /*
    596  1.4  christos      * Optional fields follow immediately:
    597  1.4  christos      * 1) Vendor Data bytes
    598  1.4  christos      * 2) Resource Source String
    599  1.4  christos      */
    600  1.4  christos 
    601  1.4  christos } AML_RESOURCE_CSI2_SERIALBUS;
    602  1.4  christos 
    603  1.4  christos #define AML_RESOURCE_CSI2_REVISION              1       /* ACPI 6.4 */
    604  1.4  christos #define AML_RESOURCE_CSI2_TYPE_REVISION         1       /* ACPI 6.4 */
    605  1.4  christos #define AML_RESOURCE_CSI2_MIN_DATA_LEN          0       /* ACPI 6.4 */
    606  1.4  christos 
    607  1.2     kamil typedef struct aml_resource_i2c_serialbus
    608  1.2     kamil {
    609  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    610  1.2     kamil     AML_RESOURCE_SERIAL_COMMON
    611  1.2     kamil     UINT32                          ConnectionSpeed;
    612  1.2     kamil     UINT16                          SlaveAddress;
    613  1.2     kamil     /*
    614  1.2     kamil      * Optional fields follow immediately:
    615  1.2     kamil      * 1) Vendor Data bytes
    616  1.2     kamil      * 2) Resource Source String
    617  1.2     kamil      */
    618  1.2     kamil 
    619  1.2     kamil } AML_RESOURCE_I2C_SERIALBUS;
    620  1.2     kamil 
    621  1.2     kamil #define AML_RESOURCE_I2C_REVISION               1       /* ACPI 5.0 */
    622  1.2     kamil #define AML_RESOURCE_I2C_TYPE_REVISION          1       /* ACPI 5.0 */
    623  1.2     kamil #define AML_RESOURCE_I2C_MIN_DATA_LEN           6
    624  1.2     kamil 
    625  1.2     kamil typedef struct aml_resource_spi_serialbus
    626  1.2     kamil {
    627  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    628  1.2     kamil     AML_RESOURCE_SERIAL_COMMON
    629  1.2     kamil     UINT32                          ConnectionSpeed;
    630  1.2     kamil     UINT8                           DataBitLength;
    631  1.2     kamil     UINT8                           ClockPhase;
    632  1.2     kamil     UINT8                           ClockPolarity;
    633  1.2     kamil     UINT16                          DeviceSelection;
    634  1.2     kamil     /*
    635  1.2     kamil      * Optional fields follow immediately:
    636  1.2     kamil      * 1) Vendor Data bytes
    637  1.2     kamil      * 2) Resource Source String
    638  1.2     kamil      */
    639  1.2     kamil 
    640  1.2     kamil } AML_RESOURCE_SPI_SERIALBUS;
    641  1.2     kamil 
    642  1.2     kamil #define AML_RESOURCE_SPI_REVISION               1       /* ACPI 5.0 */
    643  1.2     kamil #define AML_RESOURCE_SPI_TYPE_REVISION          1       /* ACPI 5.0 */
    644  1.2     kamil #define AML_RESOURCE_SPI_MIN_DATA_LEN           9
    645  1.2     kamil 
    646  1.2     kamil typedef struct aml_resource_uart_serialbus
    647  1.2     kamil {
    648  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    649  1.2     kamil     AML_RESOURCE_SERIAL_COMMON
    650  1.2     kamil     UINT32                          DefaultBaudRate;
    651  1.2     kamil     UINT16                          RxFifoSize;
    652  1.2     kamil     UINT16                          TxFifoSize;
    653  1.2     kamil     UINT8                           Parity;
    654  1.2     kamil     UINT8                           LinesEnabled;
    655  1.2     kamil     /*
    656  1.2     kamil      * Optional fields follow immediately:
    657  1.2     kamil      * 1) Vendor Data bytes
    658  1.2     kamil      * 2) Resource Source String
    659  1.2     kamil      */
    660  1.2     kamil 
    661  1.2     kamil } AML_RESOURCE_UART_SERIALBUS;
    662  1.2     kamil 
    663  1.2     kamil #define AML_RESOURCE_UART_REVISION              1       /* ACPI 5.0 */
    664  1.2     kamil #define AML_RESOURCE_UART_TYPE_REVISION         1       /* ACPI 5.0 */
    665  1.2     kamil #define AML_RESOURCE_UART_MIN_DATA_LEN          10
    666  1.2     kamil 
    667  1.2     kamil typedef struct aml_resource_pin_function
    668  1.2     kamil {
    669  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    670  1.2     kamil     UINT8                           RevisionId;
    671  1.2     kamil     UINT16                          Flags;
    672  1.2     kamil     UINT8                           PinConfig;
    673  1.2     kamil     UINT16                          FunctionNumber;
    674  1.2     kamil     UINT16                          PinTableOffset;
    675  1.2     kamil     UINT8                           ResSourceIndex;
    676  1.2     kamil     UINT16                          ResSourceOffset;
    677  1.2     kamil     UINT16                          VendorOffset;
    678  1.2     kamil     UINT16                          VendorLength;
    679  1.2     kamil     /*
    680  1.2     kamil      * Optional fields follow immediately:
    681  1.2     kamil      * 1) PIN list (Words)
    682  1.2     kamil      * 2) Resource Source String
    683  1.2     kamil      * 3) Vendor Data bytes
    684  1.2     kamil      */
    685  1.2     kamil 
    686  1.2     kamil } AML_RESOURCE_PIN_FUNCTION;
    687  1.2     kamil 
    688  1.2     kamil #define AML_RESOURCE_PIN_FUNCTION_REVISION      1       /* ACPI 6.2 */
    689  1.2     kamil 
    690  1.2     kamil typedef struct aml_resource_pin_config
    691  1.2     kamil {
    692  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    693  1.2     kamil     UINT8                           RevisionId;
    694  1.2     kamil     UINT16                          Flags;
    695  1.2     kamil     UINT8                           PinConfigType;
    696  1.2     kamil     UINT32                          PinConfigValue;
    697  1.2     kamil     UINT16                          PinTableOffset;
    698  1.2     kamil     UINT8                           ResSourceIndex;
    699  1.2     kamil     UINT16                          ResSourceOffset;
    700  1.2     kamil     UINT16                          VendorOffset;
    701  1.2     kamil     UINT16                          VendorLength;
    702  1.2     kamil     /*
    703  1.2     kamil      * Optional fields follow immediately:
    704  1.2     kamil      * 1) PIN list (Words)
    705  1.2     kamil      * 2) Resource Source String
    706  1.2     kamil      * 3) Vendor Data bytes
    707  1.2     kamil      */
    708  1.2     kamil 
    709  1.2     kamil } AML_RESOURCE_PIN_CONFIG;
    710  1.2     kamil 
    711  1.6  christos #define AML_RESOURCE_CLOCK_INPUT_REVISION      1       /* ACPI 6.5 */
    712  1.6  christos 
    713  1.6  christos typedef struct aml_resource_clock_input
    714  1.6  christos {
    715  1.6  christos     AML_RESOURCE_LARGE_HEADER_COMMON
    716  1.6  christos     UINT8                           RevisionId;
    717  1.6  christos     UINT16                          Flags;
    718  1.6  christos     UINT16                          FrequencyDivisor;
    719  1.6  christos     UINT32                          FrequencyNumerator;
    720  1.6  christos     /*
    721  1.6  christos      * Optional fields follow immediately:
    722  1.6  christos      * 1) Resource Source index
    723  1.6  christos      * 2) Resource Source String
    724  1.6  christos      */
    725  1.6  christos } AML_RESOURCE_CLOCK_INPUT;
    726  1.6  christos 
    727  1.6  christos 
    728  1.2     kamil #define AML_RESOURCE_PIN_CONFIG_REVISION      1       /* ACPI 6.2 */
    729  1.2     kamil 
    730  1.2     kamil typedef struct aml_resource_pin_group
    731  1.2     kamil {
    732  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    733  1.2     kamil     UINT8                           RevisionId;
    734  1.2     kamil     UINT16                          Flags;
    735  1.2     kamil     UINT16                          PinTableOffset;
    736  1.2     kamil     UINT16                          LabelOffset;
    737  1.2     kamil     UINT16                          VendorOffset;
    738  1.2     kamil     UINT16                          VendorLength;
    739  1.2     kamil     /*
    740  1.2     kamil      * Optional fields follow immediately:
    741  1.2     kamil      * 1) PIN list (Words)
    742  1.2     kamil      * 2) Resource Label String
    743  1.2     kamil      * 3) Vendor Data bytes
    744  1.2     kamil      */
    745  1.2     kamil 
    746  1.2     kamil } AML_RESOURCE_PIN_GROUP;
    747  1.2     kamil 
    748  1.2     kamil #define AML_RESOURCE_PIN_GROUP_REVISION      1       /* ACPI 6.2 */
    749  1.2     kamil 
    750  1.2     kamil typedef struct aml_resource_pin_group_function
    751  1.2     kamil {
    752  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    753  1.2     kamil     UINT8                           RevisionId;
    754  1.2     kamil     UINT16                          Flags;
    755  1.2     kamil     UINT16                          FunctionNumber;
    756  1.2     kamil     UINT8                           ResSourceIndex;
    757  1.2     kamil     UINT16                          ResSourceOffset;
    758  1.2     kamil     UINT16                          ResSourceLabelOffset;
    759  1.2     kamil     UINT16                          VendorOffset;
    760  1.2     kamil     UINT16                          VendorLength;
    761  1.2     kamil     /*
    762  1.2     kamil      * Optional fields follow immediately:
    763  1.2     kamil      * 1) Resource Source String
    764  1.2     kamil      * 2) Resource Source Label String
    765  1.2     kamil      * 3) Vendor Data bytes
    766  1.2     kamil      */
    767  1.2     kamil 
    768  1.2     kamil } AML_RESOURCE_PIN_GROUP_FUNCTION;
    769  1.2     kamil 
    770  1.2     kamil #define AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION    1       /* ACPI 6.2 */
    771  1.2     kamil 
    772  1.2     kamil typedef struct aml_resource_pin_group_config
    773  1.2     kamil {
    774  1.2     kamil     AML_RESOURCE_LARGE_HEADER_COMMON
    775  1.2     kamil     UINT8                           RevisionId;
    776  1.2     kamil     UINT16                          Flags;
    777  1.2     kamil     UINT8                           PinConfigType;
    778  1.2     kamil     UINT32                          PinConfigValue;
    779  1.2     kamil     UINT8                           ResSourceIndex;
    780  1.2     kamil     UINT16                          ResSourceOffset;
    781  1.2     kamil     UINT16                          ResSourceLabelOffset;
    782  1.2     kamil     UINT16                          VendorOffset;
    783  1.2     kamil     UINT16                          VendorLength;
    784  1.2     kamil     /*
    785  1.2     kamil      * Optional fields follow immediately:
    786  1.2     kamil      * 1) Resource Source String
    787  1.2     kamil      * 2) Resource Source Label String
    788  1.2     kamil      * 3) Vendor Data bytes
    789  1.2     kamil      */
    790  1.2     kamil 
    791  1.2     kamil } AML_RESOURCE_PIN_GROUP_CONFIG;
    792  1.2     kamil 
    793  1.2     kamil #define AML_RESOURCE_PIN_GROUP_CONFIG_REVISION    1       /* ACPI 6.2 */
    794  1.1    jruoho 
    795  1.7  christos /* restore default alignment */
    796  1.7  christos 
    797  1.7  christos #pragma pack()
    798  1.7  christos 
    799  1.1    jruoho /* Union of all resource descriptors, so we can allocate the worst case */
    800  1.1    jruoho 
    801  1.1    jruoho typedef union aml_resource
    802  1.1    jruoho {
    803  1.1    jruoho     /* Descriptor headers */
    804  1.1    jruoho 
    805  1.1    jruoho     UINT8                                   DescriptorType;
    806  1.1    jruoho     AML_RESOURCE_SMALL_HEADER               SmallHeader;
    807  1.1    jruoho     AML_RESOURCE_LARGE_HEADER               LargeHeader;
    808  1.1    jruoho 
    809  1.1    jruoho     /* Small resource descriptors */
    810  1.1    jruoho 
    811  1.1    jruoho     AML_RESOURCE_IRQ                        Irq;
    812  1.1    jruoho     AML_RESOURCE_DMA                        Dma;
    813  1.1    jruoho     AML_RESOURCE_START_DEPENDENT            StartDpf;
    814  1.1    jruoho     AML_RESOURCE_END_DEPENDENT              EndDpf;
    815  1.1    jruoho     AML_RESOURCE_IO                         Io;
    816  1.1    jruoho     AML_RESOURCE_FIXED_IO                   FixedIo;
    817  1.2     kamil     AML_RESOURCE_FIXED_DMA                  FixedDma;
    818  1.1    jruoho     AML_RESOURCE_VENDOR_SMALL               VendorSmall;
    819  1.1    jruoho     AML_RESOURCE_END_TAG                    EndTag;
    820  1.1    jruoho 
    821  1.1    jruoho     /* Large resource descriptors */
    822  1.1    jruoho 
    823  1.1    jruoho     AML_RESOURCE_MEMORY24                   Memory24;
    824  1.1    jruoho     AML_RESOURCE_GENERIC_REGISTER           GenericReg;
    825  1.1    jruoho     AML_RESOURCE_VENDOR_LARGE               VendorLarge;
    826  1.1    jruoho     AML_RESOURCE_MEMORY32                   Memory32;
    827  1.1    jruoho     AML_RESOURCE_FIXED_MEMORY32             FixedMemory32;
    828  1.1    jruoho     AML_RESOURCE_ADDRESS16                  Address16;
    829  1.1    jruoho     AML_RESOURCE_ADDRESS32                  Address32;
    830  1.1    jruoho     AML_RESOURCE_ADDRESS64                  Address64;
    831  1.1    jruoho     AML_RESOURCE_EXTENDED_ADDRESS64         ExtAddress64;
    832  1.1    jruoho     AML_RESOURCE_EXTENDED_IRQ               ExtendedIrq;
    833  1.2     kamil     AML_RESOURCE_GPIO                       Gpio;
    834  1.2     kamil     AML_RESOURCE_I2C_SERIALBUS              I2cSerialBus;
    835  1.2     kamil     AML_RESOURCE_SPI_SERIALBUS              SpiSerialBus;
    836  1.2     kamil     AML_RESOURCE_UART_SERIALBUS             UartSerialBus;
    837  1.4  christos     AML_RESOURCE_CSI2_SERIALBUS             Csi2SerialBus;
    838  1.2     kamil     AML_RESOURCE_COMMON_SERIALBUS           CommonSerialBus;
    839  1.2     kamil     AML_RESOURCE_PIN_FUNCTION               PinFunction;
    840  1.2     kamil     AML_RESOURCE_PIN_CONFIG                 PinConfig;
    841  1.2     kamil     AML_RESOURCE_PIN_GROUP                  PinGroup;
    842  1.2     kamil     AML_RESOURCE_PIN_GROUP_FUNCTION         PinGroupFunction;
    843  1.2     kamil     AML_RESOURCE_PIN_GROUP_CONFIG           PinGroupConfig;
    844  1.6  christos     AML_RESOURCE_CLOCK_INPUT                ClockInput;
    845  1.1    jruoho 
    846  1.1    jruoho     /* Utility overlays */
    847  1.1    jruoho 
    848  1.1    jruoho     AML_RESOURCE_ADDRESS                    Address;
    849  1.1    jruoho     UINT32                                  DwordItem;
    850  1.1    jruoho     UINT16                                  WordItem;
    851  1.1    jruoho     UINT8                                   ByteItem;
    852  1.1    jruoho 
    853  1.1    jruoho } AML_RESOURCE;
    854  1.1    jruoho 
    855  1.2     kamil /* Interfaces used by both the disassembler and compiler */
    856  1.2     kamil 
    857  1.2     kamil void
    858  1.2     kamil MpSaveGpioInfo (
    859  1.2     kamil     ACPI_PARSE_OBJECT       *Op,
    860  1.2     kamil     AML_RESOURCE            *Resource,
    861  1.2     kamil     UINT32                  PinCount,
    862  1.2     kamil     UINT16                  *PinList,
    863  1.2     kamil     char                    *DeviceName);
    864  1.2     kamil 
    865  1.2     kamil void
    866  1.2     kamil MpSaveSerialInfo (
    867  1.2     kamil     ACPI_PARSE_OBJECT       *Op,
    868  1.2     kamil     AML_RESOURCE            *Resource,
    869  1.2     kamil     char                    *DeviceName);
    870  1.2     kamil 
    871  1.2     kamil char *
    872  1.2     kamil MpGetHidFromParseTree (
    873  1.2     kamil     ACPI_NAMESPACE_NODE     *HidNode);
    874  1.2     kamil 
    875  1.2     kamil char *
    876  1.2     kamil MpGetHidViaNamestring (
    877  1.2     kamil     char                    *DeviceName);
    878  1.2     kamil 
    879  1.2     kamil char *
    880  1.2     kamil MpGetConnectionInfo (
    881  1.2     kamil     ACPI_PARSE_OBJECT       *Op,
    882  1.2     kamil     UINT32                  PinIndex,
    883  1.2     kamil     ACPI_NAMESPACE_NODE     **TargetNode,
    884  1.2     kamil     char                    **TargetName);
    885  1.2     kamil 
    886  1.2     kamil char *
    887  1.2     kamil MpGetParentDeviceHid (
    888  1.2     kamil     ACPI_PARSE_OBJECT       *Op,
    889  1.2     kamil     ACPI_NAMESPACE_NODE     **TargetNode,
    890  1.2     kamil     char                    **ParentDeviceName);
    891  1.2     kamil 
    892  1.2     kamil char *
    893  1.2     kamil MpGetDdnValue (
    894  1.2     kamil     char                    *DeviceName);
    895  1.2     kamil 
    896  1.2     kamil char *
    897  1.2     kamil MpGetHidValue (
    898  1.2     kamil     ACPI_NAMESPACE_NODE     *DeviceNode);
    899  1.2     kamil 
    900  1.1    jruoho #endif
    901