Pull altix-mmr into release branch
[deliverable/linux.git] / drivers / acpi / resources / rsdump.c
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
44 #include <acpi/acpi.h>
45 #include <acpi/acresrc.h>
46
47 #define _COMPONENT ACPI_RESOURCES
48 ACPI_MODULE_NAME("rsdump")
49
50 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
51 /* Local prototypes */
52 static void acpi_rs_dump_irq(union acpi_resource_data *data);
53
54 static void acpi_rs_dump_address16(union acpi_resource_data *data);
55
56 static void acpi_rs_dump_address32(union acpi_resource_data *data);
57
58 static void acpi_rs_dump_address64(union acpi_resource_data *data);
59
60 static void acpi_rs_dump_dma(union acpi_resource_data *data);
61
62 static void acpi_rs_dump_io(union acpi_resource_data *data);
63
64 static void acpi_rs_dump_extended_irq(union acpi_resource_data *data);
65
66 static void acpi_rs_dump_fixed_io(union acpi_resource_data *data);
67
68 static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *data);
69
70 static void acpi_rs_dump_memory24(union acpi_resource_data *data);
71
72 static void acpi_rs_dump_memory32(union acpi_resource_data *data);
73
74 static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *data);
75
76 static void acpi_rs_dump_vendor_specific(union acpi_resource_data *data);
77
78 /*******************************************************************************
79 *
80 * FUNCTION: acpi_rs_dump_irq
81 *
82 * PARAMETERS: Data - pointer to the resource structure to dump.
83 *
84 * RETURN: None
85 *
86 * DESCRIPTION: Prints out the various members of the Data structure type.
87 *
88 ******************************************************************************/
89
90 static void acpi_rs_dump_irq(union acpi_resource_data *data)
91 {
92 struct acpi_resource_irq *irq_data = (struct acpi_resource_irq *)data;
93 u8 index = 0;
94
95 ACPI_FUNCTION_ENTRY();
96
97 acpi_os_printf("IRQ Resource\n");
98
99 acpi_os_printf(" %s Triggered\n",
100 ACPI_LEVEL_SENSITIVE ==
101 irq_data->edge_level ? "Level" : "Edge");
102
103 acpi_os_printf(" Active %s\n",
104 ACPI_ACTIVE_LOW ==
105 irq_data->active_high_low ? "Low" : "High");
106
107 acpi_os_printf(" %s\n",
108 ACPI_SHARED ==
109 irq_data->shared_exclusive ? "Shared" : "Exclusive");
110
111 acpi_os_printf(" %X Interrupts ( ", irq_data->number_of_interrupts);
112
113 for (index = 0; index < irq_data->number_of_interrupts; index++) {
114 acpi_os_printf("%X ", irq_data->interrupts[index]);
115 }
116
117 acpi_os_printf(")\n");
118 return;
119 }
120
121 /*******************************************************************************
122 *
123 * FUNCTION: acpi_rs_dump_dma
124 *
125 * PARAMETERS: Data - pointer to the resource structure to dump.
126 *
127 * RETURN: None
128 *
129 * DESCRIPTION: Prints out the various members of the Data structure type.
130 *
131 ******************************************************************************/
132
133 static void acpi_rs_dump_dma(union acpi_resource_data *data)
134 {
135 struct acpi_resource_dma *dma_data = (struct acpi_resource_dma *)data;
136 u8 index = 0;
137
138 ACPI_FUNCTION_ENTRY();
139
140 acpi_os_printf("DMA Resource\n");
141
142 switch (dma_data->type) {
143 case ACPI_COMPATIBILITY:
144 acpi_os_printf(" Compatibility mode\n");
145 break;
146
147 case ACPI_TYPE_A:
148 acpi_os_printf(" Type A\n");
149 break;
150
151 case ACPI_TYPE_B:
152 acpi_os_printf(" Type B\n");
153 break;
154
155 case ACPI_TYPE_F:
156 acpi_os_printf(" Type F\n");
157 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
172 case ACPI_TRANSFER_8_16:
173 acpi_os_printf(" 8 and 16-bit transfer\n");
174 break;
175
176 case ACPI_TRANSFER_16:
177 acpi_os_printf(" 16 bit only transfer\n");
178 break;
179
180 default:
181 acpi_os_printf(" Invalid transfer preference\n");
182 break;
183 }
184
185 acpi_os_printf(" Number of Channels: %X ( ",
186 dma_data->number_of_channels);
187
188 for (index = 0; index < dma_data->number_of_channels; index++) {
189 acpi_os_printf("%X ", dma_data->channels[index]);
190 }
191
192 acpi_os_printf(")\n");
193 return;
194 }
195
196 /*******************************************************************************
197 *
198 * FUNCTION: acpi_rs_dump_start_depend_fns
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
208 static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *data)
209 {
210 struct acpi_resource_start_dpf *sdf_data =
211 (struct acpi_resource_start_dpf *)data;
212
213 ACPI_FUNCTION_ENTRY();
214
215 acpi_os_printf("Start Dependent Functions Resource\n");
216
217 switch (sdf_data->compatibility_priority) {
218 case ACPI_GOOD_CONFIGURATION:
219 acpi_os_printf(" Good configuration\n");
220 break;
221
222 case ACPI_ACCEPTABLE_CONFIGURATION:
223 acpi_os_printf(" Acceptable configuration\n");
224 break;
225
226 case ACPI_SUB_OPTIMAL_CONFIGURATION:
227 acpi_os_printf(" Sub-optimal configuration\n");
228 break;
229
230 default:
231 acpi_os_printf(" Invalid compatibility priority\n");
232 break;
233 }
234
235 switch (sdf_data->performance_robustness) {
236 case ACPI_GOOD_CONFIGURATION:
237 acpi_os_printf(" Good configuration\n");
238 break;
239
240 case ACPI_ACCEPTABLE_CONFIGURATION:
241 acpi_os_printf(" Acceptable configuration\n");
242 break;
243
244 case ACPI_SUB_OPTIMAL_CONFIGURATION:
245 acpi_os_printf(" Sub-optimal configuration\n");
246 break;
247
248 default:
249 acpi_os_printf(" Invalid performance robustness preference\n");
250 break;
251 }
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
268 static 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
304 static 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 }
319
320 /*******************************************************************************
321 *
322 * FUNCTION: acpi_rs_dump_vendor_specific
323 *
324 * PARAMETERS: Data - pointer to the resource structure to dump.
325 *
326 * RETURN: None
327 *
328 * DESCRIPTION: Prints out the various members of the Data structure type.
329 *
330 ******************************************************************************/
331
332 static void acpi_rs_dump_vendor_specific(union acpi_resource_data *data)
333 {
334 struct acpi_resource_vendor *vendor_data =
335 (struct acpi_resource_vendor *)data;
336 u16 index = 0;
337
338 ACPI_FUNCTION_ENTRY();
339
340 acpi_os_printf("Vendor Specific Resource\n");
341
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 }
348
349 return;
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
364 static 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
403 static 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
427 return;
428 }
429
430 /*******************************************************************************
431 *
432 * FUNCTION: acpi_rs_dump_fixed_memory32
433 *
434 * PARAMETERS: Data - pointer to the resource structure to dump.
435 *
436 * RETURN:
437 *
438 * DESCRIPTION: Prints out the various members of the Data structure type.
439 *
440 ******************************************************************************/
441
442 static 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 *
471 * RETURN: None
472 *
473 * DESCRIPTION: Prints out the various members of the Data structure type.
474 *
475 ******************************************************************************/
476
477 static void acpi_rs_dump_address16(union acpi_resource_data *data)
478 {
479 struct acpi_resource_address16 *address16_data =
480 (struct acpi_resource_address16 *)data;
481
482 ACPI_FUNCTION_ENTRY();
483
484 acpi_os_printf("16-Bit Address Space Resource\n");
485 acpi_os_printf(" Resource Type: ");
486
487 switch (address16_data->resource_type) {
488 case ACPI_MEMORY_RANGE:
489
490 acpi_os_printf("Memory Range\n");
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;
523
524 case ACPI_IO_RANGE:
525
526 acpi_os_printf("I/O Range\n");
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;
554
555 case ACPI_BUS_NUMBER_RANGE:
556
557 acpi_os_printf("Bus Number Range\n");
558 break;
559
560 default:
561
562 acpi_os_printf("0x%2.2X\n", address16_data->resource_type);
563 break;
564 }
565
566 acpi_os_printf(" Resource %s\n",
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
574 acpi_os_printf(" Min address is %s fixed\n",
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 }
606
607 /*******************************************************************************
608 *
609 * FUNCTION: acpi_rs_dump_address32
610 *
611 * PARAMETERS: Data - pointer to the resource structure to dump.
612 *
613 * RETURN: None
614 *
615 * DESCRIPTION: Prints out the various members of the Data structure type.
616 *
617 ******************************************************************************/
618
619 static void acpi_rs_dump_address32(union acpi_resource_data *data)
620 {
621 struct acpi_resource_address32 *address32_data =
622 (struct acpi_resource_address32 *)data;
623
624 ACPI_FUNCTION_ENTRY();
625
626 acpi_os_printf("32-Bit Address Space Resource\n");
627
628 switch (address32_data->resource_type) {
629 case ACPI_MEMORY_RANGE:
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
669 switch (address32_data->attribute.io.range_attribute) {
670 case ACPI_NON_ISA_ONLY_RANGES:
671 acpi_os_printf
672 (" Type Specific: Non-ISA Io Addresses\n");
673 break;
674
675 case ACPI_ISA_ONLY_RANGES:
676 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
677 break;
678
679 case ACPI_ENTIRE_RANGE:
680 acpi_os_printf
681 (" Type Specific: ISA and non-ISA Io Addresses\n");
682 break;
683
684 default:
685 acpi_os_printf
686 (" Type Specific: Invalid Range attribute");
687 break;
688 }
689
690 acpi_os_printf(" Type Specific: %s Translation\n",
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
724 acpi_os_printf(" Granularity: %08X\n", address32_data->granularity);
725
726 acpi_os_printf(" Address range min: %08X\n",
727 address32_data->min_address_range);
728
729 acpi_os_printf(" Address range max: %08X\n",
730 address32_data->max_address_range);
731
732 acpi_os_printf(" Address translation offset: %08X\n",
733 address32_data->address_translation_offset);
734
735 acpi_os_printf(" Address Length: %08X\n",
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 }
748
749 /*******************************************************************************
750 *
751 * FUNCTION: acpi_rs_dump_address64
752 *
753 * PARAMETERS: Data - pointer to the resource structure to dump.
754 *
755 * RETURN: None
756 *
757 * DESCRIPTION: Prints out the various members of the Data structure type.
758 *
759 ******************************************************************************/
760
761 static void acpi_rs_dump_address64(union acpi_resource_data *data)
762 {
763 struct acpi_resource_address64 *address64_data =
764 (struct acpi_resource_address64 *)data;
765
766 ACPI_FUNCTION_ENTRY();
767
768 acpi_os_printf("64-Bit Address Space Resource\n");
769
770 switch (address64_data->resource_type) {
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 }
849
850 acpi_os_printf(" Resource %s\n",
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
866 acpi_os_printf(" Granularity: %8.8X%8.8X\n",
867 ACPI_FORMAT_UINT64(address64_data->granularity));
868
869 acpi_os_printf(" Address range min: %8.8X%8.8X\n",
870 ACPI_FORMAT_UINT64(address64_data->min_address_range));
871
872 acpi_os_printf(" Address range max: %8.8X%8.8X\n",
873 ACPI_FORMAT_UINT64(address64_data->max_address_range));
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 }
893
894 return;
895 }
896
897 /*******************************************************************************
898 *
899 * FUNCTION: acpi_rs_dump_extended_irq
900 *
901 * PARAMETERS: Data - pointer to the resource structure to dump.
902 *
903 * RETURN: None
904 *
905 * DESCRIPTION: Prints out the various members of the Data structure type.
906 *
907 ******************************************************************************/
908
909 static void acpi_rs_dump_extended_irq(union acpi_resource_data *data)
910 {
911 struct acpi_resource_ext_irq *ext_irq_data =
912 (struct acpi_resource_ext_irq *)data;
913 u8 index = 0;
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 }
951
952 return;
953 }
954
955 /*******************************************************************************
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
967 void acpi_rs_dump_resource_list(struct acpi_resource *resource)
968 {
969 u8 count = 0;
970 u8 done = FALSE;
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
1043 default:
1044 acpi_os_printf("Invalid resource type\n");
1045 break;
1046
1047 }
1048
1049 resource =
1050 ACPI_PTR_ADD(struct acpi_resource, resource,
1051 resource->length);
1052 }
1053 }
1054
1055 return;
1056 }
1057
1058 /*******************************************************************************
1059 *
1060 * FUNCTION: acpi_rs_dump_irq_list
1061 *
1062 * PARAMETERS: route_table - pointer to the routing table to dump.
1063 *
1064 * RETURN: None
1065 *
1066 * DESCRIPTION: Dispatches the structures to the correct dump routine.
1067 *
1068 ******************************************************************************/
1069
1070 void acpi_rs_dump_irq_list(u8 * route_table)
1071 {
1072 u8 *buffer = route_table;
1073 u8 count = 0;
1074 u8 done = FALSE;
1075 struct acpi_pci_routing_table *prt_element;
1076
1077 ACPI_FUNCTION_ENTRY();
1078
1079 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
1080 prt_element =
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
1091 acpi_os_printf(" Pin: %X\n", prt_element->pin);
1092
1093 acpi_os_printf(" Source: %s\n", prt_element->source);
1094
1095 acpi_os_printf(" source_index: %X\n",
1096 prt_element->source_index);
1097
1098 buffer += prt_element->length;
1099 prt_element =
1100 ACPI_CAST_PTR(struct acpi_pci_routing_table,
1101 buffer);
1102 if (0 == prt_element->length) {
1103 done = TRUE;
1104 }
1105 }
1106 }
1107
1108 return;
1109 }
1110
1111 #endif
This page took 0.053281 seconds and 6 git commands to generate.