]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/85xx/mpc85xx_cds.c
[POWERPC] Fixup resources on pci_bus for PCIe PHB when no device is connected
[linux-2.6] / arch / powerpc / platforms / 85xx / mpc85xx_cds.c
index 50c8d6458362276a825df8510144df1b784b34f0..9b559ebc66f845609e6baa295319b03cf8526c93 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/i8259.h>
 
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 #include "mpc85xx.h"
 
 static int cds_pci_slot = 2;
@@ -58,8 +59,6 @@ static volatile u8 *cadmus;
 static int mpc85xx_exclude_device(struct pci_controller *hose,
                                  u_char bus, u_char devfn)
 {
-       if ((bus == hose->first_busno) && PCI_SLOT(devfn) == 0)
-               return PCIBIOS_DEVICE_NOT_FOUND;
        /* We explicitly do not go past the Tundra 320 Bridge */
        if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
                return PCIBIOS_DEVICE_NOT_FOUND;
@@ -218,9 +217,14 @@ static void __init mpc85xx_cds_setup_arch(void)
        }
 
 #ifdef CONFIG_PCI
-       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-               mpc85xx_add_bridge(np);
-
+       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
+               struct resource rsrc;
+               of_address_to_resource(np, 0, &rsrc);
+               if ((rsrc.start & 0xfffff) == 0x9000)
+                       fsl_add_bridge(np, 0);
+               else
+                       fsl_add_bridge(np, 1);
+       }
        ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
        ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
@@ -268,4 +272,5 @@ define_machine(mpc85xx_cds) {
        .restart        = mpc85xx_restart,
        .calibrate_decr = generic_calibrate_decr,
        .progress       = udbg_progress,
+       .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
 };