aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_32.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2009-08-28 04:58:16 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-09-02 01:45:53 -0400
commit0ed2c722c650513ba4bce868c7a052e576c060e2 (patch)
tree6b679585a9c2afa871f81dc9da90af9b79c49c02 /arch/powerpc/kernel/pci_32.c
parentc5b20d3926dfc9616265b8ff5967cb7a476f9344 (diff)
powerpc/pci: Merge ppc32 and ppc64 versions of phb_scan()
The two versions are doing almost exactly the same thing. No need to maintain them as separate files. This patch also has the side effect of making the PCI device tree scanning code available to 32 bit powerpc machines, but no board ports actually make use of this feature at this point. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_32.c')
-rw-r--r--arch/powerpc/kernel/pci_32.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 8cf15d961c38..c13668cf36d9 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -354,36 +354,15 @@ pci_create_OF_bus_map(void)
354 } 354 }
355} 355}
356 356
357static void __devinit pcibios_scan_phb(struct pci_controller *hose) 357void __devinit pcibios_setup_phb_io_space(struct pci_controller *hose)
358{ 358{
359 struct pci_bus *bus;
360 struct device_node *node = hose->dn;
361 unsigned long io_offset; 359 unsigned long io_offset;
362 struct resource *res = &hose->io_resource; 360 struct resource *res = &hose->io_resource;
363 361
364 pr_debug("PCI: Scanning PHB %s\n",
365 node ? node->full_name : "<NO NAME>");
366
367 /* Create an empty bus for the toplevel */
368 bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, hose);
369 if (bus == NULL) {
370 printk(KERN_ERR "Failed to create bus for PCI domain %04x\n",
371 hose->global_number);
372 return;
373 }
374 bus->secondary = hose->first_busno;
375 hose->bus = bus;
376
377 /* Fixup IO space offset */ 362 /* Fixup IO space offset */
378 io_offset = (unsigned long)hose->io_base_virt - isa_io_base; 363 io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
379 res->start = (res->start + io_offset) & 0xffffffffu; 364 res->start = (res->start + io_offset) & 0xffffffffu;
380 res->end = (res->end + io_offset) & 0xffffffffu; 365 res->end = (res->end + io_offset) & 0xffffffffu;
381
382 /* Wire up PHB bus resources */
383 pcibios_setup_phb_resources(hose);
384
385 /* Scan children */
386 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
387} 366}
388 367
389static int __init pcibios_init(void) 368static int __init pcibios_init(void)
@@ -401,7 +380,7 @@ static int __init pcibios_init(void)
401 if (pci_assign_all_buses) 380 if (pci_assign_all_buses)
402 hose->first_busno = next_busno; 381 hose->first_busno = next_busno;
403 hose->last_busno = 0xff; 382 hose->last_busno = 0xff;
404 pcibios_scan_phb(hose); 383 pcibios_scan_phb(hose, hose);
405 pci_bus_add_devices(hose->bus); 384 pci_bus_add_devices(hose->bus);
406 if (pci_assign_all_buses || next_busno <= hose->last_busno) 385 if (pci_assign_all_buses || next_busno <= hose->last_busno)
407 next_busno = hose->last_busno + pcibios_assign_bus_offset; 386 next_busno = hose->last_busno + pcibios_assign_bus_offset;