aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rsdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/resources/rsdump.c')
-rw-r--r--drivers/acpi/resources/rsdump.c1207
1 files changed, 478 insertions, 729 deletions
diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index 2f8990845b2d..27172a3d55d7 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -43,6 +43,7 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acresrc.h> 45#include <acpi/acresrc.h>
46#include <acpi/acdisasm.h>
46 47
47#define _COMPONENT ACPI_RESOURCES 48#define _COMPONENT ACPI_RESOURCES
48ACPI_MODULE_NAME("rsdump") 49ACPI_MODULE_NAME("rsdump")
@@ -61,108 +62,448 @@ static void acpi_rs_out_integer64(char *title, u64 value);
61 62
62static void acpi_rs_out_title(char *title); 63static void acpi_rs_out_title(char *title);
63 64
64static void acpi_rs_dump_byte_list(u32 length, u8 * data); 65static void acpi_rs_dump_byte_list(u16 length, u8 * data);
65 66
66static void acpi_rs_dump_dword_list(u32 length, u32 * data); 67static void acpi_rs_dump_dword_list(u8 length, u32 * data);
67 68
68static void acpi_rs_dump_short_byte_list(u32 length, u32 * data); 69static void acpi_rs_dump_short_byte_list(u8 length, u8 * data);
69 70
70static void 71static void
71acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source); 72acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
72 73
73static void acpi_rs_dump_address_common(union acpi_resource_data *resource); 74static void acpi_rs_dump_address_common(union acpi_resource_data *resource);
74 75
76static void
77acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table);
78
79#define ACPI_RSD_OFFSET(f) (u8) ACPI_OFFSET (union acpi_resource_data,f)
80#define ACPI_PRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_pci_routing_table,f)
81#define ACPI_RSD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_rsdump_info))
82
75/******************************************************************************* 83/*******************************************************************************
76 * 84 *
77 * FUNCTION: acpi_rs_out* 85 * Resource Descriptor info tables
78 *
79 * PARAMETERS: Title - Name of the resource field
80 * Value - Value of the resource field
81 *
82 * RETURN: None
83 * 86 *
84 * DESCRIPTION: Miscellaneous helper functions to consistently format the 87 * Note: The first table entry must be a Title or Literal and must contain
85 * output of the resource dump routines 88 * the table length (number of table entries)
86 * 89 *
87 ******************************************************************************/ 90 ******************************************************************************/
88 91
89static void acpi_rs_out_string(char *title, char *value) 92struct acpi_rsdump_info acpi_rs_dump_irq[6] = {
90{ 93 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_irq), "IRQ", NULL},
91 acpi_os_printf("%27s : %s\n", title, value); 94 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.triggering), "Triggering",
92} 95 acpi_gbl_HEdecode},
96 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity",
97 acpi_gbl_LLdecode},
98 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing",
99 acpi_gbl_SHRdecode},
100 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count),
101 "Interrupt Count", NULL},
102 {ACPI_RSD_SHORTLIST, ACPI_RSD_OFFSET(irq.interrupts[0]),
103 "Interrupt List", NULL}
104};
105
106struct acpi_rsdump_info acpi_rs_dump_dma[6] = {
107 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_dma), "DMA", NULL},
108 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(dma.type), "Speed",
109 acpi_gbl_TYPdecode},
110 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(dma.bus_master), "Mastering",
111 acpi_gbl_BMdecode},
112 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(dma.transfer), "Transfer Type",
113 acpi_gbl_SIZdecode},
114 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(dma.channel_count), "Channel Count",
115 NULL},
116 {ACPI_RSD_SHORTLIST, ACPI_RSD_OFFSET(dma.channels[0]), "Channel List",
117 NULL}
118};
119
120struct acpi_rsdump_info acpi_rs_dump_start_dpf[3] = {
121 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_start_dpf),
122 "Start-Dependent-Functions", NULL},
123 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.compatibility_priority),
124 "Compatibility Priority", acpi_gbl_config_decode},
125 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.performance_robustness),
126 "Performance/Robustness", acpi_gbl_config_decode}
127};
128
129struct acpi_rsdump_info acpi_rs_dump_end_dpf[1] = {
130 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_end_dpf),
131 "End-Dependent-Functions", NULL}
132};
133
134struct acpi_rsdump_info acpi_rs_dump_io[6] = {
135 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_io), "I/O", NULL},
136 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(io.io_decode), "Address Decoding",
137 acpi_gbl_io_decode},
138 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(io.minimum), "Address Minimum", NULL},
139 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(io.maximum), "Address Maximum", NULL},
140 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(io.alignment), "Alignment", NULL},
141 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(io.address_length), "Address Length",
142 NULL}
143};
144
145struct acpi_rsdump_info acpi_rs_dump_fixed_io[3] = {
146 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_io),
147 "Fixed I/O", NULL},
148 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_io.address), "Address", NULL},
149 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(fixed_io.address_length),
150 "Address Length", NULL}
151};
152
153struct acpi_rsdump_info acpi_rs_dump_vendor[3] = {
154 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_vendor),
155 "Vendor Specific", NULL},
156 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(vendor.byte_length), "Length", NULL},
157 {ACPI_RSD_LONGLIST, ACPI_RSD_OFFSET(vendor.byte_data[0]), "Vendor Data",
158 NULL}
159};
160
161struct acpi_rsdump_info acpi_rs_dump_end_tag[1] = {
162 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_end_tag), "end_tag",
163 NULL}
164};
165
166struct acpi_rsdump_info acpi_rs_dump_memory24[6] = {
167 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory24),
168 "24-Bit Memory Range", NULL},
169 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(memory24.write_protect),
170 "Write Protect", acpi_gbl_RWdecode},
171 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.minimum), "Address Minimum",
172 NULL},
173 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.maximum), "Address Maximum",
174 NULL},
175 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.alignment), "Alignment",
176 NULL},
177 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(memory24.address_length),
178 "Address Length", NULL}
179};
180
181struct acpi_rsdump_info acpi_rs_dump_memory32[6] = {
182 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory32),
183 "32-Bit Memory Range", NULL},
184 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(memory32.write_protect),
185 "Write Protect", acpi_gbl_RWdecode},
186 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.minimum), "Address Minimum",
187 NULL},
188 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.maximum), "Address Maximum",
189 NULL},
190 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.alignment), "Alignment",
191 NULL},
192 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(memory32.address_length),
193 "Address Length", NULL}
194};
195
196struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[4] = {
197 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_memory32),
198 "32-Bit Fixed Memory Range", NULL},
199 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(fixed_memory32.write_protect),
200 "Write Protect", acpi_gbl_RWdecode},
201 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(fixed_memory32.address), "Address",
202 NULL},
203 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(fixed_memory32.address_length),
204 "Address Length", NULL}
205};
206
207struct acpi_rsdump_info acpi_rs_dump_address16[8] = {
208 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address16),
209 "16-Bit WORD Address Space", NULL},
210 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
211 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.granularity), "Granularity",
212 NULL},
213 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.minimum), "Address Minimum",
214 NULL},
215 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.maximum), "Address Maximum",
216 NULL},
217 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.translation_offset),
218 "Translation Offset", NULL},
219 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address_length),
220 "Address Length", NULL},
221 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address16.resource_source), NULL, NULL}
222};
223
224struct acpi_rsdump_info acpi_rs_dump_address32[8] = {
225 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address32),
226 "32-Bit DWORD Address Space", NULL},
227 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
228 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.granularity), "Granularity",
229 NULL},
230 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.minimum), "Address Minimum",
231 NULL},
232 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.maximum), "Address Maximum",
233 NULL},
234 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.translation_offset),
235 "Translation Offset", NULL},
236 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address_length),
237 "Address Length", NULL},
238 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address32.resource_source), NULL, NULL}
239};
240
241struct acpi_rsdump_info acpi_rs_dump_address64[8] = {
242 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address64),
243 "64-Bit QWORD Address Space", NULL},
244 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
245 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.granularity), "Granularity",
246 NULL},
247 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.minimum), "Address Minimum",
248 NULL},
249 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.maximum), "Address Maximum",
250 NULL},
251 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.translation_offset),
252 "Translation Offset", NULL},
253 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address_length),
254 "Address Length", NULL},
255 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address64.resource_source), NULL, NULL}
256};
257
258struct acpi_rsdump_info acpi_rs_dump_ext_address64[8] = {
259 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_address64),
260 "64-Bit Extended Address Space", NULL},
261 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
262 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.granularity),
263 "Granularity", NULL},
264 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.minimum),
265 "Address Minimum", NULL},
266 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.maximum),
267 "Address Maximum", NULL},
268 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.translation_offset),
269 "Translation Offset", NULL},
270 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address_length),
271 "Address Length", NULL},
272 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.type_specific),
273 "Type-Specific Attribute", NULL}
274};
275
276struct acpi_rsdump_info acpi_rs_dump_ext_irq[8] = {
277 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_irq),
278 "Extended IRQ", NULL},
279 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.producer_consumer),
280 "Type", acpi_gbl_consume_decode},
281 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.triggering),
282 "Triggering", acpi_gbl_HEdecode},
283 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity",
284 acpi_gbl_LLdecode},
285 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.sharable), "Sharing",
286 acpi_gbl_SHRdecode},
287 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL,
288 NULL},
289 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(extended_irq.interrupt_count),
290 "Interrupt Count", NULL},
291 {ACPI_RSD_DWORDLIST, ACPI_RSD_OFFSET(extended_irq.interrupts[0]),
292 "Interrupt List", NULL}
293};
294
295struct acpi_rsdump_info acpi_rs_dump_generic_reg[6] = {
296 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_generic_reg),
297 "Generic Register", NULL},
298 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.space_id), "Space ID",
299 NULL},
300 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.bit_width), "Bit Width",
301 NULL},
302 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.bit_offset), "Bit Offset",
303 NULL},
304 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.access_size),
305 "Access Size", NULL},
306 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(generic_reg.address), "Address", NULL}
307};
93 308
94static void acpi_rs_out_integer8(char *title, u8 value) 309/*
95{ 310 * Tables used for common address descriptor flag fields
96 acpi_os_printf("%27s : %2.2X\n", title, value); 311 */
97} 312static struct acpi_rsdump_info acpi_rs_dump_general_flags[5] = {
98 313 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_general_flags), NULL,
99static void acpi_rs_out_integer16(char *title, u16 value) 314 NULL},
100{ 315 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.producer_consumer),
101 acpi_os_printf("%27s : %4.4X\n", title, value); 316 "Consumer/Producer", acpi_gbl_consume_decode},
102} 317 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.decode), "Address Decode",
103 318 acpi_gbl_DECdecode},
104static void acpi_rs_out_integer32(char *title, u32 value) 319 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.min_address_fixed),
105{ 320 "Min Relocatability", acpi_gbl_min_decode},
106 acpi_os_printf("%27s : %8.8X\n", title, value); 321 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.max_address_fixed),
107} 322 "Max Relocatability", acpi_gbl_max_decode}
108 323};
109static void acpi_rs_out_integer64(char *title, u64 value) 324
110{ 325static struct acpi_rsdump_info acpi_rs_dump_memory_flags[5] = {
111 acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value)); 326 {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory_flags),
112} 327 "Resource Type", "Memory Range"},
328 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.mem.write_protect),
329 "Write Protect", acpi_gbl_RWdecode},
330 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.mem.caching),
331 "Caching", acpi_gbl_MEMdecode},
332 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.mem.range_type),
333 "Range Type", acpi_gbl_MTPdecode},
334 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.mem.translation),
335 "Translation", acpi_gbl_TTPdecode}
336};
337
338static struct acpi_rsdump_info acpi_rs_dump_io_flags[4] = {
339 {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_io_flags),
340 "Resource Type", "I/O Range"},
341 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(address.info.io.range_type),
342 "Range Type", acpi_gbl_RNGdecode},
343 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.io.translation),
344 "Translation", acpi_gbl_TTPdecode},
345 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(address.info.io.translation_type),
346 "Translation Type", acpi_gbl_TRSdecode}
347};
113 348
114static void acpi_rs_out_title(char *title) 349/*
115{ 350 * Table used to dump _PRT contents
116 acpi_os_printf("%27s : ", title); 351 */
117} 352static struct acpi_rsdump_info acpi_rs_dump_prt[5] = {
353 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_prt), NULL, NULL},
354 {ACPI_RSD_UINT64, ACPI_PRT_OFFSET(address), "Address", NULL},
355 {ACPI_RSD_UINT32, ACPI_PRT_OFFSET(pin), "Pin", NULL},
356 {ACPI_RSD_STRING, ACPI_PRT_OFFSET(source[0]), "Source", NULL},
357 {ACPI_RSD_UINT32, ACPI_PRT_OFFSET(source_index), "Source Index", NULL}
358};
118 359
119/******************************************************************************* 360/*******************************************************************************
120 * 361 *
121 * FUNCTION: acpi_rs_dump*List 362 * FUNCTION: acpi_rs_dump_descriptor
122 * 363 *
123 * PARAMETERS: Length - Number of elements in the list 364 * PARAMETERS: Resource
124 * Data - Start of the list
125 * 365 *
126 * RETURN: None 366 * RETURN: None
127 * 367 *
128 * DESCRIPTION: Miscellaneous functions to dump lists of raw data 368 * DESCRIPTION:
129 * 369 *
130 ******************************************************************************/ 370 ******************************************************************************/
131 371
132static void acpi_rs_dump_byte_list(u32 length, u8 * data) 372static void
373acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
133{ 374{
134 u32 i; 375 void *target = NULL;
376 void *previous_target;
377 char *name;
378 u8 count;
379
380 /* First table entry must contain the table length (# of table entries) */
381
382 count = table->offset;
383
384 while (count) {
385 previous_target = target;
386 target = ((u8 *) resource) + table->offset;
387 name = table->name;
388
389 switch (table->opcode) {
390 case ACPI_RSD_TITLE:
391 /*
392 * Optional resource title
393 */
394 if (table->name) {
395 acpi_os_printf("%s Resource\n", name);
396 }
397 break;
135 398
136 for (i = 0; i < length; i++) { 399 /* Strings */
137 acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]);
138 }
139}
140 400
141static void acpi_rs_dump_dword_list(u32 length, u32 * data) 401 case ACPI_RSD_LITERAL:
142{ 402 acpi_rs_out_string(name, (char *)table->pointer);
143 u32 i; 403 break;
144 404
145 for (i = 0; i < length; i++) { 405 case ACPI_RSD_STRING:
146 acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i, data[i]); 406 acpi_rs_out_string(name, (char *)target);
147 } 407 break;
148}
149 408
150static void acpi_rs_dump_short_byte_list(u32 length, u32 * data) 409 /* Data items, 8/16/32/64 bit */
151{
152 u32 i;
153 410
154 for (i = 0; i < length; i++) { 411 case ACPI_RSD_UINT8:
155 acpi_os_printf("%X ", data[i]); 412 acpi_rs_out_integer8(name, *(u8 *) target);
156 } 413 break;
157 acpi_os_printf("\n");
158}
159 414
160static void acpi_rs_dump_memory_attribute(u32 read_write_attribute) 415 case ACPI_RSD_UINT16:
161{ 416 acpi_rs_out_integer16(name, *(u16 *) target);
417 break;
418
419 case ACPI_RSD_UINT32:
420 acpi_rs_out_integer32(name, *(u32 *) target);
421 break;
162 422
163 acpi_rs_out_string("Read/Write Attribute", 423 case ACPI_RSD_UINT64:
164 ACPI_READ_WRITE_MEMORY == read_write_attribute ? 424 acpi_rs_out_integer64(name, *(u64 *) target);
165 "Read/Write" : "Read-Only"); 425 break;
426
427 /* Flags: 1-bit and 2-bit flags supported */
428
429 case ACPI_RSD_1BITFLAG:
430 acpi_rs_out_string(name, (char *)
431 ((const char **)table->
432 pointer)[(*(u8 *) target) & 0x01]);
433 break;
434
435 case ACPI_RSD_2BITFLAG:
436 acpi_rs_out_string(name, (char *)
437 ((const char **)table->
438 pointer)[(*(u8 *) target) & 0x03]);
439 break;
440
441 case ACPI_RSD_SHORTLIST:
442 /*
443 * Short byte list (single line output) for DMA and IRQ resources
444 * Note: The list length is obtained from the previous table entry
445 */
446 if (previous_target) {
447 acpi_rs_out_title(name);
448 acpi_rs_dump_short_byte_list(*
449 ((u8 *)
450 previous_target),
451 (u8 *) target);
452 }
453 break;
454
455 case ACPI_RSD_LONGLIST:
456 /*
457 * Long byte list for Vendor resource data
458 * Note: The list length is obtained from the previous table entry
459 */
460 if (previous_target) {
461 acpi_rs_dump_byte_list(*
462 ((u16 *)
463 previous_target),
464 (u8 *) target);
465 }
466 break;
467
468 case ACPI_RSD_DWORDLIST:
469 /*
470 * Dword list for Extended Interrupt resources
471 * Note: The list length is obtained from the previous table entry
472 */
473 if (previous_target) {
474 acpi_rs_dump_dword_list(*
475 ((u8 *)
476 previous_target),
477 (u32 *) target);
478 }
479 break;
480
481 case ACPI_RSD_ADDRESS:
482 /*
483 * Common flags for all Address resources
484 */
485 acpi_rs_dump_address_common((union acpi_resource_data *)
486 target);
487 break;
488
489 case ACPI_RSD_SOURCE:
490 /*
491 * Optional resource_source for Address resources
492 */
493 acpi_rs_dump_resource_source((struct
494 acpi_resource_source *)
495 target);
496 break;
497
498 default:
499 acpi_os_printf("**** Invalid table opcode [%X] ****\n",
500 table->opcode);
501 return;
502 }
503
504 table++;
505 count--;
506 }
166} 507}
167 508
168/******************************************************************************* 509/*******************************************************************************
@@ -187,8 +528,7 @@ acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source)
187 return; 528 return;
188 } 529 }
189 530
190 acpi_rs_out_integer8("Resource Source Index", 531 acpi_rs_out_integer8("Resource Source Index", resource_source->index);
191 (u8) resource_source->index);
192 532
193 acpi_rs_out_string("Resource Source", 533 acpi_rs_out_string("Resource Source",
194 resource_source->string_ptr ? 534 resource_source->string_ptr ?
@@ -217,65 +557,12 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
217 switch (resource->address.resource_type) { 557 switch (resource->address.resource_type) {
218 case ACPI_MEMORY_RANGE: 558 case ACPI_MEMORY_RANGE:
219 559
220 acpi_rs_out_string("Resource Type", "Memory Range"); 560 acpi_rs_dump_descriptor(resource, acpi_rs_dump_memory_flags);
221
222 acpi_rs_out_title("Type-Specific Flags");
223
224 switch (resource->address.attribute.memory.cache_attribute) {
225 case ACPI_NON_CACHEABLE_MEMORY:
226 acpi_os_printf("Noncacheable memory\n");
227 break;
228
229 case ACPI_CACHABLE_MEMORY:
230 acpi_os_printf("Cacheable memory\n");
231 break;
232
233 case ACPI_WRITE_COMBINING_MEMORY:
234 acpi_os_printf("Write-combining memory\n");
235 break;
236
237 case ACPI_PREFETCHABLE_MEMORY:
238 acpi_os_printf("Prefetchable memory\n");
239 break;
240
241 default:
242 acpi_os_printf("Invalid cache attribute\n");
243 break;
244 }
245
246 acpi_rs_dump_memory_attribute(resource->address.attribute.
247 memory.read_write_attribute);
248 break; 561 break;
249 562
250 case ACPI_IO_RANGE: 563 case ACPI_IO_RANGE:
251 564
252 acpi_rs_out_string("Resource Type", "I/O Range"); 565 acpi_rs_dump_descriptor(resource, acpi_rs_dump_io_flags);
253
254 acpi_rs_out_title("Type-Specific Flags");
255
256 switch (resource->address.attribute.io.range_attribute) {
257 case ACPI_NON_ISA_ONLY_RANGES:
258 acpi_os_printf("Non-ISA I/O Addresses\n");
259 break;
260
261 case ACPI_ISA_ONLY_RANGES:
262 acpi_os_printf("ISA I/O Addresses\n");
263 break;
264
265 case ACPI_ENTIRE_RANGE:
266 acpi_os_printf("ISA and non-ISA I/O Addresses\n");
267 break;
268
269 default:
270 acpi_os_printf("Invalid range attribute\n");
271 break;
272 }
273
274 acpi_rs_out_string("Translation Attribute",
275 ACPI_SPARSE_TRANSLATION ==
276 resource->address.attribute.io.
277 translation_attribute ? "Sparse Translation"
278 : "Dense Translation");
279 break; 566 break;
280 567
281 case ACPI_BUS_NUMBER_RANGE: 568 case ACPI_BUS_NUMBER_RANGE:
@@ -292,24 +579,7 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
292 579
293 /* Decode the general flags */ 580 /* Decode the general flags */
294 581
295 acpi_rs_out_string("Resource", 582 acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags);
296 ACPI_CONSUMER ==
297 resource->address.
298 producer_consumer ? "Consumer" : "Producer");
299
300 acpi_rs_out_string("Decode",
301 ACPI_SUB_DECODE == resource->address.decode ?
302 "Subtractive" : "Positive");
303
304 acpi_rs_out_string("Min Address",
305 ACPI_ADDRESS_FIXED ==
306 resource->address.
307 min_address_fixed ? "Fixed" : "Not Fixed");
308
309 acpi_rs_out_string("Max Address",
310 ACPI_ADDRESS_FIXED ==
311 resource->address.
312 max_address_fixed ? "Fixed" : "Not Fixed");
313} 583}
314 584
315/******************************************************************************* 585/*******************************************************************************
@@ -327,6 +597,7 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
327void acpi_rs_dump_resource_list(struct acpi_resource *resource_list) 597void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
328{ 598{
329 u32 count = 0; 599 u32 count = 0;
600 u32 type;
330 601
331 ACPI_FUNCTION_ENTRY(); 602 ACPI_FUNCTION_ENTRY();
332 603
@@ -335,14 +606,16 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
335 return; 606 return;
336 } 607 }
337 608
338 /* Dump all resource descriptors in the list */ 609 /* Walk list and dump all resource descriptors (END_TAG terminates) */
339 610
340 while (resource_list) { 611 do {
341 acpi_os_printf("\n[%02X] ", count); 612 acpi_os_printf("\n[%02X] ", count);
613 count++;
342 614
343 /* Validate Type before dispatch */ 615 /* Validate Type before dispatch */
344 616
345 if (resource_list->type > ACPI_RESOURCE_TYPE_MAX) { 617 type = resource_list->type;
618 if (type > ACPI_RESOURCE_TYPE_MAX) {
346 acpi_os_printf 619 acpi_os_printf
347 ("Invalid descriptor type (%X) in resource list\n", 620 ("Invalid descriptor type (%X) in resource list\n",
348 resource_list->type); 621 resource_list->type);
@@ -351,665 +624,141 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
351 624
352 /* Dump the resource descriptor */ 625 /* Dump the resource descriptor */
353 626
354 acpi_gbl_dump_resource_dispatch[resource_list-> 627 acpi_rs_dump_descriptor(&resource_list->data,
355 type] (&resource_list->data); 628 acpi_gbl_dump_resource_dispatch[type]);
356
357 /* Exit on end tag */
358
359 if (resource_list->type == ACPI_RESOURCE_TYPE_END_TAG) {
360 return;
361 }
362 629
363 /* Get the next resource structure */ 630 /* Point to the next resource structure */
364 631
365 resource_list = 632 resource_list =
366 ACPI_PTR_ADD(struct acpi_resource, resource_list, 633 ACPI_PTR_ADD(struct acpi_resource, resource_list,
367 resource_list->length); 634 resource_list->length);
368 count++;
369 }
370}
371 635
372/******************************************************************************* 636 /* Exit when END_TAG descriptor is reached */
373 *
374 * FUNCTION: acpi_rs_dump_irq
375 *
376 * PARAMETERS: Resource - Pointer to an internal resource descriptor
377 *
378 * RETURN: None
379 *
380 * DESCRIPTION: Dump the field names and values of the resource descriptor
381 *
382 ******************************************************************************/
383 637
384void acpi_rs_dump_irq(union acpi_resource_data *resource) 638 } while (type != ACPI_RESOURCE_TYPE_END_TAG);
385{
386 ACPI_FUNCTION_ENTRY();
387
388 acpi_os_printf("IRQ Resource\n");
389
390 acpi_rs_out_string("Triggering",
391 ACPI_LEVEL_SENSITIVE ==
392 resource->irq.triggering ? "Level" : "Edge");
393
394 acpi_rs_out_string("Active",
395 ACPI_ACTIVE_LOW ==
396 resource->irq.polarity ? "Low" : "High");
397
398 acpi_rs_out_string("Sharing",
399 ACPI_SHARED ==
400 resource->irq.sharable ? "Shared" : "Exclusive");
401
402 acpi_rs_out_integer8("Interrupt Count",
403 (u8) resource->irq.interrupt_count);
404
405 acpi_rs_out_title("Interrupt List");
406 acpi_rs_dump_short_byte_list(resource->irq.interrupt_count,
407 resource->irq.interrupts);
408} 639}
409 640
410/******************************************************************************* 641/*******************************************************************************
411 * 642 *
412 * FUNCTION: acpi_rs_dump_dma 643 * FUNCTION: acpi_rs_dump_irq_list
413 * 644 *
414 * PARAMETERS: Resource - Pointer to an internal resource descriptor 645 * PARAMETERS: route_table - Pointer to the routing table to dump.
415 * 646 *
416 * RETURN: None 647 * RETURN: None
417 * 648 *
418 * DESCRIPTION: Dump the field names and values of the resource descriptor 649 * DESCRIPTION: Print IRQ routing table
419 * 650 *
420 ******************************************************************************/ 651 ******************************************************************************/
421 652
422void acpi_rs_dump_dma(union acpi_resource_data *resource) 653void acpi_rs_dump_irq_list(u8 * route_table)
423{ 654{
424 ACPI_FUNCTION_ENTRY(); 655 struct acpi_pci_routing_table *prt_element;
425 656 u8 count;
426 acpi_os_printf("DMA Resource\n");
427
428 acpi_rs_out_title("DMA Type");
429 switch (resource->dma.type) {
430 case ACPI_COMPATIBILITY:
431 acpi_os_printf("Compatibility mode\n");
432 break;
433
434 case ACPI_TYPE_A:
435 acpi_os_printf("Type A\n");
436 break;
437
438 case ACPI_TYPE_B:
439 acpi_os_printf("Type B\n");
440 break;
441
442 case ACPI_TYPE_F:
443 acpi_os_printf("Type F\n");
444 break;
445
446 default:
447 acpi_os_printf("**** Invalid DMA type\n");
448 break;
449 }
450
451 acpi_rs_out_string("Bus Master",
452 ACPI_BUS_MASTER ==
453 resource->dma.bus_master ? "Yes" : "No");
454
455 acpi_rs_out_title("Transfer Type");
456 switch (resource->dma.transfer) {
457 case ACPI_TRANSFER_8:
458 acpi_os_printf("8-bit transfers only\n");
459 break;
460
461 case ACPI_TRANSFER_8_16:
462 acpi_os_printf("8-bit and 16-bit transfers\n");
463 break;
464
465 case ACPI_TRANSFER_16:
466 acpi_os_printf("16-bit transfers only\n");
467 break;
468
469 default:
470 acpi_os_printf("**** Invalid transfer preference\n");
471 break;
472 }
473
474 acpi_rs_out_integer8("DMA Channel Count",
475 (u8) resource->dma.channel_count);
476
477 acpi_rs_out_title("Channel List");
478 acpi_rs_dump_short_byte_list(resource->dma.channel_count,
479 resource->dma.channels);
480}
481
482/*******************************************************************************
483 *
484 * FUNCTION: acpi_rs_dump_start_dpf
485 *
486 * PARAMETERS: Resource - Pointer to an internal resource descriptor
487 *
488 * RETURN: None
489 *
490 * DESCRIPTION: Dump the field names and values of the resource descriptor
491 *
492 ******************************************************************************/
493 657
494void acpi_rs_dump_start_dpf(union acpi_resource_data *resource)
495{
496 ACPI_FUNCTION_ENTRY(); 658 ACPI_FUNCTION_ENTRY();
497 659
498 acpi_os_printf("Start Dependent Functions Resource\n"); 660 if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
499 661 || !(_COMPONENT & acpi_dbg_layer)) {
500 acpi_rs_out_title("Compatibility Priority"); 662 return;
501 switch (resource->start_dpf.compatibility_priority) {
502 case ACPI_GOOD_CONFIGURATION:
503 acpi_os_printf("Good configuration\n");
504 break;
505
506 case ACPI_ACCEPTABLE_CONFIGURATION:
507 acpi_os_printf("Acceptable configuration\n");
508 break;
509
510 case ACPI_SUB_OPTIMAL_CONFIGURATION:
511 acpi_os_printf("Sub-optimal configuration\n");
512 break;
513
514 default:
515 acpi_os_printf("**** Invalid compatibility priority\n");
516 break;
517 } 663 }
518 664
519 acpi_rs_out_title("Performance/Robustness"); 665 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table);
520 switch (resource->start_dpf.performance_robustness) {
521 case ACPI_GOOD_CONFIGURATION:
522 acpi_os_printf("Good configuration\n");
523 break;
524 666
525 case ACPI_ACCEPTABLE_CONFIGURATION: 667 /* Dump all table elements, Exit on zero length element */
526 acpi_os_printf("Acceptable configuration\n");
527 break;
528 668
529 case ACPI_SUB_OPTIMAL_CONFIGURATION: 669 for (count = 0; prt_element->length; count++) {
530 acpi_os_printf("Sub-optimal configuration\n"); 670 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
531 break; 671 count);
672 acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
532 673
533 default: 674 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table,
534 acpi_os_printf 675 ((u8 *) prt_element) +
535 ("**** Invalid performance robustness preference\n"); 676 prt_element->length);
536 break;
537 } 677 }
538} 678}
539 679
540/******************************************************************************* 680/*******************************************************************************
541 * 681 *
542 * FUNCTION: acpi_rs_dump_io 682 * FUNCTION: acpi_rs_out*
543 *
544 * PARAMETERS: Resource - Pointer to an internal resource descriptor
545 *
546 * RETURN: None
547 *
548 * DESCRIPTION: Dump the field names and values of the resource descriptor
549 *
550 ******************************************************************************/
551
552void acpi_rs_dump_io(union acpi_resource_data *resource)
553{
554 ACPI_FUNCTION_ENTRY();
555
556 acpi_os_printf("I/O Resource\n");
557
558 acpi_rs_out_string("Decode",
559 ACPI_DECODE_16 ==
560 resource->io.io_decode ? "16-bit" : "10-bit");
561
562 acpi_rs_out_integer32("Address Minimum", resource->io.minimum);
563
564 acpi_rs_out_integer32("Address Maximum", resource->io.maximum);
565
566 acpi_rs_out_integer32("Alignment", resource->io.alignment);
567
568 acpi_rs_out_integer32("Address Length", resource->io.address_length);
569}
570
571/*******************************************************************************
572 *
573 * FUNCTION: acpi_rs_dump_fixed_io
574 *
575 * PARAMETERS: Resource - Pointer to an internal resource descriptor
576 *
577 * RETURN: None
578 *
579 * DESCRIPTION: Dump the field names and values of the resource descriptor
580 *
581 ******************************************************************************/
582
583void acpi_rs_dump_fixed_io(union acpi_resource_data *resource)
584{
585 ACPI_FUNCTION_ENTRY();
586
587 acpi_os_printf("Fixed I/O Resource\n");
588
589 acpi_rs_out_integer32("Address", resource->fixed_io.address);
590
591 acpi_rs_out_integer32("Address Length",
592 resource->fixed_io.address_length);
593}
594
595/*******************************************************************************
596 *
597 * FUNCTION: acpi_rs_dump_vendor
598 *
599 * PARAMETERS: Resource - Pointer to an internal resource descriptor
600 *
601 * RETURN: None
602 *
603 * DESCRIPTION: Dump the field names and values of the resource descriptor
604 *
605 ******************************************************************************/
606
607void acpi_rs_dump_vendor(union acpi_resource_data *resource)
608{
609 ACPI_FUNCTION_ENTRY();
610
611 acpi_os_printf("Vendor Specific Resource\n");
612
613 acpi_rs_out_integer16("Length", (u16) resource->vendor.byte_length);
614
615 acpi_rs_dump_byte_list(resource->vendor.byte_length,
616 resource->vendor.byte_data);
617}
618
619/*******************************************************************************
620 *
621 * FUNCTION: acpi_rs_dump_memory24
622 *
623 * PARAMETERS: Resource - Pointer to an internal resource descriptor
624 *
625 * RETURN: None
626 *
627 * DESCRIPTION: Dump the field names and values of the resource descriptor
628 *
629 ******************************************************************************/
630
631void acpi_rs_dump_memory24(union acpi_resource_data *resource)
632{
633 ACPI_FUNCTION_ENTRY();
634
635 acpi_os_printf("24-Bit Memory Range Resource\n");
636
637 acpi_rs_dump_memory_attribute(resource->memory24.read_write_attribute);
638
639 acpi_rs_out_integer16("Address Minimum",
640 (u16) resource->memory24.minimum);
641
642 acpi_rs_out_integer16("Address Maximum",
643 (u16) resource->memory24.maximum);
644
645 acpi_rs_out_integer16("Alignment", (u16) resource->memory24.alignment);
646
647 acpi_rs_out_integer16("Address Length",
648 (u16) resource->memory24.address_length);
649}
650
651/*******************************************************************************
652 *
653 * FUNCTION: acpi_rs_dump_memory32
654 *
655 * PARAMETERS: Resource - Pointer to an internal resource descriptor
656 *
657 * RETURN: None
658 *
659 * DESCRIPTION: Dump the field names and values of the resource descriptor
660 *
661 ******************************************************************************/
662
663void acpi_rs_dump_memory32(union acpi_resource_data *resource)
664{
665 ACPI_FUNCTION_ENTRY();
666
667 acpi_os_printf("32-Bit Memory Range Resource\n");
668
669 acpi_rs_dump_memory_attribute(resource->memory32.read_write_attribute);
670
671 acpi_rs_out_integer32("Address Minimum", resource->memory32.minimum);
672
673 acpi_rs_out_integer32("Address Maximum", resource->memory32.maximum);
674
675 acpi_rs_out_integer32("Alignment", resource->memory32.alignment);
676
677 acpi_rs_out_integer32("Address Length",
678 resource->memory32.address_length);
679}
680
681/*******************************************************************************
682 *
683 * FUNCTION: acpi_rs_dump_fixed_memory32
684 *
685 * PARAMETERS: Resource - Pointer to an internal resource descriptor
686 *
687 * RETURN:
688 *
689 * DESCRIPTION: Dump the field names and values of the resource descriptor
690 *
691 ******************************************************************************/
692
693void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource)
694{
695 ACPI_FUNCTION_ENTRY();
696
697 acpi_os_printf("32-Bit Fixed Location Memory Range Resource\n");
698
699 acpi_rs_dump_memory_attribute(resource->fixed_memory32.
700 read_write_attribute);
701
702 acpi_rs_out_integer32("Address", resource->fixed_memory32.address);
703
704 acpi_rs_out_integer32("Address Length",
705 resource->fixed_memory32.address_length);
706}
707
708/*******************************************************************************
709 *
710 * FUNCTION: acpi_rs_dump_address16
711 * 683 *
712 * PARAMETERS: Resource - Pointer to an internal resource descriptor 684 * PARAMETERS: Title - Name of the resource field
685 * Value - Value of the resource field
713 * 686 *
714 * RETURN: None 687 * RETURN: None
715 * 688 *
716 * DESCRIPTION: Dump the field names and values of the resource descriptor 689 * DESCRIPTION: Miscellaneous helper functions to consistently format the
690 * output of the resource dump routines
717 * 691 *
718 ******************************************************************************/ 692 ******************************************************************************/
719 693
720void acpi_rs_dump_address16(union acpi_resource_data *resource) 694static void acpi_rs_out_string(char *title, char *value)
721{ 695{
722 ACPI_FUNCTION_ENTRY(); 696 acpi_os_printf("%27s : %s\n", title, value);
723
724 acpi_os_printf("16-Bit WORD Address Space Resource\n");
725
726 acpi_rs_dump_address_common(resource);
727
728 acpi_rs_out_integer16("Granularity",
729 (u16) resource->address16.granularity);
730
731 acpi_rs_out_integer16("Address Minimum",
732 (u16) resource->address16.minimum);
733
734 acpi_rs_out_integer16("Address Maximum",
735 (u16) resource->address16.maximum);
736
737 acpi_rs_out_integer16("Translation Offset",
738 (u16) resource->address16.translation_offset);
739
740 acpi_rs_out_integer16("Address Length",
741 (u16) resource->address16.address_length);
742
743 acpi_rs_dump_resource_source(&resource->address16.resource_source);
744} 697}
745 698
746/******************************************************************************* 699static void acpi_rs_out_integer8(char *title, u8 value)
747 *
748 * FUNCTION: acpi_rs_dump_address32
749 *
750 * PARAMETERS: Resource - Pointer to an internal resource descriptor
751 *
752 * RETURN: None
753 *
754 * DESCRIPTION: Dump the field names and values of the resource descriptor
755 *
756 ******************************************************************************/
757
758void acpi_rs_dump_address32(union acpi_resource_data *resource)
759{ 700{
760 ACPI_FUNCTION_ENTRY(); 701 acpi_os_printf("%27s : %2.2X\n", title, value);
761
762 acpi_os_printf("32-Bit DWORD Address Space Resource\n");
763
764 acpi_rs_dump_address_common(resource);
765
766 acpi_rs_out_integer32("Granularity", resource->address32.granularity);
767
768 acpi_rs_out_integer32("Address Minimum", resource->address32.minimum);
769
770 acpi_rs_out_integer32("Address Maximum", resource->address32.maximum);
771
772 acpi_rs_out_integer32("Translation Offset",
773 resource->address32.translation_offset);
774
775 acpi_rs_out_integer32("Address Length",
776 resource->address32.address_length);
777
778 acpi_rs_dump_resource_source(&resource->address32.resource_source);
779} 702}
780 703
781/******************************************************************************* 704static void acpi_rs_out_integer16(char *title, u16 value)
782 *
783 * FUNCTION: acpi_rs_dump_address64
784 *
785 * PARAMETERS: Resource - Pointer to an internal resource descriptor
786 *
787 * RETURN: None
788 *
789 * DESCRIPTION: Dump the field names and values of the resource descriptor
790 *
791 ******************************************************************************/
792
793void acpi_rs_dump_address64(union acpi_resource_data *resource)
794{ 705{
795 ACPI_FUNCTION_ENTRY(); 706 acpi_os_printf("%27s : %4.4X\n", title, value);
796
797 acpi_os_printf("64-Bit QWORD Address Space Resource\n");
798
799 acpi_rs_dump_address_common(resource);
800
801 acpi_rs_out_integer64("Granularity", resource->address64.granularity);
802
803 acpi_rs_out_integer64("Address Minimum", resource->address64.minimum);
804
805 acpi_rs_out_integer64("Address Maximum", resource->address64.maximum);
806
807 acpi_rs_out_integer64("Translation Offset",
808 resource->address64.translation_offset);
809
810 acpi_rs_out_integer64("Address Length",
811 resource->address64.address_length);
812
813 acpi_rs_dump_resource_source(&resource->address64.resource_source);
814} 707}
815 708
816/******************************************************************************* 709static void acpi_rs_out_integer32(char *title, u32 value)
817 *
818 * FUNCTION: acpi_rs_dump_ext_address64
819 *
820 * PARAMETERS: Resource - Pointer to an internal resource descriptor
821 *
822 * RETURN: None
823 *
824 * DESCRIPTION: Dump the field names and values of the resource descriptor
825 *
826 ******************************************************************************/
827
828void acpi_rs_dump_ext_address64(union acpi_resource_data *resource)
829{ 710{
830 ACPI_FUNCTION_ENTRY(); 711 acpi_os_printf("%27s : %8.8X\n", title, value);
831
832 acpi_os_printf("64-Bit Extended Address Space Resource\n");
833
834 acpi_rs_dump_address_common(resource);
835
836 acpi_rs_out_integer64("Granularity",
837 resource->ext_address64.granularity);
838
839 acpi_rs_out_integer64("Address Minimum",
840 resource->ext_address64.minimum);
841
842 acpi_rs_out_integer64("Address Maximum",
843 resource->ext_address64.maximum);
844
845 acpi_rs_out_integer64("Translation Offset",
846 resource->ext_address64.translation_offset);
847
848 acpi_rs_out_integer64("Address Length",
849 resource->ext_address64.address_length);
850
851 acpi_rs_out_integer64("Type-Specific Attribute",
852 resource->ext_address64.type_specific_attributes);
853} 712}
854 713
855/******************************************************************************* 714static void acpi_rs_out_integer64(char *title, u64 value)
856 *
857 * FUNCTION: acpi_rs_dump_ext_irq
858 *
859 * PARAMETERS: Resource - Pointer to an internal resource descriptor
860 *
861 * RETURN: None
862 *
863 * DESCRIPTION: Dump the field names and values of the resource descriptor
864 *
865 ******************************************************************************/
866
867void acpi_rs_dump_ext_irq(union acpi_resource_data *resource)
868{ 715{
869 ACPI_FUNCTION_ENTRY(); 716 acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
870
871 acpi_os_printf("Extended IRQ Resource\n");
872
873 acpi_rs_out_string("Resource",
874 ACPI_CONSUMER ==
875 resource->extended_irq.
876 producer_consumer ? "Consumer" : "Producer");
877
878 acpi_rs_out_string("Triggering",
879 ACPI_LEVEL_SENSITIVE ==
880 resource->extended_irq.
881 triggering ? "Level" : "Edge");
882
883 acpi_rs_out_string("Active",
884 ACPI_ACTIVE_LOW == resource->extended_irq.polarity ?
885 "Low" : "High");
886
887 acpi_rs_out_string("Sharing",
888 ACPI_SHARED == resource->extended_irq.sharable ?
889 "Shared" : "Exclusive");
890
891 acpi_rs_dump_resource_source(&resource->extended_irq.resource_source);
892
893 acpi_rs_out_integer8("Interrupts",
894 (u8) resource->extended_irq.interrupt_count);
895
896 acpi_rs_dump_dword_list(resource->extended_irq.interrupt_count,
897 resource->extended_irq.interrupts);
898} 717}
899 718
900/******************************************************************************* 719static void acpi_rs_out_title(char *title)
901 *
902 * FUNCTION: acpi_rs_dump_generic_reg
903 *
904 * PARAMETERS: Resource - Pointer to an internal resource descriptor
905 *
906 * RETURN: None
907 *
908 * DESCRIPTION: Dump the field names and values of the resource descriptor
909 *
910 ******************************************************************************/
911
912void acpi_rs_dump_generic_reg(union acpi_resource_data *resource)
913{ 720{
914 ACPI_FUNCTION_ENTRY(); 721 acpi_os_printf("%27s : ", title);
915
916 acpi_os_printf("Generic Register Resource\n");
917
918 acpi_rs_out_integer8("Space ID", (u8) resource->generic_reg.space_id);
919
920 acpi_rs_out_integer8("Bit Width", (u8) resource->generic_reg.bit_width);
921
922 acpi_rs_out_integer8("Bit Offset",
923 (u8) resource->generic_reg.bit_offset);
924
925 acpi_rs_out_integer8("Access Size",
926 (u8) resource->generic_reg.access_size);
927
928 acpi_rs_out_integer64("Address", resource->generic_reg.address);
929} 722}
930 723
931/******************************************************************************* 724/*******************************************************************************
932 * 725 *
933 * FUNCTION: acpi_rs_dump_end_dpf 726 * FUNCTION: acpi_rs_dump*List
934 * 727 *
935 * PARAMETERS: Resource - Pointer to an internal resource descriptor 728 * PARAMETERS: Length - Number of elements in the list
729 * Data - Start of the list
936 * 730 *
937 * RETURN: None 731 * RETURN: None
938 * 732 *
939 * DESCRIPTION: Print type, no data. 733 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
940 * 734 *
941 ******************************************************************************/ 735 ******************************************************************************/
942 736
943void acpi_rs_dump_end_dpf(union acpi_resource_data *resource) 737static void acpi_rs_dump_byte_list(u16 length, u8 * data)
944{ 738{
945 ACPI_FUNCTION_ENTRY(); 739 u8 i;
946 740
947 acpi_os_printf("end_dependent_functions Resource\n"); 741 for (i = 0; i < length; i++) {
742 acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]);
743 }
948} 744}
949 745
950/******************************************************************************* 746static void acpi_rs_dump_short_byte_list(u8 length, u8 * data)
951 *
952 * FUNCTION: acpi_rs_dump_end_tag
953 *
954 * PARAMETERS: Resource - Pointer to an internal resource descriptor
955 *
956 * RETURN: None
957 *
958 * DESCRIPTION: Print type, no data.
959 *
960 ******************************************************************************/
961
962void acpi_rs_dump_end_tag(union acpi_resource_data *resource)
963{ 747{
964 ACPI_FUNCTION_ENTRY(); 748 u8 i;
965 749
966 acpi_os_printf("end_tag Resource\n"); 750 for (i = 0; i < length; i++) {
751 acpi_os_printf("%X ", data[i]);
752 }
753 acpi_os_printf("\n");
967} 754}
968 755
969/******************************************************************************* 756static void acpi_rs_dump_dword_list(u8 length, u32 * data)
970 *
971 * FUNCTION: acpi_rs_dump_irq_list
972 *
973 * PARAMETERS: route_table - Pointer to the routing table to dump.
974 *
975 * RETURN: None
976 *
977 * DESCRIPTION: Print IRQ routing table
978 *
979 ******************************************************************************/
980
981void acpi_rs_dump_irq_list(u8 * route_table)
982{ 757{
983 u8 *buffer = route_table; 758 u8 i;
984 u8 count = 0;
985 struct acpi_pci_routing_table *prt_element;
986
987 ACPI_FUNCTION_ENTRY();
988 759
989 if (!(acpi_dbg_level & ACPI_LV_RESOURCES) 760 for (i = 0; i < length; i++) {
990 || !(_COMPONENT & acpi_dbg_layer)) { 761 acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i, data[i]);
991 return;
992 }
993
994 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
995
996 /* Dump all table elements, Exit on null length element */
997
998 while (prt_element->length) {
999 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
1000 count);
1001
1002 acpi_rs_out_integer64("Address", prt_element->address);
1003
1004 acpi_rs_out_integer32("Pin", prt_element->pin);
1005 acpi_rs_out_string("Source", prt_element->source);
1006 acpi_rs_out_integer32("Source Index",
1007 prt_element->source_index);
1008
1009 buffer += prt_element->length;
1010 prt_element =
1011 ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
1012 count++;
1013 } 762 }
1014} 763}
1015 764