Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:42

0001 /******************************************************************************
0002  *
0003  * Name: acrestyp.h - Defines, types, and structures for resource descriptors
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights. You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025  * make derivatives, distribute, use and display any portion of the Covered
0026  * Code in any form, with the right to sublicense such rights; and
0027  *
0028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0029  * license (with the right to sublicense), under only those claims of Intel
0030  * patents that are infringed by the Original Intel Code, to make, use, sell,
0031  * offer to sell, and import the Covered Code and derivative works thereof
0032  * solely to the minimum extent necessary to exercise the above copyright
0033  * license, and in no event shall the patent license extend to any additions
0034  * to or modifications of the Original Intel Code. No other license or right
0035  * is granted directly or by implication, estoppel or otherwise;
0036  *
0037  * The above copyright and patent license is granted only if the following
0038  * conditions are met:
0039  *
0040  * 3. Conditions
0041  *
0042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0043  * Redistribution of source code of any substantial portion of the Covered
0044  * Code or modification with rights to further distribute source must include
0045  * the above Copyright Notice, the above License, this list of Conditions,
0046  * and the following Disclaimer and Export Compliance provision. In addition,
0047  * Licensee must cause all Covered Code to which Licensee contributes to
0048  * contain a file documenting the changes Licensee made to create that Covered
0049  * Code and the date of any change. Licensee must include in that file the
0050  * documentation of any changes made by any predecessor Licensee. Licensee
0051  * must include a prominent statement that the modification is derived,
0052  * directly or indirectly, from Original Intel Code.
0053  *
0054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0055  * Redistribution of source code of any substantial portion of the Covered
0056  * Code or modification without rights to further distribute source must
0057  * include the following Disclaimer and Export Compliance provision in the
0058  * documentation and/or other materials provided with distribution. In
0059  * addition, Licensee may not authorize further sublicense of source of any
0060  * portion of the Covered Code, and must include terms to the effect that the
0061  * license from Licensee to its licensee is limited to the intellectual
0062  * property embodied in the software Licensee provides to its licensee, and
0063  * not to intellectual property embodied in modifications its licensee may
0064  * make.
0065  *
0066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0067  * substantial portion of the Covered Code or modification must reproduce the
0068  * above Copyright Notice, and the following Disclaimer and Export Compliance
0069  * provision in the documentation and/or other materials provided with the
0070  * distribution.
0071  *
0072  * 3.4. Intel retains all right, title, and interest in and to the Original
0073  * Intel Code.
0074  *
0075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0076  * Intel shall be used in advertising or otherwise to promote the sale, use or
0077  * other dealings in products derived from or relating to the Covered Code
0078  * without prior written authorization from Intel.
0079  *
0080  * 4. Disclaimer and Export Compliance
0081  *
0082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0083  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
0085  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
0086  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
0087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0088  * PARTICULAR PURPOSE.
0089  *
0090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
0096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0097  * LIMITED REMEDY.
0098  *
0099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0100  * software or system incorporating such software without first obtaining any
0101  * required license or other approval from the U. S. Department of Commerce or
0102  * any other agency or department of the United States Government. In the
0103  * event Licensee exports any such software from the United States or
0104  * re-exports any such software from a foreign destination, Licensee shall
0105  * ensure that the distribution and export/re-export of the software is in
0106  * compliance with all laws, regulations, orders, or other restrictions of the
0107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0108  * any of its subsidiaries will export/re-export any technical data, process,
0109  * software, or service, directly or indirectly, to any country for which the
0110  * United States government or any agency thereof requires an export license,
0111  * other governmental approval, or letter of assurance, without first obtaining
0112  * such license, approval or letter.
0113  *
0114  *****************************************************************************
0115  *
0116  * Alternatively, you may choose to be licensed under the terms of the
0117  * following license:
0118  *
0119  * Redistribution and use in source and binary forms, with or without
0120  * modification, are permitted provided that the following conditions
0121  * are met:
0122  * 1. Redistributions of source code must retain the above copyright
0123  *    notice, this list of conditions, and the following disclaimer,
0124  *    without modification.
0125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
0126  *    substantially similar to the "NO WARRANTY" disclaimer below
0127  *    ("Disclaimer") and any redistribution must be conditioned upon
0128  *    including a substantially similar Disclaimer requirement for further
0129  *    binary redistribution.
0130  * 3. Neither the names of the above-listed copyright holders nor the names
0131  *    of any contributors may be used to endorse or promote products derived
0132  *    from this software without specific prior written permission.
0133  *
0134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0145  *
0146  * Alternatively, you may choose to be licensed under the terms of the
0147  * GNU General Public License ("GPL") version 2 as published by the Free
0148  * Software Foundation.
0149  *
0150  *****************************************************************************/
0151 
0152 #ifndef __ACRESTYP_H__
0153 #define __ACRESTYP_H__
0154 
0155 
0156 /*
0157  * Definitions for Resource Attributes
0158  */
0159 typedef UINT16                          ACPI_RS_LENGTH;    /* Resource Length field is fixed at 16 bits */
0160 typedef UINT32                          ACPI_RSDESC_SIZE;  /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */
0161 
0162 /*
0163  * Memory Attributes
0164  */
0165 #define ACPI_READ_ONLY_MEMORY           (UINT8) 0x00
0166 #define ACPI_READ_WRITE_MEMORY          (UINT8) 0x01
0167 
0168 #define ACPI_NON_CACHEABLE_MEMORY       (UINT8) 0x00
0169 #define ACPI_CACHABLE_MEMORY            (UINT8) 0x01
0170 #define ACPI_WRITE_COMBINING_MEMORY     (UINT8) 0x02
0171 #define ACPI_PREFETCHABLE_MEMORY        (UINT8) 0x03
0172 
0173 /*! [Begin] no source code translation */
0174 /*
0175  * IO Attributes
0176  * The ISA IO ranges are:     n000-n0FFh,  n400-n4FFh, n800-n8FFh, nC00-nCFFh.
0177  * The non-ISA IO ranges are: n100-n3FFh,  n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
0178  */
0179 /*! [End] no source code translation !*/
0180 
0181 #define ACPI_NON_ISA_ONLY_RANGES        (UINT8) 0x01
0182 #define ACPI_ISA_ONLY_RANGES            (UINT8) 0x02
0183 #define ACPI_ENTIRE_RANGE               (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
0184 
0185 /* Type of translation - 1=Sparse, 0=Dense */
0186 
0187 #define ACPI_SPARSE_TRANSLATION         (UINT8) 0x01
0188 
0189 /*
0190  * IO Port Descriptor Decode
0191  */
0192 #define ACPI_DECODE_10                  (UINT8) 0x00    /* 10-bit IO address decode */
0193 #define ACPI_DECODE_16                  (UINT8) 0x01    /* 16-bit IO address decode */
0194 
0195 /*
0196  * Interrupt attributes - used in multiple descriptors
0197  */
0198 
0199 /* Triggering */
0200 
0201 #define ACPI_LEVEL_SENSITIVE            (UINT8) 0x00
0202 #define ACPI_EDGE_SENSITIVE             (UINT8) 0x01
0203 
0204 /* Polarity */
0205 
0206 #define ACPI_ACTIVE_HIGH                (UINT8) 0x00
0207 #define ACPI_ACTIVE_LOW                 (UINT8) 0x01
0208 #define ACPI_ACTIVE_BOTH                (UINT8) 0x02
0209 
0210 /* Sharing */
0211 
0212 #define ACPI_EXCLUSIVE                  (UINT8) 0x00
0213 #define ACPI_SHARED                     (UINT8) 0x01
0214 
0215 /* Wake */
0216 
0217 #define ACPI_NOT_WAKE_CAPABLE           (UINT8) 0x00
0218 #define ACPI_WAKE_CAPABLE               (UINT8) 0x01
0219 
0220 /*
0221  * DMA Attributes
0222  */
0223 #define ACPI_COMPATIBILITY              (UINT8) 0x00
0224 #define ACPI_TYPE_A                     (UINT8) 0x01
0225 #define ACPI_TYPE_B                     (UINT8) 0x02
0226 #define ACPI_TYPE_F                     (UINT8) 0x03
0227 
0228 #define ACPI_NOT_BUS_MASTER             (UINT8) 0x00
0229 #define ACPI_BUS_MASTER                 (UINT8) 0x01
0230 
0231 #define ACPI_TRANSFER_8                 (UINT8) 0x00
0232 #define ACPI_TRANSFER_8_16              (UINT8) 0x01
0233 #define ACPI_TRANSFER_16                (UINT8) 0x02
0234 
0235 /*
0236  * Start Dependent Functions Priority definitions
0237  */
0238 #define ACPI_GOOD_CONFIGURATION         (UINT8) 0x00
0239 #define ACPI_ACCEPTABLE_CONFIGURATION   (UINT8) 0x01
0240 #define ACPI_SUB_OPTIMAL_CONFIGURATION  (UINT8) 0x02
0241 
0242 /*
0243  * 16, 32 and 64-bit Address Descriptor resource types
0244  */
0245 #define ACPI_MEMORY_RANGE               (UINT8) 0x00
0246 #define ACPI_IO_RANGE                   (UINT8) 0x01
0247 #define ACPI_BUS_NUMBER_RANGE           (UINT8) 0x02
0248 
0249 #define ACPI_ADDRESS_NOT_FIXED          (UINT8) 0x00
0250 #define ACPI_ADDRESS_FIXED              (UINT8) 0x01
0251 
0252 #define ACPI_POS_DECODE                 (UINT8) 0x00
0253 #define ACPI_SUB_DECODE                 (UINT8) 0x01
0254 
0255 /* Producer/Consumer */
0256 
0257 #define ACPI_PRODUCER                   (UINT8) 0x00
0258 #define ACPI_CONSUMER                   (UINT8) 0x01
0259 
0260 
0261 /*
0262  * If possible, pack the following structures to byte alignment
0263  */
0264 #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
0265 #pragma pack(1)
0266 #endif
0267 
0268 /* UUID data structures for use in vendor-defined resource descriptors */
0269 
0270 typedef struct acpi_uuid
0271 {
0272     UINT8                           Data[ACPI_UUID_LENGTH];
0273 } ACPI_UUID;
0274 
0275 typedef struct acpi_vendor_uuid
0276 {
0277     UINT8                           Subtype;
0278     UINT8                           Data[ACPI_UUID_LENGTH];
0279 
0280 } ACPI_VENDOR_UUID;
0281 
0282 /*
0283  * Structures used to describe device resources
0284  */
0285 typedef struct acpi_resource_irq
0286 {
0287     UINT8                           DescriptorLength;
0288     UINT8                           Triggering;
0289     UINT8                           Polarity;
0290     UINT8                           Shareable;
0291     UINT8                           WakeCapable;
0292     UINT8                           InterruptCount;
0293     union {
0294         UINT8                       Interrupt;
0295         ACPI_FLEX_ARRAY(UINT8,      Interrupts);
0296     };
0297 
0298 } ACPI_RESOURCE_IRQ;
0299 
0300 typedef struct acpi_resource_dma
0301 {
0302     UINT8                           Type;
0303     UINT8                           BusMaster;
0304     UINT8                           Transfer;
0305     UINT8                           ChannelCount;
0306     union {
0307         UINT8                       Channel;
0308         ACPI_FLEX_ARRAY(UINT8,      Channels);
0309     };
0310 
0311 } ACPI_RESOURCE_DMA;
0312 
0313 typedef struct acpi_resource_start_dependent
0314 {
0315     UINT8                           DescriptorLength;
0316     UINT8                           CompatibilityPriority;
0317     UINT8                           PerformanceRobustness;
0318 
0319 } ACPI_RESOURCE_START_DEPENDENT;
0320 
0321 
0322 /*
0323  * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
0324  * needed because it has no fields
0325  */
0326 
0327 
0328 typedef struct acpi_resource_io
0329 {
0330     UINT8                           IoDecode;
0331     UINT8                           Alignment;
0332     UINT8                           AddressLength;
0333     UINT16                          Minimum;
0334     UINT16                          Maximum;
0335 
0336 } ACPI_RESOURCE_IO;
0337 
0338 typedef struct acpi_resource_fixed_io
0339 {
0340     UINT16                          Address;
0341     UINT8                           AddressLength;
0342 
0343 } ACPI_RESOURCE_FIXED_IO;
0344 
0345 typedef struct acpi_resource_fixed_dma
0346 {
0347     UINT16                          RequestLines;
0348     UINT16                          Channels;
0349     UINT8                           Width;
0350 
0351 } ACPI_RESOURCE_FIXED_DMA;
0352 
0353 /* Values for Width field above */
0354 
0355 #define ACPI_DMA_WIDTH8                         0
0356 #define ACPI_DMA_WIDTH16                        1
0357 #define ACPI_DMA_WIDTH32                        2
0358 #define ACPI_DMA_WIDTH64                        3
0359 #define ACPI_DMA_WIDTH128                       4
0360 #define ACPI_DMA_WIDTH256                       5
0361 
0362 
0363 typedef struct acpi_resource_vendor
0364 {
0365     UINT16                          ByteLength;
0366     UINT8                           ByteData[];
0367 
0368 } ACPI_RESOURCE_VENDOR;
0369 
0370 /* Vendor resource with UUID info (introduced in ACPI 3.0) */
0371 
0372 typedef struct acpi_resource_vendor_typed
0373 {
0374     UINT16                          ByteLength;
0375     UINT8                           UuidSubtype;
0376     UINT8                           Uuid[ACPI_UUID_LENGTH];
0377     UINT8                           ByteData[];
0378 
0379 } ACPI_RESOURCE_VENDOR_TYPED;
0380 
0381 typedef struct acpi_resource_end_tag
0382 {
0383     UINT8                           Checksum;
0384 
0385 } ACPI_RESOURCE_END_TAG;
0386 
0387 typedef struct acpi_resource_memory24
0388 {
0389     UINT8                           WriteProtect;
0390     UINT16                          Minimum;
0391     UINT16                          Maximum;
0392     UINT16                          Alignment;
0393     UINT16                          AddressLength;
0394 
0395 } ACPI_RESOURCE_MEMORY24;
0396 
0397 typedef struct acpi_resource_memory32
0398 {
0399     UINT8                           WriteProtect;
0400     UINT32                          Minimum;
0401     UINT32                          Maximum;
0402     UINT32                          Alignment;
0403     UINT32                          AddressLength;
0404 
0405 } ACPI_RESOURCE_MEMORY32;
0406 
0407 typedef struct acpi_resource_fixed_memory32
0408 {
0409     UINT8                           WriteProtect;
0410     UINT32                          Address;
0411     UINT32                          AddressLength;
0412 
0413 } ACPI_RESOURCE_FIXED_MEMORY32;
0414 
0415 typedef struct acpi_memory_attribute
0416 {
0417     UINT8                           WriteProtect;
0418     UINT8                           Caching;
0419     UINT8                           RangeType;
0420     UINT8                           Translation;
0421 
0422 } ACPI_MEMORY_ATTRIBUTE;
0423 
0424 typedef struct acpi_io_attribute
0425 {
0426     UINT8                           RangeType;
0427     UINT8                           Translation;
0428     UINT8                           TranslationType;
0429     UINT8                           Reserved1;
0430 
0431 } ACPI_IO_ATTRIBUTE;
0432 
0433 typedef union acpi_resource_attribute
0434 {
0435     ACPI_MEMORY_ATTRIBUTE           Mem;
0436     ACPI_IO_ATTRIBUTE               Io;
0437 
0438     /* Used for the *WordSpace macros */
0439 
0440     UINT8                           TypeSpecific;
0441 
0442 } ACPI_RESOURCE_ATTRIBUTE;
0443 
0444 typedef struct acpi_resource_label
0445 {
0446     UINT16                          StringLength;
0447     char                            *StringPtr;
0448 
0449 } ACPI_RESOURCE_LABEL;
0450 
0451 typedef struct acpi_resource_source
0452 {
0453     UINT8                           Index;
0454     UINT16                          StringLength;
0455     char                            *StringPtr;
0456 
0457 } ACPI_RESOURCE_SOURCE;
0458 
0459 /* Fields common to all address descriptors, 16/32/64 bit */
0460 
0461 #define ACPI_RESOURCE_ADDRESS_COMMON \
0462     UINT8                           ResourceType; \
0463     UINT8                           ProducerConsumer; \
0464     UINT8                           Decode; \
0465     UINT8                           MinAddressFixed; \
0466     UINT8                           MaxAddressFixed; \
0467     ACPI_RESOURCE_ATTRIBUTE         Info;
0468 
0469 typedef struct acpi_address16_attribute
0470 {
0471     UINT16                          Granularity;
0472     UINT16                          Minimum;
0473     UINT16                          Maximum;
0474     UINT16                          TranslationOffset;
0475     UINT16                          AddressLength;
0476 
0477 } ACPI_ADDRESS16_ATTRIBUTE;
0478 
0479 typedef struct acpi_address32_attribute
0480 {
0481     UINT32                          Granularity;
0482     UINT32                          Minimum;
0483     UINT32                          Maximum;
0484     UINT32                          TranslationOffset;
0485     UINT32                          AddressLength;
0486 
0487 } ACPI_ADDRESS32_ATTRIBUTE;
0488 
0489 typedef struct acpi_address64_attribute
0490 {
0491     UINT64                          Granularity;
0492     UINT64                          Minimum;
0493     UINT64                          Maximum;
0494     UINT64                          TranslationOffset;
0495     UINT64                          AddressLength;
0496 
0497 } ACPI_ADDRESS64_ATTRIBUTE;
0498 
0499 typedef struct acpi_resource_address
0500 {
0501     ACPI_RESOURCE_ADDRESS_COMMON
0502 
0503 } ACPI_RESOURCE_ADDRESS;
0504 
0505 typedef struct acpi_resource_address16
0506 {
0507     ACPI_RESOURCE_ADDRESS_COMMON
0508     ACPI_ADDRESS16_ATTRIBUTE        Address;
0509     ACPI_RESOURCE_SOURCE            ResourceSource;
0510 
0511 } ACPI_RESOURCE_ADDRESS16;
0512 
0513 typedef struct acpi_resource_address32
0514 {
0515     ACPI_RESOURCE_ADDRESS_COMMON
0516     ACPI_ADDRESS32_ATTRIBUTE        Address;
0517     ACPI_RESOURCE_SOURCE            ResourceSource;
0518 
0519 } ACPI_RESOURCE_ADDRESS32;
0520 
0521 typedef struct acpi_resource_address64
0522 {
0523     ACPI_RESOURCE_ADDRESS_COMMON
0524     ACPI_ADDRESS64_ATTRIBUTE        Address;
0525     ACPI_RESOURCE_SOURCE            ResourceSource;
0526 
0527 } ACPI_RESOURCE_ADDRESS64;
0528 
0529 typedef struct acpi_resource_extended_address64
0530 {
0531     ACPI_RESOURCE_ADDRESS_COMMON
0532     UINT8                           RevisionID;
0533     ACPI_ADDRESS64_ATTRIBUTE        Address;
0534     UINT64                          TypeSpecific;
0535 
0536 } ACPI_RESOURCE_EXTENDED_ADDRESS64;
0537 
0538 typedef struct acpi_resource_extended_irq
0539 {
0540     UINT8                           ProducerConsumer;
0541     UINT8                           Triggering;
0542     UINT8                           Polarity;
0543     UINT8                           Shareable;
0544     UINT8                           WakeCapable;
0545     UINT8                           InterruptCount;
0546     ACPI_RESOURCE_SOURCE            ResourceSource;
0547     union {
0548         UINT32                      Interrupt;
0549         ACPI_FLEX_ARRAY(UINT32,     Interrupts);
0550     };
0551 
0552 } ACPI_RESOURCE_EXTENDED_IRQ;
0553 
0554 typedef struct acpi_resource_generic_register
0555 {
0556     UINT8                           SpaceId;
0557     UINT8                           BitWidth;
0558     UINT8                           BitOffset;
0559     UINT8                           AccessSize;
0560     UINT64                          Address;
0561 
0562 } ACPI_RESOURCE_GENERIC_REGISTER;
0563 
0564 typedef struct acpi_resource_gpio
0565 {
0566     UINT8                           RevisionId;
0567     UINT8                           ConnectionType;
0568     UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
0569     UINT8                           PinConfig;
0570     UINT8                           Shareable;           /* For values, see Interrupt Attributes above */
0571     UINT8                           WakeCapable;        /* For values, see Interrupt Attributes above */
0572     UINT8                           IoRestriction;
0573     UINT8                           Triggering;         /* For values, see Interrupt Attributes above */
0574     UINT8                           Polarity;           /* For values, see Interrupt Attributes above */
0575     UINT16                          DriveStrength;
0576     UINT16                          DebounceTimeout;
0577     UINT16                          PinTableLength;
0578     UINT16                          VendorLength;
0579     ACPI_RESOURCE_SOURCE            ResourceSource;
0580     UINT16                          *PinTable;
0581     UINT8                           *VendorData;
0582 
0583 } ACPI_RESOURCE_GPIO;
0584 
0585 /* Values for GPIO ConnectionType field above */
0586 
0587 #define ACPI_RESOURCE_GPIO_TYPE_INT             0
0588 #define ACPI_RESOURCE_GPIO_TYPE_IO              1
0589 
0590 /* Values for PinConfig field above */
0591 
0592 #define ACPI_PIN_CONFIG_DEFAULT                 0
0593 #define ACPI_PIN_CONFIG_PULLUP                  1
0594 #define ACPI_PIN_CONFIG_PULLDOWN                2
0595 #define ACPI_PIN_CONFIG_NOPULL                  3
0596 
0597 /* Values for IoRestriction field above */
0598 
0599 #define ACPI_IO_RESTRICT_NONE                   0
0600 #define ACPI_IO_RESTRICT_INPUT                  1
0601 #define ACPI_IO_RESTRICT_OUTPUT                 2
0602 #define ACPI_IO_RESTRICT_NONE_PRESERVE          3
0603 
0604 
0605 /* Common structure for I2C, SPI, UART, CSI2 serial descriptors */
0606 
0607 #define ACPI_RESOURCE_SERIAL_COMMON \
0608     UINT8                           RevisionId; \
0609     UINT8                           Type; \
0610     UINT8                           ProducerConsumer;    /* For values, see Producer/Consumer above */\
0611     UINT8                           SlaveMode; \
0612     UINT8                           ConnectionSharing; \
0613     UINT8                           TypeRevisionId; \
0614     UINT16                          TypeDataLength; \
0615     UINT16                          VendorLength; \
0616     ACPI_RESOURCE_SOURCE            ResourceSource; \
0617     UINT8                           *VendorData;
0618 
0619 typedef struct acpi_resource_common_serialbus
0620 {
0621     ACPI_RESOURCE_SERIAL_COMMON
0622 
0623 } ACPI_RESOURCE_COMMON_SERIALBUS;
0624 
0625 /* Values for the Type field above */
0626 
0627 #define ACPI_RESOURCE_SERIAL_TYPE_I2C           1
0628 #define ACPI_RESOURCE_SERIAL_TYPE_SPI           2
0629 #define ACPI_RESOURCE_SERIAL_TYPE_UART          3
0630 #define ACPI_RESOURCE_SERIAL_TYPE_CSI2          4
0631 
0632 /* Values for SlaveMode field above */
0633 
0634 #define ACPI_CONTROLLER_INITIATED               0
0635 #define ACPI_DEVICE_INITIATED                   1
0636 
0637 
0638 typedef struct acpi_resource_i2c_serialbus
0639 {
0640     ACPI_RESOURCE_SERIAL_COMMON
0641     UINT8                           AccessMode;
0642     UINT16                          SlaveAddress;
0643     UINT32                          ConnectionSpeed;
0644 
0645 } ACPI_RESOURCE_I2C_SERIALBUS;
0646 
0647 /* Values for AccessMode field above */
0648 
0649 #define ACPI_I2C_7BIT_MODE                      0
0650 #define ACPI_I2C_10BIT_MODE                     1
0651 
0652 
0653 typedef struct acpi_resource_spi_serialbus
0654 {
0655     ACPI_RESOURCE_SERIAL_COMMON
0656     UINT8                           WireMode;
0657     UINT8                           DevicePolarity;
0658     UINT8                           DataBitLength;
0659     UINT8                           ClockPhase;
0660     UINT8                           ClockPolarity;
0661     UINT16                          DeviceSelection;
0662     UINT32                          ConnectionSpeed;
0663 
0664 } ACPI_RESOURCE_SPI_SERIALBUS;
0665 
0666 /* Values for WireMode field above */
0667 
0668 #define ACPI_SPI_4WIRE_MODE                     0
0669 #define ACPI_SPI_3WIRE_MODE                     1
0670 
0671 /* Values for DevicePolarity field above */
0672 
0673 #define ACPI_SPI_ACTIVE_LOW                     0
0674 #define ACPI_SPI_ACTIVE_HIGH                    1
0675 
0676 /* Values for ClockPhase field above */
0677 
0678 #define ACPI_SPI_FIRST_PHASE                    0
0679 #define ACPI_SPI_SECOND_PHASE                   1
0680 
0681 /* Values for ClockPolarity field above */
0682 
0683 #define ACPI_SPI_START_LOW                      0
0684 #define ACPI_SPI_START_HIGH                     1
0685 
0686 
0687 typedef struct acpi_resource_uart_serialbus
0688 {
0689     ACPI_RESOURCE_SERIAL_COMMON
0690     UINT8                           Endian;
0691     UINT8                           DataBits;
0692     UINT8                           StopBits;
0693     UINT8                           FlowControl;
0694     UINT8                           Parity;
0695     UINT8                           LinesEnabled;
0696     UINT16                          RxFifoSize;
0697     UINT16                          TxFifoSize;
0698     UINT32                          DefaultBaudRate;
0699 
0700 } ACPI_RESOURCE_UART_SERIALBUS;
0701 
0702 /* Values for Endian field above */
0703 
0704 #define ACPI_UART_LITTLE_ENDIAN                 0
0705 #define ACPI_UART_BIG_ENDIAN                    1
0706 
0707 /* Values for DataBits field above */
0708 
0709 #define ACPI_UART_5_DATA_BITS                   0
0710 #define ACPI_UART_6_DATA_BITS                   1
0711 #define ACPI_UART_7_DATA_BITS                   2
0712 #define ACPI_UART_8_DATA_BITS                   3
0713 #define ACPI_UART_9_DATA_BITS                   4
0714 
0715 /* Values for StopBits field above */
0716 
0717 #define ACPI_UART_NO_STOP_BITS                  0
0718 #define ACPI_UART_1_STOP_BIT                    1
0719 #define ACPI_UART_1P5_STOP_BITS                 2
0720 #define ACPI_UART_2_STOP_BITS                   3
0721 
0722 /* Values for FlowControl field above */
0723 
0724 #define ACPI_UART_FLOW_CONTROL_NONE             0
0725 #define ACPI_UART_FLOW_CONTROL_HW               1
0726 #define ACPI_UART_FLOW_CONTROL_XON_XOFF         2
0727 
0728 /* Values for Parity field above */
0729 
0730 #define ACPI_UART_PARITY_NONE                   0
0731 #define ACPI_UART_PARITY_EVEN                   1
0732 #define ACPI_UART_PARITY_ODD                    2
0733 #define ACPI_UART_PARITY_MARK                   3
0734 #define ACPI_UART_PARITY_SPACE                  4
0735 
0736 /* Values for LinesEnabled bitfield above */
0737 
0738 #define ACPI_UART_CARRIER_DETECT                (1<<2)
0739 #define ACPI_UART_RING_INDICATOR                (1<<3)
0740 #define ACPI_UART_DATA_SET_READY                (1<<4)
0741 #define ACPI_UART_DATA_TERMINAL_READY           (1<<5)
0742 #define ACPI_UART_CLEAR_TO_SEND                 (1<<6)
0743 #define ACPI_UART_REQUEST_TO_SEND               (1<<7)
0744 
0745 typedef struct acpi_resource_csi2_serialbus
0746 {
0747     ACPI_RESOURCE_SERIAL_COMMON
0748     UINT8                           LocalPortInstance;
0749     UINT8                           PhyType;
0750 
0751 } ACPI_RESOURCE_CSI2_SERIALBUS;
0752 
0753 typedef struct acpi_resource_pin_function
0754 {
0755     UINT8                           RevisionId;
0756     UINT8                           PinConfig;
0757     UINT8                           Shareable;           /* For values, see Interrupt Attributes above */
0758     UINT16                          FunctionNumber;
0759     UINT16                          PinTableLength;
0760     UINT16                          VendorLength;
0761     ACPI_RESOURCE_SOURCE            ResourceSource;
0762     UINT16                          *PinTable;
0763     UINT8                           *VendorData;
0764 
0765 } ACPI_RESOURCE_PIN_FUNCTION;
0766 
0767 typedef struct acpi_resource_pin_config
0768 {
0769     UINT8                           RevisionId;
0770     UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
0771     UINT8                           Shareable;           /* For values, see Interrupt Attributes above */
0772     UINT8                           PinConfigType;
0773     UINT32                          PinConfigValue;
0774     UINT16                          PinTableLength;
0775     UINT16                          VendorLength;
0776     ACPI_RESOURCE_SOURCE            ResourceSource;
0777     UINT16                          *PinTable;
0778     UINT8                           *VendorData;
0779 
0780 } ACPI_RESOURCE_PIN_CONFIG;
0781 
0782 typedef struct acpi_resource_clock_input
0783 {
0784     UINT8                           RevisionId;
0785     UINT8                           Mode;
0786     UINT8                           Scale;
0787     UINT16                          FrequencyDivisor;
0788     UINT32                          FrequencyNumerator;
0789     ACPI_RESOURCE_SOURCE            ResourceSource;
0790 } ACPI_RESOURCE_CLOCK_INPUT;
0791 
0792 /* Values for PinConfigType field above */
0793 
0794 #define ACPI_PIN_CONFIG_DEFAULT                 0
0795 #define ACPI_PIN_CONFIG_BIAS_PULL_UP            1
0796 #define ACPI_PIN_CONFIG_BIAS_PULL_DOWN          2
0797 #define ACPI_PIN_CONFIG_BIAS_DEFAULT            3
0798 #define ACPI_PIN_CONFIG_BIAS_DISABLE            4
0799 #define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE     5
0800 #define ACPI_PIN_CONFIG_BIAS_BUS_HOLD           6
0801 #define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN        7
0802 #define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE       8
0803 #define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL         9
0804 #define ACPI_PIN_CONFIG_DRIVE_STRENGTH          10
0805 #define ACPI_PIN_CONFIG_SLEW_RATE               11
0806 #define ACPI_PIN_CONFIG_INPUT_DEBOUNCE          12
0807 #define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER   13
0808 
0809 typedef struct acpi_resource_pin_group
0810 {
0811     UINT8                           RevisionId;
0812     UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
0813     UINT16                          PinTableLength;
0814     UINT16                          VendorLength;
0815     UINT16                          *PinTable;
0816     ACPI_RESOURCE_LABEL             ResourceLabel;
0817     UINT8                           *VendorData;
0818 
0819 } ACPI_RESOURCE_PIN_GROUP;
0820 
0821 typedef struct acpi_resource_pin_group_function
0822 {
0823     UINT8                           RevisionId;
0824     UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
0825     UINT8                           Shareable;           /* For values, see Interrupt Attributes above */
0826     UINT16                          FunctionNumber;
0827     UINT16                          VendorLength;
0828     ACPI_RESOURCE_SOURCE            ResourceSource;
0829     ACPI_RESOURCE_LABEL             ResourceSourceLabel;
0830     UINT8                           *VendorData;
0831 
0832 } ACPI_RESOURCE_PIN_GROUP_FUNCTION;
0833 
0834 typedef struct acpi_resource_pin_group_config
0835 {
0836     UINT8                           RevisionId;
0837     UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
0838     UINT8                           Shareable;           /* For values, see Interrupt Attributes above */
0839     UINT8                           PinConfigType;      /* For values, see PinConfigType above */
0840     UINT32                          PinConfigValue;
0841     UINT16                          VendorLength;
0842     ACPI_RESOURCE_SOURCE            ResourceSource;
0843     ACPI_RESOURCE_LABEL             ResourceSourceLabel;
0844     UINT8                           *VendorData;
0845 
0846 } ACPI_RESOURCE_PIN_GROUP_CONFIG;
0847 
0848 /* ACPI_RESOURCE_TYPEs */
0849 
0850 #define ACPI_RESOURCE_TYPE_IRQ                  0
0851 #define ACPI_RESOURCE_TYPE_DMA                  1
0852 #define ACPI_RESOURCE_TYPE_START_DEPENDENT      2
0853 #define ACPI_RESOURCE_TYPE_END_DEPENDENT        3
0854 #define ACPI_RESOURCE_TYPE_IO                   4
0855 #define ACPI_RESOURCE_TYPE_FIXED_IO             5
0856 #define ACPI_RESOURCE_TYPE_VENDOR               6
0857 #define ACPI_RESOURCE_TYPE_END_TAG              7
0858 #define ACPI_RESOURCE_TYPE_MEMORY24             8
0859 #define ACPI_RESOURCE_TYPE_MEMORY32             9
0860 #define ACPI_RESOURCE_TYPE_FIXED_MEMORY32       10
0861 #define ACPI_RESOURCE_TYPE_ADDRESS16            11
0862 #define ACPI_RESOURCE_TYPE_ADDRESS32            12
0863 #define ACPI_RESOURCE_TYPE_ADDRESS64            13
0864 #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64   14  /* ACPI 3.0 */
0865 #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ         15
0866 #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER     16
0867 #define ACPI_RESOURCE_TYPE_GPIO                 17  /* ACPI 5.0 */
0868 #define ACPI_RESOURCE_TYPE_FIXED_DMA            18  /* ACPI 5.0 */
0869 #define ACPI_RESOURCE_TYPE_SERIAL_BUS           19  /* ACPI 5.0 */
0870 #define ACPI_RESOURCE_TYPE_PIN_FUNCTION         20  /* ACPI 6.2 */
0871 #define ACPI_RESOURCE_TYPE_PIN_CONFIG           21  /* ACPI 6.2 */
0872 #define ACPI_RESOURCE_TYPE_PIN_GROUP            22  /* ACPI 6.2 */
0873 #define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION   23  /* ACPI 6.2 */
0874 #define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG     24  /* ACPI 6.2 */
0875 #define ACPI_RESOURCE_TYPE_CLOCK_INPUT          25  /* ACPI 6.5 */
0876 #define ACPI_RESOURCE_TYPE_MAX                  25
0877 
0878 /* Master union for resource descriptors */
0879 
0880 typedef union acpi_resource_data
0881 {
0882     ACPI_RESOURCE_IRQ                       Irq;
0883     ACPI_RESOURCE_DMA                       Dma;
0884     ACPI_RESOURCE_START_DEPENDENT           StartDpf;
0885     ACPI_RESOURCE_IO                        Io;
0886     ACPI_RESOURCE_FIXED_IO                  FixedIo;
0887     ACPI_RESOURCE_FIXED_DMA                 FixedDma;
0888     ACPI_RESOURCE_VENDOR                    Vendor;
0889     ACPI_RESOURCE_VENDOR_TYPED              VendorTyped;
0890     ACPI_RESOURCE_END_TAG                   EndTag;
0891     ACPI_RESOURCE_MEMORY24                  Memory24;
0892     ACPI_RESOURCE_MEMORY32                  Memory32;
0893     ACPI_RESOURCE_FIXED_MEMORY32            FixedMemory32;
0894     ACPI_RESOURCE_ADDRESS16                 Address16;
0895     ACPI_RESOURCE_ADDRESS32                 Address32;
0896     ACPI_RESOURCE_ADDRESS64                 Address64;
0897     ACPI_RESOURCE_EXTENDED_ADDRESS64        ExtAddress64;
0898     ACPI_RESOURCE_EXTENDED_IRQ              ExtendedIrq;
0899     ACPI_RESOURCE_GENERIC_REGISTER          GenericReg;
0900     ACPI_RESOURCE_GPIO                      Gpio;
0901     ACPI_RESOURCE_I2C_SERIALBUS             I2cSerialBus;
0902     ACPI_RESOURCE_SPI_SERIALBUS             SpiSerialBus;
0903     ACPI_RESOURCE_UART_SERIALBUS            UartSerialBus;
0904     ACPI_RESOURCE_CSI2_SERIALBUS            Csi2SerialBus;
0905     ACPI_RESOURCE_COMMON_SERIALBUS          CommonSerialBus;
0906     ACPI_RESOURCE_PIN_FUNCTION              PinFunction;
0907     ACPI_RESOURCE_PIN_CONFIG                PinConfig;
0908     ACPI_RESOURCE_PIN_GROUP                 PinGroup;
0909     ACPI_RESOURCE_PIN_GROUP_FUNCTION        PinGroupFunction;
0910     ACPI_RESOURCE_PIN_GROUP_CONFIG          PinGroupConfig;
0911     ACPI_RESOURCE_CLOCK_INPUT               ClockInput;
0912 
0913     /* Common fields */
0914 
0915     ACPI_RESOURCE_ADDRESS                   Address;        /* Common 16/32/64 address fields */
0916 
0917 } ACPI_RESOURCE_DATA;
0918 
0919 
0920 /* Common resource header */
0921 
0922 typedef struct acpi_resource
0923 {
0924     UINT32                          Type;
0925     UINT32                          Length;
0926     ACPI_RESOURCE_DATA              Data;
0927 
0928 } ACPI_RESOURCE;
0929 
0930 /* restore default alignment */
0931 
0932 #pragma pack()
0933 
0934 
0935 #define ACPI_RS_SIZE_NO_DATA                8       /* Id + Length fields */
0936 #define ACPI_RS_SIZE_MIN                    (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
0937 #define ACPI_RS_SIZE(Type)                  (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type))
0938 
0939 /* Macro for walking resource templates with multiple descriptors */
0940 
0941 #define ACPI_NEXT_RESOURCE(Res) \
0942     ACPI_ADD_PTR (ACPI_RESOURCE, (Res), (Res)->Length)
0943 
0944 
0945 typedef struct acpi_pci_routing_table
0946 {
0947     UINT32                          Length;
0948     UINT32                          Pin;
0949     UINT64                          Address;        /* here for 64-bit alignment */
0950     UINT32                          SourceIndex;
0951     union {
0952                                     char Pad[4];    /* pad to 64 bits so sizeof() works in all cases */
0953                                     ACPI_FLEX_ARRAY(char, Source);
0954     };
0955 } ACPI_PCI_ROUTING_TABLE;
0956 
0957 #endif /* __ACRESTYP_H__ */