Commit 5840fc66 authored by David S. Miller's avatar David S. Miller

[SPARC64]: PCI device scan is way too verbose by default.

These messages were very useful when bringing up the
OBP based PCI device scan code, but it's just a lot
of noise every bootup now especially on big machines.

The messages can be re-enabled via 'ofpci_debug=1' on
the kernel command line.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9977e390
...@@ -306,6 +306,20 @@ static void __init pci_controller_probe(void) ...@@ -306,6 +306,20 @@ static void __init pci_controller_probe(void)
pci_controller_scan(pci_controller_init); pci_controller_scan(pci_controller_init);
} }
static int ofpci_verbose;
static int __init ofpci_debug(char *str)
{
int val = 0;
get_option(&str, &val);
if (val)
ofpci_verbose = 1;
return 1;
}
__setup("ofpci_debug=", ofpci_debug);
static unsigned long pci_parse_of_flags(u32 addr0) static unsigned long pci_parse_of_flags(u32 addr0)
{ {
unsigned long flags = 0; unsigned long flags = 0;
...@@ -337,7 +351,9 @@ static void pci_parse_of_addrs(struct of_device *op, ...@@ -337,7 +351,9 @@ static void pci_parse_of_addrs(struct of_device *op,
addrs = of_get_property(node, "assigned-addresses", &proplen); addrs = of_get_property(node, "assigned-addresses", &proplen);
if (!addrs) if (!addrs)
return; return;
printk(" parse addresses (%d bytes) @ %p\n", proplen, addrs); if (ofpci_verbose)
printk(" parse addresses (%d bytes) @ %p\n",
proplen, addrs);
op_res = &op->resource[0]; op_res = &op->resource[0];
for (; proplen >= 20; proplen -= 20, addrs += 5, op_res++) { for (; proplen >= 20; proplen -= 20, addrs += 5, op_res++) {
struct resource *res; struct resource *res;
...@@ -348,6 +364,7 @@ static void pci_parse_of_addrs(struct of_device *op, ...@@ -348,6 +364,7 @@ static void pci_parse_of_addrs(struct of_device *op,
if (!flags) if (!flags)
continue; continue;
i = addrs[0] & 0xff; i = addrs[0] & 0xff;
if (ofpci_verbose)
printk(" start: %lx, end: %lx, i: %x\n", printk(" start: %lx, end: %lx, i: %x\n",
op_res->start, op_res->end, i); op_res->start, op_res->end, i);
...@@ -393,8 +410,9 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, ...@@ -393,8 +410,9 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
if (type == NULL) if (type == NULL)
type = ""; type = "";
printk(" create device, devfn: %x, type: %s hostcontroller(%d)\n", if (ofpci_verbose)
devfn, type, host_controller); printk(" create device, devfn: %x, type: %s\n",
devfn, type);
dev->bus = bus; dev->bus = bus;
dev->sysdata = node; dev->sysdata = node;
...@@ -434,6 +452,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, ...@@ -434,6 +452,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus), sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
} }
if (ofpci_verbose)
printk(" class: 0x%x device name: %s\n", printk(" class: 0x%x device name: %s\n",
dev->class, pci_name(dev)); dev->class, pci_name(dev));
...@@ -469,6 +488,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, ...@@ -469,6 +488,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
} }
pci_parse_of_addrs(sd->op, node, dev); pci_parse_of_addrs(sd->op, node, dev);
if (ofpci_verbose)
printk(" adding to system ...\n"); printk(" adding to system ...\n");
pci_device_add(dev, bus); pci_device_add(dev, bus);
...@@ -547,6 +567,7 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm, ...@@ -547,6 +567,7 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
unsigned int flags; unsigned int flags;
u64 size; u64 size;
if (ofpci_verbose)
printk("of_scan_pci_bridge(%s)\n", node->full_name); printk("of_scan_pci_bridge(%s)\n", node->full_name);
/* parse bus-range property */ /* parse bus-range property */
...@@ -632,6 +653,7 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm, ...@@ -632,6 +653,7 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
simba_cont: simba_cont:
sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus), sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
bus->number); bus->number);
if (ofpci_verbose)
printk(" bus name: %s\n", bus->name); printk(" bus name: %s\n", bus->name);
pci_of_scan_bus(pbm, node, bus); pci_of_scan_bus(pbm, node, bus);
...@@ -646,11 +668,13 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, ...@@ -646,11 +668,13 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
int reglen, devfn; int reglen, devfn;
struct pci_dev *dev; struct pci_dev *dev;
if (ofpci_verbose)
printk("PCI: scan_bus[%s] bus no %d\n", printk("PCI: scan_bus[%s] bus no %d\n",
node->full_name, bus->number); node->full_name, bus->number);
child = NULL; child = NULL;
while ((child = of_get_next_child(node, child)) != NULL) { while ((child = of_get_next_child(node, child)) != NULL) {
if (ofpci_verbose)
printk(" * %s\n", child->full_name); printk(" * %s\n", child->full_name);
reg = of_get_property(child, "reg", &reglen); reg = of_get_property(child, "reg", &reglen);
if (reg == NULL || reglen < 20) if (reg == NULL || reglen < 20)
...@@ -661,7 +685,9 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, ...@@ -661,7 +685,9 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
dev = of_create_pci_dev(pbm, child, bus, devfn, 0); dev = of_create_pci_dev(pbm, child, bus, devfn, 0);
if (!dev) if (!dev)
continue; continue;
printk("PCI: dev header type: %x\n", dev->hdr_type); if (ofpci_verbose)
printk("PCI: dev header type: %x\n",
dev->hdr_type);
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment