aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_64.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-27 15:48:22 -0400
committerPaul Mackerras <paulus@samba.org>2008-11-05 06:11:53 -0500
commitb0494bc8ee449f0534afa92a51e2e3bb27bab69b (patch)
treef83d79bf689b1247935c506bbf71fbf384359d03 /arch/powerpc/kernel/pci_64.c
parent25d6e2d7c58ddc4a3b614fc5381591c0cfe66556 (diff)
powerpc/pci: Cleanup debug printk's
This removes the various DBG() macro from the powerpc PCI code and makes it use the standard pr_debug instead. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r--arch/powerpc/kernel/pci_64.c90
1 files changed, 43 insertions, 47 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index b771e3a20132..ffada88a4484 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -32,13 +32,6 @@
32#include <asm/machdep.h> 32#include <asm/machdep.h>
33#include <asm/ppc-pci.h> 33#include <asm/ppc-pci.h>
34 34
35#ifdef DEBUG
36#include <asm/udbg.h>
37#define DBG(fmt...) printk(fmt)
38#else
39#define DBG(fmt...)
40#endif
41
42unsigned long pci_probe_only = 1; 35unsigned long pci_probe_only = 1;
43 36
44/* pci_io_base -- the base address from which io bars are offsets. 37/* pci_io_base -- the base address from which io bars are offsets.
@@ -102,7 +95,7 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
102 addrs = of_get_property(node, "assigned-addresses", &proplen); 95 addrs = of_get_property(node, "assigned-addresses", &proplen);
103 if (!addrs) 96 if (!addrs)
104 return; 97 return;
105 DBG(" parse addresses (%d bytes) @ %p\n", proplen, addrs); 98 pr_debug(" parse addresses (%d bytes) @ %p\n", proplen, addrs);
106 for (; proplen >= 20; proplen -= 20, addrs += 5) { 99 for (; proplen >= 20; proplen -= 20, addrs += 5) {
107 flags = pci_parse_of_flags(addrs[0]); 100 flags = pci_parse_of_flags(addrs[0]);
108 if (!flags) 101 if (!flags)
@@ -112,8 +105,9 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
112 if (!size) 105 if (!size)
113 continue; 106 continue;
114 i = addrs[0] & 0xff; 107 i = addrs[0] & 0xff;
115 DBG(" base: %llx, size: %llx, i: %x\n", 108 pr_debug(" base: %llx, size: %llx, i: %x\n",
116 (unsigned long long)base, (unsigned long long)size, i); 109 (unsigned long long)base,
110 (unsigned long long)size, i);
117 111
118 if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) { 112 if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) {
119 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2]; 113 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2];
@@ -144,7 +138,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
144 if (type == NULL) 138 if (type == NULL)
145 type = ""; 139 type = "";
146 140
147 DBG(" create device, devfn: %x, type: %s\n", devfn, type); 141 pr_debug(" create device, devfn: %x, type: %s\n", devfn, type);
148 142
149 dev->bus = bus; 143 dev->bus = bus;
150 dev->sysdata = node; 144 dev->sysdata = node;
@@ -165,8 +159,8 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
165 dev->class = get_int_prop(node, "class-code", 0); 159 dev->class = get_int_prop(node, "class-code", 0);
166 dev->revision = get_int_prop(node, "revision-id", 0); 160 dev->revision = get_int_prop(node, "revision-id", 0);
167 161
168 DBG(" class: 0x%x\n", dev->class); 162 pr_debug(" class: 0x%x\n", dev->class);
169 DBG(" revision: 0x%x\n", dev->revision); 163 pr_debug(" revision: 0x%x\n", dev->revision);
170 164
171 dev->current_state = 4; /* unknown power state */ 165 dev->current_state = 4; /* unknown power state */
172 dev->error_state = pci_channel_io_normal; 166 dev->error_state = pci_channel_io_normal;
@@ -187,7 +181,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
187 181
188 pci_parse_of_addrs(node, dev); 182 pci_parse_of_addrs(node, dev);
189 183
190 DBG(" adding to system ...\n"); 184 pr_debug(" adding to system ...\n");
191 185
192 pci_device_add(dev, bus); 186 pci_device_add(dev, bus);
193 187
@@ -203,11 +197,12 @@ void __devinit of_scan_bus(struct device_node *node,
203 int reglen, devfn; 197 int reglen, devfn;
204 struct pci_dev *dev; 198 struct pci_dev *dev;
205 199
206 DBG("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number); 200 pr_debug("of_scan_bus(%s) bus no %d... \n",
201 node->full_name, bus->number);
207 202
208 /* Scan direct children */ 203 /* Scan direct children */
209 for_each_child_of_node(node, child) { 204 for_each_child_of_node(node, child) {
210 DBG(" * %s\n", child->full_name); 205 pr_debug(" * %s\n", child->full_name);
211 reg = of_get_property(child, "reg", &reglen); 206 reg = of_get_property(child, "reg", &reglen);
212 if (reg == NULL || reglen < 20) 207 if (reg == NULL || reglen < 20)
213 continue; 208 continue;
@@ -217,7 +212,7 @@ void __devinit of_scan_bus(struct device_node *node,
217 dev = of_create_pci_dev(child, bus, devfn); 212 dev = of_create_pci_dev(child, bus, devfn);
218 if (!dev) 213 if (!dev)
219 continue; 214 continue;
220 DBG(" dev header type: %x\n", dev->hdr_type); 215 pr_debug(" dev header type: %x\n", dev->hdr_type);
221 } 216 }
222 217
223 /* Ally all fixups */ 218 /* Ally all fixups */
@@ -245,7 +240,7 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
245 unsigned int flags; 240 unsigned int flags;
246 u64 size; 241 u64 size;
247 242
248 DBG("of_scan_pci_bridge(%s)\n", node->full_name); 243 pr_debug("of_scan_pci_bridge(%s)\n", node->full_name);
249 244
250 /* parse bus-range property */ 245 /* parse bus-range property */
251 busrange = of_get_property(node, "bus-range", &len); 246 busrange = of_get_property(node, "bus-range", &len);
@@ -309,12 +304,12 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
309 } 304 }
310 sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus), 305 sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
311 bus->number); 306 bus->number);
312 DBG(" bus name: %s\n", bus->name); 307 pr_debug(" bus name: %s\n", bus->name);
313 308
314 mode = PCI_PROBE_NORMAL; 309 mode = PCI_PROBE_NORMAL;
315 if (ppc_md.pci_probe_mode) 310 if (ppc_md.pci_probe_mode)
316 mode = ppc_md.pci_probe_mode(bus); 311 mode = ppc_md.pci_probe_mode(bus);
317 DBG(" probe mode: %d\n", mode); 312 pr_debug(" probe mode: %d\n", mode);
318 313
319 if (mode == PCI_PROBE_DEVTREE) 314 if (mode == PCI_PROBE_DEVTREE)
320 of_scan_bus(node, bus); 315 of_scan_bus(node, bus);
@@ -329,7 +324,8 @@ void __devinit scan_phb(struct pci_controller *hose)
329 struct device_node *node = hose->dn; 324 struct device_node *node = hose->dn;
330 int i, mode; 325 int i, mode;
331 326
332 DBG("PCI: Scanning PHB %s\n", node ? node->full_name : "<NO NAME>"); 327 pr_debug("PCI: Scanning PHB %s\n",
328 node ? node->full_name : "<NO NAME>");
333 329
334 /* Create an empty bus for the toplevel */ 330 /* Create an empty bus for the toplevel */
335 bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, node); 331 bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, node);
@@ -345,26 +341,26 @@ void __devinit scan_phb(struct pci_controller *hose)
345 pcibios_map_io_space(bus); 341 pcibios_map_io_space(bus);
346 342
347 /* Wire up PHB bus resources */ 343 /* Wire up PHB bus resources */
348 DBG("PCI: PHB IO resource = %016lx-%016lx [%lx]\n", 344 pr_debug("PCI: PHB IO resource = %016lx-%016lx [%lx]\n",
349 hose->io_resource.start, hose->io_resource.end, 345 hose->io_resource.start, hose->io_resource.end,
350 hose->io_resource.flags); 346 hose->io_resource.flags);
351 bus->resource[0] = &hose->io_resource; 347 bus->resource[0] = &hose->io_resource;
352 for (i = 0; i < 3; ++i) { 348 for (i = 0; i < 3; ++i) {
353 DBG("PCI: PHB MEM resource %d = %016lx-%016lx [%lx]\n", i, 349 pr_debug("PCI: PHB MEM resource %d = %016lx-%016lx [%lx]\n", i,
354 hose->mem_resources[i].start, 350 hose->mem_resources[i].start,
355 hose->mem_resources[i].end, 351 hose->mem_resources[i].end,
356 hose->mem_resources[i].flags); 352 hose->mem_resources[i].flags);
357 bus->resource[i+1] = &hose->mem_resources[i]; 353 bus->resource[i+1] = &hose->mem_resources[i];
358 } 354 }
359 DBG("PCI: PHB MEM offset = %016lx\n", hose->pci_mem_offset); 355 pr_debug("PCI: PHB MEM offset = %016lx\n", hose->pci_mem_offset);
360 DBG("PCI: PHB IO offset = %08lx\n", 356 pr_debug("PCI: PHB IO offset = %08lx\n",
361 (unsigned long)hose->io_base_virt - _IO_BASE); 357 (unsigned long)hose->io_base_virt - _IO_BASE);
362 358
363 /* Get probe mode and perform scan */ 359 /* Get probe mode and perform scan */
364 mode = PCI_PROBE_NORMAL; 360 mode = PCI_PROBE_NORMAL;
365 if (node && ppc_md.pci_probe_mode) 361 if (node && ppc_md.pci_probe_mode)
366 mode = ppc_md.pci_probe_mode(bus); 362 mode = ppc_md.pci_probe_mode(bus);
367 DBG(" probe mode: %d\n", mode); 363 pr_debug(" probe mode: %d\n", mode);
368 if (mode == PCI_PROBE_DEVTREE) { 364 if (mode == PCI_PROBE_DEVTREE) {
369 bus->subordinate = hose->last_busno; 365 bus->subordinate = hose->last_busno;
370 of_scan_bus(node, bus); 366 of_scan_bus(node, bus);
@@ -427,8 +423,8 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
427 if (bus->self) { 423 if (bus->self) {
428 struct resource *res = bus->resource[0]; 424 struct resource *res = bus->resource[0];
429 425
430 DBG("IO unmapping for PCI-PCI bridge %s\n", 426 pr_debug("IO unmapping for PCI-PCI bridge %s\n",
431 pci_name(bus->self)); 427 pci_name(bus->self));
432 428
433 __flush_hash_table_range(&init_mm, res->start + _IO_BASE, 429 __flush_hash_table_range(&init_mm, res->start + _IO_BASE,
434 res->end + _IO_BASE + 1); 430 res->end + _IO_BASE + 1);
@@ -442,8 +438,8 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
442 if (hose->io_base_alloc == 0) 438 if (hose->io_base_alloc == 0)
443 return 0; 439 return 0;
444 440
445 DBG("IO unmapping for PHB %s\n", hose->dn->full_name); 441 pr_debug("IO unmapping for PHB %s\n", hose->dn->full_name);
446 DBG(" alloc=0x%p\n", hose->io_base_alloc); 442 pr_debug(" alloc=0x%p\n", hose->io_base_alloc);
447 443
448 /* This is a PHB, we fully unmap the IO area */ 444 /* This is a PHB, we fully unmap the IO area */
449 vunmap(hose->io_base_alloc); 445 vunmap(hose->io_base_alloc);
@@ -468,11 +464,11 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
468 * thus HPTEs will be faulted in when needed 464 * thus HPTEs will be faulted in when needed
469 */ 465 */
470 if (bus->self) { 466 if (bus->self) {
471 DBG("IO mapping for PCI-PCI bridge %s\n", 467 pr_debug("IO mapping for PCI-PCI bridge %s\n",
472 pci_name(bus->self)); 468 pci_name(bus->self));
473 DBG(" virt=0x%016lx...0x%016lx\n", 469 pr_debug(" virt=0x%016lx...0x%016lx\n",
474 bus->resource[0]->start + _IO_BASE, 470 bus->resource[0]->start + _IO_BASE,
475 bus->resource[0]->end + _IO_BASE); 471 bus->resource[0]->end + _IO_BASE);
476 return 0; 472 return 0;
477 } 473 }
478 474
@@ -501,11 +497,11 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
501 hose->io_base_virt = (void __iomem *)(area->addr + 497 hose->io_base_virt = (void __iomem *)(area->addr +
502 hose->io_base_phys - phys_page); 498 hose->io_base_phys - phys_page);
503 499
504 DBG("IO mapping for PHB %s\n", hose->dn->full_name); 500 pr_debug("IO mapping for PHB %s\n", hose->dn->full_name);
505 DBG(" phys=0x%016lx, virt=0x%p (alloc=0x%p)\n", 501 pr_debug(" phys=0x%016lx, virt=0x%p (alloc=0x%p)\n",
506 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc); 502 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
507 DBG(" size=0x%016lx (alloc=0x%016lx)\n", 503 pr_debug(" size=0x%016lx (alloc=0x%016lx)\n",
508 hose->pci_io_size, size_page); 504 hose->pci_io_size, size_page);
509 505
510 /* Establish the mapping */ 506 /* Establish the mapping */
511 if (__ioremap_at(phys_page, area->addr, size_page, 507 if (__ioremap_at(phys_page, area->addr, size_page,
@@ -517,8 +513,8 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
517 hose->io_resource.start += io_virt_offset; 513 hose->io_resource.start += io_virt_offset;
518 hose->io_resource.end += io_virt_offset; 514 hose->io_resource.end += io_virt_offset;
519 515
520 DBG(" hose->io_resource=0x%016lx...0x%016lx\n", 516 pr_debug(" hose->io_resource=0x%016lx...0x%016lx\n",
521 hose->io_resource.start, hose->io_resource.end); 517 hose->io_resource.start, hose->io_resource.end);
522 518
523 return 0; 519 return 0;
524} 520}