Path: blob/main/sys/contrib/dev/acpica/components/resources/rsserial.c
48406 views
/*******************************************************************************1*2* Module Name: rsserial - GPIO/SerialBus 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#include <contrib/dev/acpica/include/acpi.h>152#include <contrib/dev/acpica/include/accommon.h>153#include <contrib/dev/acpica/include/acresrc.h>154155#define _COMPONENT ACPI_RESOURCES156ACPI_MODULE_NAME ("rsserial")157158159/*******************************************************************************160*161* AcpiRsConvertGpio162*163******************************************************************************/164165ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] =166{167{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,168ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),169ACPI_RSC_TABLE_SIZE (AcpiRsConvertGpio)},170171{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO,172sizeof (AML_RESOURCE_GPIO),1730},174175/*176* These fields are contiguous in both the source and destination:177* RevisionId178* ConnectionType179*/180{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.RevisionId),181AML_OFFSET (Gpio.RevisionId),1822},183184{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.ProducerConsumer),185AML_OFFSET (Gpio.Flags),1860},187188{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Shareable),189AML_OFFSET (Gpio.IntFlags),1903},191192{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.WakeCapable),193AML_OFFSET (Gpio.IntFlags),1944},195196{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.IoRestriction),197AML_OFFSET (Gpio.IntFlags),1980},199200{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Triggering),201AML_OFFSET (Gpio.IntFlags),2020},203204{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Polarity),205AML_OFFSET (Gpio.IntFlags),2061},207208{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.PinConfig),209AML_OFFSET (Gpio.PinConfig),2101},211212/*213* These fields are contiguous in both the source and destination:214* DriveStrength215* DebounceTimeout216*/217{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Gpio.DriveStrength),218AML_OFFSET (Gpio.DriveStrength),2192},220221/* Pin Table */222223{ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTableLength),224AML_OFFSET (Gpio.PinTableOffset),225AML_OFFSET (Gpio.ResSourceOffset)},226227{ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTable),228AML_OFFSET (Gpio.PinTableOffset),2290},230231/* Resource Source */232233{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.Index),234AML_OFFSET (Gpio.ResSourceIndex),2351},236237{ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringLength),238AML_OFFSET (Gpio.ResSourceOffset),239AML_OFFSET (Gpio.VendorOffset)},240241{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringPtr),242AML_OFFSET (Gpio.ResSourceOffset),2430},244245/* Vendor Data */246247{ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.Gpio.VendorLength),248AML_OFFSET (Gpio.VendorLength),2491},250251{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.VendorData),252AML_OFFSET (Gpio.VendorOffset),2530},254};255256/*******************************************************************************257*258* AcpiRsConvertClockInput259*260******************************************************************************/261262ACPI_RSCONVERT_INFO AcpiRsConvertClockInput[8] =263{264{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_CLOCK_INPUT,265ACPI_RS_SIZE (ACPI_RESOURCE_CLOCK_INPUT),266ACPI_RSC_TABLE_SIZE (AcpiRsConvertClockInput)},267268{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_CLOCK_INPUT,269sizeof (AML_RESOURCE_CLOCK_INPUT),2700},271272{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.ClockInput.RevisionId),273AML_OFFSET (ClockInput.RevisionId),2741},275276{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ClockInput.Mode),277AML_OFFSET (ClockInput.Flags),2780},279280{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.ClockInput.Scale),281AML_OFFSET (ClockInput.Flags),2821},283284{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.ClockInput.FrequencyDivisor),285AML_OFFSET (ClockInput.FrequencyDivisor),2862},287288{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ClockInput.FrequencyNumerator),289AML_OFFSET (ClockInput.FrequencyNumerator),2904},291292/* Resource Source */293{ACPI_RSC_SOURCE, ACPI_RS_OFFSET (Data.ClockInput.ResourceSource),2940,295sizeof(AML_RESOURCE_CLOCK_INPUT)},296297};298299300/*******************************************************************************301*302* AcpiRsConvertPinfunction303*304******************************************************************************/305306ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[13] =307{308{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_FUNCTION,309ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION),310ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinFunction)},311312{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_FUNCTION,313sizeof (AML_RESOURCE_PIN_FUNCTION),3140},315316{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.RevisionId),317AML_OFFSET (PinFunction.RevisionId),3181},319320{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinFunction.Shareable),321AML_OFFSET (PinFunction.Flags),3220},323324{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.PinConfig),325AML_OFFSET (PinFunction.PinConfig),3261},327328{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinFunction.FunctionNumber),329AML_OFFSET (PinFunction.FunctionNumber),3302},331332/* Pin Table */333334/*335* It is OK to use GPIO operations here because none of them refer GPIO336* structures directly but instead use offsets given here.337*/338339{ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTableLength),340AML_OFFSET (PinFunction.PinTableOffset),341AML_OFFSET (PinFunction.ResSourceOffset)},342343{ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTable),344AML_OFFSET (PinFunction.PinTableOffset),3450},346347/* Resource Source */348349{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.Index),350AML_OFFSET (PinFunction.ResSourceIndex),3511},352353{ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringLength),354AML_OFFSET (PinFunction.ResSourceOffset),355AML_OFFSET (PinFunction.VendorOffset)},356357{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringPtr),358AML_OFFSET (PinFunction.ResSourceOffset),3590},360361/* Vendor Data */362363{ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinFunction.VendorLength),364AML_OFFSET (PinFunction.VendorLength),3651},366367{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.VendorData),368AML_OFFSET (PinFunction.VendorOffset),3690},370};371372373/*******************************************************************************374*375* AcpiRsConvertCsi2SerialBus376*377******************************************************************************/378379ACPI_RSCONVERT_INFO AcpiRsConvertCsi2SerialBus[14] =380{381{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,382ACPI_RS_SIZE (ACPI_RESOURCE_CSI2_SERIALBUS),383ACPI_RSC_TABLE_SIZE (AcpiRsConvertCsi2SerialBus)},384385{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,386sizeof (AML_RESOURCE_CSI2_SERIALBUS),3870},388389{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),390AML_OFFSET (CommonSerialBus.RevisionId),3911},392393{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Csi2SerialBus.Type),394AML_OFFSET (Csi2SerialBus.Type),3951},396397{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.ProducerConsumer),398AML_OFFSET (Csi2SerialBus.Flags),3991},400401{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.SlaveMode),402AML_OFFSET (Csi2SerialBus.Flags),4030},404405{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.PhyType),406AML_OFFSET (Csi2SerialBus.TypeSpecificFlags),4070},408409{ACPI_RSC_6BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.LocalPortInstance),410AML_OFFSET (Csi2SerialBus.TypeSpecificFlags),4112},412413{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Csi2SerialBus.TypeRevisionId),414AML_OFFSET (Csi2SerialBus.TypeRevisionId),4151},416417/* Vendor data */418419{ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.Csi2SerialBus.VendorLength),420AML_OFFSET (Csi2SerialBus.TypeDataLength),421AML_RESOURCE_CSI2_MIN_DATA_LEN},422423{ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.Csi2SerialBus.VendorData),4240,425sizeof (AML_RESOURCE_CSI2_SERIALBUS)},426427/* Resource Source */428429{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.Index),430AML_OFFSET (Csi2SerialBus.ResSourceIndex),4311},432433{ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.StringLength),434AML_OFFSET (Csi2SerialBus.TypeDataLength),435sizeof (AML_RESOURCE_CSI2_SERIALBUS)},436437{ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.StringPtr),438AML_OFFSET (Csi2SerialBus.TypeDataLength),439sizeof (AML_RESOURCE_CSI2_SERIALBUS)},440};441442443/*******************************************************************************444*445* AcpiRsConvertI2cSerialBus446*447******************************************************************************/448449ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[17] =450{451{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,452ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS),453ACPI_RSC_TABLE_SIZE (AcpiRsConvertI2cSerialBus)},454455{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,456sizeof (AML_RESOURCE_I2C_SERIALBUS),4570},458459{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),460AML_OFFSET (CommonSerialBus.RevisionId),4611},462463{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),464AML_OFFSET (CommonSerialBus.Type),4651},466467{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),468AML_OFFSET (CommonSerialBus.Flags),4690},470471{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),472AML_OFFSET (CommonSerialBus.Flags),4731},474475{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),476AML_OFFSET (CommonSerialBus.Flags),4772},478479{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),480AML_OFFSET (CommonSerialBus.TypeRevisionId),4811},482483{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),484AML_OFFSET (CommonSerialBus.TypeDataLength),4851},486487/* Vendor data */488489{ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),490AML_OFFSET (CommonSerialBus.TypeDataLength),491AML_RESOURCE_I2C_MIN_DATA_LEN},492493{ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),4940,495sizeof (AML_RESOURCE_I2C_SERIALBUS)},496497/* Resource Source */498499{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),500AML_OFFSET (CommonSerialBus.ResSourceIndex),5011},502503{ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),504AML_OFFSET (CommonSerialBus.TypeDataLength),505sizeof (AML_RESOURCE_COMMON_SERIALBUS)},506507{ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),508AML_OFFSET (CommonSerialBus.TypeDataLength),509sizeof (AML_RESOURCE_COMMON_SERIALBUS)},510511/* I2C bus type specific */512513{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.I2cSerialBus.AccessMode),514AML_OFFSET (I2cSerialBus.TypeSpecificFlags),5150},516517{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.I2cSerialBus.ConnectionSpeed),518AML_OFFSET (I2cSerialBus.ConnectionSpeed),5191},520521{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.I2cSerialBus.SlaveAddress),522AML_OFFSET (I2cSerialBus.SlaveAddress),5231},524};525526527/*******************************************************************************528*529* AcpiRsConvertSpiSerialBus530*531******************************************************************************/532533ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[21] =534{535{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,536ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),537ACPI_RSC_TABLE_SIZE (AcpiRsConvertSpiSerialBus)},538539{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,540sizeof (AML_RESOURCE_SPI_SERIALBUS),5410},542543{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),544AML_OFFSET (CommonSerialBus.RevisionId),5451},546547{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),548AML_OFFSET (CommonSerialBus.Type),5491},550551{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),552AML_OFFSET (CommonSerialBus.Flags),5530},554555{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),556AML_OFFSET (CommonSerialBus.Flags),5571},558559{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),560AML_OFFSET (CommonSerialBus.Flags),5612},562563{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),564AML_OFFSET (CommonSerialBus.TypeRevisionId),5651},566567{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),568AML_OFFSET (CommonSerialBus.TypeDataLength),5691},570571/* Vendor data */572573{ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),574AML_OFFSET (CommonSerialBus.TypeDataLength),575AML_RESOURCE_SPI_MIN_DATA_LEN},576577{ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),5780,579sizeof (AML_RESOURCE_SPI_SERIALBUS)},580581/* Resource Source */582583{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),584AML_OFFSET (CommonSerialBus.ResSourceIndex),5851},586587{ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),588AML_OFFSET (CommonSerialBus.TypeDataLength),589sizeof (AML_RESOURCE_COMMON_SERIALBUS)},590591{ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),592AML_OFFSET (CommonSerialBus.TypeDataLength),593sizeof (AML_RESOURCE_COMMON_SERIALBUS)},594595/* Spi bus type specific */596597{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.WireMode),598AML_OFFSET (SpiSerialBus.TypeSpecificFlags),5990},600601{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.DevicePolarity),602AML_OFFSET (SpiSerialBus.TypeSpecificFlags),6031},604605{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.DataBitLength),606AML_OFFSET (SpiSerialBus.DataBitLength),6071},608609{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPhase),610AML_OFFSET (SpiSerialBus.ClockPhase),6111},612613{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPolarity),614AML_OFFSET (SpiSerialBus.ClockPolarity),6151},616617{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.SpiSerialBus.DeviceSelection),618AML_OFFSET (SpiSerialBus.DeviceSelection),6191},620621{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.SpiSerialBus.ConnectionSpeed),622AML_OFFSET (SpiSerialBus.ConnectionSpeed),6231},624};625626627/*******************************************************************************628*629* AcpiRsConvertUartSerialBus630*631******************************************************************************/632633ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[23] =634{635{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,636ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),637ACPI_RSC_TABLE_SIZE (AcpiRsConvertUartSerialBus)},638639{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,640sizeof (AML_RESOURCE_UART_SERIALBUS),6410},642643{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),644AML_OFFSET (CommonSerialBus.RevisionId),6451},646647{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),648AML_OFFSET (CommonSerialBus.Type),6491},650651{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),652AML_OFFSET (CommonSerialBus.Flags),6530},654655{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),656AML_OFFSET (CommonSerialBus.Flags),6571},658659{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),660AML_OFFSET (CommonSerialBus.Flags),6612},662663{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),664AML_OFFSET (CommonSerialBus.TypeRevisionId),6651},666667{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),668AML_OFFSET (CommonSerialBus.TypeDataLength),6691},670671/* Vendor data */672673{ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),674AML_OFFSET (CommonSerialBus.TypeDataLength),675AML_RESOURCE_UART_MIN_DATA_LEN},676677{ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),6780,679sizeof (AML_RESOURCE_UART_SERIALBUS)},680681/* Resource Source */682683{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),684AML_OFFSET (CommonSerialBus.ResSourceIndex),6851},686687{ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),688AML_OFFSET (CommonSerialBus.TypeDataLength),689sizeof (AML_RESOURCE_COMMON_SERIALBUS)},690691{ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),692AML_OFFSET (CommonSerialBus.TypeDataLength),693sizeof (AML_RESOURCE_COMMON_SERIALBUS)},694695/* Uart bus type specific */696697{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.FlowControl),698AML_OFFSET (UartSerialBus.TypeSpecificFlags),6990},700701{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.StopBits),702AML_OFFSET (UartSerialBus.TypeSpecificFlags),7032},704705{ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.DataBits),706AML_OFFSET (UartSerialBus.TypeSpecificFlags),7074},708709{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.Endian),710AML_OFFSET (UartSerialBus.TypeSpecificFlags),7117},712713{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.Parity),714AML_OFFSET (UartSerialBus.Parity),7151},716717{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.LinesEnabled),718AML_OFFSET (UartSerialBus.LinesEnabled),7191},720721{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.RxFifoSize),722AML_OFFSET (UartSerialBus.RxFifoSize),7231},724725{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.TxFifoSize),726AML_OFFSET (UartSerialBus.TxFifoSize),7271},728729{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.UartSerialBus.DefaultBaudRate),730AML_OFFSET (UartSerialBus.DefaultBaudRate),7311},732};733734735/*******************************************************************************736*737* AcpiRsConvertPinConfig738*739******************************************************************************/740741ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[14] =742{743{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_CONFIG,744ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),745ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinConfig)},746747{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_CONFIG,748sizeof (AML_RESOURCE_PIN_CONFIG),7490},750751{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.RevisionId),752AML_OFFSET (PinConfig.RevisionId),7531},754755{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.Shareable),756AML_OFFSET (PinConfig.Flags),7570},758759{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.ProducerConsumer),760AML_OFFSET (PinConfig.Flags),7611},762763{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.PinConfigType),764AML_OFFSET (PinConfig.PinConfigType),7651},766767{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinConfig.PinConfigValue),768AML_OFFSET (PinConfig.PinConfigValue),7691},770771/* Pin Table */772773/*774* It is OK to use GPIO operations here because none of them refer GPIO775* structures directly but instead use offsets given here.776*/777778{ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTableLength),779AML_OFFSET (PinConfig.PinTableOffset),780AML_OFFSET (PinConfig.ResSourceOffset)},781782{ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTable),783AML_OFFSET (PinConfig.PinTableOffset),7840},785786/* Resource Source */787788{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.Index),789AML_OFFSET (PinConfig.ResSourceIndex),7901},791792{ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringLength),793AML_OFFSET (PinConfig.ResSourceOffset),794AML_OFFSET (PinConfig.VendorOffset)},795796{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringPtr),797AML_OFFSET (PinConfig.ResSourceOffset),7980},799800/* Vendor Data */801802{ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinConfig.VendorLength),803AML_OFFSET (PinConfig.VendorLength),8041},805806{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.VendorData),807AML_OFFSET (PinConfig.VendorOffset),8080},809};810811/*******************************************************************************812*813* AcpiRsConvertPinGroup814*815******************************************************************************/816817ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[10] =818{819{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP,820ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),821ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroup)},822823{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP,824sizeof (AML_RESOURCE_PIN_GROUP),8250},826827{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroup.RevisionId),828AML_OFFSET (PinGroup.RevisionId),8291},830831{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroup.ProducerConsumer),832AML_OFFSET (PinGroup.Flags),8330},834835/* Pin Table */836837/*838* It is OK to use GPIO operations here because none of them refer GPIO839* structures directly but instead use offsets given here.840*/841842{ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTableLength),843AML_OFFSET (PinGroup.PinTableOffset),844AML_OFFSET (PinGroup.LabelOffset)},845846{ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTable),847AML_OFFSET (PinGroup.PinTableOffset),8480},849850/* Resource Label */851852{ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringLength),853AML_OFFSET (PinGroup.LabelOffset),854AML_OFFSET (PinGroup.VendorOffset)},855856{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringPtr),857AML_OFFSET (PinGroup.LabelOffset),8580},859860/* Vendor Data */861862{ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroup.VendorLength),863AML_OFFSET (PinGroup.VendorLength),8641},865866{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.VendorData),867AML_OFFSET (PinGroup.VendorOffset),8680},869};870871/*******************************************************************************872*873* AcpiRsConvertPinGroupFunction874*875******************************************************************************/876877ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[13] =878{879{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION,880ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),881ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupFunction)},882883{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION,884sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION),8850},886887{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.RevisionId),888AML_OFFSET (PinGroupFunction.RevisionId),8891},890891{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.Shareable),892AML_OFFSET (PinGroupFunction.Flags),8930},894895{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.ProducerConsumer),896AML_OFFSET (PinGroupFunction.Flags),8971},898899{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinGroupFunction.FunctionNumber),900AML_OFFSET (PinGroupFunction.FunctionNumber),9011},902903/* Resource Source */904905{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.Index),906AML_OFFSET (PinGroupFunction.ResSourceIndex),9071},908909{ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringLength),910AML_OFFSET (PinGroupFunction.ResSourceOffset),911AML_OFFSET (PinGroupFunction.ResSourceLabelOffset)},912913{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringPtr),914AML_OFFSET (PinGroupFunction.ResSourceOffset),9150},916917/* Resource Source Label */918919{ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringLength),920AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),921AML_OFFSET (PinGroupFunction.VendorOffset)},922923{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringPtr),924AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),9250},926927/* Vendor Data */928929{ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorLength),930AML_OFFSET (PinGroupFunction.VendorLength),9311},932933{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorData),934AML_OFFSET (PinGroupFunction.VendorOffset),9350},936};937938/*******************************************************************************939*940* AcpiRsConvertPinGroupConfig941*942******************************************************************************/943944ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[14] =945{946{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG,947ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),948ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupConfig)},949950{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG,951sizeof (AML_RESOURCE_PIN_GROUP_CONFIG),9520},953954{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.RevisionId),955AML_OFFSET (PinGroupConfig.RevisionId),9561},957958{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.Shareable),959AML_OFFSET (PinGroupConfig.Flags),9600},961962{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.ProducerConsumer),963AML_OFFSET (PinGroupConfig.Flags),9641},965966{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigType),967AML_OFFSET (PinGroupConfig.PinConfigType),9681},969970{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigValue),971AML_OFFSET (PinGroupConfig.PinConfigValue),9721},973974/* Resource Source */975976{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.Index),977AML_OFFSET (PinGroupConfig.ResSourceIndex),9781},979980{ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringLength),981AML_OFFSET (PinGroupConfig.ResSourceOffset),982AML_OFFSET (PinGroupConfig.ResSourceLabelOffset)},983984{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringPtr),985AML_OFFSET (PinGroupConfig.ResSourceOffset),9860},987988/* Resource Source Label */989990{ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringLength),991AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),992AML_OFFSET (PinGroupConfig.VendorOffset)},993994{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringPtr),995AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),9960},997998/* Vendor Data */9991000{ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorLength),1001AML_OFFSET (PinGroupConfig.VendorLength),10021},10031004{ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorData),1005AML_OFFSET (PinGroupConfig.VendorOffset),10060},1007};100810091010