1 /******************************************************************************
3 * Module Name: rsdump - Functions do dump out the resource structures.
6 *****************************************************************************/
9 * Copyright (C) 2000 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #define _COMPONENT RESOURCE_MANAGER
30 MODULE_NAME ("rsdump")
33 /******************************************************************************
35 * FUNCTION: Acpi_rs_dump_irq
37 * PARAMETERS: Data - pointer to the resource structure to dump.
41 * DESCRIPTION: Prints out the various members of the Data structure type.
43 ******************************************************************************/
49 IRQ_RESOURCE
*irq_data
= (IRQ_RESOURCE
*) data
;
53 acpi_os_printf ("\t_iRQ Resource\n");
55 acpi_os_printf ("\t\t%s Triggered\n",
56 LEVEL_SENSITIVE
== irq_data
->edge_level
?
59 acpi_os_printf ("\t\t_active %s\n",
60 ACTIVE_LOW
== irq_data
->active_high_low
?
63 acpi_os_printf ("\t\t%s\n",
64 SHARED
== irq_data
->shared_exclusive
?
65 "Shared" : "Exclusive");
67 acpi_os_printf ("\t\t%d Interrupts ( ",
68 irq_data
->number_of_interrupts
);
70 for (index
= 0; index
< irq_data
->number_of_interrupts
; index
++) {
71 acpi_os_printf ("%d ", irq_data
->interrupts
[index
]);
74 acpi_os_printf (")\n");
79 /******************************************************************************
81 * FUNCTION: Acpi_rs_dump_dma
83 * PARAMETERS: Data - pointer to the resource structure to dump.
87 * DESCRIPTION: Prints out the various members of the Data structure type.
89 ******************************************************************************/
95 DMA_RESOURCE
*dma_data
= (DMA_RESOURCE
*) data
;
99 acpi_os_printf ("\t_dMA Resource\n");
101 switch (dma_data
->type
)
104 acpi_os_printf ("\t\t_compatibility mode\n");
108 acpi_os_printf ("\t\t_type A\n");
112 acpi_os_printf ("\t\t_type B\n");
116 acpi_os_printf ("\t\t_type F\n");
120 acpi_os_printf ("\t\t_invalid DMA type\n");
124 acpi_os_printf ("\t\t%sBus Master\n",
125 BUS_MASTER
== dma_data
->bus_master
?
128 switch (dma_data
->transfer
)
131 acpi_os_printf ("\t\t8-bit only transfer\n");
135 acpi_os_printf ("\t\t8 and 16-bit transfer\n");
139 acpi_os_printf ("\t\t16 bit only transfer\n");
143 acpi_os_printf ("\t\t_invalid transfer preference\n");
147 acpi_os_printf ("\t\t_number of Channels: %d ( ",
148 dma_data
->number_of_channels
);
150 for (index
= 0; index
< dma_data
->number_of_channels
; index
++) {
151 acpi_os_printf ("%d ", dma_data
->channels
[index
]);
154 acpi_os_printf (")\n");
159 /******************************************************************************
161 * FUNCTION: Acpi_rs_dump_start_dependent_functions
163 * PARAMETERS: Data - pointer to the resource structure to dump.
167 * DESCRIPTION: Prints out the various members of the Data structure type.
169 ******************************************************************************/
172 acpi_rs_dump_start_dependent_functions (
175 START_DEPENDENT_FUNCTIONS_RESOURCE
*sdf_data
=
176 (START_DEPENDENT_FUNCTIONS_RESOURCE
*) data
;
179 acpi_os_printf ("\t_start Dependent Functions Resource\n");
181 switch (sdf_data
->compatibility_priority
)
183 case GOOD_CONFIGURATION
:
184 acpi_os_printf ("\t\t_good configuration\n");
187 case ACCEPTABLE_CONFIGURATION
:
188 acpi_os_printf ("\t\t_acceptable configuration\n");
191 case SUB_OPTIMAL_CONFIGURATION
:
192 acpi_os_printf ("\t\t_sub-optimal configuration\n");
196 acpi_os_printf ("\t\t_invalid compatibility priority\n");
200 switch(sdf_data
->performance_robustness
)
202 case GOOD_CONFIGURATION
:
203 acpi_os_printf ("\t\t_good configuration\n");
206 case ACCEPTABLE_CONFIGURATION
:
207 acpi_os_printf ("\t\t_acceptable configuration\n");
210 case SUB_OPTIMAL_CONFIGURATION
:
211 acpi_os_printf ("\t\t_sub-optimal configuration\n");
215 acpi_os_printf ("\t\t_invalid performance "
216 "robustness preference\n");
224 /******************************************************************************
226 * FUNCTION: Acpi_rs_dump_io
228 * PARAMETERS: Data - pointer to the resource structure to dump.
232 * DESCRIPTION: Prints out the various members of the Data structure type.
234 ******************************************************************************/
240 IO_RESOURCE
*io_data
= (IO_RESOURCE
*) data
;
243 acpi_os_printf ("\t_io Resource\n");
245 acpi_os_printf ("\t\t%d bit decode\n",
246 DECODE_16
== io_data
->io_decode
? 16 : 10);
248 acpi_os_printf ("\t\t_range minimum base: 0x%08x\n",
249 io_data
->min_base_address
);
251 acpi_os_printf ("\t\t_range maximum base: 0x%08x\n",
252 io_data
->max_base_address
);
254 acpi_os_printf ("\t\t_alignment: 0x%08x\n",
257 acpi_os_printf ("\t\t_range Length: 0x%08x\n",
258 io_data
->range_length
);
264 /******************************************************************************
266 * FUNCTION: Acpi_rs_dump_fixed_io
268 * PARAMETERS: Data - pointer to the resource structure to dump.
272 * DESCRIPTION: Prints out the various members of the Data structure type.
274 ******************************************************************************/
277 acpi_rs_dump_fixed_io (
280 FIXED_IO_RESOURCE
*fixed_io_data
= (FIXED_IO_RESOURCE
*) data
;
283 acpi_os_printf ("\t_fixed Io Resource\n");
284 acpi_os_printf ("\t\t_range base address: 0x%08x",
285 fixed_io_data
->base_address
);
287 acpi_os_printf ("\t\t_range length: 0x%08x",
288 fixed_io_data
->range_length
);
294 /******************************************************************************
296 * FUNCTION: Acpi_rs_dump_vendor_specific
298 * PARAMETERS: Data - pointer to the resource structure to dump.
302 * DESCRIPTION: Prints out the various members of the Data structure type.
304 ******************************************************************************/
307 acpi_rs_dump_vendor_specific (
310 VENDOR_RESOURCE
*vendor_data
= (VENDOR_RESOURCE
*) data
;
314 acpi_os_printf ("\t_vendor Specific Resource\n");
316 acpi_os_printf ("\t\t_length: 0x%08x\n", vendor_data
->length
);
318 for (index
= 0; index
< vendor_data
->length
; index
++) {
319 acpi_os_printf ("\t\t_byte %d: 0x%08x\n",
320 index
, vendor_data
->reserved
[index
]);
327 /******************************************************************************
329 * FUNCTION: Acpi_rs_dump_memory24
331 * PARAMETERS: Data - pointer to the resource structure to dump.
335 * DESCRIPTION: Prints out the various members of the Data structure type.
337 ******************************************************************************/
340 acpi_rs_dump_memory24 (
343 MEMORY24_RESOURCE
*memory24_data
= (MEMORY24_RESOURCE
*) data
;
346 acpi_os_printf ("\t24-Bit Memory Range Resource\n");
348 acpi_os_printf ("\t\t_read%s\n",
350 memory24_data
->read_write_attribute
?
353 acpi_os_printf ("\t\t_range minimum base: 0x%08x\n",
354 memory24_data
->min_base_address
);
356 acpi_os_printf ("\t\t_range maximum base: 0x%08x\n",
357 memory24_data
->max_base_address
);
359 acpi_os_printf ("\t\t_alignment: 0x%08x\n",
360 memory24_data
->alignment
);
362 acpi_os_printf ("\t\t_range length: 0x%08x\n",
363 memory24_data
->range_length
);
369 /******************************************************************************
371 * FUNCTION: Acpi_rs_dump_memory32
373 * PARAMETERS: Data - pointer to the resource structure to dump.
377 * DESCRIPTION: Prints out the various members of the Data structure type.
379 ******************************************************************************/
382 acpi_rs_dump_memory32 (
385 MEMORY32_RESOURCE
*memory32_data
= (MEMORY32_RESOURCE
*) data
;
388 acpi_os_printf ("\t32-Bit Memory Range Resource\n");
390 acpi_os_printf ("\t\t_read%s\n",
392 memory32_data
->read_write_attribute
?
395 acpi_os_printf ("\t\t_range minimum base: 0x%08x\n",
396 memory32_data
->min_base_address
);
398 acpi_os_printf ("\t\t_range maximum base: 0x%08x\n",
399 memory32_data
->max_base_address
);
401 acpi_os_printf ("\t\t_alignment: 0x%08x\n",
402 memory32_data
->alignment
);
404 acpi_os_printf ("\t\t_range length: 0x%08x\n",
405 memory32_data
->range_length
);
411 /******************************************************************************
413 * FUNCTION: Acpi_rs_dump_fixed_memory32
415 * PARAMETERS: Data - pointer to the resource structure to dump.
419 * DESCRIPTION: Prints out the various members of the Data structure type.
421 ******************************************************************************/
424 acpi_rs_dump_fixed_memory32 (
427 FIXED_MEMORY32_RESOURCE
*fixed_memory32_data
= (FIXED_MEMORY32_RESOURCE
*) data
;
430 acpi_os_printf ("\t32-Bit Fixed Location Memory Range Resource\n");
432 acpi_os_printf ("\t\t_read%s\n",
434 fixed_memory32_data
->read_write_attribute
?
437 acpi_os_printf ("\t\t_range base address: 0x%08x\n",
438 fixed_memory32_data
->range_base_address
);
440 acpi_os_printf ("\t\t_range length: 0x%08x\n",
441 fixed_memory32_data
->range_length
);
447 /******************************************************************************
449 * FUNCTION: Acpi_rs_dump_address16
451 * PARAMETERS: Data - pointer to the resource structure to dump.
455 * DESCRIPTION: Prints out the various members of the Data structure type.
457 ******************************************************************************/
460 acpi_rs_dump_address16 (
463 ADDRESS16_RESOURCE
*address16_data
= (ADDRESS16_RESOURCE
*) data
;
466 acpi_os_printf ("\t16-Bit Address Space Resource\n");
467 acpi_os_printf ("\t\t_resource Type: ");
469 switch (address16_data
->resource_type
)
473 acpi_os_printf ("Memory Range\n");
475 switch (address16_data
->attribute
.memory
.cache_attribute
)
477 case NON_CACHEABLE_MEMORY
:
478 acpi_os_printf ("\t\t_type Specific: "
479 "Noncacheable memory\n");
482 case CACHABLE_MEMORY
:
483 acpi_os_printf ("\t\t_type Specific: "
484 "Cacheable memory\n");
487 case WRITE_COMBINING_MEMORY
:
488 acpi_os_printf ("\t\t_type Specific: "
489 "Write-combining memory\n");
492 case PREFETCHABLE_MEMORY
:
493 acpi_os_printf ("\t\t_type Specific: "
494 "Prefetchable memory\n");
498 acpi_os_printf ("\t\t_type Specific: "
499 "Invalid cache attribute\n");
503 acpi_os_printf ("\t\t_type Specific: Read%s\n",
505 address16_data
->attribute
.memory
.read_write_attribute
?
511 acpi_os_printf ("I/O Range\n");
513 switch (address16_data
->attribute
.io
.range_attribute
)
515 case NON_ISA_ONLY_RANGES
:
516 acpi_os_printf ("\t\t_type Specific: "
517 "Non-ISA Io Addresses\n");
520 case ISA_ONLY_RANGES
:
521 acpi_os_printf ("\t\t_type Specific: "
522 "ISA Io Addresses\n");
526 acpi_os_printf ("\t\t_type Specific: "
527 "ISA and non-ISA Io Addresses\n");
531 acpi_os_printf ("\t\t_type Specific: "
532 "Invalid range attribute\n");
537 case BUS_NUMBER_RANGE
:
539 acpi_os_printf ("Bus Number Range\n");
544 acpi_os_printf ("Invalid resource type. Exiting.\n");
548 acpi_os_printf ("\t\t_resource %s\n",
549 CONSUMER
== address16_data
->producer_consumer
?
550 "Consumer" : "Producer");
552 acpi_os_printf ("\t\t%s decode\n",
553 SUB_DECODE
== address16_data
->decode
?
554 "Subtractive" : "Positive");
556 acpi_os_printf ("\t\t_min address is %s fixed\n",
557 ADDRESS_FIXED
== address16_data
->min_address_fixed
?
560 acpi_os_printf ("\t\t_max address is %s fixed\n",
561 ADDRESS_FIXED
== address16_data
->max_address_fixed
?
564 acpi_os_printf ("\t\t_granularity: 0x%08x\n",
565 address16_data
->granularity
);
567 acpi_os_printf ("\t\t_address range min: 0x%08x\n",
568 address16_data
->min_address_range
);
570 acpi_os_printf ("\t\t_address range max: 0x%08x\n",
571 address16_data
->max_address_range
);
573 acpi_os_printf ("\t\t_address translation offset: 0x%08x\n",
574 address16_data
->address_translation_offset
);
576 acpi_os_printf ("\t\t_address Length: 0x%08x\n",
577 address16_data
->address_length
);
579 if (0xFF != address16_data
->resource_source_index
) {
580 acpi_os_printf ("\t\t_resource Source Index: %d\n",
581 address16_data
->resource_source_index
);
582 acpi_os_printf ("\t\t_resource Source: %s\n",
583 address16_data
->resource_source
);
590 /******************************************************************************
592 * FUNCTION: Acpi_rs_dump_address32
594 * PARAMETERS: Data - pointer to the resource structure to dump.
598 * DESCRIPTION: Prints out the various members of the Data structure type.
600 ******************************************************************************/
603 acpi_rs_dump_address32 (
606 ADDRESS32_RESOURCE
*address32_data
= (ADDRESS32_RESOURCE
*) data
;
609 acpi_os_printf ("\t32-Bit Address Space Resource\n");
611 switch (address32_data
->resource_type
)
615 acpi_os_printf ("\t\t_resource Type: Memory Range\n");
617 switch (address32_data
->attribute
.memory
.cache_attribute
)
619 case NON_CACHEABLE_MEMORY
:
620 acpi_os_printf ("\t\t_type Specific: "
621 "Noncacheable memory\n");
624 case CACHABLE_MEMORY
:
625 acpi_os_printf ("\t\t_type Specific: "
626 "Cacheable memory\n");
629 case WRITE_COMBINING_MEMORY
:
630 acpi_os_printf ("\t\t_type Specific: "
631 "Write-combining memory\n");
634 case PREFETCHABLE_MEMORY
:
635 acpi_os_printf ("\t\t_type Specific: "
636 "Prefetchable memory\n");
640 acpi_os_printf ("\t\t_type Specific: "
641 "Invalid cache attribute\n");
645 acpi_os_printf ("\t\t_type Specific: Read%s\n",
647 address32_data
->attribute
.memory
.read_write_attribute
?
653 acpi_os_printf ("\t\t_resource Type: Io Range\n");
655 switch (address32_data
->attribute
.io
.range_attribute
)
657 case NON_ISA_ONLY_RANGES
:
658 acpi_os_printf ("\t\t_type Specific: "
659 "Non-ISA Io Addresses\n");
662 case ISA_ONLY_RANGES
:
663 acpi_os_printf ("\t\t_type Specific: "
664 "ISA Io Addresses\n");
668 acpi_os_printf ("\t\t_type Specific: "
669 "ISA and non-ISA Io Addresses\n");
673 acpi_os_printf ("\t\t_type Specific: "
674 "Invalid Range attribute");
679 case BUS_NUMBER_RANGE
:
681 acpi_os_printf ("\t\t_resource Type: Bus Number Range\n");
686 acpi_os_printf ("\t\t_invalid Resource Type..exiting.\n");
690 acpi_os_printf ("\t\t_resource %s\n",
691 CONSUMER
== address32_data
->producer_consumer
?
692 "Consumer" : "Producer");
694 acpi_os_printf ("\t\t%s decode\n",
695 SUB_DECODE
== address32_data
->decode
?
696 "Subtractive" : "Positive");
698 acpi_os_printf ("\t\t_min address is %s fixed\n",
699 ADDRESS_FIXED
== address32_data
->min_address_fixed
?
702 acpi_os_printf ("\t\t_max address is %s fixed\n",
703 ADDRESS_FIXED
== address32_data
->max_address_fixed
?
706 acpi_os_printf ("\t\t_granularity: 0x%08x\n",
707 address32_data
->granularity
);
709 acpi_os_printf ("\t\t_address range min: 0x%08x\n",
710 address32_data
->min_address_range
);
712 acpi_os_printf ("\t\t_address range max: 0x%08x\n",
713 address32_data
->max_address_range
);
715 acpi_os_printf ("\t\t_address translation offset: 0x%08x\n",
716 address32_data
->address_translation_offset
);
718 acpi_os_printf ("\t\t_address Length: 0x%08x\n",
719 address32_data
->address_length
);
721 if(0xFF != address32_data
->resource_source_index
) {
722 acpi_os_printf ("\t\t_resource Source Index: %d\n",
723 address32_data
->resource_source_index
);
724 acpi_os_printf ("\t\t_resource Source: %s\n",
725 address32_data
->resource_source
);
732 /******************************************************************************
734 * FUNCTION: Acpi_rs_dump_extended_irq
736 * PARAMETERS: Data - pointer to the resource structure to dump.
740 * DESCRIPTION: Prints out the various members of the Data structure type.
742 ******************************************************************************/
745 acpi_rs_dump_extended_irq (
748 EXTENDED_IRQ_RESOURCE
*ext_irq_data
= (EXTENDED_IRQ_RESOURCE
*) data
;
752 acpi_os_printf ("\t_extended IRQ Resource\n");
754 acpi_os_printf ("\t\t_resource %s\n",
755 CONSUMER
== ext_irq_data
->producer_consumer
?
756 "Consumer" : "Producer");
758 acpi_os_printf ("\t\t%s\n",
759 LEVEL_SENSITIVE
== ext_irq_data
->edge_level
?
762 acpi_os_printf ("\t\t_active %s\n",
763 ACTIVE_LOW
== ext_irq_data
->active_high_low
?
766 acpi_os_printf ("\t\t%s\n",
767 SHARED
== ext_irq_data
->shared_exclusive
?
768 "Shared" : "Exclusive");
770 acpi_os_printf ("\t\t_interrupts : %d ( ",
771 ext_irq_data
->number_of_interrupts
);
773 for (index
= 0; index
< ext_irq_data
->number_of_interrupts
; index
++) {
774 acpi_os_printf ("%d ", ext_irq_data
->interrupts
[index
]);
777 acpi_os_printf (")\n");
779 if(0xFF != ext_irq_data
->resource_source_index
) {
780 acpi_os_printf ("\t\t_resource Source Index: %d",
781 ext_irq_data
->resource_source_index
);
782 acpi_os_printf ("\t\t_resource Source: %s",
783 ext_irq_data
->resource_source
);
790 /******************************************************************************
792 * FUNCTION: Acpi_rs_dump_resource_list
794 * PARAMETERS: Data - pointer to the resource structure to dump.
798 * DESCRIPTION: Dispatches the structure to the correct dump routine.
800 ******************************************************************************/
803 acpi_rs_dump_resource_list (
810 if (acpi_dbg_level
& TRACE_RESOURCES
&& _COMPONENT
& acpi_dbg_layer
) {
812 acpi_os_printf ("\t_resource structure %x.\n", count
++);
814 switch (resource
->id
)
817 acpi_rs_dump_irq (&resource
->data
);
821 acpi_rs_dump_dma (&resource
->data
);
824 case start_dependent_functions
:
825 acpi_rs_dump_start_dependent_functions (&resource
->data
);
828 case end_dependent_functions
:
829 acpi_os_printf ("\t_end_dependent_functions Resource\n");
830 /* Acpi_rs_dump_end_dependent_functions (Resource->Data);*/
834 acpi_rs_dump_io (&resource
->data
);
838 acpi_rs_dump_fixed_io (&resource
->data
);
841 case vendor_specific
:
842 acpi_rs_dump_vendor_specific (&resource
->data
);
846 /*Rs_dump_end_tag (Resource->Data);*/
847 acpi_os_printf ("\t_end_tag Resource\n");
852 acpi_rs_dump_memory24 (&resource
->data
);
856 acpi_rs_dump_memory32 (&resource
->data
);
860 acpi_rs_dump_fixed_memory32 (&resource
->data
);
864 acpi_rs_dump_address16 (&resource
->data
);
868 acpi_rs_dump_address32 (&resource
->data
);
872 acpi_rs_dump_extended_irq (&resource
->data
);
876 acpi_os_printf ("Invalid resource type\n");
881 resource
= (RESOURCE
*) ((NATIVE_UINT
) resource
+
882 (NATIVE_UINT
) resource
->length
);
889 /******************************************************************************
891 * FUNCTION: Acpi_rs_dump_irq_list
893 * PARAMETERS: Data - pointer to the routing table to dump.
897 * DESCRIPTION: Dispatches the structures to the correct dump routine.
899 ******************************************************************************/
902 acpi_rs_dump_irq_list (
905 u8
*buffer
= route_table
;
908 PCI_ROUTING_TABLE
*prt_element
;
911 if (acpi_dbg_level
& TRACE_RESOURCES
&& _COMPONENT
& acpi_dbg_layer
) {
912 prt_element
= (PCI_ROUTING_TABLE
*)buffer
;
915 acpi_os_printf ("\t_pCI IRQ Routing Table structure %x.\n", count
++);
917 acpi_os_printf ("\t\t_address: 0x%x\n",
918 prt_element
->data
.address
);
920 acpi_os_printf ("\t\t_pin: 0x%x\n", prt_element
->data
.pin
);
922 acpi_os_printf ("\t\t_source: %s\n", prt_element
->data
.source
);
924 acpi_os_printf ("\t\t_source_index: 0x%x\n",
925 prt_element
->data
.source_index
);
927 buffer
+= prt_element
->length
;
929 prt_element
= (PCI_ROUTING_TABLE
*)buffer
;
931 if(0 == prt_element
->length
) {