[PATCH] Restore PCI IO space behind Freescale pseudo-bridge

Andrew Klossner andrew at cesa.opbu.xerox.com
Thu Jan 15 06:48:33 EST 2009


When I moved from 2.6.27 to 2.6.28, one of my devices didn't work
until I devised the attached patch.  The kernel disallowed PCI I/O
space resources behind the pseudo-bridge in the Freescale MPC8545
because that bridge's config-space registers incorrectly report that
it doesn't forward I/O space transactions.

Checking for a specific vendor ID is hacky, but it got my system going
again with only a few perturbed lines.  Is there a more correct way to
achieve this?

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index f36936d..f9f0048 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -985,6 +985,7 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
 	struct pci_dev *dev = bus->self;
 	resource_size_t offset;
 	u16 command;
+	u16 vendor;
 	int i;
 
 	/* We don't do anything if PCI_PROBE_ONLY is set */
@@ -1030,7 +1031,16 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
 		 * starting at low addresses -is- valid. What we do instead if that
 		 * we consider as unassigned anything that doesn't have IO enabled
 		 * in the PCI command register, and that's it.
+		 * However, we don't do that if the bridge is internal to a Freescale
+		 * CPU, as such bridges break the rules by, for example, not populating
+		 * the PCI_COMMAND_IO bit.
 		 */
+		pci_read_config_word(dev, PCI_VENDOR_ID, &vendor);
+		if (vendor == PCI_VENDOR_ID_MOTOROLA ||
+		    vendor == PCI_VENDOR_ID_FREESCALE) {
+			return 0;
+		}
+
 		pci_read_config_word(dev, PCI_COMMAND, &command);
 		if (command & PCI_COMMAND_IO)
 			return 0;



More information about the Linuxppc-dev mailing list