rsserial.c revision 1.1.1.14 1 1.1 christos /*******************************************************************************
2 1.1 christos *
3 1.1 christos * Module Name: rsserial - GPIO/SerialBus resource descriptors
4 1.1 christos *
5 1.1 christos ******************************************************************************/
6 1.1 christos
7 1.1.1.14 christos /******************************************************************************
8 1.1.1.14 christos *
9 1.1.1.14 christos * 1. Copyright Notice
10 1.1.1.14 christos *
11 1.1.1.14 christos * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
12 1.1 christos * All rights reserved.
13 1.1 christos *
14 1.1.1.14 christos * 2. License
15 1.1.1.14 christos *
16 1.1.1.14 christos * 2.1. This is your license from Intel Corp. under its intellectual property
17 1.1.1.14 christos * rights. You may have additional license terms from the party that provided
18 1.1.1.14 christos * you this software, covering your right to use that party's intellectual
19 1.1.1.14 christos * property rights.
20 1.1.1.14 christos *
21 1.1.1.14 christos * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 1.1.1.14 christos * copy of the source code appearing in this file ("Covered Code") an
23 1.1.1.14 christos * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 1.1.1.14 christos * base code distributed originally by Intel ("Original Intel Code") to copy,
25 1.1.1.14 christos * make derivatives, distribute, use and display any portion of the Covered
26 1.1.1.14 christos * Code in any form, with the right to sublicense such rights; and
27 1.1.1.14 christos *
28 1.1.1.14 christos * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 1.1.1.14 christos * license (with the right to sublicense), under only those claims of Intel
30 1.1.1.14 christos * patents that are infringed by the Original Intel Code, to make, use, sell,
31 1.1.1.14 christos * offer to sell, and import the Covered Code and derivative works thereof
32 1.1.1.14 christos * solely to the minimum extent necessary to exercise the above copyright
33 1.1.1.14 christos * license, and in no event shall the patent license extend to any additions
34 1.1.1.14 christos * to or modifications of the Original Intel Code. No other license or right
35 1.1.1.14 christos * is granted directly or by implication, estoppel or otherwise;
36 1.1.1.14 christos *
37 1.1.1.14 christos * The above copyright and patent license is granted only if the following
38 1.1.1.14 christos * conditions are met:
39 1.1.1.14 christos *
40 1.1.1.14 christos * 3. Conditions
41 1.1.1.14 christos *
42 1.1.1.14 christos * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 1.1.1.14 christos * Redistribution of source code of any substantial portion of the Covered
44 1.1.1.14 christos * Code or modification with rights to further distribute source must include
45 1.1.1.14 christos * the above Copyright Notice, the above License, this list of Conditions,
46 1.1.1.14 christos * and the following Disclaimer and Export Compliance provision. In addition,
47 1.1.1.14 christos * Licensee must cause all Covered Code to which Licensee contributes to
48 1.1.1.14 christos * contain a file documenting the changes Licensee made to create that Covered
49 1.1.1.14 christos * Code and the date of any change. Licensee must include in that file the
50 1.1.1.14 christos * documentation of any changes made by any predecessor Licensee. Licensee
51 1.1.1.14 christos * must include a prominent statement that the modification is derived,
52 1.1.1.14 christos * directly or indirectly, from Original Intel Code.
53 1.1.1.14 christos *
54 1.1.1.14 christos * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 1.1.1.14 christos * Redistribution of source code of any substantial portion of the Covered
56 1.1.1.14 christos * Code or modification without rights to further distribute source must
57 1.1.1.14 christos * include the following Disclaimer and Export Compliance provision in the
58 1.1.1.14 christos * documentation and/or other materials provided with distribution. In
59 1.1.1.14 christos * addition, Licensee may not authorize further sublicense of source of any
60 1.1.1.14 christos * portion of the Covered Code, and must include terms to the effect that the
61 1.1.1.14 christos * license from Licensee to its licensee is limited to the intellectual
62 1.1.1.14 christos * property embodied in the software Licensee provides to its licensee, and
63 1.1.1.14 christos * not to intellectual property embodied in modifications its licensee may
64 1.1.1.14 christos * make.
65 1.1.1.14 christos *
66 1.1.1.14 christos * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 1.1.1.14 christos * substantial portion of the Covered Code or modification must reproduce the
68 1.1.1.14 christos * above Copyright Notice, and the following Disclaimer and Export Compliance
69 1.1.1.14 christos * provision in the documentation and/or other materials provided with the
70 1.1.1.14 christos * distribution.
71 1.1.1.14 christos *
72 1.1.1.14 christos * 3.4. Intel retains all right, title, and interest in and to the Original
73 1.1.1.14 christos * Intel Code.
74 1.1.1.14 christos *
75 1.1.1.14 christos * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 1.1.1.14 christos * Intel shall be used in advertising or otherwise to promote the sale, use or
77 1.1.1.14 christos * other dealings in products derived from or relating to the Covered Code
78 1.1.1.14 christos * without prior written authorization from Intel.
79 1.1.1.14 christos *
80 1.1.1.14 christos * 4. Disclaimer and Export Compliance
81 1.1.1.14 christos *
82 1.1.1.14 christos * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 1.1.1.14 christos * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 1.1.1.14 christos * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 1.1.1.14 christos * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 1.1.1.14 christos * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 1.1.1.14 christos * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88 1.1.1.14 christos * PARTICULAR PURPOSE.
89 1.1.1.14 christos *
90 1.1.1.14 christos * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 1.1.1.14 christos * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 1.1.1.14 christos * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 1.1.1.14 christos * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 1.1.1.14 christos * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 1.1.1.14 christos * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 1.1.1.14 christos * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97 1.1.1.14 christos * LIMITED REMEDY.
98 1.1.1.14 christos *
99 1.1.1.14 christos * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 1.1.1.14 christos * software or system incorporating such software without first obtaining any
101 1.1.1.14 christos * required license or other approval from the U. S. Department of Commerce or
102 1.1.1.14 christos * any other agency or department of the United States Government. In the
103 1.1.1.14 christos * event Licensee exports any such software from the United States or
104 1.1.1.14 christos * re-exports any such software from a foreign destination, Licensee shall
105 1.1.1.14 christos * ensure that the distribution and export/re-export of the software is in
106 1.1.1.14 christos * compliance with all laws, regulations, orders, or other restrictions of the
107 1.1.1.14 christos * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 1.1.1.14 christos * any of its subsidiaries will export/re-export any technical data, process,
109 1.1.1.14 christos * software, or service, directly or indirectly, to any country for which the
110 1.1.1.14 christos * United States government or any agency thereof requires an export license,
111 1.1.1.14 christos * other governmental approval, or letter of assurance, without first obtaining
112 1.1.1.14 christos * such license, approval or letter.
113 1.1.1.14 christos *
114 1.1.1.14 christos *****************************************************************************
115 1.1.1.14 christos *
116 1.1.1.14 christos * Alternatively, you may choose to be licensed under the terms of the
117 1.1.1.14 christos * following license:
118 1.1.1.14 christos *
119 1.1 christos * Redistribution and use in source and binary forms, with or without
120 1.1 christos * modification, are permitted provided that the following conditions
121 1.1 christos * are met:
122 1.1 christos * 1. Redistributions of source code must retain the above copyright
123 1.1 christos * notice, this list of conditions, and the following disclaimer,
124 1.1 christos * without modification.
125 1.1 christos * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 1.1 christos * substantially similar to the "NO WARRANTY" disclaimer below
127 1.1 christos * ("Disclaimer") and any redistribution must be conditioned upon
128 1.1 christos * including a substantially similar Disclaimer requirement for further
129 1.1 christos * binary redistribution.
130 1.1 christos * 3. Neither the names of the above-listed copyright holders nor the names
131 1.1 christos * of any contributors may be used to endorse or promote products derived
132 1.1 christos * from this software without specific prior written permission.
133 1.1 christos *
134 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 1.1 christos * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 1.1.1.11 christos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 1.1 christos * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 1.1.1.14 christos * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 1.1.1.14 christos * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 1.1.1.14 christos * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 1.1.1.14 christos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 1.1.1.14 christos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 1.1.1.14 christos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 1.1.1.14 christos * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145 1.1.1.14 christos *
146 1.1.1.14 christos * Alternatively, you may choose to be licensed under the terms of the
147 1.1.1.14 christos * GNU General Public License ("GPL") version 2 as published by the Free
148 1.1.1.14 christos * Software Foundation.
149 1.1.1.14 christos *
150 1.1.1.14 christos *****************************************************************************/
151 1.1 christos
152 1.1 christos #include "acpi.h"
153 1.1 christos #include "accommon.h"
154 1.1 christos #include "acresrc.h"
155 1.1 christos
156 1.1 christos #define _COMPONENT ACPI_RESOURCES
157 1.1 christos ACPI_MODULE_NAME ("rsserial")
158 1.1 christos
159 1.1 christos
160 1.1 christos /*******************************************************************************
161 1.1 christos *
162 1.1 christos * AcpiRsConvertGpio
163 1.1 christos *
164 1.1 christos ******************************************************************************/
165 1.1 christos
166 1.1 christos ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] =
167 1.1 christos {
168 1.1 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,
169 1.1 christos ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
170 1.1 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertGpio)},
171 1.1 christos
172 1.1 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO,
173 1.1 christos sizeof (AML_RESOURCE_GPIO),
174 1.1 christos 0},
175 1.1 christos
176 1.1 christos /*
177 1.1 christos * These fields are contiguous in both the source and destination:
178 1.1 christos * RevisionId
179 1.1 christos * ConnectionType
180 1.1 christos */
181 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.RevisionId),
182 1.1 christos AML_OFFSET (Gpio.RevisionId),
183 1.1 christos 2},
184 1.1 christos
185 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.ProducerConsumer),
186 1.1 christos AML_OFFSET (Gpio.Flags),
187 1.1 christos 0},
188 1.1 christos
189 1.1.1.9 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Shareable),
190 1.1 christos AML_OFFSET (Gpio.IntFlags),
191 1.1 christos 3},
192 1.1 christos
193 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.WakeCapable),
194 1.1 christos AML_OFFSET (Gpio.IntFlags),
195 1.1 christos 4},
196 1.1 christos
197 1.1 christos {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.IoRestriction),
198 1.1 christos AML_OFFSET (Gpio.IntFlags),
199 1.1 christos 0},
200 1.1 christos
201 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Triggering),
202 1.1 christos AML_OFFSET (Gpio.IntFlags),
203 1.1 christos 0},
204 1.1 christos
205 1.1 christos {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Polarity),
206 1.1 christos AML_OFFSET (Gpio.IntFlags),
207 1.1 christos 1},
208 1.1 christos
209 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.PinConfig),
210 1.1 christos AML_OFFSET (Gpio.PinConfig),
211 1.1 christos 1},
212 1.1 christos
213 1.1 christos /*
214 1.1 christos * These fields are contiguous in both the source and destination:
215 1.1 christos * DriveStrength
216 1.1 christos * DebounceTimeout
217 1.1 christos */
218 1.1 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Gpio.DriveStrength),
219 1.1 christos AML_OFFSET (Gpio.DriveStrength),
220 1.1 christos 2},
221 1.1 christos
222 1.1 christos /* Pin Table */
223 1.1 christos
224 1.1 christos {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTableLength),
225 1.1 christos AML_OFFSET (Gpio.PinTableOffset),
226 1.1 christos AML_OFFSET (Gpio.ResSourceOffset)},
227 1.1 christos
228 1.1 christos {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTable),
229 1.1 christos AML_OFFSET (Gpio.PinTableOffset),
230 1.1 christos 0},
231 1.1 christos
232 1.1 christos /* Resource Source */
233 1.1 christos
234 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.Index),
235 1.1 christos AML_OFFSET (Gpio.ResSourceIndex),
236 1.1 christos 1},
237 1.1 christos
238 1.1 christos {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringLength),
239 1.1 christos AML_OFFSET (Gpio.ResSourceOffset),
240 1.1 christos AML_OFFSET (Gpio.VendorOffset)},
241 1.1 christos
242 1.1 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringPtr),
243 1.1 christos AML_OFFSET (Gpio.ResSourceOffset),
244 1.1 christos 0},
245 1.1 christos
246 1.1 christos /* Vendor Data */
247 1.1 christos
248 1.1 christos {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.Gpio.VendorLength),
249 1.1 christos AML_OFFSET (Gpio.VendorLength),
250 1.1 christos 1},
251 1.1 christos
252 1.1 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.VendorData),
253 1.1 christos AML_OFFSET (Gpio.VendorOffset),
254 1.1 christos 0},
255 1.1 christos };
256 1.1 christos
257 1.1.1.7 christos /*******************************************************************************
258 1.1.1.7 christos *
259 1.1.1.13 christos * AcpiRsConvertClockInput
260 1.1.1.13 christos *
261 1.1.1.13 christos ******************************************************************************/
262 1.1.1.13 christos
263 1.1.1.13 christos ACPI_RSCONVERT_INFO AcpiRsConvertClockInput[8] =
264 1.1.1.13 christos {
265 1.1.1.13 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_CLOCK_INPUT,
266 1.1.1.13 christos ACPI_RS_SIZE (ACPI_RESOURCE_CLOCK_INPUT),
267 1.1.1.13 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertClockInput)},
268 1.1.1.13 christos
269 1.1.1.13 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_CLOCK_INPUT,
270 1.1.1.13 christos sizeof (AML_RESOURCE_CLOCK_INPUT),
271 1.1.1.13 christos 0},
272 1.1.1.13 christos
273 1.1.1.13 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.ClockInput.RevisionId),
274 1.1.1.13 christos AML_OFFSET (ClockInput.RevisionId),
275 1.1.1.13 christos 1},
276 1.1.1.13 christos
277 1.1.1.13 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ClockInput.Mode),
278 1.1.1.13 christos AML_OFFSET (ClockInput.Flags),
279 1.1.1.13 christos 0},
280 1.1.1.13 christos
281 1.1.1.13 christos {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.ClockInput.Scale),
282 1.1.1.13 christos AML_OFFSET (ClockInput.Flags),
283 1.1.1.13 christos 1},
284 1.1.1.13 christos
285 1.1.1.13 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.ClockInput.FrequencyDivisor),
286 1.1.1.13 christos AML_OFFSET (ClockInput.FrequencyDivisor),
287 1.1.1.13 christos 2},
288 1.1.1.13 christos
289 1.1.1.13 christos {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ClockInput.FrequencyNumerator),
290 1.1.1.13 christos AML_OFFSET (ClockInput.FrequencyNumerator),
291 1.1.1.13 christos 4},
292 1.1.1.13 christos
293 1.1.1.13 christos /* Resource Source */
294 1.1.1.13 christos {ACPI_RSC_SOURCE, ACPI_RS_OFFSET (Data.ClockInput.ResourceSource),
295 1.1.1.13 christos 0,
296 1.1.1.13 christos sizeof(AML_RESOURCE_CLOCK_INPUT)},
297 1.1.1.13 christos
298 1.1.1.13 christos };
299 1.1.1.13 christos
300 1.1.1.13 christos
301 1.1.1.13 christos /*******************************************************************************
302 1.1.1.13 christos *
303 1.1.1.7 christos * AcpiRsConvertPinfunction
304 1.1.1.7 christos *
305 1.1.1.7 christos ******************************************************************************/
306 1.1.1.7 christos
307 1.1.1.7 christos ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[13] =
308 1.1.1.7 christos {
309 1.1.1.7 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_FUNCTION,
310 1.1.1.7 christos ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION),
311 1.1.1.7 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinFunction)},
312 1.1.1.7 christos
313 1.1.1.7 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_FUNCTION,
314 1.1.1.7 christos sizeof (AML_RESOURCE_PIN_FUNCTION),
315 1.1.1.7 christos 0},
316 1.1.1.7 christos
317 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.RevisionId),
318 1.1.1.7 christos AML_OFFSET (PinFunction.RevisionId),
319 1.1.1.7 christos 1},
320 1.1.1.7 christos
321 1.1.1.9 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinFunction.Shareable),
322 1.1.1.7 christos AML_OFFSET (PinFunction.Flags),
323 1.1.1.7 christos 0},
324 1.1.1.7 christos
325 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.PinConfig),
326 1.1.1.7 christos AML_OFFSET (PinFunction.PinConfig),
327 1.1.1.7 christos 1},
328 1.1.1.7 christos
329 1.1.1.7 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinFunction.FunctionNumber),
330 1.1.1.7 christos AML_OFFSET (PinFunction.FunctionNumber),
331 1.1.1.7 christos 2},
332 1.1.1.7 christos
333 1.1.1.7 christos /* Pin Table */
334 1.1.1.7 christos
335 1.1.1.7 christos /*
336 1.1.1.7 christos * It is OK to use GPIO operations here because none of them refer GPIO
337 1.1.1.7 christos * structures directly but instead use offsets given here.
338 1.1.1.7 christos */
339 1.1.1.7 christos
340 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTableLength),
341 1.1.1.7 christos AML_OFFSET (PinFunction.PinTableOffset),
342 1.1.1.7 christos AML_OFFSET (PinFunction.ResSourceOffset)},
343 1.1.1.7 christos
344 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTable),
345 1.1.1.7 christos AML_OFFSET (PinFunction.PinTableOffset),
346 1.1.1.7 christos 0},
347 1.1.1.7 christos
348 1.1.1.7 christos /* Resource Source */
349 1.1.1.7 christos
350 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.Index),
351 1.1.1.7 christos AML_OFFSET (PinFunction.ResSourceIndex),
352 1.1.1.7 christos 1},
353 1.1.1.7 christos
354 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringLength),
355 1.1.1.7 christos AML_OFFSET (PinFunction.ResSourceOffset),
356 1.1.1.7 christos AML_OFFSET (PinFunction.VendorOffset)},
357 1.1.1.7 christos
358 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringPtr),
359 1.1.1.7 christos AML_OFFSET (PinFunction.ResSourceOffset),
360 1.1.1.7 christos 0},
361 1.1.1.7 christos
362 1.1.1.7 christos /* Vendor Data */
363 1.1.1.7 christos
364 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinFunction.VendorLength),
365 1.1.1.7 christos AML_OFFSET (PinFunction.VendorLength),
366 1.1.1.7 christos 1},
367 1.1.1.7 christos
368 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.VendorData),
369 1.1.1.7 christos AML_OFFSET (PinFunction.VendorOffset),
370 1.1.1.7 christos 0},
371 1.1.1.7 christos };
372 1.1.1.7 christos
373 1.1 christos
374 1.1 christos /*******************************************************************************
375 1.1 christos *
376 1.1.1.11 christos * AcpiRsConvertCsi2SerialBus
377 1.1.1.11 christos *
378 1.1.1.11 christos ******************************************************************************/
379 1.1.1.11 christos
380 1.1.1.11 christos ACPI_RSCONVERT_INFO AcpiRsConvertCsi2SerialBus[14] =
381 1.1.1.11 christos {
382 1.1.1.11 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
383 1.1.1.11 christos ACPI_RS_SIZE (ACPI_RESOURCE_CSI2_SERIALBUS),
384 1.1.1.11 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertCsi2SerialBus)},
385 1.1.1.11 christos
386 1.1.1.11 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
387 1.1.1.11 christos sizeof (AML_RESOURCE_CSI2_SERIALBUS),
388 1.1.1.11 christos 0},
389 1.1.1.11 christos
390 1.1.1.11 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
391 1.1.1.11 christos AML_OFFSET (CommonSerialBus.RevisionId),
392 1.1.1.11 christos 1},
393 1.1.1.11 christos
394 1.1.1.11 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Csi2SerialBus.Type),
395 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.Type),
396 1.1.1.11 christos 1},
397 1.1.1.11 christos
398 1.1.1.11 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.ProducerConsumer),
399 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.Flags),
400 1.1.1.11 christos 1},
401 1.1.1.11 christos
402 1.1.1.11 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.SlaveMode),
403 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.Flags),
404 1.1.1.11 christos 0},
405 1.1.1.11 christos
406 1.1.1.11 christos {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.PhyType),
407 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.TypeSpecificFlags),
408 1.1.1.11 christos 0},
409 1.1.1.11 christos
410 1.1.1.11 christos {ACPI_RSC_6BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.LocalPortInstance),
411 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.TypeSpecificFlags),
412 1.1.1.11 christos 2},
413 1.1.1.11 christos
414 1.1.1.11 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Csi2SerialBus.TypeRevisionId),
415 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.TypeRevisionId),
416 1.1.1.11 christos 1},
417 1.1.1.11 christos
418 1.1.1.11 christos /* Vendor data */
419 1.1.1.11 christos
420 1.1.1.11 christos {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.Csi2SerialBus.VendorLength),
421 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.TypeDataLength),
422 1.1.1.11 christos AML_RESOURCE_CSI2_MIN_DATA_LEN},
423 1.1.1.11 christos
424 1.1.1.11 christos {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.Csi2SerialBus.VendorData),
425 1.1.1.11 christos 0,
426 1.1.1.11 christos sizeof (AML_RESOURCE_CSI2_SERIALBUS)},
427 1.1.1.11 christos
428 1.1.1.11 christos /* Resource Source */
429 1.1.1.11 christos
430 1.1.1.11 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.Index),
431 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.ResSourceIndex),
432 1.1.1.11 christos 1},
433 1.1.1.11 christos
434 1.1.1.11 christos {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.StringLength),
435 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.TypeDataLength),
436 1.1.1.11 christos sizeof (AML_RESOURCE_CSI2_SERIALBUS)},
437 1.1.1.11 christos
438 1.1.1.11 christos {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.StringPtr),
439 1.1.1.11 christos AML_OFFSET (Csi2SerialBus.TypeDataLength),
440 1.1.1.11 christos sizeof (AML_RESOURCE_CSI2_SERIALBUS)},
441 1.1.1.11 christos };
442 1.1.1.11 christos
443 1.1.1.11 christos
444 1.1.1.11 christos /*******************************************************************************
445 1.1.1.11 christos *
446 1.1 christos * AcpiRsConvertI2cSerialBus
447 1.1 christos *
448 1.1 christos ******************************************************************************/
449 1.1 christos
450 1.1.1.5 christos ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[17] =
451 1.1 christos {
452 1.1 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
453 1.1 christos ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS),
454 1.1 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertI2cSerialBus)},
455 1.1 christos
456 1.1 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
457 1.1 christos sizeof (AML_RESOURCE_I2C_SERIALBUS),
458 1.1 christos 0},
459 1.1 christos
460 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
461 1.1 christos AML_OFFSET (CommonSerialBus.RevisionId),
462 1.1 christos 1},
463 1.1 christos
464 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
465 1.1 christos AML_OFFSET (CommonSerialBus.Type),
466 1.1 christos 1},
467 1.1 christos
468 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
469 1.1 christos AML_OFFSET (CommonSerialBus.Flags),
470 1.1 christos 0},
471 1.1 christos
472 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
473 1.1 christos AML_OFFSET (CommonSerialBus.Flags),
474 1.1 christos 1},
475 1.1 christos
476 1.1.1.5 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
477 1.1.1.5 christos AML_OFFSET (CommonSerialBus.Flags),
478 1.1.1.5 christos 2},
479 1.1.1.5 christos
480 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
481 1.1 christos AML_OFFSET (CommonSerialBus.TypeRevisionId),
482 1.1 christos 1},
483 1.1 christos
484 1.1 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
485 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
486 1.1 christos 1},
487 1.1 christos
488 1.1 christos /* Vendor data */
489 1.1 christos
490 1.1 christos {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
491 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
492 1.1 christos AML_RESOURCE_I2C_MIN_DATA_LEN},
493 1.1 christos
494 1.1 christos {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
495 1.1 christos 0,
496 1.1 christos sizeof (AML_RESOURCE_I2C_SERIALBUS)},
497 1.1 christos
498 1.1 christos /* Resource Source */
499 1.1 christos
500 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
501 1.1 christos AML_OFFSET (CommonSerialBus.ResSourceIndex),
502 1.1 christos 1},
503 1.1 christos
504 1.1 christos {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
505 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
506 1.1 christos sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
507 1.1 christos
508 1.1 christos {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
509 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
510 1.1 christos sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
511 1.1 christos
512 1.1 christos /* I2C bus type specific */
513 1.1 christos
514 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.I2cSerialBus.AccessMode),
515 1.1 christos AML_OFFSET (I2cSerialBus.TypeSpecificFlags),
516 1.1 christos 0},
517 1.1 christos
518 1.1 christos {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.I2cSerialBus.ConnectionSpeed),
519 1.1 christos AML_OFFSET (I2cSerialBus.ConnectionSpeed),
520 1.1 christos 1},
521 1.1 christos
522 1.1 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.I2cSerialBus.SlaveAddress),
523 1.1 christos AML_OFFSET (I2cSerialBus.SlaveAddress),
524 1.1 christos 1},
525 1.1 christos };
526 1.1 christos
527 1.1 christos
528 1.1 christos /*******************************************************************************
529 1.1 christos *
530 1.1 christos * AcpiRsConvertSpiSerialBus
531 1.1 christos *
532 1.1 christos ******************************************************************************/
533 1.1 christos
534 1.1.1.5 christos ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[21] =
535 1.1 christos {
536 1.1 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
537 1.1 christos ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),
538 1.1 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertSpiSerialBus)},
539 1.1 christos
540 1.1 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
541 1.1 christos sizeof (AML_RESOURCE_SPI_SERIALBUS),
542 1.1 christos 0},
543 1.1 christos
544 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
545 1.1 christos AML_OFFSET (CommonSerialBus.RevisionId),
546 1.1 christos 1},
547 1.1 christos
548 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
549 1.1 christos AML_OFFSET (CommonSerialBus.Type),
550 1.1 christos 1},
551 1.1 christos
552 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
553 1.1 christos AML_OFFSET (CommonSerialBus.Flags),
554 1.1 christos 0},
555 1.1 christos
556 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
557 1.1 christos AML_OFFSET (CommonSerialBus.Flags),
558 1.1 christos 1},
559 1.1 christos
560 1.1.1.5 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
561 1.1.1.5 christos AML_OFFSET (CommonSerialBus.Flags),
562 1.1.1.5 christos 2},
563 1.1.1.5 christos
564 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
565 1.1 christos AML_OFFSET (CommonSerialBus.TypeRevisionId),
566 1.1 christos 1},
567 1.1 christos
568 1.1 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
569 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
570 1.1 christos 1},
571 1.1 christos
572 1.1 christos /* Vendor data */
573 1.1 christos
574 1.1 christos {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
575 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
576 1.1 christos AML_RESOURCE_SPI_MIN_DATA_LEN},
577 1.1 christos
578 1.1 christos {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
579 1.1 christos 0,
580 1.1 christos sizeof (AML_RESOURCE_SPI_SERIALBUS)},
581 1.1 christos
582 1.1 christos /* Resource Source */
583 1.1 christos
584 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
585 1.1 christos AML_OFFSET (CommonSerialBus.ResSourceIndex),
586 1.1 christos 1},
587 1.1 christos
588 1.1 christos {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
589 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
590 1.1 christos sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
591 1.1 christos
592 1.1 christos {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
593 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
594 1.1 christos sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
595 1.1 christos
596 1.1 christos /* Spi bus type specific */
597 1.1 christos
598 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.WireMode),
599 1.1 christos AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
600 1.1 christos 0},
601 1.1 christos
602 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.DevicePolarity),
603 1.1 christos AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
604 1.1 christos 1},
605 1.1 christos
606 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.DataBitLength),
607 1.1 christos AML_OFFSET (SpiSerialBus.DataBitLength),
608 1.1 christos 1},
609 1.1 christos
610 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPhase),
611 1.1 christos AML_OFFSET (SpiSerialBus.ClockPhase),
612 1.1 christos 1},
613 1.1 christos
614 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPolarity),
615 1.1 christos AML_OFFSET (SpiSerialBus.ClockPolarity),
616 1.1 christos 1},
617 1.1 christos
618 1.1 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.SpiSerialBus.DeviceSelection),
619 1.1 christos AML_OFFSET (SpiSerialBus.DeviceSelection),
620 1.1 christos 1},
621 1.1 christos
622 1.1 christos {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.SpiSerialBus.ConnectionSpeed),
623 1.1 christos AML_OFFSET (SpiSerialBus.ConnectionSpeed),
624 1.1 christos 1},
625 1.1 christos };
626 1.1 christos
627 1.1 christos
628 1.1 christos /*******************************************************************************
629 1.1 christos *
630 1.1 christos * AcpiRsConvertUartSerialBus
631 1.1 christos *
632 1.1 christos ******************************************************************************/
633 1.1 christos
634 1.1.1.5 christos ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[23] =
635 1.1 christos {
636 1.1 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
637 1.1 christos ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),
638 1.1 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertUartSerialBus)},
639 1.1 christos
640 1.1 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
641 1.1 christos sizeof (AML_RESOURCE_UART_SERIALBUS),
642 1.1 christos 0},
643 1.1 christos
644 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
645 1.1 christos AML_OFFSET (CommonSerialBus.RevisionId),
646 1.1 christos 1},
647 1.1 christos
648 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
649 1.1 christos AML_OFFSET (CommonSerialBus.Type),
650 1.1 christos 1},
651 1.1 christos
652 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
653 1.1 christos AML_OFFSET (CommonSerialBus.Flags),
654 1.1 christos 0},
655 1.1 christos
656 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
657 1.1 christos AML_OFFSET (CommonSerialBus.Flags),
658 1.1 christos 1},
659 1.1 christos
660 1.1.1.5 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
661 1.1.1.5 christos AML_OFFSET (CommonSerialBus.Flags),
662 1.1.1.5 christos 2},
663 1.1.1.5 christos
664 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
665 1.1 christos AML_OFFSET (CommonSerialBus.TypeRevisionId),
666 1.1 christos 1},
667 1.1 christos
668 1.1 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
669 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
670 1.1 christos 1},
671 1.1 christos
672 1.1 christos /* Vendor data */
673 1.1 christos
674 1.1 christos {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
675 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
676 1.1 christos AML_RESOURCE_UART_MIN_DATA_LEN},
677 1.1 christos
678 1.1 christos {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
679 1.1 christos 0,
680 1.1 christos sizeof (AML_RESOURCE_UART_SERIALBUS)},
681 1.1 christos
682 1.1 christos /* Resource Source */
683 1.1 christos
684 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
685 1.1 christos AML_OFFSET (CommonSerialBus.ResSourceIndex),
686 1.1 christos 1},
687 1.1 christos
688 1.1 christos {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
689 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
690 1.1 christos sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
691 1.1 christos
692 1.1 christos {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
693 1.1 christos AML_OFFSET (CommonSerialBus.TypeDataLength),
694 1.1 christos sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
695 1.1 christos
696 1.1 christos /* Uart bus type specific */
697 1.1 christos
698 1.1 christos {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.FlowControl),
699 1.1 christos AML_OFFSET (UartSerialBus.TypeSpecificFlags),
700 1.1 christos 0},
701 1.1 christos
702 1.1 christos {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.StopBits),
703 1.1 christos AML_OFFSET (UartSerialBus.TypeSpecificFlags),
704 1.1 christos 2},
705 1.1 christos
706 1.1 christos {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.DataBits),
707 1.1 christos AML_OFFSET (UartSerialBus.TypeSpecificFlags),
708 1.1 christos 4},
709 1.1 christos
710 1.1 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.Endian),
711 1.1 christos AML_OFFSET (UartSerialBus.TypeSpecificFlags),
712 1.1 christos 7},
713 1.1 christos
714 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.Parity),
715 1.1 christos AML_OFFSET (UartSerialBus.Parity),
716 1.1 christos 1},
717 1.1 christos
718 1.1 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.LinesEnabled),
719 1.1 christos AML_OFFSET (UartSerialBus.LinesEnabled),
720 1.1 christos 1},
721 1.1 christos
722 1.1 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.RxFifoSize),
723 1.1 christos AML_OFFSET (UartSerialBus.RxFifoSize),
724 1.1 christos 1},
725 1.1 christos
726 1.1 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.TxFifoSize),
727 1.1 christos AML_OFFSET (UartSerialBus.TxFifoSize),
728 1.1 christos 1},
729 1.1 christos
730 1.1 christos {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.UartSerialBus.DefaultBaudRate),
731 1.1 christos AML_OFFSET (UartSerialBus.DefaultBaudRate),
732 1.1 christos 1},
733 1.1 christos };
734 1.1.1.7 christos
735 1.1.1.7 christos
736 1.1.1.7 christos /*******************************************************************************
737 1.1.1.7 christos *
738 1.1.1.7 christos * AcpiRsConvertPinConfig
739 1.1.1.7 christos *
740 1.1.1.7 christos ******************************************************************************/
741 1.1.1.7 christos
742 1.1.1.7 christos ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[14] =
743 1.1.1.7 christos {
744 1.1.1.7 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_CONFIG,
745 1.1.1.7 christos ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),
746 1.1.1.7 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinConfig)},
747 1.1.1.7 christos
748 1.1.1.7 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_CONFIG,
749 1.1.1.7 christos sizeof (AML_RESOURCE_PIN_CONFIG),
750 1.1.1.7 christos 0},
751 1.1.1.7 christos
752 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.RevisionId),
753 1.1.1.7 christos AML_OFFSET (PinConfig.RevisionId),
754 1.1.1.7 christos 1},
755 1.1.1.7 christos
756 1.1.1.9 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.Shareable),
757 1.1.1.7 christos AML_OFFSET (PinConfig.Flags),
758 1.1.1.7 christos 0},
759 1.1.1.7 christos
760 1.1.1.7 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.ProducerConsumer),
761 1.1.1.7 christos AML_OFFSET (PinConfig.Flags),
762 1.1.1.7 christos 1},
763 1.1.1.7 christos
764 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.PinConfigType),
765 1.1.1.7 christos AML_OFFSET (PinConfig.PinConfigType),
766 1.1.1.7 christos 1},
767 1.1.1.7 christos
768 1.1.1.7 christos {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinConfig.PinConfigValue),
769 1.1.1.7 christos AML_OFFSET (PinConfig.PinConfigValue),
770 1.1.1.7 christos 1},
771 1.1.1.7 christos
772 1.1.1.7 christos /* Pin Table */
773 1.1.1.7 christos
774 1.1.1.7 christos /*
775 1.1.1.7 christos * It is OK to use GPIO operations here because none of them refer GPIO
776 1.1.1.7 christos * structures directly but instead use offsets given here.
777 1.1.1.7 christos */
778 1.1.1.7 christos
779 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTableLength),
780 1.1.1.7 christos AML_OFFSET (PinConfig.PinTableOffset),
781 1.1.1.7 christos AML_OFFSET (PinConfig.ResSourceOffset)},
782 1.1.1.7 christos
783 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTable),
784 1.1.1.7 christos AML_OFFSET (PinConfig.PinTableOffset),
785 1.1.1.7 christos 0},
786 1.1.1.7 christos
787 1.1.1.7 christos /* Resource Source */
788 1.1.1.7 christos
789 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.Index),
790 1.1.1.7 christos AML_OFFSET (PinConfig.ResSourceIndex),
791 1.1.1.7 christos 1},
792 1.1.1.7 christos
793 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringLength),
794 1.1.1.7 christos AML_OFFSET (PinConfig.ResSourceOffset),
795 1.1.1.7 christos AML_OFFSET (PinConfig.VendorOffset)},
796 1.1.1.7 christos
797 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringPtr),
798 1.1.1.7 christos AML_OFFSET (PinConfig.ResSourceOffset),
799 1.1.1.7 christos 0},
800 1.1.1.7 christos
801 1.1.1.7 christos /* Vendor Data */
802 1.1.1.7 christos
803 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinConfig.VendorLength),
804 1.1.1.7 christos AML_OFFSET (PinConfig.VendorLength),
805 1.1.1.7 christos 1},
806 1.1.1.7 christos
807 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.VendorData),
808 1.1.1.7 christos AML_OFFSET (PinConfig.VendorOffset),
809 1.1.1.7 christos 0},
810 1.1.1.7 christos };
811 1.1.1.7 christos
812 1.1.1.7 christos /*******************************************************************************
813 1.1.1.7 christos *
814 1.1.1.7 christos * AcpiRsConvertPinGroup
815 1.1.1.7 christos *
816 1.1.1.7 christos ******************************************************************************/
817 1.1.1.7 christos
818 1.1.1.7 christos ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[10] =
819 1.1.1.7 christos {
820 1.1.1.7 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP,
821 1.1.1.7 christos ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),
822 1.1.1.7 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroup)},
823 1.1.1.7 christos
824 1.1.1.7 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP,
825 1.1.1.7 christos sizeof (AML_RESOURCE_PIN_GROUP),
826 1.1.1.7 christos 0},
827 1.1.1.7 christos
828 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroup.RevisionId),
829 1.1.1.7 christos AML_OFFSET (PinGroup.RevisionId),
830 1.1.1.7 christos 1},
831 1.1.1.7 christos
832 1.1.1.7 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroup.ProducerConsumer),
833 1.1.1.7 christos AML_OFFSET (PinGroup.Flags),
834 1.1.1.7 christos 0},
835 1.1.1.7 christos
836 1.1.1.7 christos /* Pin Table */
837 1.1.1.7 christos
838 1.1.1.7 christos /*
839 1.1.1.7 christos * It is OK to use GPIO operations here because none of them refer GPIO
840 1.1.1.7 christos * structures directly but instead use offsets given here.
841 1.1.1.7 christos */
842 1.1.1.7 christos
843 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTableLength),
844 1.1.1.7 christos AML_OFFSET (PinGroup.PinTableOffset),
845 1.1.1.7 christos AML_OFFSET (PinGroup.LabelOffset)},
846 1.1.1.7 christos
847 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTable),
848 1.1.1.7 christos AML_OFFSET (PinGroup.PinTableOffset),
849 1.1.1.7 christos 0},
850 1.1.1.7 christos
851 1.1.1.7 christos /* Resource Label */
852 1.1.1.7 christos
853 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringLength),
854 1.1.1.7 christos AML_OFFSET (PinGroup.LabelOffset),
855 1.1.1.7 christos AML_OFFSET (PinGroup.VendorOffset)},
856 1.1.1.7 christos
857 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringPtr),
858 1.1.1.7 christos AML_OFFSET (PinGroup.LabelOffset),
859 1.1.1.7 christos 0},
860 1.1.1.7 christos
861 1.1.1.7 christos /* Vendor Data */
862 1.1.1.7 christos
863 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroup.VendorLength),
864 1.1.1.7 christos AML_OFFSET (PinGroup.VendorLength),
865 1.1.1.7 christos 1},
866 1.1.1.7 christos
867 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.VendorData),
868 1.1.1.7 christos AML_OFFSET (PinGroup.VendorOffset),
869 1.1.1.7 christos 0},
870 1.1.1.7 christos };
871 1.1.1.7 christos
872 1.1.1.7 christos /*******************************************************************************
873 1.1.1.7 christos *
874 1.1.1.7 christos * AcpiRsConvertPinGroupFunction
875 1.1.1.7 christos *
876 1.1.1.7 christos ******************************************************************************/
877 1.1.1.7 christos
878 1.1.1.7 christos ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[13] =
879 1.1.1.7 christos {
880 1.1.1.7 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION,
881 1.1.1.7 christos ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),
882 1.1.1.7 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupFunction)},
883 1.1.1.7 christos
884 1.1.1.7 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION,
885 1.1.1.7 christos sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION),
886 1.1.1.7 christos 0},
887 1.1.1.7 christos
888 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.RevisionId),
889 1.1.1.7 christos AML_OFFSET (PinGroupFunction.RevisionId),
890 1.1.1.7 christos 1},
891 1.1.1.7 christos
892 1.1.1.9 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.Shareable),
893 1.1.1.7 christos AML_OFFSET (PinGroupFunction.Flags),
894 1.1.1.7 christos 0},
895 1.1.1.7 christos
896 1.1.1.7 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.ProducerConsumer),
897 1.1.1.7 christos AML_OFFSET (PinGroupFunction.Flags),
898 1.1.1.7 christos 1},
899 1.1.1.7 christos
900 1.1.1.7 christos {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinGroupFunction.FunctionNumber),
901 1.1.1.7 christos AML_OFFSET (PinGroupFunction.FunctionNumber),
902 1.1.1.7 christos 1},
903 1.1.1.7 christos
904 1.1.1.7 christos /* Resource Source */
905 1.1.1.7 christos
906 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.Index),
907 1.1.1.7 christos AML_OFFSET (PinGroupFunction.ResSourceIndex),
908 1.1.1.7 christos 1},
909 1.1.1.7 christos
910 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringLength),
911 1.1.1.7 christos AML_OFFSET (PinGroupFunction.ResSourceOffset),
912 1.1.1.7 christos AML_OFFSET (PinGroupFunction.ResSourceLabelOffset)},
913 1.1.1.7 christos
914 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringPtr),
915 1.1.1.7 christos AML_OFFSET (PinGroupFunction.ResSourceOffset),
916 1.1.1.7 christos 0},
917 1.1.1.7 christos
918 1.1.1.7 christos /* Resource Source Label */
919 1.1.1.7 christos
920 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringLength),
921 1.1.1.7 christos AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
922 1.1.1.7 christos AML_OFFSET (PinGroupFunction.VendorOffset)},
923 1.1.1.7 christos
924 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringPtr),
925 1.1.1.7 christos AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
926 1.1.1.7 christos 0},
927 1.1.1.7 christos
928 1.1.1.7 christos /* Vendor Data */
929 1.1.1.7 christos
930 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorLength),
931 1.1.1.7 christos AML_OFFSET (PinGroupFunction.VendorLength),
932 1.1.1.7 christos 1},
933 1.1.1.7 christos
934 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorData),
935 1.1.1.7 christos AML_OFFSET (PinGroupFunction.VendorOffset),
936 1.1.1.7 christos 0},
937 1.1.1.7 christos };
938 1.1.1.7 christos
939 1.1.1.7 christos /*******************************************************************************
940 1.1.1.7 christos *
941 1.1.1.7 christos * AcpiRsConvertPinGroupConfig
942 1.1.1.7 christos *
943 1.1.1.7 christos ******************************************************************************/
944 1.1.1.7 christos
945 1.1.1.7 christos ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[14] =
946 1.1.1.7 christos {
947 1.1.1.7 christos {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG,
948 1.1.1.7 christos ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),
949 1.1.1.7 christos ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupConfig)},
950 1.1.1.7 christos
951 1.1.1.7 christos {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG,
952 1.1.1.7 christos sizeof (AML_RESOURCE_PIN_GROUP_CONFIG),
953 1.1.1.7 christos 0},
954 1.1.1.7 christos
955 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.RevisionId),
956 1.1.1.7 christos AML_OFFSET (PinGroupConfig.RevisionId),
957 1.1.1.7 christos 1},
958 1.1.1.7 christos
959 1.1.1.9 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.Shareable),
960 1.1.1.7 christos AML_OFFSET (PinGroupConfig.Flags),
961 1.1.1.7 christos 0},
962 1.1.1.7 christos
963 1.1.1.7 christos {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.ProducerConsumer),
964 1.1.1.7 christos AML_OFFSET (PinGroupConfig.Flags),
965 1.1.1.7 christos 1},
966 1.1.1.7 christos
967 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigType),
968 1.1.1.7 christos AML_OFFSET (PinGroupConfig.PinConfigType),
969 1.1.1.7 christos 1},
970 1.1.1.7 christos
971 1.1.1.7 christos {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigValue),
972 1.1.1.7 christos AML_OFFSET (PinGroupConfig.PinConfigValue),
973 1.1.1.7 christos 1},
974 1.1.1.7 christos
975 1.1.1.7 christos /* Resource Source */
976 1.1.1.7 christos
977 1.1.1.7 christos {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.Index),
978 1.1.1.7 christos AML_OFFSET (PinGroupConfig.ResSourceIndex),
979 1.1.1.7 christos 1},
980 1.1.1.7 christos
981 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringLength),
982 1.1.1.7 christos AML_OFFSET (PinGroupConfig.ResSourceOffset),
983 1.1.1.7 christos AML_OFFSET (PinGroupConfig.ResSourceLabelOffset)},
984 1.1.1.7 christos
985 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringPtr),
986 1.1.1.7 christos AML_OFFSET (PinGroupConfig.ResSourceOffset),
987 1.1.1.7 christos 0},
988 1.1.1.7 christos
989 1.1.1.7 christos /* Resource Source Label */
990 1.1.1.7 christos
991 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringLength),
992 1.1.1.7 christos AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
993 1.1.1.7 christos AML_OFFSET (PinGroupConfig.VendorOffset)},
994 1.1.1.7 christos
995 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringPtr),
996 1.1.1.7 christos AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
997 1.1.1.7 christos 0},
998 1.1.1.7 christos
999 1.1.1.7 christos /* Vendor Data */
1000 1.1.1.7 christos
1001 1.1.1.7 christos {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorLength),
1002 1.1.1.7 christos AML_OFFSET (PinGroupConfig.VendorLength),
1003 1.1.1.7 christos 1},
1004 1.1.1.7 christos
1005 1.1.1.7 christos {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorData),
1006 1.1.1.7 christos AML_OFFSET (PinGroupConfig.VendorOffset),
1007 1.1.1.7 christos 0},
1008 1.1.1.7 christos };
1009