xref: /openbmc/linux/drivers/acpi/acpica/rsdumpinfo.c (revision 47aab533)
1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
2 /*******************************************************************************
3  *
4  * Module Name: rsdumpinfo - Tables used to display resource descriptors.
5  *
6  ******************************************************************************/
7 
8 #include <acpi/acpi.h>
9 #include "accommon.h"
10 #include "acresrc.h"
11 
12 #define _COMPONENT          ACPI_RESOURCES
13 ACPI_MODULE_NAME("rsdumpinfo")
14 
15 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
16 #define ACPI_RSD_OFFSET(f)          (u8) ACPI_OFFSET (union acpi_resource_data,f)
17 #define ACPI_PRT_OFFSET(f)          (u8) ACPI_OFFSET (struct acpi_pci_routing_table,f)
18 #define ACPI_RSD_TABLE_SIZE(name)   (sizeof(name) / sizeof (struct acpi_rsdump_info))
19 /*******************************************************************************
20  *
21  * Resource Descriptor info tables
22  *
23  * Note: The first table entry must be a Title or Literal and must contain
24  * the table length (number of table entries)
25  *
26  ******************************************************************************/
27 struct acpi_rsdump_info acpi_rs_dump_irq[7] = {
28 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_irq), "IRQ", NULL},
29 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.descriptor_length),
30 	 "Descriptor Length", NULL},
31 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.triggering), "Triggering",
32 	 acpi_gbl_he_decode},
33 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity",
34 	 acpi_gbl_ll_decode},
35 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.shareable), "Sharing",
36 	 acpi_gbl_shr_decode},
37 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count),
38 	 "Interrupt Count", NULL},
39 	{ACPI_RSD_SHORTLIST, ACPI_RSD_OFFSET(irq.interrupts[0]),
40 	 "Interrupt List", NULL}
41 };
42 
43 struct acpi_rsdump_info acpi_rs_dump_dma[6] = {
44 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_dma), "DMA", NULL},
45 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(dma.type), "Speed",
46 	 acpi_gbl_typ_decode},
47 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(dma.bus_master), "Mastering",
48 	 acpi_gbl_bm_decode},
49 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(dma.transfer), "Transfer Type",
50 	 acpi_gbl_siz_decode},
51 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(dma.channel_count), "Channel Count",
52 	 NULL},
53 	{ACPI_RSD_SHORTLIST, ACPI_RSD_OFFSET(dma.channels[0]), "Channel List",
54 	 NULL}
55 };
56 
57 struct acpi_rsdump_info acpi_rs_dump_start_dpf[4] = {
58 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_start_dpf),
59 	 "Start-Dependent-Functions", NULL},
60 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(start_dpf.descriptor_length),
61 	 "Descriptor Length", NULL},
62 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.compatibility_priority),
63 	 "Compatibility Priority", acpi_gbl_config_decode},
64 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.performance_robustness),
65 	 "Performance/Robustness", acpi_gbl_config_decode}
66 };
67 
68 struct acpi_rsdump_info acpi_rs_dump_end_dpf[1] = {
69 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_end_dpf),
70 	 "End-Dependent-Functions", NULL}
71 };
72 
73 struct acpi_rsdump_info acpi_rs_dump_io[6] = {
74 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_io), "I/O", NULL},
75 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(io.io_decode), "Address Decoding",
76 	 acpi_gbl_io_decode},
77 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(io.minimum), "Address Minimum", NULL},
78 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(io.maximum), "Address Maximum", NULL},
79 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(io.alignment), "Alignment", NULL},
80 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(io.address_length), "Address Length",
81 	 NULL}
82 };
83 
84 struct acpi_rsdump_info acpi_rs_dump_fixed_io[3] = {
85 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_io),
86 	 "Fixed I/O", NULL},
87 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_io.address), "Address", NULL},
88 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(fixed_io.address_length),
89 	 "Address Length", NULL}
90 };
91 
92 struct acpi_rsdump_info acpi_rs_dump_vendor[3] = {
93 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_vendor),
94 	 "Vendor Specific", NULL},
95 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(vendor.byte_length), "Length", NULL},
96 	{ACPI_RSD_LONGLIST, ACPI_RSD_OFFSET(vendor.byte_data[0]), "Vendor Data",
97 	 NULL}
98 };
99 
100 struct acpi_rsdump_info acpi_rs_dump_end_tag[1] = {
101 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_end_tag), "EndTag",
102 	 NULL}
103 };
104 
105 struct acpi_rsdump_info acpi_rs_dump_memory24[6] = {
106 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory24),
107 	 "24-Bit Memory Range", NULL},
108 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(memory24.write_protect),
109 	 "Write Protect", acpi_gbl_rw_decode},
110 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.minimum), "Address Minimum",
111 	 NULL},
112 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.maximum), "Address Maximum",
113 	 NULL},
114 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.alignment), "Alignment",
115 	 NULL},
116 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.address_length),
117 	 "Address Length", NULL}
118 };
119 
120 struct acpi_rsdump_info acpi_rs_dump_memory32[6] = {
121 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory32),
122 	 "32-Bit Memory Range", NULL},
123 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(memory32.write_protect),
124 	 "Write Protect", acpi_gbl_rw_decode},
125 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.minimum), "Address Minimum",
126 	 NULL},
127 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.maximum), "Address Maximum",
128 	 NULL},
129 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.alignment), "Alignment",
130 	 NULL},
131 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.address_length),
132 	 "Address Length", NULL}
133 };
134 
135 struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[4] = {
136 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_memory32),
137 	 "32-Bit Fixed Memory Range", NULL},
138 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(fixed_memory32.write_protect),
139 	 "Write Protect", acpi_gbl_rw_decode},
140 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(fixed_memory32.address), "Address",
141 	 NULL},
142 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(fixed_memory32.address_length),
143 	 "Address Length", NULL}
144 };
145 
146 struct acpi_rsdump_info acpi_rs_dump_address16[8] = {
147 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address16),
148 	 "16-Bit WORD Address Space", NULL},
149 	{ACPI_RSD_ADDRESS, 0, NULL, NULL},
150 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.granularity),
151 	 "Granularity", NULL},
152 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.minimum),
153 	 "Address Minimum", NULL},
154 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.maximum),
155 	 "Address Maximum", NULL},
156 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.translation_offset),
157 	 "Translation Offset", NULL},
158 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.address_length),
159 	 "Address Length", NULL},
160 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address16.resource_source), NULL, NULL}
161 };
162 
163 struct acpi_rsdump_info acpi_rs_dump_address32[8] = {
164 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address32),
165 	 "32-Bit DWORD Address Space", NULL},
166 	{ACPI_RSD_ADDRESS, 0, NULL, NULL},
167 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.granularity),
168 	 "Granularity", NULL},
169 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.minimum),
170 	 "Address Minimum", NULL},
171 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.maximum),
172 	 "Address Maximum", NULL},
173 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.translation_offset),
174 	 "Translation Offset", NULL},
175 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.address_length),
176 	 "Address Length", NULL},
177 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address32.resource_source), NULL, NULL}
178 };
179 
180 struct acpi_rsdump_info acpi_rs_dump_address64[8] = {
181 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address64),
182 	 "64-Bit QWORD Address Space", NULL},
183 	{ACPI_RSD_ADDRESS, 0, NULL, NULL},
184 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.granularity),
185 	 "Granularity", NULL},
186 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.minimum),
187 	 "Address Minimum", NULL},
188 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.maximum),
189 	 "Address Maximum", NULL},
190 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.translation_offset),
191 	 "Translation Offset", NULL},
192 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.address_length),
193 	 "Address Length", NULL},
194 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address64.resource_source), NULL, NULL}
195 };
196 
197 struct acpi_rsdump_info acpi_rs_dump_ext_address64[8] = {
198 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_address64),
199 	 "64-Bit Extended Address Space", NULL},
200 	{ACPI_RSD_ADDRESS, 0, NULL, NULL},
201 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.granularity),
202 	 "Granularity", NULL},
203 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.minimum),
204 	 "Address Minimum", NULL},
205 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.maximum),
206 	 "Address Maximum", NULL},
207 	{ACPI_RSD_UINT64,
208 	 ACPI_RSD_OFFSET(ext_address64.address.translation_offset),
209 	 "Translation Offset", NULL},
210 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.address_length),
211 	 "Address Length", NULL},
212 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.type_specific),
213 	 "Type-Specific Attribute", NULL}
214 };
215 
216 struct acpi_rsdump_info acpi_rs_dump_ext_irq[8] = {
217 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_irq),
218 	 "Extended IRQ", NULL},
219 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.producer_consumer),
220 	 "Type", acpi_gbl_consume_decode},
221 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.triggering),
222 	 "Triggering", acpi_gbl_he_decode},
223 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity",
224 	 acpi_gbl_ll_decode},
225 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(extended_irq.shareable), "Sharing",
226 	 acpi_gbl_shr_decode},
227 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL,
228 	 NULL},
229 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(extended_irq.interrupt_count),
230 	 "Interrupt Count", NULL},
231 	{ACPI_RSD_DWORDLIST, ACPI_RSD_OFFSET(extended_irq.interrupts[0]),
232 	 "Interrupt List", NULL}
233 };
234 
235 struct acpi_rsdump_info acpi_rs_dump_generic_reg[6] = {
236 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_generic_reg),
237 	 "Generic Register", NULL},
238 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.space_id), "Space ID",
239 	 NULL},
240 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.bit_width), "Bit Width",
241 	 NULL},
242 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.bit_offset), "Bit Offset",
243 	 NULL},
244 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.access_size),
245 	 "Access Size", NULL},
246 	{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(generic_reg.address), "Address", NULL}
247 };
248 
249 struct acpi_rsdump_info acpi_rs_dump_gpio[16] = {
250 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_gpio), "GPIO", NULL},
251 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.revision_id), "RevisionId", NULL},
252 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.connection_type),
253 	 "ConnectionType", acpi_gbl_ct_decode},
254 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(gpio.producer_consumer),
255 	 "ProducerConsumer", acpi_gbl_consume_decode},
256 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig",
257 	 acpi_gbl_ppc_decode},
258 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.shareable), "Sharing",
259 	 acpi_gbl_shr_decode},
260 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction),
261 	 "IoRestriction", acpi_gbl_ior_decode},
262 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(gpio.triggering), "Triggering",
263 	 acpi_gbl_he_decode},
264 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.polarity), "Polarity",
265 	 acpi_gbl_ll_decode},
266 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.drive_strength), "DriveStrength",
267 	 NULL},
268 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.debounce_timeout),
269 	 "DebounceTimeout", NULL},
270 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(gpio.resource_source),
271 	 "ResourceSource", NULL},
272 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.pin_table_length),
273 	 "PinTableLength", NULL},
274 	{ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(gpio.pin_table), "PinTable", NULL},
275 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.vendor_length), "VendorLength",
276 	 NULL},
277 	{ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(gpio.vendor_data), "VendorData",
278 	 NULL},
279 };
280 
281 struct acpi_rsdump_info acpi_rs_dump_pin_function[10] = {
282 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_function),
283 	 "PinFunction", NULL},
284 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.revision_id),
285 	 "RevisionId", NULL},
286 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.pin_config), "PinConfig",
287 	 acpi_gbl_ppc_decode},
288 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_function.shareable), "Sharing",
289 	 acpi_gbl_shr_decode},
290 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.function_number),
291 	 "FunctionNumber", NULL},
292 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_function.resource_source),
293 	 "ResourceSource", NULL},
294 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.pin_table_length),
295 	 "PinTableLength", NULL},
296 	{ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_function.pin_table), "PinTable",
297 	 NULL},
298 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.vendor_length),
299 	 "VendorLength", NULL},
300 	{ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_function.vendor_data),
301 	 "VendorData", NULL},
302 };
303 
304 struct acpi_rsdump_info acpi_rs_dump_clock_input[7] = {
305 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_clock_input),
306 	 "ClockInput", NULL},
307 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(clock_input.revision_id), "RevisionId",
308 	 NULL},
309 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(clock_input.frequency_numerator),
310 	 "FrequencyNumerator", NULL},
311 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(clock_input.frequency_divisor),
312 	 "FrequencyDivisor", NULL},
313 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(clock_input.scale), "Scale",
314 	 acpi_gbl_clock_input_scale},
315 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(clock_input.mode), "Mode",
316 	 acpi_gbl_clock_input_mode},
317 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(clock_input.resource_source),
318 	 "ResourceSource", NULL},
319 };
320 
321 struct acpi_rsdump_info acpi_rs_dump_pin_config[11] = {
322 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_config),
323 	 "PinConfig", NULL},
324 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.revision_id), "RevisionId",
325 	 NULL},
326 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.producer_consumer),
327 	 "ProducerConsumer", acpi_gbl_consume_decode},
328 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.shareable), "Sharing",
329 	 acpi_gbl_shr_decode},
330 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.pin_config_type),
331 	 "PinConfigType", NULL},
332 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(pin_config.pin_config_value),
333 	 "PinConfigValue", NULL},
334 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_config.resource_source),
335 	 "ResourceSource", NULL},
336 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_config.pin_table_length),
337 	 "PinTableLength", NULL},
338 	{ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_config.pin_table), "PinTable",
339 	 NULL},
340 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_config.vendor_length),
341 	 "VendorLength", NULL},
342 	{ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_config.vendor_data),
343 	 "VendorData", NULL},
344 };
345 
346 struct acpi_rsdump_info acpi_rs_dump_pin_group[8] = {
347 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group),
348 	 "PinGroup", NULL},
349 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group.revision_id), "RevisionId",
350 	 NULL},
351 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group.producer_consumer),
352 	 "ProducerConsumer", acpi_gbl_consume_decode},
353 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group.pin_table_length),
354 	 "PinTableLength", NULL},
355 	{ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_group.pin_table), "PinTable",
356 	 NULL},
357 	{ACPI_RSD_LABEL, ACPI_RSD_OFFSET(pin_group.resource_label),
358 	 "ResourceLabel", NULL},
359 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group.vendor_length),
360 	 "VendorLength", NULL},
361 	{ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group.vendor_data),
362 	 "VendorData", NULL},
363 };
364 
365 struct acpi_rsdump_info acpi_rs_dump_pin_group_function[9] = {
366 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group_function),
367 	 "PinGroupFunction", NULL},
368 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_function.revision_id),
369 	 "RevisionId", NULL},
370 	{ACPI_RSD_1BITFLAG,
371 	 ACPI_RSD_OFFSET(pin_group_function.producer_consumer),
372 	 "ProducerConsumer", acpi_gbl_consume_decode},
373 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_function.shareable),
374 	 "Sharing", acpi_gbl_shr_decode},
375 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.function_number),
376 	 "FunctionNumber", NULL},
377 	{ACPI_RSD_SOURCE_LABEL,
378 	 ACPI_RSD_OFFSET(pin_group_function.resource_source_label),
379 	 "ResourceSourceLabel", NULL},
380 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_group_function.resource_source),
381 	 "ResourceSource", NULL},
382 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.vendor_length),
383 	 "VendorLength", NULL},
384 	{ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group_function.vendor_data),
385 	 "VendorData", NULL},
386 };
387 
388 struct acpi_rsdump_info acpi_rs_dump_pin_group_config[10] = {
389 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group_config),
390 	 "PinGroupConfig", NULL},
391 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.revision_id),
392 	 "RevisionId", NULL},
393 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.producer_consumer),
394 	 "ProducerConsumer", acpi_gbl_consume_decode},
395 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.shareable),
396 	 "Sharing", acpi_gbl_shr_decode},
397 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.pin_config_type),
398 	 "PinConfigType", NULL},
399 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(pin_group_config.pin_config_value),
400 	 "PinConfigValue", NULL},
401 	{ACPI_RSD_SOURCE_LABEL,
402 	 ACPI_RSD_OFFSET(pin_group_config.resource_source_label),
403 	 "ResourceSourceLabel", NULL},
404 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_group_config.resource_source),
405 	 "ResourceSource", NULL},
406 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_config.vendor_length),
407 	 "VendorLength", NULL},
408 	{ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group_config.vendor_data),
409 	 "VendorData", NULL},
410 };
411 
412 struct acpi_rsdump_info acpi_rs_dump_fixed_dma[4] = {
413 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_dma),
414 	 "FixedDma", NULL},
415 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_dma.request_lines),
416 	 "RequestLines", NULL},
417 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_dma.channels), "Channels",
418 	 NULL},
419 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(fixed_dma.width), "TransferWidth",
420 	 acpi_gbl_dts_decode},
421 };
422 
423 #define ACPI_RS_DUMP_COMMON_SERIAL_BUS \
424 	{ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (common_serial_bus.revision_id),    "RevisionId",               NULL}, \
425 	{ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (common_serial_bus.type),           "Type",                     acpi_gbl_sbt_decode}, \
426 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.producer_consumer), "ProducerConsumer",      acpi_gbl_consume_decode}, \
427 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.slave_mode),     "SlaveMode",                acpi_gbl_sm_decode}, \
428 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.connection_sharing),"ConnectionSharing",     acpi_gbl_shr_decode}, \
429 	{ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (common_serial_bus.type_revision_id), "TypeRevisionId",         NULL}, \
430 	{ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (common_serial_bus.type_data_length), "TypeDataLength",         NULL}, \
431 	{ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (common_serial_bus.resource_source), "ResourceSource",          NULL}, \
432 	{ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (common_serial_bus.vendor_length),  "VendorLength",             NULL}, \
433 	{ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (common_serial_bus.vendor_data),   "VendorData",               NULL},
434 
435 struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[11] = {
436 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_common_serial_bus),
437 	 "Common Serial Bus", NULL},
438 	ACPI_RS_DUMP_COMMON_SERIAL_BUS
439 };
440 
441 struct acpi_rsdump_info acpi_rs_dump_csi2_serial_bus[11] = {
442 	{ ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_csi2_serial_bus),
443 	 "Camera Serial Bus", NULL },
444 	{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.revision_id),
445 	 "RevisionId", NULL },
446 	{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.type), "Type",
447 	 acpi_gbl_sbt_decode },
448 	{ ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.producer_consumer),
449 	 "ProducerConsumer", acpi_gbl_consume_decode },
450 	{ ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.slave_mode),
451 	 "SlaveMode", acpi_gbl_sm_decode },
452 	{ ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.phy_type),
453 	 "PhyType", acpi_gbl_phy_decode },
454 	{ ACPI_RSD_6BITFLAG,
455 	 ACPI_RSD_OFFSET(csi2_serial_bus.local_port_instance),
456 	 "LocalPortInstance", NULL },
457 	{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.type_revision_id),
458 	 "TypeRevisionId", NULL },
459 	{ ACPI_RSD_UINT16, ACPI_RSD_OFFSET(csi2_serial_bus.vendor_length),
460 	 "VendorLength", NULL },
461 	{ ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(csi2_serial_bus.vendor_data),
462 	 "VendorData", NULL },
463 	{ ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(csi2_serial_bus.resource_source),
464 	 "ResourceSource", NULL },
465 };
466 
467 struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[14] = {
468 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_i2c_serial_bus),
469 	 "I2C Serial Bus", NULL},
470 	ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_1BITFLAG,
471 					ACPI_RSD_OFFSET(i2c_serial_bus.
472 							access_mode),
473 					"AccessMode", acpi_gbl_am_decode},
474 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(i2c_serial_bus.connection_speed),
475 	 "ConnectionSpeed", NULL},
476 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(i2c_serial_bus.slave_address),
477 	 "SlaveAddress", NULL},
478 };
479 
480 struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[18] = {
481 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_spi_serial_bus),
482 	 "Spi Serial Bus", NULL},
483 	ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_1BITFLAG,
484 					ACPI_RSD_OFFSET(spi_serial_bus.
485 							wire_mode), "WireMode",
486 					acpi_gbl_wm_decode},
487 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(spi_serial_bus.device_polarity),
488 	 "DevicePolarity", acpi_gbl_dp_decode},
489 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.data_bit_length),
490 	 "DataBitLength", NULL},
491 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.clock_phase),
492 	 "ClockPhase", acpi_gbl_cph_decode},
493 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.clock_polarity),
494 	 "ClockPolarity", acpi_gbl_cpo_decode},
495 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(spi_serial_bus.device_selection),
496 	 "DeviceSelection", NULL},
497 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(spi_serial_bus.connection_speed),
498 	 "ConnectionSpeed", NULL},
499 };
500 
501 struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[20] = {
502 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_uart_serial_bus),
503 	 "Uart Serial Bus", NULL},
504 	ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_2BITFLAG,
505 					ACPI_RSD_OFFSET(uart_serial_bus.
506 							flow_control),
507 					"FlowControl", acpi_gbl_fc_decode},
508 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.stop_bits),
509 	 "StopBits", acpi_gbl_sb_decode},
510 	{ACPI_RSD_3BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.data_bits),
511 	 "DataBits", acpi_gbl_bpb_decode},
512 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.endian), "Endian",
513 	 acpi_gbl_ed_decode},
514 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(uart_serial_bus.parity), "Parity",
515 	 acpi_gbl_pt_decode},
516 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(uart_serial_bus.lines_enabled),
517 	 "LinesEnabled", NULL},
518 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(uart_serial_bus.rx_fifo_size),
519 	 "RxFifoSize", NULL},
520 	{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(uart_serial_bus.tx_fifo_size),
521 	 "TxFifoSize", NULL},
522 	{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(uart_serial_bus.default_baud_rate),
523 	 "ConnectionSpeed", NULL},
524 };
525 
526 /*
527  * Tables used for common address descriptor flag fields
528  */
529 struct acpi_rsdump_info acpi_rs_dump_general_flags[5] = {
530 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_general_flags), NULL,
531 	 NULL},
532 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.producer_consumer),
533 	 "Consumer/Producer", acpi_gbl_consume_decode},
534 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.decode), "Address Decode",
535 	 acpi_gbl_dec_decode},
536 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.min_address_fixed),
537 	 "Min Relocatability", acpi_gbl_min_decode},
538 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.max_address_fixed),
539 	 "Max Relocatability", acpi_gbl_max_decode}
540 };
541 
542 struct acpi_rsdump_info acpi_rs_dump_memory_flags[5] = {
543 	{ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory_flags),
544 	 "Resource Type", (void *)"Memory Range"},
545 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.mem.write_protect),
546 	 "Write Protect", acpi_gbl_rw_decode},
547 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.mem.caching),
548 	 "Caching", acpi_gbl_mem_decode},
549 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.mem.range_type),
550 	 "Range Type", acpi_gbl_mtp_decode},
551 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.mem.translation),
552 	 "Translation", acpi_gbl_ttp_decode}
553 };
554 
555 struct acpi_rsdump_info acpi_rs_dump_io_flags[4] = {
556 	{ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_io_flags),
557 	 "Resource Type", (void *)"I/O Range"},
558 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.io.range_type),
559 	 "Range Type", acpi_gbl_rng_decode},
560 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.io.translation),
561 	 "Translation", acpi_gbl_ttp_decode},
562 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.io.translation_type),
563 	 "Translation Type", acpi_gbl_trs_decode}
564 };
565 
566 /*
567  * Table used to dump _PRT contents
568  */
569 struct acpi_rsdump_info acpi_rs_dump_prt[5] = {
570 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_prt), NULL, NULL},
571 	{ACPI_RSD_UINT64, ACPI_PRT_OFFSET(address), "Address", NULL},
572 	{ACPI_RSD_UINT32, ACPI_PRT_OFFSET(pin), "Pin", NULL},
573 	{ACPI_RSD_STRING, ACPI_PRT_OFFSET(source[0]), "Source", NULL},
574 	{ACPI_RSD_UINT32, ACPI_PRT_OFFSET(source_index), "Source Index", NULL}
575 };
576 
577 #endif
578