aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/probe.c6
-rw-r--r--drivers/pci/setup-bus.c35
2 files changed, 41 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index b1724cf31b66..d2bd74ee3e08 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -275,6 +275,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
275 } 275 }
276 res->start = l64 & PCI_BASE_ADDRESS_MEM_MASK; 276 res->start = l64 & PCI_BASE_ADDRESS_MEM_MASK;
277 res->end = res->start + sz64; 277 res->end = res->start + sz64;
278 printk(KERN_INFO "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n", pci_name(dev), reg, res->start, res->end);
278#else 279#else
279 if (sz64 > 0x100000000ULL) { 280 if (sz64 > 0x100000000ULL) {
280 dev_err(&dev->dev, "BAR %d: can't handle 64-bit" 281 dev_err(&dev->dev, "BAR %d: can't handle 64-bit"
@@ -290,6 +291,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
290 res->end = sz; 291 res->end = sz;
291 } 292 }
292#endif 293#endif
294 } else {
295 printk(KERN_INFO "PCI: %s reg %x %s: [%llx, %llx]\n", pci_name(dev), reg, (res->flags & IORESOURCE_IO)? "io port":"32bit mmio", res->start, res->end);
293 } 296 }
294 } 297 }
295 if (rom) { 298 if (rom) {
@@ -357,6 +360,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
357 res->start = base; 360 res->start = base;
358 if (!res->end) 361 if (!res->end)
359 res->end = limit + 0xfff; 362 res->end = limit + 0xfff;
363 printk(KERN_INFO "PCI: bridge %s io port: [%llx, %llx]\n", pci_name(dev), res->start, res->end);
360 } 364 }
361 365
362 res = child->resource[1]; 366 res = child->resource[1];
@@ -368,6 +372,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
368 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; 372 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
369 res->start = base; 373 res->start = base;
370 res->end = limit + 0xfffff; 374 res->end = limit + 0xfffff;
375 printk(KERN_INFO "PCI: bridge %s 32bit mmio: [%llx, %llx]\n", pci_name(dev), res->start, res->end);
371 } 376 }
372 377
373 res = child->resource[2]; 378 res = child->resource[2];
@@ -403,6 +408,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
403 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH; 408 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH;
404 res->start = base; 409 res->start = base;
405 res->end = limit + 0xfffff; 410 res->end = limit + 0xfffff;
411 printk(KERN_INFO "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n", pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64)?"64":"32",res->start, res->end);
406 } 412 }
407} 413}
408 414
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 827c0a520e2b..82634a2f1b1d 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -530,6 +530,36 @@ void __ref pci_bus_assign_resources(struct pci_bus *bus)
530} 530}
531EXPORT_SYMBOL(pci_bus_assign_resources); 531EXPORT_SYMBOL(pci_bus_assign_resources);
532 532
533static void pci_bus_dump_res(struct pci_bus *bus)
534{
535 int i;
536
537 for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
538 struct resource *res = bus->resource[i];
539 if (!res)
540 continue;
541
542 printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n", bus->number, i, (res->flags & IORESOURCE_IO)? "io port":"mmio", res->start, res->end);
543 }
544}
545
546static void pci_bus_dump_resources(struct pci_bus *bus)
547{
548 struct pci_bus *b;
549 struct pci_dev *dev;
550
551
552 pci_bus_dump_res(bus);
553
554 list_for_each_entry(dev, &bus->devices, bus_list) {
555 b = dev->subordinate;
556 if (!b)
557 continue;
558
559 pci_bus_dump_resources(b);
560 }
561}
562
533void __init 563void __init
534pci_assign_unassigned_resources(void) 564pci_assign_unassigned_resources(void)
535{ 565{
@@ -545,4 +575,9 @@ pci_assign_unassigned_resources(void)
545 pci_bus_assign_resources(bus); 575 pci_bus_assign_resources(bus);
546 pci_enable_bridges(bus); 576 pci_enable_bridges(bus);
547 } 577 }
578
579 /* dump the resource on buses */
580 list_for_each_entry(bus, &pci_root_buses, node) {
581 pci_bus_dump_resources(bus);
582 }
548} 583}