1 /*******************************************************************************
3 * Module Name: rsdump - Functions do dump out the resource structures.
6 ******************************************************************************/
9 * Copyright (C) 2000, 2001 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
30 #define _COMPONENT ACPI_RESOURCES
31 MODULE_NAME ("rsdump")
34 /*******************************************************************************
36 * FUNCTION: Acpi_rs_dump_irq
38 * PARAMETERS: Data - pointer to the resource structure to dump.
42 * DESCRIPTION: Prints out the various members of the Data structure type.
44 ******************************************************************************/
50 IRQ_RESOURCE *irq_data = (IRQ_RESOURCE*) data;
54 acpi_os_printf ("\t_iRQ Resource\n");
56 acpi_os_printf ("\t\t%s Triggered\n",
57 LEVEL_SENSITIVE == irq_data->edge_level ?
60 acpi_os_printf ("\t\t_active %s\n",
61 ACTIVE_LOW == irq_data->active_high_low ?
64 acpi_os_printf ("\t\t%s\n",
65 SHARED == irq_data->shared_exclusive ?
66 "Shared" : "Exclusive");
68 acpi_os_printf ("\t\t%X Interrupts ( ",
69 irq_data->number_of_interrupts);
71 for (index = 0; index < irq_data->number_of_interrupts; index++) {
72 acpi_os_printf ("%X ", irq_data->interrupts[index]);
75 acpi_os_printf (")\n");
80 /*******************************************************************************
82 * FUNCTION: Acpi_rs_dump_dma
84 * PARAMETERS: Data - pointer to the resource structure to dump.
88 * DESCRIPTION: Prints out the various members of the Data structure type.
90 ******************************************************************************/
96 DMA_RESOURCE *dma_data = (DMA_RESOURCE*) data;
100 acpi_os_printf ("\t_dMA Resource\n");
102 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) {
130 acpi_os_printf ("\t\t8-bit only transfer\n");
134 acpi_os_printf ("\t\t8 and 16-bit transfer\n");
138 acpi_os_printf ("\t\t16 bit only transfer\n");
142 acpi_os_printf ("\t\t_invalid transfer preference\n");
146 acpi_os_printf ("\t\t_number of Channels: %X ( ",
147 dma_data->number_of_channels);
149 for (index = 0; index < dma_data->number_of_channels; index++) {
150 acpi_os_printf ("%X ", dma_data->channels[index]);
153 acpi_os_printf (")\n");
158 /*******************************************************************************
160 * FUNCTION: Acpi_rs_dump_start_dependent_functions
162 * PARAMETERS: Data - pointer to the resource structure to dump.
166 * DESCRIPTION: Prints out the various members of the Data structure type.
168 ******************************************************************************/
171 acpi_rs_dump_start_dependent_functions (
174 START_DEPENDENT_FUNCTIONS_RESOURCE *sdf_data =
175 (START_DEPENDENT_FUNCTIONS_RESOURCE*) data;
178 acpi_os_printf ("\t_start Dependent Functions Resource\n");
180 switch (sdf_data->compatibility_priority) {
181 case GOOD_CONFIGURATION:
182 acpi_os_printf ("\t\t_good configuration\n");
185 case ACCEPTABLE_CONFIGURATION:
186 acpi_os_printf ("\t\t_acceptable configuration\n");
189 case SUB_OPTIMAL_CONFIGURATION:
190 acpi_os_printf ("\t\t_sub-optimal configuration\n");
194 acpi_os_printf ("\t\t_invalid compatibility priority\n");
198 switch(sdf_data->performance_robustness) {
199 case GOOD_CONFIGURATION:
200 acpi_os_printf ("\t\t_good configuration\n");
203 case ACCEPTABLE_CONFIGURATION:
204 acpi_os_printf ("\t\t_acceptable configuration\n");
207 case SUB_OPTIMAL_CONFIGURATION:
208 acpi_os_printf ("\t\t_sub-optimal configuration\n");
212 acpi_os_printf ("\t\t_invalid performance "
213 "robustness preference\n");
221 /*******************************************************************************
223 * FUNCTION: Acpi_rs_dump_io
225 * PARAMETERS: Data - pointer to the resource structure to dump.
229 * DESCRIPTION: Prints out the various members of the Data structure type.
231 ******************************************************************************/
237 IO_RESOURCE *io_data = (IO_RESOURCE*) data;
240 acpi_os_printf ("\t_io Resource\n");
242 acpi_os_printf ("\t\t%d bit decode\n",
243 DECODE_16 == io_data->io_decode ? 16 : 10);
245 acpi_os_printf ("\t\t_range minimum base: %08X\n",
246 io_data->min_base_address);
248 acpi_os_printf ("\t\t_range maximum base: %08X\n",
249 io_data->max_base_address);
251 acpi_os_printf ("\t\t_alignment: %08X\n",
254 acpi_os_printf ("\t\t_range Length: %08X\n",
255 io_data->range_length);
261 /*******************************************************************************
263 * FUNCTION: Acpi_rs_dump_fixed_io
265 * PARAMETERS: Data - pointer to the resource structure to dump.
269 * DESCRIPTION: Prints out the various members of the Data structure type.
271 ******************************************************************************/
274 acpi_rs_dump_fixed_io (
277 FIXED_IO_RESOURCE *fixed_io_data = (FIXED_IO_RESOURCE*) data;
280 acpi_os_printf ("\t_fixed Io Resource\n");
281 acpi_os_printf ("\t\t_range base address: %08X",
282 fixed_io_data->base_address);
284 acpi_os_printf ("\t\t_range length: %08X",
285 fixed_io_data->range_length);
291 /*******************************************************************************
293 * FUNCTION: Acpi_rs_dump_vendor_specific
295 * PARAMETERS: Data - pointer to the resource structure to dump.
299 * DESCRIPTION: Prints out the various members of the Data structure type.
301 ******************************************************************************/
304 acpi_rs_dump_vendor_specific (
307 VENDOR_RESOURCE *vendor_data = (VENDOR_RESOURCE*) data;
311 acpi_os_printf ("\t_vendor Specific Resource\n");
313 acpi_os_printf ("\t\t_length: %08X\n", vendor_data->length);
315 for (index = 0; index < vendor_data->length; index++) {
316 acpi_os_printf ("\t\t_byte %X: %08X\n",
317 index, vendor_data->reserved[index]);
324 /*******************************************************************************
326 * FUNCTION: Acpi_rs_dump_memory24
328 * PARAMETERS: Data - pointer to the resource structure to dump.
332 * DESCRIPTION: Prints out the various members of the Data structure type.
334 ******************************************************************************/
337 acpi_rs_dump_memory24 (
340 MEMORY24_RESOURCE *memory24_data = (MEMORY24_RESOURCE*) data;
343 acpi_os_printf ("\t24-Bit Memory Range Resource\n");
345 acpi_os_printf ("\t\t_read%s\n",
347 memory24_data->read_write_attribute ?
350 acpi_os_printf ("\t\t_range minimum base: %08X\n",
351 memory24_data->min_base_address);
353 acpi_os_printf ("\t\t_range maximum base: %08X\n",
354 memory24_data->max_base_address);
356 acpi_os_printf ("\t\t_alignment: %08X\n",
357 memory24_data->alignment);
359 acpi_os_printf ("\t\t_range length: %08X\n",
360 memory24_data->range_length);
366 /*******************************************************************************
368 * FUNCTION: Acpi_rs_dump_memory32
370 * PARAMETERS: Data - pointer to the resource structure to dump.
374 * DESCRIPTION: Prints out the various members of the Data structure type.
376 ******************************************************************************/
379 acpi_rs_dump_memory32 (
382 MEMORY32_RESOURCE *memory32_data = (MEMORY32_RESOURCE*) data;
385 acpi_os_printf ("\t32-Bit Memory Range Resource\n");
387 acpi_os_printf ("\t\t_read%s\n",
389 memory32_data->read_write_attribute ?
392 acpi_os_printf ("\t\t_range minimum base: %08X\n",
393 memory32_data->min_base_address);
395 acpi_os_printf ("\t\t_range maximum base: %08X\n",
396 memory32_data->max_base_address);
398 acpi_os_printf ("\t\t_alignment: %08X\n",
399 memory32_data->alignment);
401 acpi_os_printf ("\t\t_range length: %08X\n",
402 memory32_data->range_length);
408 /*******************************************************************************
410 * FUNCTION: Acpi_rs_dump_fixed_memory32
412 * PARAMETERS: Data - pointer to the resource structure to dump.
416 * DESCRIPTION: Prints out the various members of the Data structure type.
418 ******************************************************************************/
421 acpi_rs_dump_fixed_memory32 (
424 FIXED_MEMORY32_RESOURCE *fixed_memory32_data = (FIXED_MEMORY32_RESOURCE*) data;
427 acpi_os_printf ("\t32-Bit Fixed Location Memory Range Resource\n");
429 acpi_os_printf ("\t\t_read%s\n",
431 fixed_memory32_data->read_write_attribute ?
434 acpi_os_printf ("\t\t_range base address: %08X\n",
435 fixed_memory32_data->range_base_address);
437 acpi_os_printf ("\t\t_range length: %08X\n",
438 fixed_memory32_data->range_length);
444 /*******************************************************************************
446 * FUNCTION: Acpi_rs_dump_address16
448 * PARAMETERS: Data - pointer to the resource structure to dump.
452 * DESCRIPTION: Prints out the various members of the Data structure type.
454 ******************************************************************************/
457 acpi_rs_dump_address16 (
460 ADDRESS16_RESOURCE *address16_data = (ADDRESS16_RESOURCE*) data;
463 acpi_os_printf ("\t16-Bit Address Space Resource\n");
464 acpi_os_printf ("\t\t_resource Type: ");
466 switch (address16_data->resource_type) {
469 acpi_os_printf ("Memory Range\n");
471 switch (address16_data->attribute.memory.cache_attribute) {
472 case NON_CACHEABLE_MEMORY:
473 acpi_os_printf ("\t\t_type Specific: "
474 "Noncacheable memory\n");
477 case CACHABLE_MEMORY:
478 acpi_os_printf ("\t\t_type Specific: "
479 "Cacheable memory\n");
482 case WRITE_COMBINING_MEMORY:
483 acpi_os_printf ("\t\t_type Specific: "
484 "Write-combining memory\n");
487 case PREFETCHABLE_MEMORY:
488 acpi_os_printf ("\t\t_type Specific: "
489 "Prefetchable memory\n");
493 acpi_os_printf ("\t\t_type Specific: "
494 "Invalid cache attribute\n");
498 acpi_os_printf ("\t\t_type Specific: Read%s\n",
500 address16_data->attribute.memory.read_write_attribute ?
506 acpi_os_printf ("I/O Range\n");
508 switch (address16_data->attribute.io.range_attribute) {
509 case NON_ISA_ONLY_RANGES:
510 acpi_os_printf ("\t\t_type Specific: "
511 "Non-ISA Io Addresses\n");
514 case ISA_ONLY_RANGES:
515 acpi_os_printf ("\t\t_type Specific: "
516 "ISA Io Addresses\n");
520 acpi_os_printf ("\t\t_type Specific: "
521 "ISA and non-ISA Io Addresses\n");
525 acpi_os_printf ("\t\t_type Specific: "
526 "Invalid range attribute\n");
531 case BUS_NUMBER_RANGE:
533 acpi_os_printf ("Bus Number Range\n");
538 acpi_os_printf ("Invalid resource type. Exiting.\n");
542 acpi_os_printf ("\t\t_resource %s\n",
543 CONSUMER == address16_data->producer_consumer ?
544 "Consumer" : "Producer");
546 acpi_os_printf ("\t\t%s decode\n",
547 SUB_DECODE == address16_data->decode ?
548 "Subtractive" : "Positive");
550 acpi_os_printf ("\t\t_min address is %s fixed\n",
551 ADDRESS_FIXED == address16_data->min_address_fixed ?
554 acpi_os_printf ("\t\t_max address is %s fixed\n",
555 ADDRESS_FIXED == address16_data->max_address_fixed ?
558 acpi_os_printf ("\t\t_granularity: %08X\n",
559 address16_data->granularity);
561 acpi_os_printf ("\t\t_address range min: %08X\n",
562 address16_data->min_address_range);
564 acpi_os_printf ("\t\t_address range max: %08X\n",
565 address16_data->max_address_range);
567 acpi_os_printf ("\t\t_address translation offset: %08X\n",
568 address16_data->address_translation_offset);
570 acpi_os_printf ("\t\t_address Length: %08X\n",
571 address16_data->address_length);
573 if (0xFF != address16_data->resource_source_index) {
574 acpi_os_printf ("\t\t_resource Source Index: %X\n",
575 address16_data->resource_source_index);
576 acpi_os_printf ("\t\t_resource Source: %s\n",
577 address16_data->resource_source);
584 /*******************************************************************************
586 * FUNCTION: Acpi_rs_dump_address32
588 * PARAMETERS: Data - pointer to the resource structure to dump.
592 * DESCRIPTION: Prints out the various members of the Data structure type.
594 ******************************************************************************/
597 acpi_rs_dump_address32 (
600 ADDRESS32_RESOURCE *address32_data = (ADDRESS32_RESOURCE*) data;
603 acpi_os_printf ("\t32-Bit Address Space Resource\n");
605 switch (address32_data->resource_type) {
608 acpi_os_printf ("\t\t_resource Type: Memory Range\n");
610 switch (address32_data->attribute.memory.cache_attribute) {
611 case NON_CACHEABLE_MEMORY:
612 acpi_os_printf ("\t\t_type Specific: "
613 "Noncacheable memory\n");
616 case CACHABLE_MEMORY:
617 acpi_os_printf ("\t\t_type Specific: "
618 "Cacheable memory\n");
621 case WRITE_COMBINING_MEMORY:
622 acpi_os_printf ("\t\t_type Specific: "
623 "Write-combining memory\n");
626 case PREFETCHABLE_MEMORY:
627 acpi_os_printf ("\t\t_type Specific: "
628 "Prefetchable memory\n");
632 acpi_os_printf ("\t\t_type Specific: "
633 "Invalid cache attribute\n");
637 acpi_os_printf ("\t\t_type Specific: Read%s\n",
639 address32_data->attribute.memory.read_write_attribute ?
645 acpi_os_printf ("\t\t_resource Type: Io Range\n");
647 switch (address32_data->attribute.io.range_attribute) {
648 case NON_ISA_ONLY_RANGES:
649 acpi_os_printf ("\t\t_type Specific: "
650 "Non-ISA Io Addresses\n");
653 case ISA_ONLY_RANGES:
654 acpi_os_printf ("\t\t_type Specific: "
655 "ISA Io Addresses\n");
659 acpi_os_printf ("\t\t_type Specific: "
660 "ISA and non-ISA Io Addresses\n");
664 acpi_os_printf ("\t\t_type Specific: "
665 "Invalid Range attribute");
670 case BUS_NUMBER_RANGE:
672 acpi_os_printf ("\t\t_resource Type: Bus Number Range\n");
677 acpi_os_printf ("\t\t_invalid Resource Type..exiting.\n");
681 acpi_os_printf ("\t\t_resource %s\n",
682 CONSUMER == address32_data->producer_consumer ?
683 "Consumer" : "Producer");
685 acpi_os_printf ("\t\t%s decode\n",
686 SUB_DECODE == address32_data->decode ?
687 "Subtractive" : "Positive");
689 acpi_os_printf ("\t\t_min address is %s fixed\n",
690 ADDRESS_FIXED == address32_data->min_address_fixed ?
693 acpi_os_printf ("\t\t_max address is %s fixed\n",
694 ADDRESS_FIXED == address32_data->max_address_fixed ?
697 acpi_os_printf ("\t\t_granularity: %08X\n",
698 address32_data->granularity);
700 acpi_os_printf ("\t\t_address range min: %08X\n",
701 address32_data->min_address_range);
703 acpi_os_printf ("\t\t_address range max: %08X\n",
704 address32_data->max_address_range);
706 acpi_os_printf ("\t\t_address translation offset: %08X\n",
707 address32_data->address_translation_offset);
709 acpi_os_printf ("\t\t_address Length: %08X\n",
710 address32_data->address_length);
712 if(0xFF != address32_data->resource_source_index) {
713 acpi_os_printf ("\t\t_resource Source Index: %X\n",
714 address32_data->resource_source_index);
715 acpi_os_printf ("\t\t_resource Source: %s\n",
716 address32_data->resource_source);
723 /*******************************************************************************
725 * FUNCTION: Acpi_rs_dump_extended_irq
727 * PARAMETERS: Data - pointer to the resource structure to dump.
731 * DESCRIPTION: Prints out the various members of the Data structure type.
733 ******************************************************************************/
736 acpi_rs_dump_extended_irq (
739 EXTENDED_IRQ_RESOURCE *ext_irq_data = (EXTENDED_IRQ_RESOURCE*) data;
743 acpi_os_printf ("\t_extended IRQ Resource\n");
745 acpi_os_printf ("\t\t_resource %s\n",
746 CONSUMER == ext_irq_data->producer_consumer ?
747 "Consumer" : "Producer");
749 acpi_os_printf ("\t\t%s\n",
750 LEVEL_SENSITIVE == ext_irq_data->edge_level ?
753 acpi_os_printf ("\t\t_active %s\n",
754 ACTIVE_LOW == ext_irq_data->active_high_low ?
757 acpi_os_printf ("\t\t%s\n",
758 SHARED == ext_irq_data->shared_exclusive ?
759 "Shared" : "Exclusive");
761 acpi_os_printf ("\t\t_interrupts : %X ( ",
762 ext_irq_data->number_of_interrupts);
764 for (index = 0; index < ext_irq_data->number_of_interrupts; index++) {
765 acpi_os_printf ("%X ", ext_irq_data->interrupts[index]);
768 acpi_os_printf (")\n");
770 if(0xFF != ext_irq_data->resource_source_index) {
771 acpi_os_printf ("\t\t_resource Source Index: %X",
772 ext_irq_data->resource_source_index);
773 acpi_os_printf ("\t\t_resource Source: %s",
774 ext_irq_data->resource_source);
781 /*******************************************************************************
783 * FUNCTION: Acpi_rs_dump_resource_list
785 * PARAMETERS: Data - pointer to the resource structure to dump.
789 * DESCRIPTION: Dispatches the structure to the correct dump routine.
791 ******************************************************************************/
794 acpi_rs_dump_resource_list (
801 if (acpi_dbg_level & TRACE_RESOURCES && _COMPONENT & acpi_dbg_layer) {
803 acpi_os_printf ("\t_resource structure %x.\n", count++);
805 switch (resource->id) {
807 acpi_rs_dump_irq (&resource->data);
811 acpi_rs_dump_dma (&resource->data);
814 case start_dependent_functions:
815 acpi_rs_dump_start_dependent_functions (&resource->data);
818 case end_dependent_functions:
819 acpi_os_printf ("\t_end_dependent_functions Resource\n");
820 /* Acpi_rs_dump_end_dependent_functions (Resource->Data);*/
824 acpi_rs_dump_io (&resource->data);
828 acpi_rs_dump_fixed_io (&resource->data);
831 case vendor_specific:
832 acpi_rs_dump_vendor_specific (&resource->data);
836 /*Rs_dump_end_tag (Resource->Data);*/
837 acpi_os_printf ("\t_end_tag Resource\n");
842 acpi_rs_dump_memory24 (&resource->data);
846 acpi_rs_dump_memory32 (&resource->data);
850 acpi_rs_dump_fixed_memory32 (&resource->data);
854 acpi_rs_dump_address16 (&resource->data);
858 acpi_rs_dump_address32 (&resource->data);
862 acpi_rs_dump_extended_irq (&resource->data);
866 acpi_os_printf ("Invalid resource type\n");
871 resource = (RESOURCE *) ((NATIVE_UINT) resource +
872 (NATIVE_UINT) resource->length);
879 /*******************************************************************************
881 * FUNCTION: Acpi_rs_dump_irq_list
883 * PARAMETERS: Data - pointer to the routing table to dump.
887 * DESCRIPTION: Dispatches the structures to the correct dump routine.
889 ******************************************************************************/
892 acpi_rs_dump_irq_list (
895 u8 *buffer = route_table;
898 PCI_ROUTING_TABLE *prt_element;
901 if (acpi_dbg_level & TRACE_RESOURCES && _COMPONENT & acpi_dbg_layer) {
902 prt_element = (PCI_ROUTING_TABLE *) buffer;
905 acpi_os_printf ("\t_pCI IRQ Routing Table structure %X.\n", count++);
907 acpi_os_printf ("\t\t_address: %X\n",
908 prt_element->address);
910 acpi_os_printf ("\t\t_pin: %X\n", prt_element->pin);
912 acpi_os_printf ("\t\t_source: %s\n", prt_element->source);
914 acpi_os_printf ("\t\t_source_index: %X\n",
915 prt_element->source_index);
917 buffer += prt_element->length;
919 prt_element = (PCI_ROUTING_TABLE *) buffer;
921 if(0 == prt_element->length) {