[POWERPC] Added indirect quirk to handle PCIe PHB that have issue w/no link
authorKumar Gala <galak@kernel.crashing.org>
Wed, 11 Jul 2007 18:22:41 +0000 (13:22 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Mon, 23 Jul 2007 15:27:07 +0000 (10:27 -0500)
Added PPC_INDIRECT_TYPE_NO_PCIE_LINK flag to the indirect pci handling
code to ensure that we don't talk to any device other than the PHB
if we don't have PCIe link.  Some controllers will lockup if they try
to do a config cycle to any device on the bus except the PHB.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/sysdev/indirect_pci.c
include/asm-powerpc/pci-bridge.h

index c7e6e859b393c5b11998fbd73836ab3ff9f14722..bc5b4e22fa5d16c74ae2006f6dd0abc9addb60cd 100644 (file)
@@ -35,10 +35,17 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
        u8 cfg_type = 0;
        u32 bus_no, reg;
 
+       if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
+               if (bus->number != hose->first_busno)
+                       return PCIBIOS_DEVICE_NOT_FOUND;
+               if (devfn != 0)
+                       return PCIBIOS_DEVICE_NOT_FOUND;
+       }
+
        if (ppc_md.pci_exclude_device)
                if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
                        return PCIBIOS_DEVICE_NOT_FOUND;
-       
+
        if (hose->indirect_type & PPC_INDIRECT_TYPE_SET_CFG_TYPE)
                if (bus->number != hose->first_busno)
                        cfg_type = 1;
@@ -83,6 +90,13 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
        u8 cfg_type = 0;
        u32 bus_no, reg;
 
+       if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
+               if (bus->number != hose->first_busno)
+                       return PCIBIOS_DEVICE_NOT_FOUND;
+               if (devfn != 0)
+                       return PCIBIOS_DEVICE_NOT_FOUND;
+       }
+
        if (ppc_md.pci_exclude_device)
                if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
                        return PCIBIOS_DEVICE_NOT_FOUND;
index 7a00b8e388ec53869b5485bf535423cdcf14138e..975435743031b0ac7f57efac3c02a4d904987d6f 100644 (file)
@@ -45,10 +45,15 @@ struct pci_controller {
         *   on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS
         *   to determine which bus number to match on when generating type0
         *   config cycles
+        *  NO_PCIE_LINK - the Freescale PCI-e controllers have issues with
+        *   hanging if we don't have link and try to do config cycles to
+        *   anything but the PHB.  Only allow talking to the PHB if this is
+        *   set.
         */
 #define PPC_INDIRECT_TYPE_SET_CFG_TYPE         (0x00000001)
 #define PPC_INDIRECT_TYPE_EXT_REG              (0x00000002)
 #define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004)
+#define PPC_INDIRECT_TYPE_NO_PCIE_LINK         (0x00000008)
        u32 indirect_type;
 
        /* Currently, we limit ourselves to 1 IO range and 3 mem