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:29 -0400
committerPaul Mackerras <paulus@samba.org>2008-11-05 06:11:53 -0500
commit53280323350621985b3f2f8ffe649215304bcc5f (patch)
treeec4c126dd620ecb1b36f67fc4201e24fcca6ab18 /arch/powerpc/kernel/pci_64.c
parentb0494bc8ee449f0534afa92a51e2e3bb27bab69b (diff)
powerpc/pci: Use common PHB resource hookup
The 32-bit and 64-bit powerpc PCI code used to set up the resource pointers of the root bus of a given PHB in completely different places. This unifies this in large part, by making 32-bit use a routine very similar to what 64-bit does when initially scanning the PCI busses. The actual setup of the PHB resources itself is then moved to a common function in pci-common.c. This should cause no functional change on 64-bit. On 32-bit, the effect is that the PHB resources are going to be setup a bit earlier, instead of being setup from pcibios_fixup_bus(). 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.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index ffada88a4484..f5fc547284bc 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -322,7 +322,7 @@ void __devinit scan_phb(struct pci_controller *hose)
322{ 322{
323 struct pci_bus *bus; 323 struct pci_bus *bus;
324 struct device_node *node = hose->dn; 324 struct device_node *node = hose->dn;
325 int i, mode; 325 int mode;
326 326
327 pr_debug("PCI: Scanning PHB %s\n", 327 pr_debug("PCI: Scanning PHB %s\n",
328 node ? node->full_name : "<NO NAME>"); 328 node ? node->full_name : "<NO NAME>");
@@ -341,20 +341,7 @@ void __devinit scan_phb(struct pci_controller *hose)
341 pcibios_map_io_space(bus); 341 pcibios_map_io_space(bus);
342 342
343 /* Wire up PHB bus resources */ 343 /* Wire up PHB bus resources */
344 pr_debug("PCI: PHB IO resource = %016lx-%016lx [%lx]\n", 344 pcibios_setup_phb_resources(hose);
345 hose->io_resource.start, hose->io_resource.end,
346 hose->io_resource.flags);
347 bus->resource[0] = &hose->io_resource;
348 for (i = 0; i < 3; ++i) {
349 pr_debug("PCI: PHB MEM resource %d = %016lx-%016lx [%lx]\n", i,
350 hose->mem_resources[i].start,
351 hose->mem_resources[i].end,
352 hose->mem_resources[i].flags);
353 bus->resource[i+1] = &hose->mem_resources[i];
354 }
355 pr_debug("PCI: PHB MEM offset = %016lx\n", hose->pci_mem_offset);
356 pr_debug("PCI: PHB IO offset = %08lx\n",
357 (unsigned long)hose->io_base_virt - _IO_BASE);
358 345
359 /* Get probe mode and perform scan */ 346 /* Get probe mode and perform scan */
360 mode = PCI_PROBE_NORMAL; 347 mode = PCI_PROBE_NORMAL;
@@ -376,7 +363,7 @@ static int __init pcibios_init(void)
376 363
377 printk(KERN_INFO "PCI: Probing PCI hardware\n"); 364 printk(KERN_INFO "PCI: Probing PCI hardware\n");
378 365
379 /* For now, override phys_mem_access_prot. If we need it, 366 /* For now, override phys_mem_access_prot. If we need it,g
380 * later, we may move that initialization to each ppc_md 367 * later, we may move that initialization to each ppc_md
381 */ 368 */
382 ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot; 369 ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;