[ACPI] ACPICA 20050916
[deliverable/linux.git] / drivers / acpi / resources / rsdump.c
CommitLineData
1da177e4
LT
1/*******************************************************************************
2 *
3 * Module Name: rsdump - Functions to display the resource structures.
4 *
5 ******************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
1da177e4
LT
44#include <acpi/acpi.h>
45#include <acpi/acresrc.h>
46
47#define _COMPONENT ACPI_RESOURCES
4be44fcd 48ACPI_MODULE_NAME("rsdump")
6f42ccf2
RM
49
50#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
44f6c012 51/* Local prototypes */
bda663d3 52static void acpi_rs_dump_irq(union acpi_resource_data *resource);
1da177e4 53
bda663d3 54static void acpi_rs_dump_address16(union acpi_resource_data *resource);
44f6c012 55
bda663d3 56static void acpi_rs_dump_address32(union acpi_resource_data *resource);
44f6c012 57
bda663d3 58static void acpi_rs_dump_address64(union acpi_resource_data *resource);
44f6c012 59
bda663d3 60static void acpi_rs_dump_dma(union acpi_resource_data *resource);
44f6c012 61
bda663d3 62static void acpi_rs_dump_io(union acpi_resource_data *resource);
44f6c012 63
bda663d3 64static void acpi_rs_dump_extended_irq(union acpi_resource_data *resource);
1da177e4 65
bda663d3 66static void acpi_rs_dump_fixed_io(union acpi_resource_data *resource);
44f6c012 67
bda663d3 68static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource);
44f6c012 69
bda663d3 70static void acpi_rs_dump_memory24(union acpi_resource_data *resource);
44f6c012 71
bda663d3 72static void acpi_rs_dump_memory32(union acpi_resource_data *resource);
44f6c012 73
bda663d3 74static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *resource);
44f6c012 75
bda663d3
RM
76static void acpi_rs_dump_vendor_specific(union acpi_resource_data *resource);
77
78static void acpi_rs_dump_generic_reg(union acpi_resource_data *resource);
79
80static void acpi_rs_dump_end_depend_fns(union acpi_resource_data *resource);
81
82static void acpi_rs_dump_end_tag(union acpi_resource_data *resource);
83
84static void acpi_rs_out_string(char *title, char *value);
85
86static void acpi_rs_out_integer8(char *title, u8 value);
87
88static void acpi_rs_out_integer16(char *title, u16 value);
89
90static void acpi_rs_out_integer32(char *title, u32 value);
91
92static void acpi_rs_out_integer64(char *title, u64 value);
93
94static void acpi_rs_out_title(char *title);
95
96static void acpi_rs_dump_byte_list(u32 length, u8 * data);
97
98static void acpi_rs_dump_dword_list(u32 length, u32 * data);
99
100static void acpi_rs_dump_short_byte_list(u32 length, u32 * data);
101
102static void
103acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
104
105static void acpi_rs_dump_address_common(union acpi_resource_data *resource);
106
107/* Dispatch table for resource dump functions */
108
109typedef
110void (*ACPI_DUMP_RESOURCE) (union acpi_resource_data * data);
111
112static ACPI_DUMP_RESOURCE acpi_gbl_dump_resource_dispatch[] = {
113 acpi_rs_dump_irq, /* ACPI_RSTYPE_IRQ */
114 acpi_rs_dump_dma, /* ACPI_RSTYPE_DMA */
115 acpi_rs_dump_start_depend_fns, /* ACPI_RSTYPE_START_DPF */
116 acpi_rs_dump_end_depend_fns, /* ACPI_RSTYPE_END_DPF */
117 acpi_rs_dump_io, /* ACPI_RSTYPE_IO */
118 acpi_rs_dump_fixed_io, /* ACPI_RSTYPE_FIXED_IO */
119 acpi_rs_dump_vendor_specific, /* ACPI_RSTYPE_VENDOR */
120 acpi_rs_dump_end_tag, /* ACPI_RSTYPE_END_TAG */
121 acpi_rs_dump_memory24, /* ACPI_RSTYPE_MEM24 */
122 acpi_rs_dump_memory32, /* ACPI_RSTYPE_MEM32 */
123 acpi_rs_dump_fixed_memory32, /* ACPI_RSTYPE_FIXED_MEM32 */
124 acpi_rs_dump_address16, /* ACPI_RSTYPE_ADDRESS16 */
125 acpi_rs_dump_address32, /* ACPI_RSTYPE_ADDRESS32 */
126 acpi_rs_dump_address64, /* ACPI_RSTYPE_ADDRESS64 */
127 acpi_rs_dump_extended_irq, /* ACPI_RSTYPE_EXT_IRQ */
128 acpi_rs_dump_generic_reg /* ACPI_RSTYPE_GENERIC_REG */
129};
44f6c012 130
1da177e4
LT
131/*******************************************************************************
132 *
bda663d3
RM
133 * FUNCTION: acpi_rs_out*
134 *
135 * PARAMETERS: Title - Name of the resource field
136 * Value - Value of the resource field
137 *
138 * RETURN: None
139 *
140 * DESCRIPTION: Miscellaneous helper functions to consistently format the
141 * output of the resource dump routines
142 *
143 ******************************************************************************/
144
145static void acpi_rs_out_string(char *title, char *value)
146{
147 acpi_os_printf("%30s : %s\n", title, value);
148}
149
150static void acpi_rs_out_integer8(char *title, u8 value)
151{
152 acpi_os_printf("%30s : %2.2X\n", title, value);
153}
154
155static void acpi_rs_out_integer16(char *title, u16 value)
156{
157 acpi_os_printf("%30s : %4.4X\n", title, value);
158}
159
160static void acpi_rs_out_integer32(char *title, u32 value)
161{
162 acpi_os_printf("%30s : %8.8X\n", title, value);
163}
164
165static void acpi_rs_out_integer64(char *title, u64 value)
166{
167 acpi_os_printf("%30s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
168}
169
170static void acpi_rs_out_title(char *title)
171{
172 acpi_os_printf("%30s : ", title);
173}
174
175/*******************************************************************************
176 *
177 * FUNCTION: acpi_rs_dump*List
178 *
179 * PARAMETERS: Length - Number of elements in the list
180 * Data - Start of the list
181 *
182 * RETURN: None
183 *
184 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
185 *
186 ******************************************************************************/
187
188static void acpi_rs_dump_byte_list(u32 length, u8 * data)
189{
190 u32 i;
191
192 for (i = 0; i < length; i++) {
193 acpi_os_printf("%28s%2.2X : %2.2X\n", "Byte", i, data[i]);
194 }
195}
196
197static void acpi_rs_dump_dword_list(u32 length, u32 * data)
198{
199 u32 i;
200
201 for (i = 0; i < length; i++) {
202 acpi_os_printf("%28s%2.2X : %8.8X\n", "Dword", i, data[i]);
203 }
204}
205
206static void acpi_rs_dump_short_byte_list(u32 length, u32 * data)
207{
208 u32 i;
209
210 for (i = 0; i < length; i++) {
211 acpi_os_printf("%X ", data[i]);
212 }
213 acpi_os_printf("\n");
214}
215
216/*******************************************************************************
217 *
218 * FUNCTION: acpi_rs_dump_resource_source
1da177e4 219 *
bda663d3 220 * PARAMETERS: resource_source - Pointer to a Resource Source struct
1da177e4
LT
221 *
222 * RETURN: None
223 *
bda663d3
RM
224 * DESCRIPTION: Common routine for dumping the optional resource_source and the
225 * corresponding resource_source_index.
1da177e4
LT
226 *
227 ******************************************************************************/
228
bda663d3
RM
229static void
230acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source)
1da177e4 231{
1da177e4 232
bda663d3
RM
233 if (resource_source->index == 0xFF) {
234 return;
235 }
236
237 acpi_rs_out_integer8("Resource Source Index",
238 (u8) resource_source->index);
239
240 acpi_rs_out_string("Resource Source",
241 resource_source->string_ptr ?
242 resource_source->string_ptr : "[Not Specified]");
243}
244
245/*******************************************************************************
246 *
247 * FUNCTION: acpi_rs_dump_address_common
248 *
249 * PARAMETERS: Resource - Pointer to an internal resource descriptor
250 *
251 * RETURN: None
252 *
253 * DESCRIPTION: Dump the fields that are common to all Address resource
254 * descriptors
255 *
256 ******************************************************************************/
257
258static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
259{
4be44fcd 260 ACPI_FUNCTION_ENTRY();
1da177e4 261
bda663d3
RM
262 /* Decode the type-specific flags */
263
264 switch (resource->address.resource_type) {
265 case ACPI_MEMORY_RANGE:
1da177e4 266
bda663d3
RM
267 acpi_rs_out_string("Resource Type", "Memory Range");
268
269 acpi_rs_out_title("Type-Specific Flags");
270
271 switch (resource->address.attribute.memory.cache_attribute) {
272 case ACPI_NON_CACHEABLE_MEMORY:
273 acpi_os_printf("Noncacheable memory\n");
274 break;
1da177e4 275
bda663d3
RM
276 case ACPI_CACHABLE_MEMORY:
277 acpi_os_printf("Cacheable memory\n");
278 break;
1da177e4 279
bda663d3
RM
280 case ACPI_WRITE_COMBINING_MEMORY:
281 acpi_os_printf("Write-combining memory\n");
282 break;
1da177e4 283
bda663d3
RM
284 case ACPI_PREFETCHABLE_MEMORY:
285 acpi_os_printf("Prefetchable memory\n");
286 break;
287
288 default:
289 acpi_os_printf("Invalid cache attribute\n");
290 break;
291 }
292
293 acpi_rs_out_string("Read/Write Attribute",
294 ACPI_READ_WRITE_MEMORY ==
295 resource->address.attribute.memory.
296 read_write_attribute ? "Read/Write" :
297 "Read Only");
298 break;
299
300 case ACPI_IO_RANGE:
301
302 acpi_rs_out_string("Resource Type", "I/O Range");
303
304 acpi_rs_out_title("Type-Specific Flags");
305
306 switch (resource->address.attribute.io.range_attribute) {
307 case ACPI_NON_ISA_ONLY_RANGES:
308 acpi_os_printf("Non-ISA I/O Addresses\n");
309 break;
1da177e4 310
bda663d3
RM
311 case ACPI_ISA_ONLY_RANGES:
312 acpi_os_printf("ISA I/O Addresses\n");
313 break;
314
315 case ACPI_ENTIRE_RANGE:
316 acpi_os_printf("ISA and non-ISA I/O Addresses\n");
317 break;
318
319 default:
320 acpi_os_printf("Invalid range attribute\n");
321 break;
322 }
323
324 acpi_rs_out_string("Translation Attribute",
325 ACPI_SPARSE_TRANSLATION ==
326 resource->address.attribute.io.
327 translation_attribute ? "Sparse Translation"
328 : "Dense Translation");
329 break;
330
331 case ACPI_BUS_NUMBER_RANGE:
332
333 acpi_rs_out_string("Resource Type", "Bus Number Range");
334 break;
335
336 default:
337
338 acpi_rs_out_integer8("Resource Type",
339 (u8) resource->address.resource_type);
340 break;
1da177e4
LT
341 }
342
bda663d3
RM
343 /* Decode the general flags */
344
345 acpi_rs_out_string("Resource",
346 ACPI_CONSUMER ==
347 resource->address.
348 producer_consumer ? "Consumer" : "Producer");
349
350 acpi_rs_out_string("Decode",
351 ACPI_SUB_DECODE == resource->address.decode ?
352 "Subtractive" : "Positive");
353
354 acpi_rs_out_string("Min Address",
355 ACPI_ADDRESS_FIXED ==
356 resource->address.
357 min_address_fixed ? "Fixed" : "Not Fixed");
358
359 acpi_rs_out_string("Max Address",
360 ACPI_ADDRESS_FIXED ==
361 resource->address.
362 max_address_fixed ? "Fixed" : "Not Fixed");
1da177e4
LT
363}
364
1da177e4
LT
365/*******************************************************************************
366 *
bda663d3 367 * FUNCTION: acpi_rs_dump_resource_list
1da177e4 368 *
bda663d3 369 * PARAMETERS: resource_list - Pointer to a resource descriptor list
1da177e4
LT
370 *
371 * RETURN: None
372 *
bda663d3 373 * DESCRIPTION: Dispatches the structure to the correct dump routine.
1da177e4
LT
374 *
375 ******************************************************************************/
376
bda663d3 377void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
1da177e4 378{
bda663d3 379 u32 count = 0;
1da177e4 380
4be44fcd 381 ACPI_FUNCTION_ENTRY();
1da177e4 382
bda663d3
RM
383 if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
384 || !(_COMPONENT & acpi_dbg_layer)) {
385 return;
386 }
387
388 /* Dump all resource descriptors in the list */
389
390 while (resource_list) {
391 acpi_os_printf("\n[%02X] ", count);
392
393 /* Validate Type before dispatch */
394
395 if (resource_list->type > ACPI_RSTYPE_MAX) {
396 acpi_os_printf
397 ("Invalid descriptor type (%X) in resource list\n",
398 resource_list->type);
399 return;
400 }
401
402 /* Dump the resource descriptor */
403
404 acpi_gbl_dump_resource_dispatch[resource_list->
405 type] (&resource_list->data);
406
407 /* Exit on end tag */
408
409 if (resource_list->type == ACPI_RSTYPE_END_TAG) {
410 return;
411 }
412
413 /* Get the next resource structure */
414
415 resource_list =
416 ACPI_PTR_ADD(struct acpi_resource, resource_list,
417 resource_list->length);
418 count++;
419 }
420}
421
422/*******************************************************************************
423 *
424 * FUNCTION: acpi_rs_dump_irq
425 *
426 * PARAMETERS: Resource - Pointer to an internal resource descriptor
427 *
428 * RETURN: None
429 *
430 * DESCRIPTION: Dump the field names and values of the resource descriptor
431 *
432 ******************************************************************************/
433
434static void acpi_rs_dump_irq(union acpi_resource_data *resource)
435{
436 ACPI_FUNCTION_ENTRY();
437
438 acpi_os_printf("IRQ Resource\n");
439
440 acpi_rs_out_string("Triggering",
441 ACPI_LEVEL_SENSITIVE ==
442 resource->irq.edge_level ? "Level" : "Edge");
443
444 acpi_rs_out_string("Active",
445 ACPI_ACTIVE_LOW ==
446 resource->irq.active_high_low ? "Low" : "High");
447
448 acpi_rs_out_string("Sharing",
449 ACPI_SHARED ==
450 resource->irq.
451 shared_exclusive ? "Shared" : "Exclusive");
452
453 acpi_rs_out_integer8("Interrupt Count",
454 (u8) resource->irq.number_of_interrupts);
455
456 acpi_rs_out_title("Interrupt List");
457 acpi_rs_dump_short_byte_list(resource->irq.number_of_interrupts,
458 resource->irq.interrupts);
459}
460
461/*******************************************************************************
462 *
463 * FUNCTION: acpi_rs_dump_dma
464 *
465 * PARAMETERS: Resource - Pointer to an internal resource descriptor
466 *
467 * RETURN: None
468 *
469 * DESCRIPTION: Dump the field names and values of the resource descriptor
470 *
471 ******************************************************************************/
472
473static void acpi_rs_dump_dma(union acpi_resource_data *resource)
474{
475 ACPI_FUNCTION_ENTRY();
476
4be44fcd 477 acpi_os_printf("DMA Resource\n");
1da177e4 478
bda663d3
RM
479 acpi_rs_out_title("DMA Type");
480 switch (resource->dma.type) {
1da177e4 481 case ACPI_COMPATIBILITY:
bda663d3 482 acpi_os_printf("Compatibility mode\n");
1da177e4
LT
483 break;
484
485 case ACPI_TYPE_A:
bda663d3 486 acpi_os_printf("Type A\n");
1da177e4
LT
487 break;
488
489 case ACPI_TYPE_B:
bda663d3 490 acpi_os_printf("Type B\n");
1da177e4
LT
491 break;
492
493 case ACPI_TYPE_F:
bda663d3 494 acpi_os_printf("Type F\n");
1da177e4
LT
495 break;
496
497 default:
bda663d3 498 acpi_os_printf("**** Invalid DMA type\n");
1da177e4
LT
499 break;
500 }
501
bda663d3
RM
502 acpi_rs_out_string("Bus Master",
503 ACPI_BUS_MASTER ==
504 resource->dma.bus_master ? "Yes" : "No");
1da177e4 505
bda663d3
RM
506 acpi_rs_out_title("Transfer Type");
507 switch (resource->dma.transfer) {
1da177e4 508 case ACPI_TRANSFER_8:
bda663d3 509 acpi_os_printf("8-bit transfers only\n");
1da177e4
LT
510 break;
511
512 case ACPI_TRANSFER_8_16:
bda663d3 513 acpi_os_printf("8-bit and 16-bit transfers\n");
1da177e4
LT
514 break;
515
516 case ACPI_TRANSFER_16:
bda663d3 517 acpi_os_printf("16-bit transfers only\n");
1da177e4
LT
518 break;
519
520 default:
bda663d3 521 acpi_os_printf("**** Invalid transfer preference\n");
1da177e4
LT
522 break;
523 }
524
bda663d3
RM
525 acpi_rs_out_integer8("DMA Channel Count",
526 (u8) resource->dma.number_of_channels);
1da177e4 527
bda663d3
RM
528 acpi_rs_out_title("Channel List");
529 acpi_rs_dump_short_byte_list(resource->dma.number_of_channels,
530 resource->dma.channels);
1da177e4
LT
531}
532
1da177e4
LT
533/*******************************************************************************
534 *
535 * FUNCTION: acpi_rs_dump_start_depend_fns
536 *
bda663d3 537 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
538 *
539 * RETURN: None
540 *
bda663d3 541 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
542 *
543 ******************************************************************************/
544
bda663d3 545static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *resource)
1da177e4 546{
4be44fcd 547 ACPI_FUNCTION_ENTRY();
1da177e4 548
4be44fcd 549 acpi_os_printf("Start Dependent Functions Resource\n");
1da177e4 550
bda663d3
RM
551 acpi_rs_out_title("Compatibility Priority");
552 switch (resource->start_dpf.compatibility_priority) {
1da177e4 553 case ACPI_GOOD_CONFIGURATION:
bda663d3 554 acpi_os_printf("Good configuration\n");
1da177e4
LT
555 break;
556
557 case ACPI_ACCEPTABLE_CONFIGURATION:
bda663d3 558 acpi_os_printf("Acceptable configuration\n");
1da177e4
LT
559 break;
560
561 case ACPI_SUB_OPTIMAL_CONFIGURATION:
bda663d3 562 acpi_os_printf("Sub-optimal configuration\n");
1da177e4
LT
563 break;
564
565 default:
bda663d3 566 acpi_os_printf("**** Invalid compatibility priority\n");
1da177e4
LT
567 break;
568 }
569
bda663d3
RM
570 acpi_rs_out_title("Performance/Robustness");
571 switch (resource->start_dpf.performance_robustness) {
1da177e4 572 case ACPI_GOOD_CONFIGURATION:
bda663d3 573 acpi_os_printf("Good configuration\n");
1da177e4
LT
574 break;
575
576 case ACPI_ACCEPTABLE_CONFIGURATION:
bda663d3 577 acpi_os_printf("Acceptable configuration\n");
1da177e4
LT
578 break;
579
580 case ACPI_SUB_OPTIMAL_CONFIGURATION:
bda663d3 581 acpi_os_printf("Sub-optimal configuration\n");
1da177e4
LT
582 break;
583
584 default:
bda663d3
RM
585 acpi_os_printf
586 ("**** Invalid performance robustness preference\n");
1da177e4
LT
587 break;
588 }
1da177e4
LT
589}
590
1da177e4
LT
591/*******************************************************************************
592 *
593 * FUNCTION: acpi_rs_dump_io
594 *
bda663d3 595 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
596 *
597 * RETURN: None
598 *
bda663d3 599 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
600 *
601 ******************************************************************************/
602
bda663d3 603static void acpi_rs_dump_io(union acpi_resource_data *resource)
1da177e4 604{
4be44fcd 605 ACPI_FUNCTION_ENTRY();
1da177e4 606
bda663d3 607 acpi_os_printf("I/O Resource\n");
1da177e4 608
bda663d3
RM
609 acpi_rs_out_string("Decode",
610 ACPI_DECODE_16 ==
611 resource->io.io_decode ? "16-bit" : "10-bit");
1da177e4 612
bda663d3
RM
613 acpi_rs_out_integer32("Range Minimum Base",
614 resource->io.min_base_address);
1da177e4 615
bda663d3
RM
616 acpi_rs_out_integer32("Range Maximum Base",
617 resource->io.max_base_address);
1da177e4 618
bda663d3 619 acpi_rs_out_integer32("Alignment", resource->io.alignment);
1da177e4 620
bda663d3 621 acpi_rs_out_integer32("Range Length", resource->io.range_length);
1da177e4
LT
622}
623
1da177e4
LT
624/*******************************************************************************
625 *
626 * FUNCTION: acpi_rs_dump_fixed_io
627 *
bda663d3 628 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
629 *
630 * RETURN: None
631 *
bda663d3 632 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
633 *
634 ******************************************************************************/
635
bda663d3 636static void acpi_rs_dump_fixed_io(union acpi_resource_data *resource)
1da177e4 637{
4be44fcd 638 ACPI_FUNCTION_ENTRY();
1da177e4 639
bda663d3 640 acpi_os_printf("Fixed I/O Resource\n");
1da177e4 641
bda663d3
RM
642 acpi_rs_out_integer32("Range Base Address",
643 resource->fixed_io.base_address);
1da177e4 644
bda663d3 645 acpi_rs_out_integer32("Range Length", resource->fixed_io.range_length);
1da177e4
LT
646}
647
1da177e4
LT
648/*******************************************************************************
649 *
650 * FUNCTION: acpi_rs_dump_vendor_specific
651 *
bda663d3 652 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
653 *
654 * RETURN: None
655 *
bda663d3 656 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
657 *
658 ******************************************************************************/
659
bda663d3 660static void acpi_rs_dump_vendor_specific(union acpi_resource_data *resource)
1da177e4 661{
4be44fcd 662 ACPI_FUNCTION_ENTRY();
1da177e4 663
4be44fcd 664 acpi_os_printf("Vendor Specific Resource\n");
1da177e4 665
bda663d3 666 acpi_rs_out_integer16("Length", (u16) resource->vendor_specific.length);
1da177e4 667
bda663d3
RM
668 acpi_rs_dump_byte_list(resource->vendor_specific.length,
669 resource->vendor_specific.reserved);
1da177e4
LT
670}
671
1da177e4
LT
672/*******************************************************************************
673 *
674 * FUNCTION: acpi_rs_dump_memory24
675 *
bda663d3 676 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
677 *
678 * RETURN: None
679 *
bda663d3 680 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
681 *
682 ******************************************************************************/
683
bda663d3 684static void acpi_rs_dump_memory24(union acpi_resource_data *resource)
1da177e4 685{
4be44fcd 686 ACPI_FUNCTION_ENTRY();
1da177e4 687
4be44fcd 688 acpi_os_printf("24-Bit Memory Range Resource\n");
1da177e4 689
bda663d3
RM
690 acpi_rs_out_string("Attribute",
691 ACPI_READ_WRITE_MEMORY ==
692 resource->memory24.read_write_attribute ?
693 "Read/Write" : "Read Only");
1da177e4 694
bda663d3
RM
695 acpi_rs_out_integer16("Range Minimum Base",
696 (u16) resource->memory24.min_base_address);
1da177e4 697
bda663d3
RM
698 acpi_rs_out_integer16("Range Maximum Base",
699 (u16) resource->memory24.max_base_address);
1da177e4 700
bda663d3 701 acpi_rs_out_integer16("Alignment", (u16) resource->memory24.alignment);
1da177e4 702
bda663d3
RM
703 acpi_rs_out_integer16("Range Length",
704 (u16) resource->memory24.range_length);
1da177e4
LT
705}
706
1da177e4
LT
707/*******************************************************************************
708 *
709 * FUNCTION: acpi_rs_dump_memory32
710 *
bda663d3 711 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
712 *
713 * RETURN: None
714 *
bda663d3 715 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
716 *
717 ******************************************************************************/
718
bda663d3 719static void acpi_rs_dump_memory32(union acpi_resource_data *resource)
1da177e4 720{
4be44fcd 721 ACPI_FUNCTION_ENTRY();
1da177e4 722
4be44fcd 723 acpi_os_printf("32-Bit Memory Range Resource\n");
1da177e4 724
bda663d3
RM
725 acpi_rs_out_string("Attribute",
726 ACPI_READ_WRITE_MEMORY ==
727 resource->memory32.read_write_attribute ?
728 "Read/Write" : "Read Only");
1da177e4 729
bda663d3
RM
730 acpi_rs_out_integer32("Range Minimum Base",
731 resource->memory32.min_base_address);
1da177e4 732
bda663d3
RM
733 acpi_rs_out_integer32("Range Maximum Base",
734 resource->memory32.max_base_address);
1da177e4 735
bda663d3 736 acpi_rs_out_integer32("Alignment", resource->memory32.alignment);
1da177e4 737
bda663d3 738 acpi_rs_out_integer32("Range Length", resource->memory32.range_length);
1da177e4
LT
739}
740
1da177e4
LT
741/*******************************************************************************
742 *
743 * FUNCTION: acpi_rs_dump_fixed_memory32
744 *
bda663d3 745 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
746 *
747 * RETURN:
748 *
bda663d3 749 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
750 *
751 ******************************************************************************/
752
bda663d3 753static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource)
1da177e4 754{
4be44fcd 755 ACPI_FUNCTION_ENTRY();
1da177e4 756
4be44fcd 757 acpi_os_printf("32-Bit Fixed Location Memory Range Resource\n");
1da177e4 758
bda663d3
RM
759 acpi_rs_out_string("Attribute",
760 ACPI_READ_WRITE_MEMORY ==
761 resource->fixed_memory32.read_write_attribute ?
762 "Read/Write" : "Read Only");
1da177e4 763
bda663d3
RM
764 acpi_rs_out_integer32("Range Base Address",
765 resource->fixed_memory32.range_base_address);
1da177e4 766
bda663d3
RM
767 acpi_rs_out_integer32("Range Length",
768 resource->fixed_memory32.range_length);
1da177e4
LT
769}
770
1da177e4
LT
771/*******************************************************************************
772 *
773 * FUNCTION: acpi_rs_dump_address16
774 *
bda663d3 775 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
776 *
777 * RETURN: None
778 *
bda663d3 779 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
780 *
781 ******************************************************************************/
782
bda663d3 783static void acpi_rs_dump_address16(union acpi_resource_data *resource)
1da177e4 784{
4be44fcd 785 ACPI_FUNCTION_ENTRY();
1da177e4 786
4be44fcd 787 acpi_os_printf("16-Bit Address Space Resource\n");
1da177e4 788
bda663d3 789 acpi_rs_dump_address_common(resource);
1da177e4 790
bda663d3
RM
791 acpi_rs_out_integer16("Granularity",
792 (u16) resource->address16.granularity);
1da177e4 793
bda663d3
RM
794 acpi_rs_out_integer16("Address Range Min",
795 (u16) resource->address16.min_address_range);
1da177e4 796
bda663d3
RM
797 acpi_rs_out_integer16("Address Range Max",
798 (u16) resource->address16.max_address_range);
1da177e4 799
bda663d3
RM
800 acpi_rs_out_integer16("Address Translation Offset",
801 (u16) resource->address16.
802 address_translation_offset);
1da177e4 803
bda663d3
RM
804 acpi_rs_out_integer16("Address Length",
805 (u16) resource->address16.address_length);
1da177e4 806
bda663d3 807 acpi_rs_dump_resource_source(&resource->address16.resource_source);
1da177e4
LT
808}
809
1da177e4
LT
810/*******************************************************************************
811 *
812 * FUNCTION: acpi_rs_dump_address32
813 *
bda663d3 814 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
815 *
816 * RETURN: None
817 *
bda663d3 818 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
819 *
820 ******************************************************************************/
821
bda663d3 822static void acpi_rs_dump_address32(union acpi_resource_data *resource)
1da177e4 823{
4be44fcd 824 ACPI_FUNCTION_ENTRY();
1da177e4 825
4be44fcd 826 acpi_os_printf("32-Bit Address Space Resource\n");
1da177e4 827
bda663d3 828 acpi_rs_dump_address_common(resource);
1da177e4 829
bda663d3 830 acpi_rs_out_integer32("Granularity", resource->address32.granularity);
1da177e4 831
bda663d3
RM
832 acpi_rs_out_integer32("Address Range Min",
833 resource->address32.min_address_range);
1da177e4 834
bda663d3
RM
835 acpi_rs_out_integer32("Address Range Max",
836 resource->address32.max_address_range);
1da177e4 837
bda663d3
RM
838 acpi_rs_out_integer32("Address Translation Offset",
839 resource->address32.address_translation_offset);
1da177e4 840
bda663d3
RM
841 acpi_rs_out_integer32("Address Length",
842 resource->address32.address_length);
1da177e4 843
bda663d3 844 acpi_rs_dump_resource_source(&resource->address32.resource_source);
1da177e4
LT
845}
846
1da177e4
LT
847/*******************************************************************************
848 *
849 * FUNCTION: acpi_rs_dump_address64
850 *
bda663d3 851 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
852 *
853 * RETURN: None
854 *
bda663d3 855 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
856 *
857 ******************************************************************************/
858
bda663d3 859static void acpi_rs_dump_address64(union acpi_resource_data *resource)
1da177e4 860{
4be44fcd 861 ACPI_FUNCTION_ENTRY();
1da177e4 862
4be44fcd 863 acpi_os_printf("64-Bit Address Space Resource\n");
1da177e4 864
bda663d3 865 acpi_rs_dump_address_common(resource);
1da177e4 866
bda663d3 867 acpi_rs_out_integer64("Granularity", resource->address64.granularity);
1da177e4 868
bda663d3
RM
869 acpi_rs_out_integer64("Address Range Min",
870 resource->address64.min_address_range);
1da177e4 871
bda663d3
RM
872 acpi_rs_out_integer64("Address Range Max",
873 resource->address64.max_address_range);
1da177e4 874
bda663d3
RM
875 acpi_rs_out_integer64("Address Translation Offset",
876 resource->address64.address_translation_offset);
1da177e4 877
bda663d3
RM
878 acpi_rs_out_integer64("Address Length",
879 resource->address64.address_length);
1da177e4 880
bda663d3
RM
881 acpi_rs_out_integer64("Type Specific Attributes",
882 resource->address64.type_specific_attributes);
1da177e4 883
bda663d3 884 acpi_rs_dump_resource_source(&resource->address64.resource_source);
1da177e4
LT
885}
886
1da177e4
LT
887/*******************************************************************************
888 *
889 * FUNCTION: acpi_rs_dump_extended_irq
890 *
bda663d3 891 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
892 *
893 * RETURN: None
894 *
bda663d3 895 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
896 *
897 ******************************************************************************/
898
bda663d3 899static void acpi_rs_dump_extended_irq(union acpi_resource_data *resource)
1da177e4 900{
4be44fcd 901 ACPI_FUNCTION_ENTRY();
1da177e4 902
4be44fcd 903 acpi_os_printf("Extended IRQ Resource\n");
1da177e4 904
bda663d3
RM
905 acpi_rs_out_string("Resource",
906 ACPI_CONSUMER ==
907 resource->extended_irq.
908 producer_consumer ? "Consumer" : "Producer");
1da177e4 909
bda663d3
RM
910 acpi_rs_out_string("Triggering",
911 ACPI_LEVEL_SENSITIVE ==
912 resource->extended_irq.
913 edge_level ? "Level" : "Edge");
1da177e4 914
bda663d3
RM
915 acpi_rs_out_string("Active",
916 ACPI_ACTIVE_LOW ==
917 resource->extended_irq.
918 active_high_low ? "Low" : "High");
1da177e4 919
bda663d3
RM
920 acpi_rs_out_string("Sharing",
921 ACPI_SHARED ==
922 resource->extended_irq.
923 shared_exclusive ? "Shared" : "Exclusive");
1da177e4 924
bda663d3 925 acpi_rs_dump_resource_source(&resource->extended_irq.resource_source);
1da177e4 926
bda663d3
RM
927 acpi_rs_out_integer8("Interrupts",
928 (u8) resource->extended_irq.number_of_interrupts);
1da177e4 929
bda663d3
RM
930 acpi_rs_dump_dword_list(resource->extended_irq.number_of_interrupts,
931 resource->extended_irq.interrupts);
1da177e4
LT
932}
933
1da177e4
LT
934/*******************************************************************************
935 *
bda663d3 936 * FUNCTION: acpi_rs_dump_generic_reg
1da177e4 937 *
bda663d3 938 * PARAMETERS: Resource - Pointer to an internal resource descriptor
1da177e4
LT
939 *
940 * RETURN: None
941 *
bda663d3 942 * DESCRIPTION: Dump the field names and values of the resource descriptor
1da177e4
LT
943 *
944 ******************************************************************************/
945
bda663d3 946static void acpi_rs_dump_generic_reg(union acpi_resource_data *resource)
1da177e4 947{
1da177e4 948
4be44fcd 949 ACPI_FUNCTION_ENTRY();
1da177e4 950
bda663d3 951 acpi_os_printf("Generic Register Resource\n");
1da177e4 952
bda663d3 953 acpi_rs_out_integer8("Space ID", (u8) resource->generic_reg.space_id);
1da177e4 954
bda663d3 955 acpi_rs_out_integer8("Bit Width", (u8) resource->generic_reg.bit_width);
1da177e4 956
bda663d3
RM
957 acpi_rs_out_integer8("Bit Offset",
958 (u8) resource->generic_reg.bit_offset);
1da177e4 959
bda663d3
RM
960 acpi_rs_out_integer8("Address Size",
961 (u8) resource->generic_reg.address_size);
1da177e4 962
bda663d3
RM
963 acpi_rs_out_integer64("Address", resource->generic_reg.address);
964}
1da177e4 965
bda663d3
RM
966/*******************************************************************************
967 *
968 * FUNCTION: acpi_rs_dump_end_depend_fns
969 *
970 * PARAMETERS: Resource - Pointer to an internal resource descriptor
971 *
972 * RETURN: None
973 *
974 * DESCRIPTION: Print type, no data.
975 *
976 ******************************************************************************/
1da177e4 977
bda663d3
RM
978static void acpi_rs_dump_end_depend_fns(union acpi_resource_data *resource)
979{
980 ACPI_FUNCTION_ENTRY();
1da177e4 981
bda663d3
RM
982 acpi_os_printf("end_dependent_functions Resource\n");
983}
1da177e4 984
bda663d3
RM
985/*******************************************************************************
986 *
987 * FUNCTION: acpi_rs_dump_end_tag
988 *
989 * PARAMETERS: Resource - Pointer to an internal resource descriptor
990 *
991 * RETURN: None
992 *
993 * DESCRIPTION: Print type, no data.
994 *
995 ******************************************************************************/
1da177e4 996
bda663d3
RM
997static void acpi_rs_dump_end_tag(union acpi_resource_data *resource)
998{
999 ACPI_FUNCTION_ENTRY();
1da177e4 1000
bda663d3 1001 acpi_os_printf("end_tag Resource\n");
1da177e4
LT
1002}
1003
1004/*******************************************************************************
1005 *
1006 * FUNCTION: acpi_rs_dump_irq_list
1007 *
bda663d3 1008 * PARAMETERS: route_table - Pointer to the routing table to dump.
1da177e4
LT
1009 *
1010 * RETURN: None
1011 *
bda663d3 1012 * DESCRIPTION: Print IRQ routing table
1da177e4
LT
1013 *
1014 ******************************************************************************/
1015
4be44fcd 1016void acpi_rs_dump_irq_list(u8 * route_table)
1da177e4 1017{
4be44fcd
LB
1018 u8 *buffer = route_table;
1019 u8 count = 0;
4be44fcd 1020 struct acpi_pci_routing_table *prt_element;
1da177e4 1021
4be44fcd 1022 ACPI_FUNCTION_ENTRY();
1da177e4 1023
bda663d3
RM
1024 if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
1025 || !(_COMPONENT & acpi_dbg_layer)) {
1026 return;
1027 }
1da177e4 1028
bda663d3 1029 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
1da177e4 1030
bda663d3 1031 /* Dump all table elements, Exit on null length element */
1da177e4 1032
bda663d3
RM
1033 while (prt_element->length) {
1034 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
1035 count);
1da177e4 1036
bda663d3 1037 acpi_rs_out_integer64("Address", prt_element->address);
1da177e4 1038
bda663d3
RM
1039 acpi_rs_out_integer32("Pin", prt_element->pin);
1040 acpi_rs_out_string("Source", prt_element->source);
1041 acpi_rs_out_integer32("Source Index",
1042 prt_element->source_index);
1da177e4 1043
bda663d3
RM
1044 buffer += prt_element->length;
1045 prt_element =
1046 ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
1047 count++;
1da177e4 1048 }
1da177e4
LT
1049}
1050
1051#endif
This page took 0.098245 seconds and 5 git commands to generate.