]> Pileus Git - ~andy/linux/commitdiff
arm: kirkwood: move PCIe window init to legacy driver
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 15 May 2013 13:36:55 +0000 (15:36 +0200)
committerJason Cooper <jason@lakedaemon.net>
Mon, 27 May 2013 16:02:10 +0000 (16:02 +0000)
Since we are going to enable the usage of the mvebu PCIe driver on
Kirkwood, we don't want the PCIe windows to be unconditionally created
by kirkwood_setup_wins(). Therefore, we move the PCIe window
initialization into the legacy PCIe driver
(arch/arm/mach-kirkwood/pcie.c).

The platforms using the legacy driver will see their windows
statically allocated by
arch/arm/mach-kirkwood/pcie.c:kirkwood_pcie_init(). The platforms
using the new driver in drivers/pci/ will see their windows
dynamically allocated directly by the driver.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/pcie.c

index c2cae69e6d2bb9343798a7a3398ce174850d59cf..9b0b90171e620a7c4d219d957e4dbdb20223a4f5 100644 (file)
@@ -654,30 +654,6 @@ char * __init kirkwood_id(void)
 
 void __init kirkwood_setup_wins(void)
 {
-       /*
-        * The PCIe windows will no longer be statically allocated
-        * here once Kirkwood is migrated to the pci-mvebu driver.
-        */
-       mvebu_mbus_add_window_remap_flags("pcie0.0",
-                                         KIRKWOOD_PCIE_IO_PHYS_BASE,
-                                         KIRKWOOD_PCIE_IO_SIZE,
-                                         KIRKWOOD_PCIE_IO_BUS_BASE,
-                                         MVEBU_MBUS_PCI_IO);
-       mvebu_mbus_add_window_remap_flags("pcie0.0",
-                                         KIRKWOOD_PCIE_MEM_PHYS_BASE,
-                                         KIRKWOOD_PCIE_MEM_SIZE,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
-       mvebu_mbus_add_window_remap_flags("pcie1.0",
-                                         KIRKWOOD_PCIE1_IO_PHYS_BASE,
-                                         KIRKWOOD_PCIE1_IO_SIZE,
-                                         KIRKWOOD_PCIE1_IO_BUS_BASE,
-                                         MVEBU_MBUS_PCI_IO);
-       mvebu_mbus_add_window_remap_flags("pcie1.0",
-                                         KIRKWOOD_PCIE1_MEM_PHYS_BASE,
-                                         KIRKWOOD_PCIE1_MEM_SIZE,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
        mvebu_mbus_add_window("nand", KIRKWOOD_NAND_MEM_PHYS_BASE,
                              KIRKWOOD_NAND_MEM_SIZE);
        mvebu_mbus_add_window("sram", KIRKWOOD_SRAM_PHYS_BASE,
index 7f43e6c2f8c0a15f820ce7fc0cbd6ddb0f6936de..ddcb09f5bdd38403423f2123c329149b74848fd5 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/clk.h>
+#include <linux/mbus.h>
 #include <video/vga.h>
 #include <asm/irq.h>
 #include <asm/mach/pci.h>
@@ -253,6 +254,27 @@ static void __init add_pcie_port(int index, void __iomem *base)
 
 void __init kirkwood_pcie_init(unsigned int portmask)
 {
+       mvebu_mbus_add_window_remap_flags("pcie0.0",
+                                         KIRKWOOD_PCIE_IO_PHYS_BASE,
+                                         KIRKWOOD_PCIE_IO_SIZE,
+                                         KIRKWOOD_PCIE_IO_BUS_BASE,
+                                         MVEBU_MBUS_PCI_IO);
+       mvebu_mbus_add_window_remap_flags("pcie0.0",
+                                         KIRKWOOD_PCIE_MEM_PHYS_BASE,
+                                         KIRKWOOD_PCIE_MEM_SIZE,
+                                         MVEBU_MBUS_NO_REMAP,
+                                         MVEBU_MBUS_PCI_MEM);
+       mvebu_mbus_add_window_remap_flags("pcie1.0",
+                                         KIRKWOOD_PCIE1_IO_PHYS_BASE,
+                                         KIRKWOOD_PCIE1_IO_SIZE,
+                                         KIRKWOOD_PCIE1_IO_BUS_BASE,
+                                         MVEBU_MBUS_PCI_IO);
+       mvebu_mbus_add_window_remap_flags("pcie1.0",
+                                         KIRKWOOD_PCIE1_MEM_PHYS_BASE,
+                                         KIRKWOOD_PCIE1_MEM_SIZE,
+                                         MVEBU_MBUS_NO_REMAP,
+                                         MVEBU_MBUS_PCI_MEM);
+
        vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE;
 
        if (portmask & KW_PCIE0)