Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[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
45 #include <acpi/acpi.h>
46 #include <acpi/acresrc.h>
47
48 #define _COMPONENT ACPI_RESOURCES
49 ACPI_MODULE_NAME ("rsdump")
50
51 /* Local prototypes */
52
53 static void
54 acpi_rs_dump_irq (
55 union acpi_resource_data *data);
56
57 static void
58 acpi_rs_dump_address16 (
59 union acpi_resource_data *data);
60
61 static void
62 acpi_rs_dump_address32 (
63 union acpi_resource_data *data);
64
65 static void
66 acpi_rs_dump_address64 (
67 union acpi_resource_data *data);
68
69 static void
70 acpi_rs_dump_dma (
71 union acpi_resource_data *data);
72
73 static void
74 acpi_rs_dump_io (
75 union acpi_resource_data *data);
76
77 static void
78 acpi_rs_dump_extended_irq (
79 union acpi_resource_data *data);
80
81 static void
82 acpi_rs_dump_fixed_io (
83 union acpi_resource_data *data);
84
85 static void
86 acpi_rs_dump_fixed_memory32 (
87 union acpi_resource_data *data);
88
89 static void
90 acpi_rs_dump_memory24 (
91 union acpi_resource_data *data);
92
93 static void
94 acpi_rs_dump_memory32 (
95 union acpi_resource_data *data);
96
97 static void
98 acpi_rs_dump_start_depend_fns (
99 union acpi_resource_data *data);
100
101 static void
102 acpi_rs_dump_vendor_specific (
103 union acpi_resource_data *data);
104
105
106 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
107 /*******************************************************************************
108 *
109 * FUNCTION: acpi_rs_dump_irq
110 *
111 * PARAMETERS: Data - pointer to the resource structure to dump.
112 *
113 * RETURN: None
114 *
115 * DESCRIPTION: Prints out the various members of the Data structure type.
116 *
117 ******************************************************************************/
118
119 static void
120 acpi_rs_dump_irq (
121 union acpi_resource_data *data)
122 {
123 struct acpi_resource_irq *irq_data = (struct acpi_resource_irq *) data;
124 u8 index = 0;
125
126
127 ACPI_FUNCTION_ENTRY ();
128
129
130 acpi_os_printf ("IRQ Resource\n");
131
132 acpi_os_printf (" %s Triggered\n",
133 ACPI_LEVEL_SENSITIVE == irq_data->edge_level ? "Level" : "Edge");
134
135 acpi_os_printf (" Active %s\n",
136 ACPI_ACTIVE_LOW == irq_data->active_high_low ? "Low" : "High");
137
138 acpi_os_printf (" %s\n",
139 ACPI_SHARED == irq_data->shared_exclusive ? "Shared" : "Exclusive");
140
141 acpi_os_printf (" %X Interrupts ( ", irq_data->number_of_interrupts);
142
143 for (index = 0; index < irq_data->number_of_interrupts; index++) {
144 acpi_os_printf ("%X ", irq_data->interrupts[index]);
145 }
146
147 acpi_os_printf (")\n");
148 return;
149 }
150
151
152 /*******************************************************************************
153 *
154 * FUNCTION: acpi_rs_dump_dma
155 *
156 * PARAMETERS: Data - pointer to the resource structure to dump.
157 *
158 * RETURN: None
159 *
160 * DESCRIPTION: Prints out the various members of the Data structure type.
161 *
162 ******************************************************************************/
163
164 static void
165 acpi_rs_dump_dma (
166 union acpi_resource_data *data)
167 {
168 struct acpi_resource_dma *dma_data = (struct acpi_resource_dma *) data;
169 u8 index = 0;
170
171
172 ACPI_FUNCTION_ENTRY ();
173
174
175 acpi_os_printf ("DMA Resource\n");
176
177 switch (dma_data->type) {
178 case ACPI_COMPATIBILITY:
179 acpi_os_printf (" Compatibility mode\n");
180 break;
181
182 case ACPI_TYPE_A:
183 acpi_os_printf (" Type A\n");
184 break;
185
186 case ACPI_TYPE_B:
187 acpi_os_printf (" Type B\n");
188 break;
189
190 case ACPI_TYPE_F:
191 acpi_os_printf (" Type F\n");
192 break;
193
194 default:
195 acpi_os_printf (" Invalid DMA type\n");
196 break;
197 }
198
199 acpi_os_printf (" %sBus Master\n",
200 ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a ");
201
202
203 switch (dma_data->transfer) {
204 case ACPI_TRANSFER_8:
205 acpi_os_printf (" 8-bit only transfer\n");
206 break;
207
208 case ACPI_TRANSFER_8_16:
209 acpi_os_printf (" 8 and 16-bit transfer\n");
210 break;
211
212 case ACPI_TRANSFER_16:
213 acpi_os_printf (" 16 bit only transfer\n");
214 break;
215
216 default:
217 acpi_os_printf (" Invalid transfer preference\n");
218 break;
219 }
220
221 acpi_os_printf (" Number of Channels: %X ( ",
222 dma_data->number_of_channels);
223
224 for (index = 0; index < dma_data->number_of_channels; index++) {
225 acpi_os_printf ("%X ", dma_data->channels[index]);
226 }
227
228 acpi_os_printf (")\n");
229 return;
230 }
231
232
233 /*******************************************************************************
234 *
235 * FUNCTION: acpi_rs_dump_start_depend_fns
236 *
237 * PARAMETERS: Data - pointer to the resource structure to dump.
238 *
239 * RETURN: None
240 *
241 * DESCRIPTION: Prints out the various members of the Data structure type.
242 *
243 ******************************************************************************/
244
245 static void
246 acpi_rs_dump_start_depend_fns (
247 union acpi_resource_data *data)
248 {
249 struct acpi_resource_start_dpf *sdf_data = (struct acpi_resource_start_dpf *) data;
250
251
252 ACPI_FUNCTION_ENTRY ();
253
254
255 acpi_os_printf ("Start Dependent Functions Resource\n");
256
257 switch (sdf_data->compatibility_priority) {
258 case ACPI_GOOD_CONFIGURATION:
259 acpi_os_printf (" Good configuration\n");
260 break;
261
262 case ACPI_ACCEPTABLE_CONFIGURATION:
263 acpi_os_printf (" Acceptable configuration\n");
264 break;
265
266 case ACPI_SUB_OPTIMAL_CONFIGURATION:
267 acpi_os_printf (" Sub-optimal configuration\n");
268 break;
269
270 default:
271 acpi_os_printf (" Invalid compatibility priority\n");
272 break;
273 }
274
275 switch(sdf_data->performance_robustness) {
276 case ACPI_GOOD_CONFIGURATION:
277 acpi_os_printf (" Good configuration\n");
278 break;
279
280 case ACPI_ACCEPTABLE_CONFIGURATION:
281 acpi_os_printf (" Acceptable configuration\n");
282 break;
283
284 case ACPI_SUB_OPTIMAL_CONFIGURATION:
285 acpi_os_printf (" Sub-optimal configuration\n");
286 break;
287
288 default:
289 acpi_os_printf (" Invalid performance robustness preference\n");
290 break;
291 }
292
293 return;
294 }
295
296
297 /*******************************************************************************
298 *
299 * FUNCTION: acpi_rs_dump_io
300 *
301 * PARAMETERS: Data - pointer to the resource structure to dump.
302 *
303 * RETURN: None
304 *
305 * DESCRIPTION: Prints out the various members of the Data structure type.
306 *
307 ******************************************************************************/
308
309 static void
310 acpi_rs_dump_io (
311 union acpi_resource_data *data)
312 {
313 struct acpi_resource_io *io_data = (struct acpi_resource_io *) data;
314
315
316 ACPI_FUNCTION_ENTRY ();
317
318
319 acpi_os_printf ("Io Resource\n");
320
321 acpi_os_printf (" %d bit decode\n",
322 ACPI_DECODE_16 == io_data->io_decode ? 16 : 10);
323
324 acpi_os_printf (" Range minimum base: %08X\n", io_data->min_base_address);
325
326 acpi_os_printf (" Range maximum base: %08X\n", io_data->max_base_address);
327
328 acpi_os_printf (" Alignment: %08X\n", io_data->alignment);
329
330 acpi_os_printf (" Range Length: %08X\n", io_data->range_length);
331
332 return;
333 }
334
335
336 /*******************************************************************************
337 *
338 * FUNCTION: acpi_rs_dump_fixed_io
339 *
340 * PARAMETERS: Data - pointer to the resource structure to dump.
341 *
342 * RETURN: None
343 *
344 * DESCRIPTION: Prints out the various members of the Data structure type.
345 *
346 ******************************************************************************/
347
348 static void
349 acpi_rs_dump_fixed_io (
350 union acpi_resource_data *data)
351 {
352 struct acpi_resource_fixed_io *fixed_io_data = (struct acpi_resource_fixed_io *) data;
353
354
355 ACPI_FUNCTION_ENTRY ();
356
357
358 acpi_os_printf ("Fixed Io Resource\n");
359 acpi_os_printf (" Range base address: %08X", fixed_io_data->base_address);
360
361 acpi_os_printf (" Range length: %08X", fixed_io_data->range_length);
362
363 return;
364 }
365
366
367 /*******************************************************************************
368 *
369 * FUNCTION: acpi_rs_dump_vendor_specific
370 *
371 * PARAMETERS: Data - pointer to the resource structure to dump.
372 *
373 * RETURN: None
374 *
375 * DESCRIPTION: Prints out the various members of the Data structure type.
376 *
377 ******************************************************************************/
378
379 static void
380 acpi_rs_dump_vendor_specific (
381 union acpi_resource_data *data)
382 {
383 struct acpi_resource_vendor *vendor_data = (struct acpi_resource_vendor *) data;
384 u16 index = 0;
385
386
387 ACPI_FUNCTION_ENTRY ();
388
389
390 acpi_os_printf ("Vendor Specific Resource\n");
391
392 acpi_os_printf (" Length: %08X\n", vendor_data->length);
393
394 for (index = 0; index < vendor_data->length; index++) {
395 acpi_os_printf (" Byte %X: %08X\n",
396 index, vendor_data->reserved[index]);
397 }
398
399 return;
400 }
401
402
403 /*******************************************************************************
404 *
405 * FUNCTION: acpi_rs_dump_memory24
406 *
407 * PARAMETERS: Data - pointer to the resource structure to dump.
408 *
409 * RETURN: None
410 *
411 * DESCRIPTION: Prints out the various members of the Data structure type.
412 *
413 ******************************************************************************/
414
415 static void
416 acpi_rs_dump_memory24 (
417 union acpi_resource_data *data)
418 {
419 struct acpi_resource_mem24 *memory24_data = (struct acpi_resource_mem24 *) data;
420
421
422 ACPI_FUNCTION_ENTRY ();
423
424
425 acpi_os_printf ("24-Bit Memory Range Resource\n");
426
427 acpi_os_printf (" Read%s\n",
428 ACPI_READ_WRITE_MEMORY ==
429 memory24_data->read_write_attribute ?
430 "/Write" : " only");
431
432 acpi_os_printf (" Range minimum base: %08X\n",
433 memory24_data->min_base_address);
434
435 acpi_os_printf (" Range maximum base: %08X\n",
436 memory24_data->max_base_address);
437
438 acpi_os_printf (" Alignment: %08X\n", memory24_data->alignment);
439
440 acpi_os_printf (" Range length: %08X\n", memory24_data->range_length);
441
442 return;
443 }
444
445
446 /*******************************************************************************
447 *
448 * FUNCTION: acpi_rs_dump_memory32
449 *
450 * PARAMETERS: Data - pointer to the resource structure to dump.
451 *
452 * RETURN: None
453 *
454 * DESCRIPTION: Prints out the various members of the Data structure type.
455 *
456 ******************************************************************************/
457
458 static void
459 acpi_rs_dump_memory32 (
460 union acpi_resource_data *data)
461 {
462 struct acpi_resource_mem32 *memory32_data = (struct acpi_resource_mem32 *) data;
463
464
465 ACPI_FUNCTION_ENTRY ();
466
467
468 acpi_os_printf ("32-Bit Memory Range Resource\n");
469
470 acpi_os_printf (" Read%s\n",
471 ACPI_READ_WRITE_MEMORY ==
472 memory32_data->read_write_attribute ?
473 "/Write" : " only");
474
475 acpi_os_printf (" Range minimum base: %08X\n",
476 memory32_data->min_base_address);
477
478 acpi_os_printf (" Range maximum base: %08X\n",
479 memory32_data->max_base_address);
480
481 acpi_os_printf (" Alignment: %08X\n", memory32_data->alignment);
482
483 acpi_os_printf (" Range length: %08X\n", memory32_data->range_length);
484
485 return;
486 }
487
488
489 /*******************************************************************************
490 *
491 * FUNCTION: acpi_rs_dump_fixed_memory32
492 *
493 * PARAMETERS: Data - pointer to the resource structure to dump.
494 *
495 * RETURN:
496 *
497 * DESCRIPTION: Prints out the various members of the Data structure type.
498 *
499 ******************************************************************************/
500
501 static void
502 acpi_rs_dump_fixed_memory32 (
503 union acpi_resource_data *data)
504 {
505 struct acpi_resource_fixed_mem32 *fixed_memory32_data =
506 (struct acpi_resource_fixed_mem32 *) data;
507
508
509 ACPI_FUNCTION_ENTRY ();
510
511
512 acpi_os_printf ("32-Bit Fixed Location Memory Range Resource\n");
513
514 acpi_os_printf (" Read%s\n",
515 ACPI_READ_WRITE_MEMORY ==
516 fixed_memory32_data->read_write_attribute ? "/Write" : " Only");
517
518 acpi_os_printf (" Range base address: %08X\n",
519 fixed_memory32_data->range_base_address);
520
521 acpi_os_printf (" Range length: %08X\n",
522 fixed_memory32_data->range_length);
523
524 return;
525 }
526
527
528 /*******************************************************************************
529 *
530 * FUNCTION: acpi_rs_dump_address16
531 *
532 * PARAMETERS: Data - pointer to the resource structure to dump.
533 *
534 * RETURN: None
535 *
536 * DESCRIPTION: Prints out the various members of the Data structure type.
537 *
538 ******************************************************************************/
539
540 static void
541 acpi_rs_dump_address16 (
542 union acpi_resource_data *data)
543 {
544 struct acpi_resource_address16 *address16_data = (struct acpi_resource_address16 *) data;
545
546
547 ACPI_FUNCTION_ENTRY ();
548
549
550 acpi_os_printf ("16-Bit Address Space Resource\n");
551 acpi_os_printf (" Resource Type: ");
552
553 switch (address16_data->resource_type) {
554 case ACPI_MEMORY_RANGE:
555
556 acpi_os_printf ("Memory Range\n");
557
558 switch (address16_data->attribute.memory.cache_attribute) {
559 case ACPI_NON_CACHEABLE_MEMORY:
560 acpi_os_printf (" Type Specific: Noncacheable memory\n");
561 break;
562
563 case ACPI_CACHABLE_MEMORY:
564 acpi_os_printf (" Type Specific: Cacheable memory\n");
565 break;
566
567 case ACPI_WRITE_COMBINING_MEMORY:
568 acpi_os_printf (" Type Specific: Write-combining memory\n");
569 break;
570
571 case ACPI_PREFETCHABLE_MEMORY:
572 acpi_os_printf (" Type Specific: Prefetchable memory\n");
573 break;
574
575 default:
576 acpi_os_printf (" Type Specific: Invalid cache attribute\n");
577 break;
578 }
579
580 acpi_os_printf (" Type Specific: Read%s\n",
581 ACPI_READ_WRITE_MEMORY ==
582 address16_data->attribute.memory.read_write_attribute ?
583 "/Write" : " Only");
584 break;
585
586 case ACPI_IO_RANGE:
587
588 acpi_os_printf ("I/O Range\n");
589
590 switch (address16_data->attribute.io.range_attribute) {
591 case ACPI_NON_ISA_ONLY_RANGES:
592 acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
593 break;
594
595 case ACPI_ISA_ONLY_RANGES:
596 acpi_os_printf (" Type Specific: ISA Io Addresses\n");
597 break;
598
599 case ACPI_ENTIRE_RANGE:
600 acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
601 break;
602
603 default:
604 acpi_os_printf (" Type Specific: Invalid range attribute\n");
605 break;
606 }
607
608 acpi_os_printf (" Type Specific: %s Translation\n",
609 ACPI_SPARSE_TRANSLATION ==
610 address16_data->attribute.io.translation_attribute ?
611 "Sparse" : "Dense");
612 break;
613
614 case ACPI_BUS_NUMBER_RANGE:
615
616 acpi_os_printf ("Bus Number Range\n");
617 break;
618
619 default:
620
621 acpi_os_printf ("0x%2.2X\n", address16_data->resource_type);
622 break;
623 }
624
625 acpi_os_printf (" Resource %s\n",
626 ACPI_CONSUMER == address16_data->producer_consumer ?
627 "Consumer" : "Producer");
628
629 acpi_os_printf (" %s decode\n",
630 ACPI_SUB_DECODE == address16_data->decode ?
631 "Subtractive" : "Positive");
632
633 acpi_os_printf (" Min address is %s fixed\n",
634 ACPI_ADDRESS_FIXED == address16_data->min_address_fixed ?
635 "" : "not");
636
637 acpi_os_printf (" Max address is %s fixed\n",
638 ACPI_ADDRESS_FIXED == address16_data->max_address_fixed ?
639 "" : "not");
640
641 acpi_os_printf (" Granularity: %08X\n",
642 address16_data->granularity);
643
644 acpi_os_printf (" Address range min: %08X\n",
645 address16_data->min_address_range);
646
647 acpi_os_printf (" Address range max: %08X\n",
648 address16_data->max_address_range);
649
650 acpi_os_printf (" Address translation offset: %08X\n",
651 address16_data->address_translation_offset);
652
653 acpi_os_printf (" Address Length: %08X\n",
654 address16_data->address_length);
655
656 if (0xFF != address16_data->resource_source.index) {
657 acpi_os_printf (" Resource Source Index: %X\n",
658 address16_data->resource_source.index);
659
660 acpi_os_printf (" Resource Source: %s\n",
661 address16_data->resource_source.string_ptr);
662 }
663
664 return;
665 }
666
667
668 /*******************************************************************************
669 *
670 * FUNCTION: acpi_rs_dump_address32
671 *
672 * PARAMETERS: Data - pointer to the resource structure to dump.
673 *
674 * RETURN: None
675 *
676 * DESCRIPTION: Prints out the various members of the Data structure type.
677 *
678 ******************************************************************************/
679
680 static void
681 acpi_rs_dump_address32 (
682 union acpi_resource_data *data)
683 {
684 struct acpi_resource_address32 *address32_data = (struct acpi_resource_address32 *) data;
685
686
687 ACPI_FUNCTION_ENTRY ();
688
689
690 acpi_os_printf ("32-Bit Address Space Resource\n");
691
692 switch (address32_data->resource_type) {
693 case ACPI_MEMORY_RANGE:
694
695 acpi_os_printf (" Resource Type: Memory Range\n");
696
697 switch (address32_data->attribute.memory.cache_attribute) {
698 case ACPI_NON_CACHEABLE_MEMORY:
699 acpi_os_printf (" Type Specific: Noncacheable memory\n");
700 break;
701
702 case ACPI_CACHABLE_MEMORY:
703 acpi_os_printf (" Type Specific: Cacheable memory\n");
704 break;
705
706 case ACPI_WRITE_COMBINING_MEMORY:
707 acpi_os_printf (" Type Specific: Write-combining memory\n");
708 break;
709
710 case ACPI_PREFETCHABLE_MEMORY:
711 acpi_os_printf (" Type Specific: Prefetchable memory\n");
712 break;
713
714 default:
715 acpi_os_printf (" Type Specific: Invalid cache attribute\n");
716 break;
717 }
718
719 acpi_os_printf (" Type Specific: Read%s\n",
720 ACPI_READ_WRITE_MEMORY ==
721 address32_data->attribute.memory.read_write_attribute ?
722 "/Write" : " Only");
723 break;
724
725 case ACPI_IO_RANGE:
726
727 acpi_os_printf (" Resource Type: Io Range\n");
728
729 switch (address32_data->attribute.io.range_attribute) {
730 case ACPI_NON_ISA_ONLY_RANGES:
731 acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
732 break;
733
734 case ACPI_ISA_ONLY_RANGES:
735 acpi_os_printf (" Type Specific: ISA Io Addresses\n");
736 break;
737
738 case ACPI_ENTIRE_RANGE:
739 acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
740 break;
741
742 default:
743 acpi_os_printf (" Type Specific: Invalid Range attribute");
744 break;
745 }
746
747 acpi_os_printf (" Type Specific: %s Translation\n",
748 ACPI_SPARSE_TRANSLATION ==
749 address32_data->attribute.io.translation_attribute ?
750 "Sparse" : "Dense");
751 break;
752
753 case ACPI_BUS_NUMBER_RANGE:
754
755 acpi_os_printf (" Resource Type: Bus Number Range\n");
756 break;
757
758 default:
759
760 acpi_os_printf (" Resource Type: 0x%2.2X\n",
761 address32_data->resource_type);
762 break;
763 }
764
765 acpi_os_printf (" Resource %s\n",
766 ACPI_CONSUMER == address32_data->producer_consumer ?
767 "Consumer" : "Producer");
768
769 acpi_os_printf (" %s decode\n",
770 ACPI_SUB_DECODE == address32_data->decode ?
771 "Subtractive" : "Positive");
772
773 acpi_os_printf (" Min address is %s fixed\n",
774 ACPI_ADDRESS_FIXED == address32_data->min_address_fixed ?
775 "" : "not ");
776
777 acpi_os_printf (" Max address is %s fixed\n",
778 ACPI_ADDRESS_FIXED == address32_data->max_address_fixed ?
779 "" : "not ");
780
781 acpi_os_printf (" Granularity: %08X\n",
782 address32_data->granularity);
783
784 acpi_os_printf (" Address range min: %08X\n",
785 address32_data->min_address_range);
786
787 acpi_os_printf (" Address range max: %08X\n",
788 address32_data->max_address_range);
789
790 acpi_os_printf (" Address translation offset: %08X\n",
791 address32_data->address_translation_offset);
792
793 acpi_os_printf (" Address Length: %08X\n",
794 address32_data->address_length);
795
796 if(0xFF != address32_data->resource_source.index) {
797 acpi_os_printf (" Resource Source Index: %X\n",
798 address32_data->resource_source.index);
799
800 acpi_os_printf (" Resource Source: %s\n",
801 address32_data->resource_source.string_ptr);
802 }
803
804 return;
805 }
806
807
808 /*******************************************************************************
809 *
810 * FUNCTION: acpi_rs_dump_address64
811 *
812 * PARAMETERS: Data - pointer to the resource structure to dump.
813 *
814 * RETURN: None
815 *
816 * DESCRIPTION: Prints out the various members of the Data structure type.
817 *
818 ******************************************************************************/
819
820 static void
821 acpi_rs_dump_address64 (
822 union acpi_resource_data *data)
823 {
824 struct acpi_resource_address64 *address64_data = (struct acpi_resource_address64 *) data;
825
826
827 ACPI_FUNCTION_ENTRY ();
828
829
830 acpi_os_printf ("64-Bit Address Space Resource\n");
831
832 switch (address64_data->resource_type) {
833 case ACPI_MEMORY_RANGE:
834
835 acpi_os_printf (" Resource Type: Memory Range\n");
836
837 switch (address64_data->attribute.memory.cache_attribute) {
838 case ACPI_NON_CACHEABLE_MEMORY:
839 acpi_os_printf (" Type Specific: Noncacheable memory\n");
840 break;
841
842 case ACPI_CACHABLE_MEMORY:
843 acpi_os_printf (" Type Specific: Cacheable memory\n");
844 break;
845
846 case ACPI_WRITE_COMBINING_MEMORY:
847 acpi_os_printf (" Type Specific: Write-combining memory\n");
848 break;
849
850 case ACPI_PREFETCHABLE_MEMORY:
851 acpi_os_printf (" Type Specific: Prefetchable memory\n");
852 break;
853
854 default:
855 acpi_os_printf (" Type Specific: Invalid cache attribute\n");
856 break;
857 }
858
859 acpi_os_printf (" Type Specific: Read%s\n",
860 ACPI_READ_WRITE_MEMORY ==
861 address64_data->attribute.memory.read_write_attribute ?
862 "/Write" : " Only");
863 break;
864
865 case ACPI_IO_RANGE:
866
867 acpi_os_printf (" Resource Type: Io Range\n");
868
869 switch (address64_data->attribute.io.range_attribute) {
870 case ACPI_NON_ISA_ONLY_RANGES:
871 acpi_os_printf (" Type Specific: Non-ISA Io Addresses\n");
872 break;
873
874 case ACPI_ISA_ONLY_RANGES:
875 acpi_os_printf (" Type Specific: ISA Io Addresses\n");
876 break;
877
878 case ACPI_ENTIRE_RANGE:
879 acpi_os_printf (" Type Specific: ISA and non-ISA Io Addresses\n");
880 break;
881
882 default:
883 acpi_os_printf (" Type Specific: Invalid Range attribute");
884 break;
885 }
886
887 acpi_os_printf (" Type Specific: %s Translation\n",
888 ACPI_SPARSE_TRANSLATION ==
889 address64_data->attribute.io.translation_attribute ?
890 "Sparse" : "Dense");
891 break;
892
893 case ACPI_BUS_NUMBER_RANGE:
894
895 acpi_os_printf (" Resource Type: Bus Number Range\n");
896 break;
897
898 default:
899
900 acpi_os_printf (" Resource Type: 0x%2.2X\n",
901 address64_data->resource_type);
902 break;
903 }
904
905 acpi_os_printf (" Resource %s\n",
906 ACPI_CONSUMER == address64_data->producer_consumer ?
907 "Consumer" : "Producer");
908
909 acpi_os_printf (" %s decode\n",
910 ACPI_SUB_DECODE == address64_data->decode ?
911 "Subtractive" : "Positive");
912
913 acpi_os_printf (" Min address is %s fixed\n",
914 ACPI_ADDRESS_FIXED == address64_data->min_address_fixed ?
915 "" : "not ");
916
917 acpi_os_printf (" Max address is %s fixed\n",
918 ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ?
919 "" : "not ");
920
921 acpi_os_printf (" Granularity: %8.8X%8.8X\n",
922 ACPI_FORMAT_UINT64 (address64_data->granularity));
923
924 acpi_os_printf (" Address range min: %8.8X%8.8X\n",
925 ACPI_FORMAT_UINT64 (address64_data->min_address_range));
926
927 acpi_os_printf (" Address range max: %8.8X%8.8X\n",
928 ACPI_FORMAT_UINT64 (address64_data->max_address_range));
929
930 acpi_os_printf (" Address translation offset: %8.8X%8.8X\n",
931 ACPI_FORMAT_UINT64 (address64_data->address_translation_offset));
932
933 acpi_os_printf (" Address Length: %8.8X%8.8X\n",
934 ACPI_FORMAT_UINT64 (address64_data->address_length));
935
936 acpi_os_printf (" Type Specific Attributes: %8.8X%8.8X\n",
937 ACPI_FORMAT_UINT64 (address64_data->type_specific_attributes));
938
939 if (0xFF != address64_data->resource_source.index) {
940 acpi_os_printf (" Resource Source Index: %X\n",
941 address64_data->resource_source.index);
942
943 acpi_os_printf (" Resource Source: %s\n",
944 address64_data->resource_source.string_ptr);
945 }
946
947 return;
948 }
949
950
951 /*******************************************************************************
952 *
953 * FUNCTION: acpi_rs_dump_extended_irq
954 *
955 * PARAMETERS: Data - pointer to the resource structure to dump.
956 *
957 * RETURN: None
958 *
959 * DESCRIPTION: Prints out the various members of the Data structure type.
960 *
961 ******************************************************************************/
962
963 static void
964 acpi_rs_dump_extended_irq (
965 union acpi_resource_data *data)
966 {
967 struct acpi_resource_ext_irq *ext_irq_data = (struct acpi_resource_ext_irq *) data;
968 u8 index = 0;
969
970
971 ACPI_FUNCTION_ENTRY ();
972
973
974 acpi_os_printf ("Extended IRQ Resource\n");
975
976 acpi_os_printf (" Resource %s\n",
977 ACPI_CONSUMER == ext_irq_data->producer_consumer ?
978 "Consumer" : "Producer");
979
980 acpi_os_printf (" %s\n",
981 ACPI_LEVEL_SENSITIVE == ext_irq_data->edge_level ?
982 "Level" : "Edge");
983
984 acpi_os_printf (" Active %s\n",
985 ACPI_ACTIVE_LOW == ext_irq_data->active_high_low ?
986 "low" : "high");
987
988 acpi_os_printf (" %s\n",
989 ACPI_SHARED == ext_irq_data->shared_exclusive ?
990 "Shared" : "Exclusive");
991
992 acpi_os_printf (" Interrupts : %X ( ", ext_irq_data->number_of_interrupts);
993
994 for (index = 0; index < ext_irq_data->number_of_interrupts; index++) {
995 acpi_os_printf ("%X ", ext_irq_data->interrupts[index]);
996 }
997
998 acpi_os_printf (")\n");
999
1000 if(0xFF != ext_irq_data->resource_source.index) {
1001 acpi_os_printf (" Resource Source Index: %X",
1002 ext_irq_data->resource_source.index);
1003
1004 acpi_os_printf (" Resource Source: %s",
1005 ext_irq_data->resource_source.string_ptr);
1006 }
1007
1008 return;
1009 }
1010
1011
1012 /*******************************************************************************
1013 *
1014 * FUNCTION: acpi_rs_dump_resource_list
1015 *
1016 * PARAMETERS: Resource - pointer to the resource structure to dump.
1017 *
1018 * RETURN: None
1019 *
1020 * DESCRIPTION: Dispatches the structure to the correct dump routine.
1021 *
1022 ******************************************************************************/
1023
1024 void
1025 acpi_rs_dump_resource_list (
1026 struct acpi_resource *resource)
1027 {
1028 u8 count = 0;
1029 u8 done = FALSE;
1030
1031
1032 ACPI_FUNCTION_ENTRY ();
1033
1034
1035 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
1036 while (!done) {
1037 acpi_os_printf ("Resource structure %X.\n", count++);
1038
1039 switch (resource->id) {
1040 case ACPI_RSTYPE_IRQ:
1041 acpi_rs_dump_irq (&resource->data);
1042 break;
1043
1044 case ACPI_RSTYPE_DMA:
1045 acpi_rs_dump_dma (&resource->data);
1046 break;
1047
1048 case ACPI_RSTYPE_START_DPF:
1049 acpi_rs_dump_start_depend_fns (&resource->data);
1050 break;
1051
1052 case ACPI_RSTYPE_END_DPF:
1053 acpi_os_printf ("end_dependent_functions Resource\n");
1054 /* acpi_rs_dump_end_dependent_functions (Resource->Data);*/
1055 break;
1056
1057 case ACPI_RSTYPE_IO:
1058 acpi_rs_dump_io (&resource->data);
1059 break;
1060
1061 case ACPI_RSTYPE_FIXED_IO:
1062 acpi_rs_dump_fixed_io (&resource->data);
1063 break;
1064
1065 case ACPI_RSTYPE_VENDOR:
1066 acpi_rs_dump_vendor_specific (&resource->data);
1067 break;
1068
1069 case ACPI_RSTYPE_END_TAG:
1070 /*rs_dump_end_tag (Resource->Data);*/
1071 acpi_os_printf ("end_tag Resource\n");
1072 done = TRUE;
1073 break;
1074
1075 case ACPI_RSTYPE_MEM24:
1076 acpi_rs_dump_memory24 (&resource->data);
1077 break;
1078
1079 case ACPI_RSTYPE_MEM32:
1080 acpi_rs_dump_memory32 (&resource->data);
1081 break;
1082
1083 case ACPI_RSTYPE_FIXED_MEM32:
1084 acpi_rs_dump_fixed_memory32 (&resource->data);
1085 break;
1086
1087 case ACPI_RSTYPE_ADDRESS16:
1088 acpi_rs_dump_address16 (&resource->data);
1089 break;
1090
1091 case ACPI_RSTYPE_ADDRESS32:
1092 acpi_rs_dump_address32 (&resource->data);
1093 break;
1094
1095 case ACPI_RSTYPE_ADDRESS64:
1096 acpi_rs_dump_address64 (&resource->data);
1097 break;
1098
1099 case ACPI_RSTYPE_EXT_IRQ:
1100 acpi_rs_dump_extended_irq (&resource->data);
1101 break;
1102
1103 default:
1104 acpi_os_printf ("Invalid resource type\n");
1105 break;
1106
1107 }
1108
1109 resource = ACPI_PTR_ADD (struct acpi_resource, resource, resource->length);
1110 }
1111 }
1112
1113 return;
1114 }
1115
1116 /*******************************************************************************
1117 *
1118 * FUNCTION: acpi_rs_dump_irq_list
1119 *
1120 * PARAMETERS: route_table - pointer to the routing table to dump.
1121 *
1122 * RETURN: None
1123 *
1124 * DESCRIPTION: Dispatches the structures to the correct dump routine.
1125 *
1126 ******************************************************************************/
1127
1128 void
1129 acpi_rs_dump_irq_list (
1130 u8 *route_table)
1131 {
1132 u8 *buffer = route_table;
1133 u8 count = 0;
1134 u8 done = FALSE;
1135 struct acpi_pci_routing_table *prt_element;
1136
1137
1138 ACPI_FUNCTION_ENTRY ();
1139
1140
1141 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
1142 prt_element = ACPI_CAST_PTR (struct acpi_pci_routing_table, buffer);
1143
1144 while (!done) {
1145 acpi_os_printf ("PCI IRQ Routing Table structure %X.\n", count++);
1146
1147 acpi_os_printf (" Address: %8.8X%8.8X\n",
1148 ACPI_FORMAT_UINT64 (prt_element->address));
1149
1150 acpi_os_printf (" Pin: %X\n", prt_element->pin);
1151
1152 acpi_os_printf (" Source: %s\n", prt_element->source);
1153
1154 acpi_os_printf (" source_index: %X\n", prt_element->source_index);
1155
1156 buffer += prt_element->length;
1157 prt_element = ACPI_CAST_PTR (struct acpi_pci_routing_table, buffer);
1158 if (0 == prt_element->length) {
1159 done = TRUE;
1160 }
1161 }
1162 }
1163
1164 return;
1165 }
1166
1167 #endif
1168
This page took 0.053823 seconds and 6 git commands to generate.