aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/pci.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-08-13 02:22:39 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-14 00:17:49 -0400
commit93a6423bd84d977bd768a001c6c3868e6a20b63a (patch)
tree5134930d02aaa372ded8a4f78bcd1ceae53dcae6 /arch/sparc/kernel/pci.c
parentf0094b28f3038936c1985be64dbe83f0e950b671 (diff)
sparc64: Expand PCI bridge probing debug logging.
Dump the various aspects of the PCI bridge probed at boot time, most importantly the bridge number ranges, and the ranges property. This helps diagnose PCI resource issues and other problems by giving ofpci_debug=1 on the boot command line. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/pci.c')
-rw-r--r--arch/sparc/kernel/pci.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 539babf00bb2..da24fb6deb03 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -432,6 +432,11 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
432 node->full_name); 432 node->full_name);
433 return; 433 return;
434 } 434 }
435
436 if (ofpci_verbose)
437 printk(" Bridge bus range [%u --> %u]\n",
438 busrange[0], busrange[1]);
439
435 ranges = of_get_property(node, "ranges", &len); 440 ranges = of_get_property(node, "ranges", &len);
436 simba = 0; 441 simba = 0;
437 if (ranges == NULL) { 442 if (ranges == NULL) {
@@ -451,6 +456,10 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
451 pci_bus_insert_busn_res(bus, busrange[0], busrange[1]); 456 pci_bus_insert_busn_res(bus, busrange[0], busrange[1]);
452 bus->bridge_ctl = 0; 457 bus->bridge_ctl = 0;
453 458
459 if (ofpci_verbose)
460 printk(" Bridge ranges[%p] simba[%d]\n",
461 ranges, simba);
462
454 /* parse ranges property, or cook one up by hand for Simba */ 463 /* parse ranges property, or cook one up by hand for Simba */
455 /* PCI #address-cells == 3 and #size-cells == 2 always */ 464 /* PCI #address-cells == 3 and #size-cells == 2 always */
456 res = &dev->resource[PCI_BRIDGE_RESOURCES]; 465 res = &dev->resource[PCI_BRIDGE_RESOURCES];
@@ -468,6 +477,14 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
468 } 477 }
469 i = 1; 478 i = 1;
470 for (; len >= 32; len -= 32, ranges += 8) { 479 for (; len >= 32; len -= 32, ranges += 8) {
480 u64 start;
481
482 if (ofpci_verbose)
483 printk(" RAW Range[%08x:%08x:%08x:%08x:%08x:%08x:"
484 "%08x:%08x]\n",
485 ranges[0], ranges[1], ranges[2], ranges[3],
486 ranges[4], ranges[5], ranges[6], ranges[7]);
487
471 flags = pci_parse_of_flags(ranges[0]); 488 flags = pci_parse_of_flags(ranges[0]);
472 size = GET_64BIT(ranges, 6); 489 size = GET_64BIT(ranges, 6);
473 if (flags == 0 || size == 0) 490 if (flags == 0 || size == 0)
@@ -490,8 +507,13 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
490 } 507 }
491 508
492 res->flags = flags; 509 res->flags = flags;
493 region.start = GET_64BIT(ranges, 1); 510 region.start = start = GET_64BIT(ranges, 1);
494 region.end = region.start + size - 1; 511 region.end = region.start + size - 1;
512
513 if (ofpci_verbose)
514 printk(" Using flags[%08x] start[%016llx] size[%016llx]\n",
515 flags, start, size);
516
495 pcibios_bus_to_resource(dev->bus, res, &region); 517 pcibios_bus_to_resource(dev->bus, res, &region);
496 } 518 }
497after_ranges: 519after_ranges: