]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: Kirkwood: Update PCI-E fixup
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Wed, 21 Nov 2012 07:19:06 +0000 (00:19 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Dec 2012 11:20:34 +0000 (11:20 +0000)
commit 1dc831bf53fddcc6443f74a39e72db5bcea4f15d upstream.

- The code relies on rc_pci_fixup being called, which only happens
  when CONFIG_PCI_QUIRKS is enabled, so add that to Kconfig. Omitting
  this causes a booting failure with a non-obvious cause.
- Update rc_pci_fixup to set the class properly, copying the
  more modern style from other places
- Correct the rc_pci_fixup comment

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/arm/Kconfig
arch/arm/mach-kirkwood/pcie.c

index 9fdc151b2d02acd9ce058b0dbd3711ff513d9ca0..27bcd12b10562e3ad47b67f4b609a5b07fe35ce7 100644 (file)
@@ -542,6 +542,7 @@ config ARCH_KIRKWOOD
        bool "Marvell Kirkwood"
        select CPU_FEROCEON
        select PCI
+       select PCI_QUIRKS
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select PLAT_ORION
index 74b992d810ea0137c4919a13f18c68cd937422d2..a881c54f5dd1f0a83c49854a25630c043367a86e 100644 (file)
@@ -213,14 +213,19 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
        return 1;
 }
 
+/*
+ * The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
+ * is operating as a root complex this needs to be switched to
+ * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
+ * the device. Decoding setup is handled by the orion code.
+ */
 static void __devinit rc_pci_fixup(struct pci_dev *dev)
 {
-       /*
-        * Prevent enumeration of root complex.
-        */
        if (dev->bus->parent == NULL && dev->devfn == 0) {
                int i;
 
+               dev->class &= 0xff;
+               dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
                for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
                        dev->resource[i].start = 0;
                        dev->resource[i].end   = 0;