Path: blob/main/sys/contrib/dev/acpica/include/acrestyp.h
48286 views
/******************************************************************************1*2* Name: acrestyp.h - Defines, types, and structures for resource descriptors3*4*****************************************************************************/56/******************************************************************************7*8* 1. Copyright Notice9*10* Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.11* All rights reserved.12*13* 2. License14*15* 2.1. This is your license from Intel Corp. under its intellectual property16* rights. You may have additional license terms from the party that provided17* you this software, covering your right to use that party's intellectual18* property rights.19*20* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a21* copy of the source code appearing in this file ("Covered Code") an22* irrevocable, perpetual, worldwide license under Intel's copyrights in the23* base code distributed originally by Intel ("Original Intel Code") to copy,24* make derivatives, distribute, use and display any portion of the Covered25* Code in any form, with the right to sublicense such rights; and26*27* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent28* license (with the right to sublicense), under only those claims of Intel29* patents that are infringed by the Original Intel Code, to make, use, sell,30* offer to sell, and import the Covered Code and derivative works thereof31* solely to the minimum extent necessary to exercise the above copyright32* license, and in no event shall the patent license extend to any additions33* to or modifications of the Original Intel Code. No other license or right34* is granted directly or by implication, estoppel or otherwise;35*36* The above copyright and patent license is granted only if the following37* conditions are met:38*39* 3. Conditions40*41* 3.1. Redistribution of Source with Rights to Further Distribute Source.42* Redistribution of source code of any substantial portion of the Covered43* Code or modification with rights to further distribute source must include44* the above Copyright Notice, the above License, this list of Conditions,45* and the following Disclaimer and Export Compliance provision. In addition,46* Licensee must cause all Covered Code to which Licensee contributes to47* contain a file documenting the changes Licensee made to create that Covered48* Code and the date of any change. Licensee must include in that file the49* documentation of any changes made by any predecessor Licensee. Licensee50* must include a prominent statement that the modification is derived,51* directly or indirectly, from Original Intel Code.52*53* 3.2. Redistribution of Source with no Rights to Further Distribute Source.54* Redistribution of source code of any substantial portion of the Covered55* Code or modification without rights to further distribute source must56* include the following Disclaimer and Export Compliance provision in the57* documentation and/or other materials provided with distribution. In58* addition, Licensee may not authorize further sublicense of source of any59* portion of the Covered Code, and must include terms to the effect that the60* license from Licensee to its licensee is limited to the intellectual61* property embodied in the software Licensee provides to its licensee, and62* not to intellectual property embodied in modifications its licensee may63* make.64*65* 3.3. Redistribution of Executable. Redistribution in executable form of any66* substantial portion of the Covered Code or modification must reproduce the67* above Copyright Notice, and the following Disclaimer and Export Compliance68* provision in the documentation and/or other materials provided with the69* distribution.70*71* 3.4. Intel retains all right, title, and interest in and to the Original72* Intel Code.73*74* 3.5. Neither the name Intel nor any other trademark owned or controlled by75* Intel shall be used in advertising or otherwise to promote the sale, use or76* other dealings in products derived from or relating to the Covered Code77* without prior written authorization from Intel.78*79* 4. Disclaimer and Export Compliance80*81* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED82* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE83* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,84* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY85* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY86* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A87* PARTICULAR PURPOSE.88*89* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES90* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR91* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,92* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY93* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL94* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS95* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY96* LIMITED REMEDY.97*98* 4.3. Licensee shall not export, either directly or indirectly, any of this99* software or system incorporating such software without first obtaining any100* required license or other approval from the U. S. Department of Commerce or101* any other agency or department of the United States Government. In the102* event Licensee exports any such software from the United States or103* re-exports any such software from a foreign destination, Licensee shall104* ensure that the distribution and export/re-export of the software is in105* compliance with all laws, regulations, orders, or other restrictions of the106* U.S. Export Administration Regulations. Licensee agrees that neither it nor107* any of its subsidiaries will export/re-export any technical data, process,108* software, or service, directly or indirectly, to any country for which the109* United States government or any agency thereof requires an export license,110* other governmental approval, or letter of assurance, without first obtaining111* such license, approval or letter.112*113*****************************************************************************114*115* Alternatively, you may choose to be licensed under the terms of the116* following license:117*118* Redistribution and use in source and binary forms, with or without119* modification, are permitted provided that the following conditions120* are met:121* 1. Redistributions of source code must retain the above copyright122* notice, this list of conditions, and the following disclaimer,123* without modification.124* 2. Redistributions in binary form must reproduce at minimum a disclaimer125* substantially similar to the "NO WARRANTY" disclaimer below126* ("Disclaimer") and any redistribution must be conditioned upon127* including a substantially similar Disclaimer requirement for further128* binary redistribution.129* 3. Neither the names of the above-listed copyright holders nor the names130* of any contributors may be used to endorse or promote products derived131* from this software without specific prior written permission.132*133* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS134* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT135* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR136* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT137* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,138* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT139* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,140* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY141* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT142* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE143* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.144*145* Alternatively, you may choose to be licensed under the terms of the146* GNU General Public License ("GPL") version 2 as published by the Free147* Software Foundation.148*149*****************************************************************************/150151#ifndef __ACRESTYP_H__152#define __ACRESTYP_H__153154155/*156* Definitions for Resource Attributes157*/158typedef UINT16 ACPI_RS_LENGTH; /* Resource Length field is fixed at 16 bits */159typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */160161/*162* Memory Attributes163*/164#define ACPI_READ_ONLY_MEMORY (UINT8) 0x00165#define ACPI_READ_WRITE_MEMORY (UINT8) 0x01166167#define ACPI_NON_CACHEABLE_MEMORY (UINT8) 0x00168#define ACPI_CACHABLE_MEMORY (UINT8) 0x01169#define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02170#define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03171172/*! [Begin] no source code translation */173/*174* IO Attributes175* The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh.176* The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh.177*/178/*! [End] no source code translation !*/179180#define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01181#define ACPI_ISA_ONLY_RANGES (UINT8) 0x02182#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)183184/* Type of translation - 1=Sparse, 0=Dense */185186#define ACPI_SPARSE_TRANSLATION (UINT8) 0x01187188/*189* IO Port Descriptor Decode190*/191#define ACPI_DECODE_10 (UINT8) 0x00 /* 10-bit IO address decode */192#define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */193194/*195* Interrupt attributes - used in multiple descriptors196*/197198/* Triggering */199200#define ACPI_LEVEL_SENSITIVE (UINT8) 0x00201#define ACPI_EDGE_SENSITIVE (UINT8) 0x01202203/* Polarity */204205#define ACPI_ACTIVE_HIGH (UINT8) 0x00206#define ACPI_ACTIVE_LOW (UINT8) 0x01207#define ACPI_ACTIVE_BOTH (UINT8) 0x02208209/* Sharing */210211#define ACPI_EXCLUSIVE (UINT8) 0x00212#define ACPI_SHARED (UINT8) 0x01213214/* Wake */215216#define ACPI_NOT_WAKE_CAPABLE (UINT8) 0x00217#define ACPI_WAKE_CAPABLE (UINT8) 0x01218219/*220* DMA Attributes221*/222#define ACPI_COMPATIBILITY (UINT8) 0x00223#define ACPI_TYPE_A (UINT8) 0x01224#define ACPI_TYPE_B (UINT8) 0x02225#define ACPI_TYPE_F (UINT8) 0x03226227#define ACPI_NOT_BUS_MASTER (UINT8) 0x00228#define ACPI_BUS_MASTER (UINT8) 0x01229230#define ACPI_TRANSFER_8 (UINT8) 0x00231#define ACPI_TRANSFER_8_16 (UINT8) 0x01232#define ACPI_TRANSFER_16 (UINT8) 0x02233234/*235* Start Dependent Functions Priority definitions236*/237#define ACPI_GOOD_CONFIGURATION (UINT8) 0x00238#define ACPI_ACCEPTABLE_CONFIGURATION (UINT8) 0x01239#define ACPI_SUB_OPTIMAL_CONFIGURATION (UINT8) 0x02240241/*242* 16, 32 and 64-bit Address Descriptor resource types243*/244#define ACPI_MEMORY_RANGE (UINT8) 0x00245#define ACPI_IO_RANGE (UINT8) 0x01246#define ACPI_BUS_NUMBER_RANGE (UINT8) 0x02247248#define ACPI_ADDRESS_NOT_FIXED (UINT8) 0x00249#define ACPI_ADDRESS_FIXED (UINT8) 0x01250251#define ACPI_POS_DECODE (UINT8) 0x00252#define ACPI_SUB_DECODE (UINT8) 0x01253254/* Producer/Consumer */255256#define ACPI_PRODUCER (UINT8) 0x00257#define ACPI_CONSUMER (UINT8) 0x01258259260/*261* If possible, pack the following structures to byte alignment262*/263#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED264#pragma pack(1)265#endif266267/* UUID data structures for use in vendor-defined resource descriptors */268269typedef struct acpi_uuid270{271UINT8 Data[ACPI_UUID_LENGTH];272} ACPI_UUID;273274typedef struct acpi_vendor_uuid275{276UINT8 Subtype;277UINT8 Data[ACPI_UUID_LENGTH];278279} ACPI_VENDOR_UUID;280281/*282* Structures used to describe device resources283*/284typedef struct acpi_resource_irq285{286UINT8 DescriptorLength;287UINT8 Triggering;288UINT8 Polarity;289UINT8 Shareable;290UINT8 WakeCapable;291UINT8 InterruptCount;292union {293UINT8 Interrupt;294ACPI_FLEX_ARRAY(UINT8, Interrupts);295};296297} ACPI_RESOURCE_IRQ;298299typedef struct acpi_resource_dma300{301UINT8 Type;302UINT8 BusMaster;303UINT8 Transfer;304UINT8 ChannelCount;305union {306UINT8 Channel;307ACPI_FLEX_ARRAY(UINT8, Channels);308};309310} ACPI_RESOURCE_DMA;311312typedef struct acpi_resource_start_dependent313{314UINT8 DescriptorLength;315UINT8 CompatibilityPriority;316UINT8 PerformanceRobustness;317318} ACPI_RESOURCE_START_DEPENDENT;319320321/*322* The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not323* needed because it has no fields324*/325326327typedef struct acpi_resource_io328{329UINT8 IoDecode;330UINT8 Alignment;331UINT8 AddressLength;332UINT16 Minimum;333UINT16 Maximum;334335} ACPI_RESOURCE_IO;336337typedef struct acpi_resource_fixed_io338{339UINT16 Address;340UINT8 AddressLength;341342} ACPI_RESOURCE_FIXED_IO;343344typedef struct acpi_resource_fixed_dma345{346UINT16 RequestLines;347UINT16 Channels;348UINT8 Width;349350} ACPI_RESOURCE_FIXED_DMA;351352/* Values for Width field above */353354#define ACPI_DMA_WIDTH8 0355#define ACPI_DMA_WIDTH16 1356#define ACPI_DMA_WIDTH32 2357#define ACPI_DMA_WIDTH64 3358#define ACPI_DMA_WIDTH128 4359#define ACPI_DMA_WIDTH256 5360361362typedef struct acpi_resource_vendor363{364UINT16 ByteLength;365UINT8 ByteData[];366367} ACPI_RESOURCE_VENDOR;368369/* Vendor resource with UUID info (introduced in ACPI 3.0) */370371typedef struct acpi_resource_vendor_typed372{373UINT16 ByteLength;374UINT8 UuidSubtype;375UINT8 Uuid[ACPI_UUID_LENGTH];376UINT8 ByteData[];377378} ACPI_RESOURCE_VENDOR_TYPED;379380typedef struct acpi_resource_end_tag381{382UINT8 Checksum;383384} ACPI_RESOURCE_END_TAG;385386typedef struct acpi_resource_memory24387{388UINT8 WriteProtect;389UINT16 Minimum;390UINT16 Maximum;391UINT16 Alignment;392UINT16 AddressLength;393394} ACPI_RESOURCE_MEMORY24;395396typedef struct acpi_resource_memory32397{398UINT8 WriteProtect;399UINT32 Minimum;400UINT32 Maximum;401UINT32 Alignment;402UINT32 AddressLength;403404} ACPI_RESOURCE_MEMORY32;405406typedef struct acpi_resource_fixed_memory32407{408UINT8 WriteProtect;409UINT32 Address;410UINT32 AddressLength;411412} ACPI_RESOURCE_FIXED_MEMORY32;413414typedef struct acpi_memory_attribute415{416UINT8 WriteProtect;417UINT8 Caching;418UINT8 RangeType;419UINT8 Translation;420421} ACPI_MEMORY_ATTRIBUTE;422423typedef struct acpi_io_attribute424{425UINT8 RangeType;426UINT8 Translation;427UINT8 TranslationType;428UINT8 Reserved1;429430} ACPI_IO_ATTRIBUTE;431432typedef union acpi_resource_attribute433{434ACPI_MEMORY_ATTRIBUTE Mem;435ACPI_IO_ATTRIBUTE Io;436437/* Used for the *WordSpace macros */438439UINT8 TypeSpecific;440441} ACPI_RESOURCE_ATTRIBUTE;442443typedef struct acpi_resource_label444{445UINT16 StringLength;446char *StringPtr;447448} ACPI_RESOURCE_LABEL;449450typedef struct acpi_resource_source451{452UINT8 Index;453UINT16 StringLength;454char *StringPtr;455456} ACPI_RESOURCE_SOURCE;457458/* Fields common to all address descriptors, 16/32/64 bit */459460#define ACPI_RESOURCE_ADDRESS_COMMON \461UINT8 ResourceType; \462UINT8 ProducerConsumer; \463UINT8 Decode; \464UINT8 MinAddressFixed; \465UINT8 MaxAddressFixed; \466ACPI_RESOURCE_ATTRIBUTE Info;467468typedef struct acpi_address16_attribute469{470UINT16 Granularity;471UINT16 Minimum;472UINT16 Maximum;473UINT16 TranslationOffset;474UINT16 AddressLength;475476} ACPI_ADDRESS16_ATTRIBUTE;477478typedef struct acpi_address32_attribute479{480UINT32 Granularity;481UINT32 Minimum;482UINT32 Maximum;483UINT32 TranslationOffset;484UINT32 AddressLength;485486} ACPI_ADDRESS32_ATTRIBUTE;487488typedef struct acpi_address64_attribute489{490UINT64 Granularity;491UINT64 Minimum;492UINT64 Maximum;493UINT64 TranslationOffset;494UINT64 AddressLength;495496} ACPI_ADDRESS64_ATTRIBUTE;497498typedef struct acpi_resource_address499{500ACPI_RESOURCE_ADDRESS_COMMON501502} ACPI_RESOURCE_ADDRESS;503504typedef struct acpi_resource_address16505{506ACPI_RESOURCE_ADDRESS_COMMON507ACPI_ADDRESS16_ATTRIBUTE Address;508ACPI_RESOURCE_SOURCE ResourceSource;509510} ACPI_RESOURCE_ADDRESS16;511512typedef struct acpi_resource_address32513{514ACPI_RESOURCE_ADDRESS_COMMON515ACPI_ADDRESS32_ATTRIBUTE Address;516ACPI_RESOURCE_SOURCE ResourceSource;517518} ACPI_RESOURCE_ADDRESS32;519520typedef struct acpi_resource_address64521{522ACPI_RESOURCE_ADDRESS_COMMON523ACPI_ADDRESS64_ATTRIBUTE Address;524ACPI_RESOURCE_SOURCE ResourceSource;525526} ACPI_RESOURCE_ADDRESS64;527528typedef struct acpi_resource_extended_address64529{530ACPI_RESOURCE_ADDRESS_COMMON531UINT8 RevisionID;532ACPI_ADDRESS64_ATTRIBUTE Address;533UINT64 TypeSpecific;534535} ACPI_RESOURCE_EXTENDED_ADDRESS64;536537typedef struct acpi_resource_extended_irq538{539UINT8 ProducerConsumer;540UINT8 Triggering;541UINT8 Polarity;542UINT8 Shareable;543UINT8 WakeCapable;544UINT8 InterruptCount;545ACPI_RESOURCE_SOURCE ResourceSource;546union {547UINT32 Interrupt;548ACPI_FLEX_ARRAY(UINT32, Interrupts);549};550551} ACPI_RESOURCE_EXTENDED_IRQ;552553typedef struct acpi_resource_generic_register554{555UINT8 SpaceId;556UINT8 BitWidth;557UINT8 BitOffset;558UINT8 AccessSize;559UINT64 Address;560561} ACPI_RESOURCE_GENERIC_REGISTER;562563typedef struct acpi_resource_gpio564{565UINT8 RevisionId;566UINT8 ConnectionType;567UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */568UINT8 PinConfig;569UINT8 Shareable; /* For values, see Interrupt Attributes above */570UINT8 WakeCapable; /* For values, see Interrupt Attributes above */571UINT8 IoRestriction;572UINT8 Triggering; /* For values, see Interrupt Attributes above */573UINT8 Polarity; /* For values, see Interrupt Attributes above */574UINT16 DriveStrength;575UINT16 DebounceTimeout;576UINT16 PinTableLength;577UINT16 VendorLength;578ACPI_RESOURCE_SOURCE ResourceSource;579UINT16 *PinTable;580UINT8 *VendorData;581582} ACPI_RESOURCE_GPIO;583584/* Values for GPIO ConnectionType field above */585586#define ACPI_RESOURCE_GPIO_TYPE_INT 0587#define ACPI_RESOURCE_GPIO_TYPE_IO 1588589/* Values for PinConfig field above */590591#define ACPI_PIN_CONFIG_DEFAULT 0592#define ACPI_PIN_CONFIG_PULLUP 1593#define ACPI_PIN_CONFIG_PULLDOWN 2594#define ACPI_PIN_CONFIG_NOPULL 3595596/* Values for IoRestriction field above */597598#define ACPI_IO_RESTRICT_NONE 0599#define ACPI_IO_RESTRICT_INPUT 1600#define ACPI_IO_RESTRICT_OUTPUT 2601#define ACPI_IO_RESTRICT_NONE_PRESERVE 3602603604/* Common structure for I2C, SPI, UART, CSI2 serial descriptors */605606#define ACPI_RESOURCE_SERIAL_COMMON \607UINT8 RevisionId; \608UINT8 Type; \609UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\610UINT8 SlaveMode; \611UINT8 ConnectionSharing; \612UINT8 TypeRevisionId; \613UINT16 TypeDataLength; \614UINT16 VendorLength; \615ACPI_RESOURCE_SOURCE ResourceSource; \616UINT8 *VendorData;617618typedef struct acpi_resource_common_serialbus619{620ACPI_RESOURCE_SERIAL_COMMON621622} ACPI_RESOURCE_COMMON_SERIALBUS;623624/* Values for the Type field above */625626#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1627#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2628#define ACPI_RESOURCE_SERIAL_TYPE_UART 3629#define ACPI_RESOURCE_SERIAL_TYPE_CSI2 4630631/* Values for SlaveMode field above */632633#define ACPI_CONTROLLER_INITIATED 0634#define ACPI_DEVICE_INITIATED 1635636637typedef struct acpi_resource_i2c_serialbus638{639ACPI_RESOURCE_SERIAL_COMMON640UINT8 AccessMode;641UINT16 SlaveAddress;642UINT32 ConnectionSpeed;643644} ACPI_RESOURCE_I2C_SERIALBUS;645646/* Values for AccessMode field above */647648#define ACPI_I2C_7BIT_MODE 0649#define ACPI_I2C_10BIT_MODE 1650651652typedef struct acpi_resource_spi_serialbus653{654ACPI_RESOURCE_SERIAL_COMMON655UINT8 WireMode;656UINT8 DevicePolarity;657UINT8 DataBitLength;658UINT8 ClockPhase;659UINT8 ClockPolarity;660UINT16 DeviceSelection;661UINT32 ConnectionSpeed;662663} ACPI_RESOURCE_SPI_SERIALBUS;664665/* Values for WireMode field above */666667#define ACPI_SPI_4WIRE_MODE 0668#define ACPI_SPI_3WIRE_MODE 1669670/* Values for DevicePolarity field above */671672#define ACPI_SPI_ACTIVE_LOW 0673#define ACPI_SPI_ACTIVE_HIGH 1674675/* Values for ClockPhase field above */676677#define ACPI_SPI_FIRST_PHASE 0678#define ACPI_SPI_SECOND_PHASE 1679680/* Values for ClockPolarity field above */681682#define ACPI_SPI_START_LOW 0683#define ACPI_SPI_START_HIGH 1684685686typedef struct acpi_resource_uart_serialbus687{688ACPI_RESOURCE_SERIAL_COMMON689UINT8 Endian;690UINT8 DataBits;691UINT8 StopBits;692UINT8 FlowControl;693UINT8 Parity;694UINT8 LinesEnabled;695UINT16 RxFifoSize;696UINT16 TxFifoSize;697UINT32 DefaultBaudRate;698699} ACPI_RESOURCE_UART_SERIALBUS;700701/* Values for Endian field above */702703#define ACPI_UART_LITTLE_ENDIAN 0704#define ACPI_UART_BIG_ENDIAN 1705706/* Values for DataBits field above */707708#define ACPI_UART_5_DATA_BITS 0709#define ACPI_UART_6_DATA_BITS 1710#define ACPI_UART_7_DATA_BITS 2711#define ACPI_UART_8_DATA_BITS 3712#define ACPI_UART_9_DATA_BITS 4713714/* Values for StopBits field above */715716#define ACPI_UART_NO_STOP_BITS 0717#define ACPI_UART_1_STOP_BIT 1718#define ACPI_UART_1P5_STOP_BITS 2719#define ACPI_UART_2_STOP_BITS 3720721/* Values for FlowControl field above */722723#define ACPI_UART_FLOW_CONTROL_NONE 0724#define ACPI_UART_FLOW_CONTROL_HW 1725#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2726727/* Values for Parity field above */728729#define ACPI_UART_PARITY_NONE 0730#define ACPI_UART_PARITY_EVEN 1731#define ACPI_UART_PARITY_ODD 2732#define ACPI_UART_PARITY_MARK 3733#define ACPI_UART_PARITY_SPACE 4734735/* Values for LinesEnabled bitfield above */736737#define ACPI_UART_CARRIER_DETECT (1<<2)738#define ACPI_UART_RING_INDICATOR (1<<3)739#define ACPI_UART_DATA_SET_READY (1<<4)740#define ACPI_UART_DATA_TERMINAL_READY (1<<5)741#define ACPI_UART_CLEAR_TO_SEND (1<<6)742#define ACPI_UART_REQUEST_TO_SEND (1<<7)743744typedef struct acpi_resource_csi2_serialbus745{746ACPI_RESOURCE_SERIAL_COMMON747UINT8 LocalPortInstance;748UINT8 PhyType;749750} ACPI_RESOURCE_CSI2_SERIALBUS;751752typedef struct acpi_resource_pin_function753{754UINT8 RevisionId;755UINT8 PinConfig;756UINT8 Shareable; /* For values, see Interrupt Attributes above */757UINT16 FunctionNumber;758UINT16 PinTableLength;759UINT16 VendorLength;760ACPI_RESOURCE_SOURCE ResourceSource;761UINT16 *PinTable;762UINT8 *VendorData;763764} ACPI_RESOURCE_PIN_FUNCTION;765766typedef struct acpi_resource_pin_config767{768UINT8 RevisionId;769UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */770UINT8 Shareable; /* For values, see Interrupt Attributes above */771UINT8 PinConfigType;772UINT32 PinConfigValue;773UINT16 PinTableLength;774UINT16 VendorLength;775ACPI_RESOURCE_SOURCE ResourceSource;776UINT16 *PinTable;777UINT8 *VendorData;778779} ACPI_RESOURCE_PIN_CONFIG;780781typedef struct acpi_resource_clock_input782{783UINT8 RevisionId;784UINT8 Mode;785UINT8 Scale;786UINT16 FrequencyDivisor;787UINT32 FrequencyNumerator;788ACPI_RESOURCE_SOURCE ResourceSource;789} ACPI_RESOURCE_CLOCK_INPUT;790791/* Values for PinConfigType field above */792793#define ACPI_PIN_CONFIG_DEFAULT 0794#define ACPI_PIN_CONFIG_BIAS_PULL_UP 1795#define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2796#define ACPI_PIN_CONFIG_BIAS_DEFAULT 3797#define ACPI_PIN_CONFIG_BIAS_DISABLE 4798#define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5799#define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6800#define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7801#define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8802#define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9803#define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10804#define ACPI_PIN_CONFIG_SLEW_RATE 11805#define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12806#define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13807808typedef struct acpi_resource_pin_group809{810UINT8 RevisionId;811UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */812UINT16 PinTableLength;813UINT16 VendorLength;814UINT16 *PinTable;815ACPI_RESOURCE_LABEL ResourceLabel;816UINT8 *VendorData;817818} ACPI_RESOURCE_PIN_GROUP;819820typedef struct acpi_resource_pin_group_function821{822UINT8 RevisionId;823UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */824UINT8 Shareable; /* For values, see Interrupt Attributes above */825UINT16 FunctionNumber;826UINT16 VendorLength;827ACPI_RESOURCE_SOURCE ResourceSource;828ACPI_RESOURCE_LABEL ResourceSourceLabel;829UINT8 *VendorData;830831} ACPI_RESOURCE_PIN_GROUP_FUNCTION;832833typedef struct acpi_resource_pin_group_config834{835UINT8 RevisionId;836UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */837UINT8 Shareable; /* For values, see Interrupt Attributes above */838UINT8 PinConfigType; /* For values, see PinConfigType above */839UINT32 PinConfigValue;840UINT16 VendorLength;841ACPI_RESOURCE_SOURCE ResourceSource;842ACPI_RESOURCE_LABEL ResourceSourceLabel;843UINT8 *VendorData;844845} ACPI_RESOURCE_PIN_GROUP_CONFIG;846847/* ACPI_RESOURCE_TYPEs */848849#define ACPI_RESOURCE_TYPE_IRQ 0850#define ACPI_RESOURCE_TYPE_DMA 1851#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2852#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3853#define ACPI_RESOURCE_TYPE_IO 4854#define ACPI_RESOURCE_TYPE_FIXED_IO 5855#define ACPI_RESOURCE_TYPE_VENDOR 6856#define ACPI_RESOURCE_TYPE_END_TAG 7857#define ACPI_RESOURCE_TYPE_MEMORY24 8858#define ACPI_RESOURCE_TYPE_MEMORY32 9859#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10860#define ACPI_RESOURCE_TYPE_ADDRESS16 11861#define ACPI_RESOURCE_TYPE_ADDRESS32 12862#define ACPI_RESOURCE_TYPE_ADDRESS64 13863#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */864#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15865#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16866#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */867#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */868#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */869#define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20 /* ACPI 6.2 */870#define ACPI_RESOURCE_TYPE_PIN_CONFIG 21 /* ACPI 6.2 */871#define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */872#define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */873#define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */874#define ACPI_RESOURCE_TYPE_CLOCK_INPUT 25 /* ACPI 6.5 */875#define ACPI_RESOURCE_TYPE_MAX 25876877/* Master union for resource descriptors */878879typedef union acpi_resource_data880{881ACPI_RESOURCE_IRQ Irq;882ACPI_RESOURCE_DMA Dma;883ACPI_RESOURCE_START_DEPENDENT StartDpf;884ACPI_RESOURCE_IO Io;885ACPI_RESOURCE_FIXED_IO FixedIo;886ACPI_RESOURCE_FIXED_DMA FixedDma;887ACPI_RESOURCE_VENDOR Vendor;888ACPI_RESOURCE_VENDOR_TYPED VendorTyped;889ACPI_RESOURCE_END_TAG EndTag;890ACPI_RESOURCE_MEMORY24 Memory24;891ACPI_RESOURCE_MEMORY32 Memory32;892ACPI_RESOURCE_FIXED_MEMORY32 FixedMemory32;893ACPI_RESOURCE_ADDRESS16 Address16;894ACPI_RESOURCE_ADDRESS32 Address32;895ACPI_RESOURCE_ADDRESS64 Address64;896ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;897ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq;898ACPI_RESOURCE_GENERIC_REGISTER GenericReg;899ACPI_RESOURCE_GPIO Gpio;900ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus;901ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus;902ACPI_RESOURCE_UART_SERIALBUS UartSerialBus;903ACPI_RESOURCE_CSI2_SERIALBUS Csi2SerialBus;904ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus;905ACPI_RESOURCE_PIN_FUNCTION PinFunction;906ACPI_RESOURCE_PIN_CONFIG PinConfig;907ACPI_RESOURCE_PIN_GROUP PinGroup;908ACPI_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction;909ACPI_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig;910ACPI_RESOURCE_CLOCK_INPUT ClockInput;911912/* Common fields */913914ACPI_RESOURCE_ADDRESS Address; /* Common 16/32/64 address fields */915916} ACPI_RESOURCE_DATA;917918919/* Common resource header */920921typedef struct acpi_resource922{923UINT32 Type;924UINT32 Length;925ACPI_RESOURCE_DATA Data;926927} ACPI_RESOURCE;928929/* restore default alignment */930931#pragma pack()932933934#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */935#define ACPI_RS_SIZE_MIN (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)936#define ACPI_RS_SIZE(Type) (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type))937938/* Macro for walking resource templates with multiple descriptors */939940#define ACPI_NEXT_RESOURCE(Res) \941ACPI_ADD_PTR (ACPI_RESOURCE, (Res), (Res)->Length)942943944typedef struct acpi_pci_routing_table945{946UINT32 Length;947UINT32 Pin;948UINT64 Address; /* here for 64-bit alignment */949UINT32 SourceIndex;950union {951char Pad[4]; /* pad to 64 bits so sizeof() works in all cases */952ACPI_FLEX_ARRAY(char, Source);953};954} ACPI_PCI_ROUTING_TABLE;955956#endif /* __ACRESTYP_H__ */957958959