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