Loading...
1/*******************************************************************************
2 *
3 * Module Name: rsserial - GPIO/serial_bus resource descriptors
4 *
5 ******************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2016, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#include <acpi/acpi.h>
45#include "accommon.h"
46#include "acresrc.h"
47
48#define _COMPONENT ACPI_RESOURCES
49ACPI_MODULE_NAME("rsserial")
50
51/*******************************************************************************
52 *
53 * acpi_rs_convert_gpio
54 *
55 ******************************************************************************/
56struct acpi_rsconvert_info acpi_rs_convert_gpio[18] = {
57 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,
58 ACPI_RS_SIZE(struct acpi_resource_gpio),
59 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_gpio)},
60
61 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO,
62 sizeof(struct aml_resource_gpio),
63 0},
64
65 /*
66 * These fields are contiguous in both the source and destination:
67 * revision_id
68 * connection_type
69 */
70 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.revision_id),
71 AML_OFFSET(gpio.revision_id),
72 2},
73
74 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.producer_consumer),
75 AML_OFFSET(gpio.flags),
76 0},
77
78 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable),
79 AML_OFFSET(gpio.int_flags),
80 3},
81
82 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.wake_capable),
83 AML_OFFSET(gpio.int_flags),
84 4},
85
86 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.io_restriction),
87 AML_OFFSET(gpio.int_flags),
88 0},
89
90 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.triggering),
91 AML_OFFSET(gpio.int_flags),
92 0},
93
94 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.polarity),
95 AML_OFFSET(gpio.int_flags),
96 1},
97
98 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.pin_config),
99 AML_OFFSET(gpio.pin_config),
100 1},
101
102 /*
103 * These fields are contiguous in both the source and destination:
104 * drive_strength
105 * debounce_timeout
106 */
107 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.gpio.drive_strength),
108 AML_OFFSET(gpio.drive_strength),
109 2},
110
111 /* Pin Table */
112
113 {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET(data.gpio.pin_table_length),
114 AML_OFFSET(gpio.pin_table_offset),
115 AML_OFFSET(gpio.res_source_offset)},
116
117 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.gpio.pin_table),
118 AML_OFFSET(gpio.pin_table_offset),
119 0},
120
121 /* Resource Source */
122
123 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.resource_source.index),
124 AML_OFFSET(gpio.res_source_index),
125 1},
126
127 {ACPI_RSC_COUNT_GPIO_RES,
128 ACPI_RS_OFFSET(data.gpio.resource_source.string_length),
129 AML_OFFSET(gpio.res_source_offset),
130 AML_OFFSET(gpio.vendor_offset)},
131
132 {ACPI_RSC_MOVE_GPIO_RES,
133 ACPI_RS_OFFSET(data.gpio.resource_source.string_ptr),
134 AML_OFFSET(gpio.res_source_offset),
135 0},
136
137 /* Vendor Data */
138
139 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET(data.gpio.vendor_length),
140 AML_OFFSET(gpio.vendor_length),
141 1},
142
143 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.gpio.vendor_data),
144 AML_OFFSET(gpio.vendor_offset),
145 0},
146};
147
148/*******************************************************************************
149 *
150 * acpi_rs_convert_i2c_serial_bus
151 *
152 ******************************************************************************/
153
154struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[16] = {
155 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
156 ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus),
157 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_i2c_serial_bus)},
158
159 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
160 sizeof(struct aml_resource_i2c_serialbus),
161 0},
162
163 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id),
164 AML_OFFSET(common_serial_bus.revision_id),
165 1},
166
167 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type),
168 AML_OFFSET(common_serial_bus.type),
169 1},
170
171 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode),
172 AML_OFFSET(common_serial_bus.flags),
173 0},
174
175 {ACPI_RSC_1BITFLAG,
176 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer),
177 AML_OFFSET(common_serial_bus.flags),
178 1},
179
180 {ACPI_RSC_MOVE8,
181 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id),
182 AML_OFFSET(common_serial_bus.type_revision_id),
183 1},
184
185 {ACPI_RSC_MOVE16,
186 ACPI_RS_OFFSET(data.common_serial_bus.type_data_length),
187 AML_OFFSET(common_serial_bus.type_data_length),
188 1},
189
190 /* Vendor data */
191
192 {ACPI_RSC_COUNT_SERIAL_VEN,
193 ACPI_RS_OFFSET(data.common_serial_bus.vendor_length),
194 AML_OFFSET(common_serial_bus.type_data_length),
195 AML_RESOURCE_I2C_MIN_DATA_LEN},
196
197 {ACPI_RSC_MOVE_SERIAL_VEN,
198 ACPI_RS_OFFSET(data.common_serial_bus.vendor_data),
199 0,
200 sizeof(struct aml_resource_i2c_serialbus)},
201
202 /* Resource Source */
203
204 {ACPI_RSC_MOVE8,
205 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index),
206 AML_OFFSET(common_serial_bus.res_source_index),
207 1},
208
209 {ACPI_RSC_COUNT_SERIAL_RES,
210 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length),
211 AML_OFFSET(common_serial_bus.type_data_length),
212 sizeof(struct aml_resource_common_serialbus)},
213
214 {ACPI_RSC_MOVE_SERIAL_RES,
215 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr),
216 AML_OFFSET(common_serial_bus.type_data_length),
217 sizeof(struct aml_resource_common_serialbus)},
218
219 /* I2C bus type specific */
220
221 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.i2c_serial_bus.access_mode),
222 AML_OFFSET(i2c_serial_bus.type_specific_flags),
223 0},
224
225 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.i2c_serial_bus.connection_speed),
226 AML_OFFSET(i2c_serial_bus.connection_speed),
227 1},
228
229 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.i2c_serial_bus.slave_address),
230 AML_OFFSET(i2c_serial_bus.slave_address),
231 1},
232};
233
234/*******************************************************************************
235 *
236 * acpi_rs_convert_spi_serial_bus
237 *
238 ******************************************************************************/
239
240struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[20] = {
241 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
242 ACPI_RS_SIZE(struct acpi_resource_spi_serialbus),
243 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_spi_serial_bus)},
244
245 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
246 sizeof(struct aml_resource_spi_serialbus),
247 0},
248
249 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id),
250 AML_OFFSET(common_serial_bus.revision_id),
251 1},
252
253 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type),
254 AML_OFFSET(common_serial_bus.type),
255 1},
256
257 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode),
258 AML_OFFSET(common_serial_bus.flags),
259 0},
260
261 {ACPI_RSC_1BITFLAG,
262 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer),
263 AML_OFFSET(common_serial_bus.flags),
264 1},
265
266 {ACPI_RSC_MOVE8,
267 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id),
268 AML_OFFSET(common_serial_bus.type_revision_id),
269 1},
270
271 {ACPI_RSC_MOVE16,
272 ACPI_RS_OFFSET(data.common_serial_bus.type_data_length),
273 AML_OFFSET(common_serial_bus.type_data_length),
274 1},
275
276 /* Vendor data */
277
278 {ACPI_RSC_COUNT_SERIAL_VEN,
279 ACPI_RS_OFFSET(data.common_serial_bus.vendor_length),
280 AML_OFFSET(common_serial_bus.type_data_length),
281 AML_RESOURCE_SPI_MIN_DATA_LEN},
282
283 {ACPI_RSC_MOVE_SERIAL_VEN,
284 ACPI_RS_OFFSET(data.common_serial_bus.vendor_data),
285 0,
286 sizeof(struct aml_resource_spi_serialbus)},
287
288 /* Resource Source */
289
290 {ACPI_RSC_MOVE8,
291 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index),
292 AML_OFFSET(common_serial_bus.res_source_index),
293 1},
294
295 {ACPI_RSC_COUNT_SERIAL_RES,
296 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length),
297 AML_OFFSET(common_serial_bus.type_data_length),
298 sizeof(struct aml_resource_common_serialbus)},
299
300 {ACPI_RSC_MOVE_SERIAL_RES,
301 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr),
302 AML_OFFSET(common_serial_bus.type_data_length),
303 sizeof(struct aml_resource_common_serialbus)},
304
305 /* Spi bus type specific */
306
307 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.spi_serial_bus.wire_mode),
308 AML_OFFSET(spi_serial_bus.type_specific_flags),
309 0},
310
311 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.spi_serial_bus.device_polarity),
312 AML_OFFSET(spi_serial_bus.type_specific_flags),
313 1},
314
315 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.data_bit_length),
316 AML_OFFSET(spi_serial_bus.data_bit_length),
317 1},
318
319 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.clock_phase),
320 AML_OFFSET(spi_serial_bus.clock_phase),
321 1},
322
323 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.clock_polarity),
324 AML_OFFSET(spi_serial_bus.clock_polarity),
325 1},
326
327 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.spi_serial_bus.device_selection),
328 AML_OFFSET(spi_serial_bus.device_selection),
329 1},
330
331 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.spi_serial_bus.connection_speed),
332 AML_OFFSET(spi_serial_bus.connection_speed),
333 1},
334};
335
336/*******************************************************************************
337 *
338 * acpi_rs_convert_uart_serial_bus
339 *
340 ******************************************************************************/
341
342struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[22] = {
343 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
344 ACPI_RS_SIZE(struct acpi_resource_uart_serialbus),
345 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_uart_serial_bus)},
346
347 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
348 sizeof(struct aml_resource_uart_serialbus),
349 0},
350
351 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id),
352 AML_OFFSET(common_serial_bus.revision_id),
353 1},
354
355 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type),
356 AML_OFFSET(common_serial_bus.type),
357 1},
358
359 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode),
360 AML_OFFSET(common_serial_bus.flags),
361 0},
362
363 {ACPI_RSC_1BITFLAG,
364 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer),
365 AML_OFFSET(common_serial_bus.flags),
366 1},
367
368 {ACPI_RSC_MOVE8,
369 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id),
370 AML_OFFSET(common_serial_bus.type_revision_id),
371 1},
372
373 {ACPI_RSC_MOVE16,
374 ACPI_RS_OFFSET(data.common_serial_bus.type_data_length),
375 AML_OFFSET(common_serial_bus.type_data_length),
376 1},
377
378 /* Vendor data */
379
380 {ACPI_RSC_COUNT_SERIAL_VEN,
381 ACPI_RS_OFFSET(data.common_serial_bus.vendor_length),
382 AML_OFFSET(common_serial_bus.type_data_length),
383 AML_RESOURCE_UART_MIN_DATA_LEN},
384
385 {ACPI_RSC_MOVE_SERIAL_VEN,
386 ACPI_RS_OFFSET(data.common_serial_bus.vendor_data),
387 0,
388 sizeof(struct aml_resource_uart_serialbus)},
389
390 /* Resource Source */
391
392 {ACPI_RSC_MOVE8,
393 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index),
394 AML_OFFSET(common_serial_bus.res_source_index),
395 1},
396
397 {ACPI_RSC_COUNT_SERIAL_RES,
398 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length),
399 AML_OFFSET(common_serial_bus.type_data_length),
400 sizeof(struct aml_resource_common_serialbus)},
401
402 {ACPI_RSC_MOVE_SERIAL_RES,
403 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr),
404 AML_OFFSET(common_serial_bus.type_data_length),
405 sizeof(struct aml_resource_common_serialbus)},
406
407 /* Uart bus type specific */
408
409 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.flow_control),
410 AML_OFFSET(uart_serial_bus.type_specific_flags),
411 0},
412
413 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.stop_bits),
414 AML_OFFSET(uart_serial_bus.type_specific_flags),
415 2},
416
417 {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.data_bits),
418 AML_OFFSET(uart_serial_bus.type_specific_flags),
419 4},
420
421 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.endian),
422 AML_OFFSET(uart_serial_bus.type_specific_flags),
423 7},
424
425 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.uart_serial_bus.parity),
426 AML_OFFSET(uart_serial_bus.parity),
427 1},
428
429 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.uart_serial_bus.lines_enabled),
430 AML_OFFSET(uart_serial_bus.lines_enabled),
431 1},
432
433 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.uart_serial_bus.rx_fifo_size),
434 AML_OFFSET(uart_serial_bus.rx_fifo_size),
435 1},
436
437 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.uart_serial_bus.tx_fifo_size),
438 AML_OFFSET(uart_serial_bus.tx_fifo_size),
439 1},
440
441 {ACPI_RSC_MOVE32,
442 ACPI_RS_OFFSET(data.uart_serial_bus.default_baud_rate),
443 AML_OFFSET(uart_serial_bus.default_baud_rate),
444 1},
445};
1/*******************************************************************************
2 *
3 * Module Name: rsserial - GPIO/serial_bus resource descriptors
4 *
5 ******************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#include <acpi/acpi.h>
45#include "accommon.h"
46#include "acresrc.h"
47
48#define _COMPONENT ACPI_RESOURCES
49ACPI_MODULE_NAME("rsserial")
50
51/*******************************************************************************
52 *
53 * acpi_rs_convert_gpio
54 *
55 ******************************************************************************/
56struct acpi_rsconvert_info acpi_rs_convert_gpio[17] = {
57 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,
58 ACPI_RS_SIZE(struct acpi_resource_gpio),
59 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_gpio)},
60
61 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO,
62 sizeof(struct aml_resource_gpio),
63 0},
64
65 /*
66 * These fields are contiguous in both the source and destination:
67 * revision_id
68 * connection_type
69 */
70 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.revision_id),
71 AML_OFFSET(gpio.revision_id),
72 2},
73
74 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.producer_consumer),
75 AML_OFFSET(gpio.flags),
76 0},
77
78 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable),
79 AML_OFFSET(gpio.int_flags),
80 3},
81
82 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.io_restriction),
83 AML_OFFSET(gpio.int_flags),
84 0},
85
86 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.triggering),
87 AML_OFFSET(gpio.int_flags),
88 0},
89
90 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.polarity),
91 AML_OFFSET(gpio.int_flags),
92 1},
93
94 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.pin_config),
95 AML_OFFSET(gpio.pin_config),
96 1},
97
98 /*
99 * These fields are contiguous in both the source and destination:
100 * drive_strength
101 * debounce_timeout
102 */
103 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.gpio.drive_strength),
104 AML_OFFSET(gpio.drive_strength),
105 2},
106
107 /* Pin Table */
108
109 {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET(data.gpio.pin_table_length),
110 AML_OFFSET(gpio.pin_table_offset),
111 AML_OFFSET(gpio.res_source_offset)},
112
113 {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.gpio.pin_table),
114 AML_OFFSET(gpio.pin_table_offset),
115 0},
116
117 /* Resource Source */
118
119 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.resource_source.index),
120 AML_OFFSET(gpio.res_source_index),
121 1},
122
123 {ACPI_RSC_COUNT_GPIO_RES,
124 ACPI_RS_OFFSET(data.gpio.resource_source.string_length),
125 AML_OFFSET(gpio.res_source_offset),
126 AML_OFFSET(gpio.vendor_offset)},
127
128 {ACPI_RSC_MOVE_GPIO_RES,
129 ACPI_RS_OFFSET(data.gpio.resource_source.string_ptr),
130 AML_OFFSET(gpio.res_source_offset),
131 0},
132
133 /* Vendor Data */
134
135 {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET(data.gpio.vendor_length),
136 AML_OFFSET(gpio.vendor_length),
137 1},
138
139 {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.gpio.vendor_data),
140 AML_OFFSET(gpio.vendor_offset),
141 0},
142};
143
144/*******************************************************************************
145 *
146 * acpi_rs_convert_i2c_serial_bus
147 *
148 ******************************************************************************/
149
150struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[16] = {
151 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
152 ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus),
153 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_i2c_serial_bus)},
154
155 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
156 sizeof(struct aml_resource_i2c_serialbus),
157 0},
158
159 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id),
160 AML_OFFSET(common_serial_bus.revision_id),
161 1},
162
163 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type),
164 AML_OFFSET(common_serial_bus.type),
165 1},
166
167 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode),
168 AML_OFFSET(common_serial_bus.flags),
169 0},
170
171 {ACPI_RSC_1BITFLAG,
172 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer),
173 AML_OFFSET(common_serial_bus.flags),
174 1},
175
176 {ACPI_RSC_MOVE8,
177 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id),
178 AML_OFFSET(common_serial_bus.type_revision_id),
179 1},
180
181 {ACPI_RSC_MOVE16,
182 ACPI_RS_OFFSET(data.common_serial_bus.type_data_length),
183 AML_OFFSET(common_serial_bus.type_data_length),
184 1},
185
186 /* Vendor data */
187
188 {ACPI_RSC_COUNT_SERIAL_VEN,
189 ACPI_RS_OFFSET(data.common_serial_bus.vendor_length),
190 AML_OFFSET(common_serial_bus.type_data_length),
191 AML_RESOURCE_I2C_MIN_DATA_LEN},
192
193 {ACPI_RSC_MOVE_SERIAL_VEN,
194 ACPI_RS_OFFSET(data.common_serial_bus.vendor_data),
195 0,
196 sizeof(struct aml_resource_i2c_serialbus)},
197
198 /* Resource Source */
199
200 {ACPI_RSC_MOVE8,
201 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index),
202 AML_OFFSET(common_serial_bus.res_source_index),
203 1},
204
205 {ACPI_RSC_COUNT_SERIAL_RES,
206 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length),
207 AML_OFFSET(common_serial_bus.type_data_length),
208 sizeof(struct aml_resource_common_serialbus)},
209
210 {ACPI_RSC_MOVE_SERIAL_RES,
211 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr),
212 AML_OFFSET(common_serial_bus.type_data_length),
213 sizeof(struct aml_resource_common_serialbus)},
214
215 /* I2C bus type specific */
216
217 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.i2c_serial_bus.access_mode),
218 AML_OFFSET(i2c_serial_bus.type_specific_flags),
219 0},
220
221 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.i2c_serial_bus.connection_speed),
222 AML_OFFSET(i2c_serial_bus.connection_speed),
223 1},
224
225 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.i2c_serial_bus.slave_address),
226 AML_OFFSET(i2c_serial_bus.slave_address),
227 1},
228};
229
230/*******************************************************************************
231 *
232 * acpi_rs_convert_spi_serial_bus
233 *
234 ******************************************************************************/
235
236struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[20] = {
237 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
238 ACPI_RS_SIZE(struct acpi_resource_spi_serialbus),
239 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_spi_serial_bus)},
240
241 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
242 sizeof(struct aml_resource_spi_serialbus),
243 0},
244
245 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id),
246 AML_OFFSET(common_serial_bus.revision_id),
247 1},
248
249 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type),
250 AML_OFFSET(common_serial_bus.type),
251 1},
252
253 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode),
254 AML_OFFSET(common_serial_bus.flags),
255 0},
256
257 {ACPI_RSC_1BITFLAG,
258 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer),
259 AML_OFFSET(common_serial_bus.flags),
260 1},
261
262 {ACPI_RSC_MOVE8,
263 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id),
264 AML_OFFSET(common_serial_bus.type_revision_id),
265 1},
266
267 {ACPI_RSC_MOVE16,
268 ACPI_RS_OFFSET(data.common_serial_bus.type_data_length),
269 AML_OFFSET(common_serial_bus.type_data_length),
270 1},
271
272 /* Vendor data */
273
274 {ACPI_RSC_COUNT_SERIAL_VEN,
275 ACPI_RS_OFFSET(data.common_serial_bus.vendor_length),
276 AML_OFFSET(common_serial_bus.type_data_length),
277 AML_RESOURCE_SPI_MIN_DATA_LEN},
278
279 {ACPI_RSC_MOVE_SERIAL_VEN,
280 ACPI_RS_OFFSET(data.common_serial_bus.vendor_data),
281 0,
282 sizeof(struct aml_resource_spi_serialbus)},
283
284 /* Resource Source */
285
286 {ACPI_RSC_MOVE8,
287 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index),
288 AML_OFFSET(common_serial_bus.res_source_index),
289 1},
290
291 {ACPI_RSC_COUNT_SERIAL_RES,
292 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length),
293 AML_OFFSET(common_serial_bus.type_data_length),
294 sizeof(struct aml_resource_common_serialbus)},
295
296 {ACPI_RSC_MOVE_SERIAL_RES,
297 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr),
298 AML_OFFSET(common_serial_bus.type_data_length),
299 sizeof(struct aml_resource_common_serialbus)},
300
301 /* Spi bus type specific */
302
303 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.spi_serial_bus.wire_mode),
304 AML_OFFSET(spi_serial_bus.type_specific_flags),
305 0},
306
307 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.spi_serial_bus.device_polarity),
308 AML_OFFSET(spi_serial_bus.type_specific_flags),
309 1},
310
311 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.data_bit_length),
312 AML_OFFSET(spi_serial_bus.data_bit_length),
313 1},
314
315 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.clock_phase),
316 AML_OFFSET(spi_serial_bus.clock_phase),
317 1},
318
319 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.clock_polarity),
320 AML_OFFSET(spi_serial_bus.clock_polarity),
321 1},
322
323 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.spi_serial_bus.device_selection),
324 AML_OFFSET(spi_serial_bus.device_selection),
325 1},
326
327 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.spi_serial_bus.connection_speed),
328 AML_OFFSET(spi_serial_bus.connection_speed),
329 1},
330};
331
332/*******************************************************************************
333 *
334 * acpi_rs_convert_uart_serial_bus
335 *
336 ******************************************************************************/
337
338struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[22] = {
339 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
340 ACPI_RS_SIZE(struct acpi_resource_uart_serialbus),
341 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_uart_serial_bus)},
342
343 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
344 sizeof(struct aml_resource_uart_serialbus),
345 0},
346
347 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id),
348 AML_OFFSET(common_serial_bus.revision_id),
349 1},
350
351 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type),
352 AML_OFFSET(common_serial_bus.type),
353 1},
354
355 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode),
356 AML_OFFSET(common_serial_bus.flags),
357 0},
358
359 {ACPI_RSC_1BITFLAG,
360 ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer),
361 AML_OFFSET(common_serial_bus.flags),
362 1},
363
364 {ACPI_RSC_MOVE8,
365 ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id),
366 AML_OFFSET(common_serial_bus.type_revision_id),
367 1},
368
369 {ACPI_RSC_MOVE16,
370 ACPI_RS_OFFSET(data.common_serial_bus.type_data_length),
371 AML_OFFSET(common_serial_bus.type_data_length),
372 1},
373
374 /* Vendor data */
375
376 {ACPI_RSC_COUNT_SERIAL_VEN,
377 ACPI_RS_OFFSET(data.common_serial_bus.vendor_length),
378 AML_OFFSET(common_serial_bus.type_data_length),
379 AML_RESOURCE_UART_MIN_DATA_LEN},
380
381 {ACPI_RSC_MOVE_SERIAL_VEN,
382 ACPI_RS_OFFSET(data.common_serial_bus.vendor_data),
383 0,
384 sizeof(struct aml_resource_uart_serialbus)},
385
386 /* Resource Source */
387
388 {ACPI_RSC_MOVE8,
389 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index),
390 AML_OFFSET(common_serial_bus.res_source_index),
391 1},
392
393 {ACPI_RSC_COUNT_SERIAL_RES,
394 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length),
395 AML_OFFSET(common_serial_bus.type_data_length),
396 sizeof(struct aml_resource_common_serialbus)},
397
398 {ACPI_RSC_MOVE_SERIAL_RES,
399 ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr),
400 AML_OFFSET(common_serial_bus.type_data_length),
401 sizeof(struct aml_resource_common_serialbus)},
402
403 /* Uart bus type specific */
404
405 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.flow_control),
406 AML_OFFSET(uart_serial_bus.type_specific_flags),
407 0},
408
409 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.stop_bits),
410 AML_OFFSET(uart_serial_bus.type_specific_flags),
411 2},
412
413 {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.data_bits),
414 AML_OFFSET(uart_serial_bus.type_specific_flags),
415 4},
416
417 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.endian),
418 AML_OFFSET(uart_serial_bus.type_specific_flags),
419 7},
420
421 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.uart_serial_bus.parity),
422 AML_OFFSET(uart_serial_bus.parity),
423 1},
424
425 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.uart_serial_bus.lines_enabled),
426 AML_OFFSET(uart_serial_bus.lines_enabled),
427 1},
428
429 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.uart_serial_bus.rx_fifo_size),
430 AML_OFFSET(uart_serial_bus.rx_fifo_size),
431 1},
432
433 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.uart_serial_bus.tx_fifo_size),
434 AML_OFFSET(uart_serial_bus.tx_fifo_size),
435 1},
436
437 {ACPI_RSC_MOVE32,
438 ACPI_RS_OFFSET(data.uart_serial_bus.default_baud_rate),
439 AML_OFFSET(uart_serial_bus.default_baud_rate),
440 1},
441};