096ee6f8479ab2b58ed40649759754df3f7e1945
[openwrt/svn-archive/archive.git] / target / linux / kirkwood / patches-3.10 / 0010-arm-kirkwood-move-PCIe-window-init-to-legacy-driver.patch
1 From 080dc44291ff143d84b63e5ff9fda963d46a7dce Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 27 Mar 2013 18:51:25 +0100
4 Subject: [PATCH 10/29] arm: kirkwood: move PCIe window init to legacy driver
5
6 Since we are going to enable the usage of the mvebu PCIe driver on
7 Kirkwood, we don't want the PCIe windows to be unconditionally created
8 by kirkwood_setup_wins(). Therefore, we move the PCIe window
9 initialization into the legacy PCIe driver
10 (arch/arm/mach-kirkwood/pcie.c).
11
12 The platforms using the legacy driver will see their windows
13 statically allocated by
14 arch/arm/mach-kirkwood/pcie.c:kirkwood_pcie_init(). The platforms
15 using the new driver in drivers/pci/ will see their windows
16 dynamically allocated directly by the driver.
17
18 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
19 Tested-by: Andrew Lunn <andrew@lunn.ch>
20 ---
21 arch/arm/mach-kirkwood/common.c | 24 ------------------------
22 arch/arm/mach-kirkwood/pcie.c | 22 ++++++++++++++++++++++
23 2 files changed, 22 insertions(+), 24 deletions(-)
24
25 diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
26 index f389228..41ea98d 100644
27 --- a/arch/arm/mach-kirkwood/common.c
28 +++ b/arch/arm/mach-kirkwood/common.c
29 @@ -648,30 +648,6 @@ char * __init kirkwood_id(void)
30
31 void __init kirkwood_setup_wins(void)
32 {
33 - /*
34 - * The PCIe windows will no longer be statically allocated
35 - * here once Kirkwood is migrated to the pci-mvebu driver.
36 - */
37 - mvebu_mbus_add_window_remap_flags("pcie0.0",
38 - KIRKWOOD_PCIE_IO_PHYS_BASE,
39 - KIRKWOOD_PCIE_IO_SIZE,
40 - KIRKWOOD_PCIE_IO_BUS_BASE,
41 - MVEBU_MBUS_PCI_IO);
42 - mvebu_mbus_add_window_remap_flags("pcie0.0",
43 - KIRKWOOD_PCIE_MEM_PHYS_BASE,
44 - KIRKWOOD_PCIE_MEM_SIZE,
45 - MVEBU_MBUS_NO_REMAP,
46 - MVEBU_MBUS_PCI_MEM);
47 - mvebu_mbus_add_window_remap_flags("pcie1.0",
48 - KIRKWOOD_PCIE1_IO_PHYS_BASE,
49 - KIRKWOOD_PCIE1_IO_SIZE,
50 - KIRKWOOD_PCIE1_IO_BUS_BASE,
51 - MVEBU_MBUS_PCI_IO);
52 - mvebu_mbus_add_window_remap_flags("pcie1.0",
53 - KIRKWOOD_PCIE1_MEM_PHYS_BASE,
54 - KIRKWOOD_PCIE1_MEM_SIZE,
55 - MVEBU_MBUS_NO_REMAP,
56 - MVEBU_MBUS_PCI_MEM);
57 mvebu_mbus_add_window("nand", KIRKWOOD_NAND_MEM_PHYS_BASE,
58 KIRKWOOD_NAND_MEM_SIZE);
59 mvebu_mbus_add_window("sram", KIRKWOOD_SRAM_PHYS_BASE,
60 diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
61 index 7f43e6c..ddcb09f 100644
62 --- a/arch/arm/mach-kirkwood/pcie.c
63 +++ b/arch/arm/mach-kirkwood/pcie.c
64 @@ -12,6 +12,7 @@
65 #include <linux/pci.h>
66 #include <linux/slab.h>
67 #include <linux/clk.h>
68 +#include <linux/mbus.h>
69 #include <video/vga.h>
70 #include <asm/irq.h>
71 #include <asm/mach/pci.h>
72 @@ -253,6 +254,27 @@ static void __init add_pcie_port(int index, void __iomem *base)
73
74 void __init kirkwood_pcie_init(unsigned int portmask)
75 {
76 + mvebu_mbus_add_window_remap_flags("pcie0.0",
77 + KIRKWOOD_PCIE_IO_PHYS_BASE,
78 + KIRKWOOD_PCIE_IO_SIZE,
79 + KIRKWOOD_PCIE_IO_BUS_BASE,
80 + MVEBU_MBUS_PCI_IO);
81 + mvebu_mbus_add_window_remap_flags("pcie0.0",
82 + KIRKWOOD_PCIE_MEM_PHYS_BASE,
83 + KIRKWOOD_PCIE_MEM_SIZE,
84 + MVEBU_MBUS_NO_REMAP,
85 + MVEBU_MBUS_PCI_MEM);
86 + mvebu_mbus_add_window_remap_flags("pcie1.0",
87 + KIRKWOOD_PCIE1_IO_PHYS_BASE,
88 + KIRKWOOD_PCIE1_IO_SIZE,
89 + KIRKWOOD_PCIE1_IO_BUS_BASE,
90 + MVEBU_MBUS_PCI_IO);
91 + mvebu_mbus_add_window_remap_flags("pcie1.0",
92 + KIRKWOOD_PCIE1_MEM_PHYS_BASE,
93 + KIRKWOOD_PCIE1_MEM_SIZE,
94 + MVEBU_MBUS_NO_REMAP,
95 + MVEBU_MBUS_PCI_MEM);
96 +
97 vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE;
98
99 if (portmask & KW_PCIE0)
100 --
101 1.8.4.rc1
102