1 /*******************************************************************************
3 * Module Name: rsserial - GPIO/SerialBus resource descriptors
5 ******************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
153 #include "accommon.h"
156 #define _COMPONENT ACPI_RESOURCES
157 ACPI_MODULE_NAME ("rsserial")
160 /*******************************************************************************
164 ******************************************************************************/
166 ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] =
168 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,
169 ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
170 ACPI_RSC_TABLE_SIZE (AcpiRsConvertGpio)},
172 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO,
173 sizeof (AML_RESOURCE_GPIO),
177 * These fields are contiguous in both the source and destination:
181 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.RevisionId),
182 AML_OFFSET (Gpio.RevisionId),
185 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.ProducerConsumer),
186 AML_OFFSET (Gpio.Flags),
189 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Sharable),
190 AML_OFFSET (Gpio.IntFlags),
193 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.WakeCapable),
194 AML_OFFSET (Gpio.IntFlags),
197 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.IoRestriction),
198 AML_OFFSET (Gpio.IntFlags),
201 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Triggering),
202 AML_OFFSET (Gpio.IntFlags),
205 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Polarity),
206 AML_OFFSET (Gpio.IntFlags),
209 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.PinConfig),
210 AML_OFFSET (Gpio.PinConfig),
214 * These fields are contiguous in both the source and destination:
218 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Gpio.DriveStrength),
219 AML_OFFSET (Gpio.DriveStrength),
224 {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTableLength),
225 AML_OFFSET (Gpio.PinTableOffset),
226 AML_OFFSET (Gpio.ResSourceOffset)},
228 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTable),
229 AML_OFFSET (Gpio.PinTableOffset),
232 /* Resource Source */
234 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.Index),
235 AML_OFFSET (Gpio.ResSourceIndex),
238 {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringLength),
239 AML_OFFSET (Gpio.ResSourceOffset),
240 AML_OFFSET (Gpio.VendorOffset)},
242 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringPtr),
243 AML_OFFSET (Gpio.ResSourceOffset),
248 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.Gpio.VendorLength),
249 AML_OFFSET (Gpio.VendorLength),
252 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.VendorData),
253 AML_OFFSET (Gpio.VendorOffset),
257 /*******************************************************************************
259 * AcpiRsConvertPinfunction
261 ******************************************************************************/
263 ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[13] =
265 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_FUNCTION,
266 ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION),
267 ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinFunction)},
269 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_FUNCTION,
270 sizeof (AML_RESOURCE_PIN_FUNCTION),
273 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.RevisionId),
274 AML_OFFSET (PinFunction.RevisionId),
277 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinFunction.Sharable),
278 AML_OFFSET (PinFunction.Flags),
281 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.PinConfig),
282 AML_OFFSET (PinFunction.PinConfig),
285 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinFunction.FunctionNumber),
286 AML_OFFSET (PinFunction.FunctionNumber),
292 * It is OK to use GPIO operations here because none of them refer GPIO
293 * structures directly but instead use offsets given here.
296 {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTableLength),
297 AML_OFFSET (PinFunction.PinTableOffset),
298 AML_OFFSET (PinFunction.ResSourceOffset)},
300 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTable),
301 AML_OFFSET (PinFunction.PinTableOffset),
304 /* Resource Source */
306 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.Index),
307 AML_OFFSET (PinFunction.ResSourceIndex),
310 {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringLength),
311 AML_OFFSET (PinFunction.ResSourceOffset),
312 AML_OFFSET (PinFunction.VendorOffset)},
314 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringPtr),
315 AML_OFFSET (PinFunction.ResSourceOffset),
320 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinFunction.VendorLength),
321 AML_OFFSET (PinFunction.VendorLength),
324 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.VendorData),
325 AML_OFFSET (PinFunction.VendorOffset),
330 /*******************************************************************************
332 * AcpiRsConvertI2cSerialBus
334 ******************************************************************************/
336 ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[17] =
338 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
339 ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS),
340 ACPI_RSC_TABLE_SIZE (AcpiRsConvertI2cSerialBus)},
342 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
343 sizeof (AML_RESOURCE_I2C_SERIALBUS),
346 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
347 AML_OFFSET (CommonSerialBus.RevisionId),
350 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
351 AML_OFFSET (CommonSerialBus.Type),
354 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
355 AML_OFFSET (CommonSerialBus.Flags),
358 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
359 AML_OFFSET (CommonSerialBus.Flags),
362 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
363 AML_OFFSET (CommonSerialBus.Flags),
366 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
367 AML_OFFSET (CommonSerialBus.TypeRevisionId),
370 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
371 AML_OFFSET (CommonSerialBus.TypeDataLength),
376 {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
377 AML_OFFSET (CommonSerialBus.TypeDataLength),
378 AML_RESOURCE_I2C_MIN_DATA_LEN},
380 {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
382 sizeof (AML_RESOURCE_I2C_SERIALBUS)},
384 /* Resource Source */
386 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
387 AML_OFFSET (CommonSerialBus.ResSourceIndex),
390 {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
391 AML_OFFSET (CommonSerialBus.TypeDataLength),
392 sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
394 {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
395 AML_OFFSET (CommonSerialBus.TypeDataLength),
396 sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
398 /* I2C bus type specific */
400 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.I2cSerialBus.AccessMode),
401 AML_OFFSET (I2cSerialBus.TypeSpecificFlags),
404 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.I2cSerialBus.ConnectionSpeed),
405 AML_OFFSET (I2cSerialBus.ConnectionSpeed),
408 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.I2cSerialBus.SlaveAddress),
409 AML_OFFSET (I2cSerialBus.SlaveAddress),
414 /*******************************************************************************
416 * AcpiRsConvertSpiSerialBus
418 ******************************************************************************/
420 ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[21] =
422 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
423 ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),
424 ACPI_RSC_TABLE_SIZE (AcpiRsConvertSpiSerialBus)},
426 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
427 sizeof (AML_RESOURCE_SPI_SERIALBUS),
430 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
431 AML_OFFSET (CommonSerialBus.RevisionId),
434 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
435 AML_OFFSET (CommonSerialBus.Type),
438 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
439 AML_OFFSET (CommonSerialBus.Flags),
442 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
443 AML_OFFSET (CommonSerialBus.Flags),
446 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
447 AML_OFFSET (CommonSerialBus.Flags),
450 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
451 AML_OFFSET (CommonSerialBus.TypeRevisionId),
454 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
455 AML_OFFSET (CommonSerialBus.TypeDataLength),
460 {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
461 AML_OFFSET (CommonSerialBus.TypeDataLength),
462 AML_RESOURCE_SPI_MIN_DATA_LEN},
464 {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
466 sizeof (AML_RESOURCE_SPI_SERIALBUS)},
468 /* Resource Source */
470 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
471 AML_OFFSET (CommonSerialBus.ResSourceIndex),
474 {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
475 AML_OFFSET (CommonSerialBus.TypeDataLength),
476 sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
478 {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
479 AML_OFFSET (CommonSerialBus.TypeDataLength),
480 sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
482 /* Spi bus type specific */
484 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.WireMode),
485 AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
488 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.DevicePolarity),
489 AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
492 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.DataBitLength),
493 AML_OFFSET (SpiSerialBus.DataBitLength),
496 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPhase),
497 AML_OFFSET (SpiSerialBus.ClockPhase),
500 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPolarity),
501 AML_OFFSET (SpiSerialBus.ClockPolarity),
504 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.SpiSerialBus.DeviceSelection),
505 AML_OFFSET (SpiSerialBus.DeviceSelection),
508 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.SpiSerialBus.ConnectionSpeed),
509 AML_OFFSET (SpiSerialBus.ConnectionSpeed),
514 /*******************************************************************************
516 * AcpiRsConvertUartSerialBus
518 ******************************************************************************/
520 ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[23] =
522 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
523 ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),
524 ACPI_RSC_TABLE_SIZE (AcpiRsConvertUartSerialBus)},
526 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
527 sizeof (AML_RESOURCE_UART_SERIALBUS),
530 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
531 AML_OFFSET (CommonSerialBus.RevisionId),
534 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
535 AML_OFFSET (CommonSerialBus.Type),
538 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
539 AML_OFFSET (CommonSerialBus.Flags),
542 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
543 AML_OFFSET (CommonSerialBus.Flags),
546 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
547 AML_OFFSET (CommonSerialBus.Flags),
550 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
551 AML_OFFSET (CommonSerialBus.TypeRevisionId),
554 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
555 AML_OFFSET (CommonSerialBus.TypeDataLength),
560 {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
561 AML_OFFSET (CommonSerialBus.TypeDataLength),
562 AML_RESOURCE_UART_MIN_DATA_LEN},
564 {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
566 sizeof (AML_RESOURCE_UART_SERIALBUS)},
568 /* Resource Source */
570 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
571 AML_OFFSET (CommonSerialBus.ResSourceIndex),
574 {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
575 AML_OFFSET (CommonSerialBus.TypeDataLength),
576 sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
578 {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
579 AML_OFFSET (CommonSerialBus.TypeDataLength),
580 sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
582 /* Uart bus type specific */
584 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.FlowControl),
585 AML_OFFSET (UartSerialBus.TypeSpecificFlags),
588 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.StopBits),
589 AML_OFFSET (UartSerialBus.TypeSpecificFlags),
592 {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.DataBits),
593 AML_OFFSET (UartSerialBus.TypeSpecificFlags),
596 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.Endian),
597 AML_OFFSET (UartSerialBus.TypeSpecificFlags),
600 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.Parity),
601 AML_OFFSET (UartSerialBus.Parity),
604 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.LinesEnabled),
605 AML_OFFSET (UartSerialBus.LinesEnabled),
608 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.RxFifoSize),
609 AML_OFFSET (UartSerialBus.RxFifoSize),
612 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.TxFifoSize),
613 AML_OFFSET (UartSerialBus.TxFifoSize),
616 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.UartSerialBus.DefaultBaudRate),
617 AML_OFFSET (UartSerialBus.DefaultBaudRate),
622 /*******************************************************************************
624 * AcpiRsConvertPinConfig
626 ******************************************************************************/
628 ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[14] =
630 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_CONFIG,
631 ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),
632 ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinConfig)},
634 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_CONFIG,
635 sizeof (AML_RESOURCE_PIN_CONFIG),
638 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.RevisionId),
639 AML_OFFSET (PinConfig.RevisionId),
642 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.Sharable),
643 AML_OFFSET (PinConfig.Flags),
646 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.ProducerConsumer),
647 AML_OFFSET (PinConfig.Flags),
650 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.PinConfigType),
651 AML_OFFSET (PinConfig.PinConfigType),
654 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinConfig.PinConfigValue),
655 AML_OFFSET (PinConfig.PinConfigValue),
661 * It is OK to use GPIO operations here because none of them refer GPIO
662 * structures directly but instead use offsets given here.
665 {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTableLength),
666 AML_OFFSET (PinConfig.PinTableOffset),
667 AML_OFFSET (PinConfig.ResSourceOffset)},
669 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTable),
670 AML_OFFSET (PinConfig.PinTableOffset),
673 /* Resource Source */
675 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.Index),
676 AML_OFFSET (PinConfig.ResSourceIndex),
679 {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringLength),
680 AML_OFFSET (PinConfig.ResSourceOffset),
681 AML_OFFSET (PinConfig.VendorOffset)},
683 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringPtr),
684 AML_OFFSET (PinConfig.ResSourceOffset),
689 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinConfig.VendorLength),
690 AML_OFFSET (PinConfig.VendorLength),
693 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.VendorData),
694 AML_OFFSET (PinConfig.VendorOffset),
698 /*******************************************************************************
700 * AcpiRsConvertPinGroup
702 ******************************************************************************/
704 ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[10] =
706 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP,
707 ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),
708 ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroup)},
710 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP,
711 sizeof (AML_RESOURCE_PIN_GROUP),
714 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroup.RevisionId),
715 AML_OFFSET (PinGroup.RevisionId),
718 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroup.ProducerConsumer),
719 AML_OFFSET (PinGroup.Flags),
725 * It is OK to use GPIO operations here because none of them refer GPIO
726 * structures directly but instead use offsets given here.
729 {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTableLength),
730 AML_OFFSET (PinGroup.PinTableOffset),
731 AML_OFFSET (PinGroup.LabelOffset)},
733 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTable),
734 AML_OFFSET (PinGroup.PinTableOffset),
739 {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringLength),
740 AML_OFFSET (PinGroup.LabelOffset),
741 AML_OFFSET (PinGroup.VendorOffset)},
743 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringPtr),
744 AML_OFFSET (PinGroup.LabelOffset),
749 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroup.VendorLength),
750 AML_OFFSET (PinGroup.VendorLength),
753 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.VendorData),
754 AML_OFFSET (PinGroup.VendorOffset),
758 /*******************************************************************************
760 * AcpiRsConvertPinGroupFunction
762 ******************************************************************************/
764 ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[13] =
766 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION,
767 ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),
768 ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupFunction)},
770 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION,
771 sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION),
774 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.RevisionId),
775 AML_OFFSET (PinGroupFunction.RevisionId),
778 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.Sharable),
779 AML_OFFSET (PinGroupFunction.Flags),
782 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.ProducerConsumer),
783 AML_OFFSET (PinGroupFunction.Flags),
786 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinGroupFunction.FunctionNumber),
787 AML_OFFSET (PinGroupFunction.FunctionNumber),
790 /* Resource Source */
792 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.Index),
793 AML_OFFSET (PinGroupFunction.ResSourceIndex),
796 {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringLength),
797 AML_OFFSET (PinGroupFunction.ResSourceOffset),
798 AML_OFFSET (PinGroupFunction.ResSourceLabelOffset)},
800 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringPtr),
801 AML_OFFSET (PinGroupFunction.ResSourceOffset),
804 /* Resource Source Label */
806 {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringLength),
807 AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
808 AML_OFFSET (PinGroupFunction.VendorOffset)},
810 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringPtr),
811 AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
816 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorLength),
817 AML_OFFSET (PinGroupFunction.VendorLength),
820 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorData),
821 AML_OFFSET (PinGroupFunction.VendorOffset),
825 /*******************************************************************************
827 * AcpiRsConvertPinGroupConfig
829 ******************************************************************************/
831 ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[14] =
833 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG,
834 ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),
835 ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupConfig)},
837 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG,
838 sizeof (AML_RESOURCE_PIN_GROUP_CONFIG),
841 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.RevisionId),
842 AML_OFFSET (PinGroupConfig.RevisionId),
845 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.Sharable),
846 AML_OFFSET (PinGroupConfig.Flags),
849 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.ProducerConsumer),
850 AML_OFFSET (PinGroupConfig.Flags),
853 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigType),
854 AML_OFFSET (PinGroupConfig.PinConfigType),
857 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigValue),
858 AML_OFFSET (PinGroupConfig.PinConfigValue),
861 /* Resource Source */
863 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.Index),
864 AML_OFFSET (PinGroupConfig.ResSourceIndex),
867 {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringLength),
868 AML_OFFSET (PinGroupConfig.ResSourceOffset),
869 AML_OFFSET (PinGroupConfig.ResSourceLabelOffset)},
871 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringPtr),
872 AML_OFFSET (PinGroupConfig.ResSourceOffset),
875 /* Resource Source Label */
877 {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringLength),
878 AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
879 AML_OFFSET (PinGroupConfig.VendorOffset)},
881 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringPtr),
882 AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
887 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorLength),
888 AML_OFFSET (PinGroupConfig.VendorLength),
891 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorData),
892 AML_OFFSET (PinGroupConfig.VendorOffset),