Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/include/drivers/acpi/acrestyp.h need to be fixed.

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 - 2009, 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 #ifndef __ACRESTYP_H__
0117 #define __ACRESTYP_H__
0118 
0119 
0120 /*
0121  * Definitions for Resource Attributes
0122  */
0123 typedef UINT16                          ACPI_RS_LENGTH;    /* Resource Length field is fixed at 16 bits */
0124 typedef UINT32                          ACPI_RSDESC_SIZE;  /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */
0125 
0126 /*
0127  * Memory Attributes
0128  */
0129 #define ACPI_READ_ONLY_MEMORY           (UINT8) 0x00
0130 #define ACPI_READ_WRITE_MEMORY          (UINT8) 0x01
0131 
0132 #define ACPI_NON_CACHEABLE_MEMORY       (UINT8) 0x00
0133 #define ACPI_CACHABLE_MEMORY            (UINT8) 0x01
0134 #define ACPI_WRITE_COMBINING_MEMORY     (UINT8) 0x02
0135 #define ACPI_PREFETCHABLE_MEMORY        (UINT8) 0x03
0136 
0137 /*
0138  * IO Attributes
0139  * The ISA IO ranges are:     n000-n0FFh,  n400-n4FFh, n800-n8FFh, nC00-nCFFh.
0140  * The non-ISA IO ranges are: n100-n3FFh,  n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
0141  */
0142 #define ACPI_NON_ISA_ONLY_RANGES        (UINT8) 0x01
0143 #define ACPI_ISA_ONLY_RANGES            (UINT8) 0x02
0144 #define ACPI_ENTIRE_RANGE               (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
0145 
0146 /* Type of translation - 1=Sparse, 0=Dense */
0147 
0148 #define ACPI_SPARSE_TRANSLATION         (UINT8) 0x01
0149 
0150 /*
0151  * IO Port Descriptor Decode
0152  */
0153 #define ACPI_DECODE_10                  (UINT8) 0x00    /* 10-bit IO address decode */
0154 #define ACPI_DECODE_16                  (UINT8) 0x01    /* 16-bit IO address decode */
0155 
0156 /*
0157  * IRQ Attributes
0158  */
0159 #define ACPI_LEVEL_SENSITIVE            (UINT8) 0x00
0160 #define ACPI_EDGE_SENSITIVE             (UINT8) 0x01
0161 
0162 #define ACPI_ACTIVE_HIGH                (UINT8) 0x00
0163 #define ACPI_ACTIVE_LOW                 (UINT8) 0x01
0164 
0165 #define ACPI_EXCLUSIVE                  (UINT8) 0x00
0166 #define ACPI_SHARED                     (UINT8) 0x01
0167 
0168 /*
0169  * DMA Attributes
0170  */
0171 #define ACPI_COMPATIBILITY              (UINT8) 0x00
0172 #define ACPI_TYPE_A                     (UINT8) 0x01
0173 #define ACPI_TYPE_B                     (UINT8) 0x02
0174 #define ACPI_TYPE_F                     (UINT8) 0x03
0175 
0176 #define ACPI_NOT_BUS_MASTER             (UINT8) 0x00
0177 #define ACPI_BUS_MASTER                 (UINT8) 0x01
0178 
0179 #define ACPI_TRANSFER_8                 (UINT8) 0x00
0180 #define ACPI_TRANSFER_8_16              (UINT8) 0x01
0181 #define ACPI_TRANSFER_16                (UINT8) 0x02
0182 
0183 /*
0184  * Start Dependent Functions Priority definitions
0185  */
0186 #define ACPI_GOOD_CONFIGURATION         (UINT8) 0x00
0187 #define ACPI_ACCEPTABLE_CONFIGURATION   (UINT8) 0x01
0188 #define ACPI_SUB_OPTIMAL_CONFIGURATION  (UINT8) 0x02
0189 
0190 /*
0191  * 16, 32 and 64-bit Address Descriptor resource types
0192  */
0193 #define ACPI_MEMORY_RANGE               (UINT8) 0x00
0194 #define ACPI_IO_RANGE                   (UINT8) 0x01
0195 #define ACPI_BUS_NUMBER_RANGE           (UINT8) 0x02
0196 
0197 #define ACPI_ADDRESS_NOT_FIXED          (UINT8) 0x00
0198 #define ACPI_ADDRESS_FIXED              (UINT8) 0x01
0199 
0200 #define ACPI_POS_DECODE                 (UINT8) 0x00
0201 #define ACPI_SUB_DECODE                 (UINT8) 0x01
0202 
0203 #define ACPI_PRODUCER                   (UINT8) 0x00
0204 #define ACPI_CONSUMER                   (UINT8) 0x01
0205 
0206 
0207 /*
0208  * If possible, pack the following structures to byte alignment
0209  */
0210 #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
0211 #pragma pack(1)
0212 #endif
0213 
0214 /* UUID data structures for use in vendor-defined resource descriptors */
0215 
0216 typedef struct acpi_uuid
0217 {
0218     UINT8                           Data[ACPI_UUID_LENGTH];
0219 } ACPI_UUID;
0220 
0221 typedef struct acpi_vendor_uuid
0222 {
0223     UINT8                           Subtype;
0224     UINT8                           Data[ACPI_UUID_LENGTH];
0225 
0226 } ACPI_VENDOR_UUID;
0227 
0228 /*
0229  * Structures used to describe device resources
0230  */
0231 typedef struct acpi_resource_irq
0232 {
0233     UINT8                           DescriptorLength;
0234     UINT8                           Triggering;
0235     UINT8                           Polarity;
0236     UINT8                           Sharable;
0237     UINT8                           InterruptCount;
0238     UINT8                           Interrupts[1];
0239 
0240 } ACPI_RESOURCE_IRQ;
0241 
0242 typedef struct ACPI_RESOURCE_DMA
0243 {
0244     UINT8                           Type;
0245     UINT8                           BusMaster;
0246     UINT8                           Transfer;
0247     UINT8                           ChannelCount;
0248     UINT8                           Channels[1];
0249 
0250 } ACPI_RESOURCE_DMA;
0251 
0252 typedef struct acpi_resource_start_dependent
0253 {
0254     UINT8                           DescriptorLength;
0255     UINT8                           CompatibilityPriority;
0256     UINT8                           PerformanceRobustness;
0257 
0258 } ACPI_RESOURCE_START_DEPENDENT;
0259 
0260 
0261 /*
0262  * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
0263  * needed because it has no fields
0264  */
0265 
0266 
0267 typedef struct acpi_resource_io
0268 {
0269     UINT8                           IoDecode;
0270     UINT8                           Alignment;
0271     UINT8                           AddressLength;
0272     UINT16                          Minimum;
0273     UINT16                          Maximum;
0274 
0275 } ACPI_RESOURCE_IO;
0276 
0277 typedef struct acpi_resource_fixed_io
0278 {
0279     UINT16                          Address;
0280     UINT8                           AddressLength;
0281 
0282 } ACPI_RESOURCE_FIXED_IO;
0283 
0284 typedef struct acpi_resource_vendor
0285 {
0286     UINT16                          ByteLength;
0287     UINT8                           ByteData[1];
0288 
0289 } ACPI_RESOURCE_VENDOR;
0290 
0291 /* Vendor resource with UUID info (introduced in ACPI 3.0) */
0292 
0293 typedef struct acpi_resource_vendor_typed
0294 {
0295     UINT16                          ByteLength;
0296     UINT8                           UuidSubtype;
0297     UINT8                           Uuid[ACPI_UUID_LENGTH];
0298     UINT8                           ByteData[1];
0299 
0300 } ACPI_RESOURCE_VENDOR_TYPED;
0301 
0302 typedef struct acpi_resource_end_tag
0303 {
0304     UINT8                           Checksum;
0305 
0306 } ACPI_RESOURCE_END_TAG;
0307 
0308 typedef struct acpi_resource_memory24
0309 {
0310     UINT8                           WriteProtect;
0311     UINT16                          Minimum;
0312     UINT16                          Maximum;
0313     UINT16                          Alignment;
0314     UINT16                          AddressLength;
0315 
0316 } ACPI_RESOURCE_MEMORY24;
0317 
0318 typedef struct acpi_resource_memory32
0319 {
0320     UINT8                           WriteProtect;
0321     UINT32                          Minimum;
0322     UINT32                          Maximum;
0323     UINT32                          Alignment;
0324     UINT32                          AddressLength;
0325 
0326 } ACPI_RESOURCE_MEMORY32;
0327 
0328 typedef struct acpi_resource_fixed_memory32
0329 {
0330     UINT8                           WriteProtect;
0331     UINT32                          Address;
0332     UINT32                          AddressLength;
0333 
0334 } ACPI_RESOURCE_FIXED_MEMORY32;
0335 
0336 typedef struct acpi_memory_attribute
0337 {
0338     UINT8                           WriteProtect;
0339     UINT8                           Caching;
0340     UINT8                           RangeType;
0341     UINT8                           Translation;
0342 
0343 } ACPI_MEMORY_ATTRIBUTE;
0344 
0345 typedef struct acpi_io_attribute
0346 {
0347     UINT8                           RangeType;
0348     UINT8                           Translation;
0349     UINT8                           TranslationType;
0350     UINT8                           Reserved1;
0351 
0352 } ACPI_IO_ATTRIBUTE;
0353 
0354 typedef union acpi_resource_attribute
0355 {
0356     ACPI_MEMORY_ATTRIBUTE           Mem;
0357     ACPI_IO_ATTRIBUTE               Io;
0358 
0359     /* Used for the *WordSpace macros */
0360 
0361     UINT8                           TypeSpecific;
0362 
0363 } ACPI_RESOURCE_ATTRIBUTE;
0364 
0365 typedef struct acpi_resource_source
0366 {
0367     UINT8                           Index;
0368     UINT16                          StringLength;
0369     char                            *StringPtr;
0370 
0371 } ACPI_RESOURCE_SOURCE;
0372 
0373 /* Fields common to all address descriptors, 16/32/64 bit */
0374 
0375 #define ACPI_RESOURCE_ADDRESS_COMMON \
0376     UINT8                           ResourceType; \
0377     UINT8                           ProducerConsumer; \
0378     UINT8                           Decode; \
0379     UINT8                           MinAddressFixed; \
0380     UINT8                           MaxAddressFixed; \
0381     ACPI_RESOURCE_ATTRIBUTE         Info;
0382 
0383 typedef struct acpi_resource_address
0384 {
0385     ACPI_RESOURCE_ADDRESS_COMMON
0386 
0387 } ACPI_RESOURCE_ADDRESS;
0388 
0389 typedef struct acpi_resource_address16
0390 {
0391     ACPI_RESOURCE_ADDRESS_COMMON
0392     UINT16                          Granularity;
0393     UINT16                          Minimum;
0394     UINT16                          Maximum;
0395     UINT16                          TranslationOffset;
0396     UINT16                          AddressLength;
0397     ACPI_RESOURCE_SOURCE            ResourceSource;
0398 
0399 } ACPI_RESOURCE_ADDRESS16;
0400 
0401 typedef struct acpi_resource_address32
0402 {
0403     ACPI_RESOURCE_ADDRESS_COMMON
0404     UINT32                          Granularity;
0405     UINT32                          Minimum;
0406     UINT32                          Maximum;
0407     UINT32                          TranslationOffset;
0408     UINT32                          AddressLength;
0409     ACPI_RESOURCE_SOURCE            ResourceSource;
0410 
0411 } ACPI_RESOURCE_ADDRESS32;
0412 
0413 typedef struct acpi_resource_address64
0414 {
0415     ACPI_RESOURCE_ADDRESS_COMMON
0416     UINT64                          Granularity;
0417     UINT64                          Minimum;
0418     UINT64                          Maximum;
0419     UINT64                          TranslationOffset;
0420     UINT64                          AddressLength;
0421     ACPI_RESOURCE_SOURCE            ResourceSource;
0422 
0423 } ACPI_RESOURCE_ADDRESS64;
0424 
0425 typedef struct acpi_resource_extended_address64
0426 {
0427     ACPI_RESOURCE_ADDRESS_COMMON
0428     UINT8                           RevisionID;
0429     UINT64                          Granularity;
0430     UINT64                          Minimum;
0431     UINT64                          Maximum;
0432     UINT64                          TranslationOffset;
0433     UINT64                          AddressLength;
0434     UINT64                          TypeSpecific;
0435 
0436 } ACPI_RESOURCE_EXTENDED_ADDRESS64;
0437 
0438 typedef struct acpi_resource_extended_irq
0439 {
0440     UINT8                           ProducerConsumer;
0441     UINT8                           Triggering;
0442     UINT8                           Polarity;
0443     UINT8                           Sharable;
0444     UINT8                           InterruptCount;
0445     ACPI_RESOURCE_SOURCE            ResourceSource;
0446     UINT32                          Interrupts[1];
0447 
0448 } ACPI_RESOURCE_EXTENDED_IRQ;
0449 
0450 typedef struct acpi_resource_generic_register
0451 {
0452     UINT8                           SpaceId;
0453     UINT8                           BitWidth;
0454     UINT8                           BitOffset;
0455     UINT8                           AccessSize;
0456     UINT64                          Address;
0457 
0458 } ACPI_RESOURCE_GENERIC_REGISTER;
0459 
0460 
0461 /* ACPI_RESOURCE_TYPEs */
0462 
0463 #define ACPI_RESOURCE_TYPE_IRQ                  0
0464 #define ACPI_RESOURCE_TYPE_DMA                  1
0465 #define ACPI_RESOURCE_TYPE_START_DEPENDENT      2
0466 #define ACPI_RESOURCE_TYPE_END_DEPENDENT        3
0467 #define ACPI_RESOURCE_TYPE_IO                   4
0468 #define ACPI_RESOURCE_TYPE_FIXED_IO             5
0469 #define ACPI_RESOURCE_TYPE_VENDOR               6
0470 #define ACPI_RESOURCE_TYPE_END_TAG              7
0471 #define ACPI_RESOURCE_TYPE_MEMORY24             8
0472 #define ACPI_RESOURCE_TYPE_MEMORY32             9
0473 #define ACPI_RESOURCE_TYPE_FIXED_MEMORY32       10
0474 #define ACPI_RESOURCE_TYPE_ADDRESS16            11
0475 #define ACPI_RESOURCE_TYPE_ADDRESS32            12
0476 #define ACPI_RESOURCE_TYPE_ADDRESS64            13
0477 #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64   14  /* ACPI 3.0 */
0478 #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ         15
0479 #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER     16
0480 #define ACPI_RESOURCE_TYPE_MAX                  16
0481 
0482 /* Master union for resource descriptors */
0483 
0484 typedef union acpi_resource_data
0485 {
0486     ACPI_RESOURCE_IRQ                       Irq;
0487     ACPI_RESOURCE_DMA                       Dma;
0488     ACPI_RESOURCE_START_DEPENDENT           StartDpf;
0489     ACPI_RESOURCE_IO                        Io;
0490     ACPI_RESOURCE_FIXED_IO                  FixedIo;
0491     ACPI_RESOURCE_VENDOR                    Vendor;
0492     ACPI_RESOURCE_VENDOR_TYPED              VendorTyped;
0493     ACPI_RESOURCE_END_TAG                   EndTag;
0494     ACPI_RESOURCE_MEMORY24                  Memory24;
0495     ACPI_RESOURCE_MEMORY32                  Memory32;
0496     ACPI_RESOURCE_FIXED_MEMORY32            FixedMemory32;
0497     ACPI_RESOURCE_ADDRESS16                 Address16;
0498     ACPI_RESOURCE_ADDRESS32                 Address32;
0499     ACPI_RESOURCE_ADDRESS64                 Address64;
0500     ACPI_RESOURCE_EXTENDED_ADDRESS64        ExtAddress64;
0501     ACPI_RESOURCE_EXTENDED_IRQ              ExtendedIrq;
0502     ACPI_RESOURCE_GENERIC_REGISTER          GenericReg;
0503 
0504     /* Common fields */
0505 
0506     ACPI_RESOURCE_ADDRESS                   Address;        /* Common 16/32/64 address fields */
0507 
0508 } ACPI_RESOURCE_DATA;
0509 
0510 
0511 /* Common resource header */
0512 
0513 typedef struct acpi_resource
0514 {
0515     UINT32                          Type;
0516     UINT32                          Length;
0517     ACPI_RESOURCE_DATA              Data;
0518 
0519 } ACPI_RESOURCE;
0520 
0521 /* restore default alignment */
0522 
0523 #pragma pack()
0524 
0525 
0526 #define ACPI_RS_SIZE_NO_DATA                8       /* Id + Length fields */
0527 #define ACPI_RS_SIZE_MIN                    (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
0528 #define ACPI_RS_SIZE(Type)                  (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type))
0529 
0530 #define ACPI_NEXT_RESOURCE(Res)             (ACPI_RESOURCE *)((UINT8 *) Res + Res->Length)
0531 
0532 
0533 typedef struct acpi_pci_routing_table
0534 {
0535     UINT32                          Length;
0536     UINT32                          Pin;
0537     ACPI_INTEGER                    Address;        /* here for 64-bit alignment */
0538     UINT32                          SourceIndex;
0539     char                            Source[4];      /* pad to 64 bits so sizeof() works in all cases */
0540 
0541 } ACPI_PCI_ROUTING_TABLE;
0542 
0543 #endif /* __ACRESTYP_H__ */
0544