]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: PCI: Add a hook for IORESOURCE_BUS in pci_controller/bridge_controller
authorJoshua Kinard <kumba@gentoo.org>
Mon, 19 Jan 2015 09:19:20 +0000 (04:19 -0500)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 1 Apr 2015 15:22:16 +0000 (17:22 +0200)
On SGI Origin 2k/Onyx2 and SGI Octane systems, there can exist multiple PCI
buses attached to the Xtalk bus.  The current code will stop counting PCI buses
after it finds the first one.  If one installs the optional PCI cardcage
("shoebox") into these systems, because of the order of the Xtalk widgets, the
current PCI code will find the cardcage first, and fail to detect the BaseIO
PCI devices, which are on a higher Xtalk widget ID.

This patch adds the hooks needed for resolving this issue in the IP27 PCI code
(in a later patch).

Verified on both an SGI Onyx2 and an SGI Octane.

Signed-off-by: Joshua Kinard <kumba@gentoo.org>
Cc: Linux MIPS List <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/9074/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/pci.h
arch/mips/include/asm/pci/bridge.h
arch/mips/pci/pci.c

index 193b4c6b7541a774f3a0ccfbaa8bb7f7add55b83..d9692993fc83373057d9594ad945b753b62723e3 100644 (file)
@@ -35,6 +35,8 @@ struct pci_controller {
        struct resource *io_resource;
        unsigned long io_offset;
        unsigned long io_map_base;
+       struct resource *busn_resource;
+       unsigned long busn_offset;
 
        unsigned int index;
        /* For compatibility with current (as of July 2003) pciutils
index af2c8a351ca70ae0ca14bc43d277ab6cea154f43..8d7a63b52ac73bacfd14fcddf838e6cb2758ff6b 100644 (file)
@@ -835,6 +835,7 @@ struct bridge_controller {
        struct pci_controller   pc;
        struct resource         mem;
        struct resource         io;
+       struct resource         busn;
        bridge_t                *base;
        nasid_t                 nasid;
        unsigned int            widget_id;
index 1bf60b12737746d19cfec9c8b0512e6c419a2a5c..0e3f437e8cadbca654030e195b69d9677d8b497d 100644 (file)
@@ -91,7 +91,10 @@ static void pcibios_scanbus(struct pci_controller *hose)
 
        pci_add_resource_offset(&resources,
                                hose->mem_resource, hose->mem_offset);
-       pci_add_resource_offset(&resources, hose->io_resource, hose->io_offset);
+       pci_add_resource_offset(&resources,
+                               hose->io_resource, hose->io_offset);
+       pci_add_resource_offset(&resources,
+                               hose->busn_resource, hose->busn_offset);
        bus = pci_scan_root_bus(NULL, next_busno, hose->pci_ops, hose,
                                &resources);
        if (!bus)