kirkwood: update patches and configuration (3.10)
[openwrt.git] / target / linux / kirkwood / patches-3.10 / 0010-arm-kirkwood-move-PCIe-window-init-to-legacy-driver.patch
1 From 722ffe56a78344821877496f5bb28ca95b4cb67c Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 15 May 2013 15:36:55 +0200
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 Signed-off-by: Jason Cooper <jason@lakedaemon.net>
21 ---
22  arch/arm/mach-kirkwood/common.c | 24 ------------------------
23  arch/arm/mach-kirkwood/pcie.c   | 22 ++++++++++++++++++++++
24  2 files changed, 22 insertions(+), 24 deletions(-)
25
26 --- a/arch/arm/mach-kirkwood/common.c
27 +++ b/arch/arm/mach-kirkwood/common.c
28 @@ -648,30 +648,6 @@ char * __init kirkwood_id(void)
29  
30  void __init kirkwood_setup_wins(void)
31  {
32 -       /*
33 -        * The PCIe windows will no longer be statically allocated
34 -        * here once Kirkwood is migrated to the pci-mvebu driver.
35 -        */
36 -       mvebu_mbus_add_window_remap_flags("pcie0.0",
37 -                                         KIRKWOOD_PCIE_IO_PHYS_BASE,
38 -                                         KIRKWOOD_PCIE_IO_SIZE,
39 -                                         KIRKWOOD_PCIE_IO_BUS_BASE,
40 -                                         MVEBU_MBUS_PCI_IO);
41 -       mvebu_mbus_add_window_remap_flags("pcie0.0",
42 -                                         KIRKWOOD_PCIE_MEM_PHYS_BASE,
43 -                                         KIRKWOOD_PCIE_MEM_SIZE,
44 -                                         MVEBU_MBUS_NO_REMAP,
45 -                                         MVEBU_MBUS_PCI_MEM);
46 -       mvebu_mbus_add_window_remap_flags("pcie1.0",
47 -                                         KIRKWOOD_PCIE1_IO_PHYS_BASE,
48 -                                         KIRKWOOD_PCIE1_IO_SIZE,
49 -                                         KIRKWOOD_PCIE1_IO_BUS_BASE,
50 -                                         MVEBU_MBUS_PCI_IO);
51 -       mvebu_mbus_add_window_remap_flags("pcie1.0",
52 -                                         KIRKWOOD_PCIE1_MEM_PHYS_BASE,
53 -                                         KIRKWOOD_PCIE1_MEM_SIZE,
54 -                                         MVEBU_MBUS_NO_REMAP,
55 -                                         MVEBU_MBUS_PCI_MEM);
56         mvebu_mbus_add_window("nand", KIRKWOOD_NAND_MEM_PHYS_BASE,
57                               KIRKWOOD_NAND_MEM_SIZE);
58         mvebu_mbus_add_window("sram", KIRKWOOD_SRAM_PHYS_BASE,
59 --- a/arch/arm/mach-kirkwood/pcie.c
60 +++ b/arch/arm/mach-kirkwood/pcie.c
61 @@ -12,6 +12,7 @@
62  #include <linux/pci.h>
63  #include <linux/slab.h>
64  #include <linux/clk.h>
65 +#include <linux/mbus.h>
66  #include <video/vga.h>
67  #include <asm/irq.h>
68  #include <asm/mach/pci.h>
69 @@ -253,6 +254,27 @@ static void __init add_pcie_port(int ind
70  
71  void __init kirkwood_pcie_init(unsigned int portmask)
72  {
73 +       mvebu_mbus_add_window_remap_flags("pcie0.0",
74 +                                         KIRKWOOD_PCIE_IO_PHYS_BASE,
75 +                                         KIRKWOOD_PCIE_IO_SIZE,
76 +                                         KIRKWOOD_PCIE_IO_BUS_BASE,
77 +                                         MVEBU_MBUS_PCI_IO);
78 +       mvebu_mbus_add_window_remap_flags("pcie0.0",
79 +                                         KIRKWOOD_PCIE_MEM_PHYS_BASE,
80 +                                         KIRKWOOD_PCIE_MEM_SIZE,
81 +                                         MVEBU_MBUS_NO_REMAP,
82 +                                         MVEBU_MBUS_PCI_MEM);
83 +       mvebu_mbus_add_window_remap_flags("pcie1.0",
84 +                                         KIRKWOOD_PCIE1_IO_PHYS_BASE,
85 +                                         KIRKWOOD_PCIE1_IO_SIZE,
86 +                                         KIRKWOOD_PCIE1_IO_BUS_BASE,
87 +                                         MVEBU_MBUS_PCI_IO);
88 +       mvebu_mbus_add_window_remap_flags("pcie1.0",
89 +                                         KIRKWOOD_PCIE1_MEM_PHYS_BASE,
90 +                                         KIRKWOOD_PCIE1_MEM_SIZE,
91 +                                         MVEBU_MBUS_NO_REMAP,
92 +                                         MVEBU_MBUS_PCI_MEM);
93 +
94         vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE;
95  
96         if (portmask & KW_PCIE0)