aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/arm/mrvl/feroceon.txt16
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/boot/dts/Makefile7
-rw-r--r--arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts62
-rw-r--r--arch/arm/include/asm/hardware/cache-feroceon-l2.h (renamed from arch/arm/plat-orion/include/plat/cache-feroceon-l2.h)4
-rw-r--r--arch/arm/mach-kirkwood/Kconfig7
-rw-r--r--arch/arm/mach-kirkwood/Makefile4
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c113
-rw-r--r--arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c50
-rw-r--r--arch/arm/mach-kirkwood/common.c3
-rw-r--r--arch/arm/mach-kirkwood/common.h13
-rw-r--r--arch/arm/mach-kirkwood/include/mach/bridge-regs.h2
-rw-r--r--arch/arm/mach-kirkwood/pm.c9
-rw-r--r--arch/arm/mach-kirkwood/pm.h26
-rw-r--r--arch/arm/mach-mv78xx0/common.c2
-rw-r--r--arch/arm/mach-mvebu/Kconfig36
-rw-r--r--arch/arm/mach-mvebu/Makefile2
-rw-r--r--arch/arm/mach-mvebu/board-t5325.c41
-rw-r--r--arch/arm/mach-mvebu/board.h22
-rw-r--r--arch/arm/mach-mvebu/kirkwood-pm.c76
-rw-r--r--arch/arm/mach-mvebu/kirkwood-pm.h26
-rw-r--r--arch/arm/mach-mvebu/kirkwood.c199
-rw-r--r--arch/arm/mach-mvebu/kirkwood.h22
-rw-r--r--arch/arm/mach-mvebu/mvebu-soc-id.c1
-rw-r--r--arch/arm/mm/Kconfig2
-rw-r--r--arch/arm/mm/cache-feroceon-l2.c45
26 files changed, 682 insertions, 110 deletions
diff --git a/Documentation/devicetree/bindings/arm/mrvl/feroceon.txt b/Documentation/devicetree/bindings/arm/mrvl/feroceon.txt
new file mode 100644
index 000000000000..0d244b999d10
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mrvl/feroceon.txt
@@ -0,0 +1,16 @@
1* Marvell Feroceon Cache
2
3Required properties:
4- compatible : Should be either "marvell,feroceon-cache" or
5 "marvell,kirkwood-cache".
6
7Optional properties:
8- reg : Address of the L2 cache control register. Mandatory for
9 "marvell,kirkwood-cache", not used by "marvell,feroceon-cache"
10
11
12Example:
13 l2: l2-cache@20128 {
14 compatible = "marvell,kirkwood-cache";
15 reg = <0x20128 0x4>;
16 };
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4f13bf3d1870..ae5d6152d977 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -898,7 +898,7 @@ config ARCH_MULTI_V5
898 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" 898 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
899 depends on !ARCH_MULTI_V6_V7 899 depends on !ARCH_MULTI_V6_V7
900 select ARCH_MULTI_V4_V5 900 select ARCH_MULTI_V4_V5
901 select CPU_ARM926T if (!CPU_ARM946E || CPU_ARM1020 || \ 901 select CPU_ARM926T if !(CPU_ARM946E || CPU_ARM1020 || \
902 CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \ 902 CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \
903 CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON) 903 CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON)
904 904
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4a89023f55ab..87c99d3cfa39 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -82,8 +82,8 @@ dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \
82 ecx-2000.dtb 82 ecx-2000.dtb
83dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ 83dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
84 integratorcp.dtb 84 integratorcp.dtb
85dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb 85kirkwood := \
86dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \ 86 kirkwood-cloudbox.dtb \
87 kirkwood-db-88f6281.dtb \ 87 kirkwood-db-88f6281.dtb \
88 kirkwood-db-88f6282.dtb \ 88 kirkwood-db-88f6282.dtb \
89 kirkwood-dns320.dtb \ 89 kirkwood-dns320.dtb \
@@ -117,6 +117,9 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
117 kirkwood-topkick.dtb \ 117 kirkwood-topkick.dtb \
118 kirkwood-ts219-6281.dtb \ 118 kirkwood-ts219-6281.dtb \
119 kirkwood-ts219-6282.dtb 119 kirkwood-ts219-6282.dtb
120dtb-$(CONFIG_ARCH_KIRKWOOD) += $(kirkwood)
121dtb-$(CONFIG_MACH_KIRKWOOD) += $(kirkwood)
122dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
120dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb 123dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
121dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb 124dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
122dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ 125dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
index dc86429756d7..2cb0dc529165 100644
--- a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
+++ b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
@@ -122,4 +122,66 @@
122 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; 122 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
123 }; 123 };
124 }; 124 };
125
126 dsa@0 {
127 compatible = "marvell,dsa";
128 #address-cells = <2>;
129 #size-cells = <0>;
130
131 dsa,ethernet = <&eth0>;
132 dsa,mii-bus = <&ethphy0>;
133
134 switch@0 {
135 #address-cells = <1>;
136 #size-cells = <0>;
137 reg = <0 0>; /* MDIO address 0, switch 0 in tree */
138
139 port@0 {
140 reg = <0>;
141 label = "lan1";
142 };
143
144 port@1 {
145 reg = <1>;
146 label = "lan2";
147 };
148
149 port@2 {
150 reg = <2>;
151 label = "lan3";
152 };
153
154 port@3 {
155 reg = <3>;
156 label = "lan4";
157 };
158
159 port@4 {
160 reg = <4>;
161 label = "wan";
162 };
163
164 port@5 {
165 reg = <5>;
166 label = "cpu";
167 };
168 };
169 };
170};
171
172&mdio {
173 status = "okay";
174
175 ethphy0: ethernet-phy@ff {
176 reg = <0xff>; /* No phy attached */
177 speed = <1000>;
178 duplex = <1>;
179 };
180};
181
182&eth0 {
183 status = "okay";
184 ethernet0-port@0 {
185 phy-handle = <&ethphy0>;
186 };
125}; 187};
diff --git a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h b/arch/arm/include/asm/hardware/cache-feroceon-l2.h
index 06f982d55697..12e1588dc4f1 100644
--- a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h
+++ b/arch/arm/include/asm/hardware/cache-feroceon-l2.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/cache-feroceon-l2.h 2 * arch/arm/include/asm/hardware/cache-feroceon-l2.h
3 * 3 *
4 * Copyright (C) 2008 Marvell Semiconductor 4 * Copyright (C) 2008 Marvell Semiconductor
5 * 5 *
@@ -9,3 +9,5 @@
9 */ 9 */
10 10
11extern void __init feroceon_l2_init(int l2_wt_override); 11extern void __init feroceon_l2_init(int l2_wt_override);
12extern int __init feroceon_of_init(void);
13
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index fe8319ad3158..df4b26340ae4 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -106,13 +106,6 @@ config ARCH_KIRKWOOD_DT
106 Say 'Y' here if you want your kernel to support the 106 Say 'Y' here if you want your kernel to support the
107 Marvell Kirkwood using flattened device tree. 107 Marvell Kirkwood using flattened device tree.
108 108
109config MACH_MV88F6281GTW_GE_DT
110 bool "Marvell 88F6281 GTW GE Board (Flattened Device Tree)"
111 depends on ARCH_KIRKWOOD_DT
112 help
113 Say 'Y' here if you want your kernel to support the
114 Marvell 88F6281 GTW GE Board (Flattened Device Tree).
115
116endmenu 109endmenu
117 110
118endif 111endif
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 144b51102939..3a72c5c6e747 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -1,5 +1,4 @@
1obj-y += common.o pcie.o 1obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o common.o pcie.o
2obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o
3obj-$(CONFIG_PM) += pm.o 2obj-$(CONFIG_PM) += pm.o
4 3
5obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o 4obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
@@ -13,4 +12,3 @@ obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
13obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o 12obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
14 13
15obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 14obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
16obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT) += board-mv88f6281gtw_ge.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 78188159484d..2801da49e2a3 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -19,11 +19,84 @@
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
21#include <linux/irqchip.h> 21#include <linux/irqchip.h>
22#include <linux/kexec.h> 22#include <asm/hardware/cache-feroceon-l2.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
24#include <mach/bridge-regs.h> 25#include <mach/bridge-regs.h>
25#include <plat/common.h> 26#include <plat/common.h>
26#include "common.h" 27#include <plat/pcie.h>
28#include "pm.h"
29
30static struct map_desc kirkwood_io_desc[] __initdata = {
31 {
32 .virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE,
33 .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
34 .length = KIRKWOOD_REGS_SIZE,
35 .type = MT_DEVICE,
36 },
37};
38
39static void __init kirkwood_map_io(void)
40{
41 iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
42}
43
44static struct resource kirkwood_cpufreq_resources[] = {
45 [0] = {
46 .start = CPU_CONTROL_PHYS,
47 .end = CPU_CONTROL_PHYS + 3,
48 .flags = IORESOURCE_MEM,
49 },
50};
51
52static struct platform_device kirkwood_cpufreq_device = {
53 .name = "kirkwood-cpufreq",
54 .id = -1,
55 .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources),
56 .resource = kirkwood_cpufreq_resources,
57};
58
59static void __init kirkwood_cpufreq_init(void)
60{
61 platform_device_register(&kirkwood_cpufreq_device);
62}
63
64static struct resource kirkwood_cpuidle_resource[] = {
65 {
66 .flags = IORESOURCE_MEM,
67 .start = DDR_OPERATION_BASE,
68 .end = DDR_OPERATION_BASE + 3,
69 },
70};
71
72static struct platform_device kirkwood_cpuidle = {
73 .name = "kirkwood_cpuidle",
74 .id = -1,
75 .resource = kirkwood_cpuidle_resource,
76 .num_resources = 1,
77};
78
79static void __init kirkwood_cpuidle_init(void)
80{
81 platform_device_register(&kirkwood_cpuidle);
82}
83
84/* Temporary here since mach-mvebu has a function we can use */
85static void kirkwood_restart(enum reboot_mode mode, const char *cmd)
86{
87 /*
88 * Enable soft reset to assert RSTOUTn.
89 */
90 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
91
92 /*
93 * Assert soft reset.
94 */
95 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
96
97 while (1)
98 ;
99}
27 100
28#define MV643XX_ETH_MAC_ADDR_LOW 0x0414 101#define MV643XX_ETH_MAC_ADDR_LOW 0x0414
29#define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 102#define MV643XX_ETH_MAC_ADDR_HIGH 0x0418
@@ -104,35 +177,35 @@ eth_fixup_skip:
104 } 177 }
105} 178}
106 179
107static void __init kirkwood_dt_init(void) 180/*
181 * Disable propagation of mbus errors to the CPU local bus, as this
182 * causes mbus errors (which can occur for example for PCI aborts) to
183 * throw CPU aborts, which we're not set up to deal with.
184 */
185static void __init kirkwood_disable_mbus_error_propagation(void)
108{ 186{
109 pr_info("Kirkwood: %s.\n", kirkwood_id()); 187 void __iomem *cpu_config;
110 188
111 /* 189 cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
112 * Disable propagation of mbus errors to the CPU local bus, 190 writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
113 * as this causes mbus errors (which can occur for example 191 iounmap(cpu_config);
114 * for PCI aborts) to throw CPU aborts, which we're not set 192}
115 * up to deal with.
116 */
117 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
118 193
119 BUG_ON(mvebu_mbus_dt_init()); 194static void __init kirkwood_dt_init(void)
195{
196 kirkwood_disable_mbus_error_propagation();
120 197
121 kirkwood_l2_init(); 198 BUG_ON(mvebu_mbus_dt_init());
122 199
200#ifdef CONFIG_CACHE_FEROCEON_L2
201 feroceon_of_init();
202#endif
123 kirkwood_cpufreq_init(); 203 kirkwood_cpufreq_init();
124 kirkwood_cpuidle_init(); 204 kirkwood_cpuidle_init();
125 205
126 kirkwood_pm_init(); 206 kirkwood_pm_init();
127 kirkwood_dt_eth_fixup(); 207 kirkwood_dt_eth_fixup();
128 208
129#ifdef CONFIG_KEXEC
130 kexec_reinit = kirkwood_enable_pcie;
131#endif
132
133 if (of_machine_is_compatible("marvell,mv88f6281gtw-ge"))
134 mv88f6281gtw_ge_init();
135
136 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 209 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
137} 210}
138 211
diff --git a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c b/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
deleted file mode 100644
index ee5eea678c11..000000000000
--- a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
3 *
4 * Marvell 88F6281 GTW GE Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/irq.h>
15#include <linux/timer.h>
16#include <linux/mv643xx_eth.h>
17#include <linux/ethtool.h>
18#include <linux/gpio.h>
19#include <net/dsa.h>
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22#include <asm/mach/pci.h>
23#include <mach/kirkwood.h>
24#include "common.h"
25
26static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
27 .phy_addr = MV643XX_ETH_PHY_NONE,
28 .speed = SPEED_1000,
29 .duplex = DUPLEX_FULL,
30};
31
32static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
33 .port_names[0] = "lan1",
34 .port_names[1] = "lan2",
35 .port_names[2] = "lan3",
36 .port_names[3] = "lan4",
37 .port_names[4] = "wan",
38 .port_names[5] = "cpu",
39};
40
41static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
42 .nr_chips = 1,
43 .chip = &mv88f6281gtw_ge_switch_chip_data,
44};
45
46void __init mv88f6281gtw_ge_init(void)
47{
48 kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
49 kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
50}
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index f3407a5db216..255f33a3903c 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -25,10 +25,10 @@
25#include <asm/page.h> 25#include <asm/page.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <asm/mach/time.h> 27#include <asm/mach/time.h>
28#include <asm/hardware/cache-feroceon-l2.h>
28#include <mach/kirkwood.h> 29#include <mach/kirkwood.h>
29#include <mach/bridge-regs.h> 30#include <mach/bridge-regs.h>
30#include <linux/platform_data/asoc-kirkwood.h> 31#include <linux/platform_data/asoc-kirkwood.h>
31#include <plat/cache-feroceon-l2.h>
32#include <linux/platform_data/mmc-mvsdio.h> 32#include <linux/platform_data/mmc-mvsdio.h>
33#include <linux/platform_data/mtd-orion_nand.h> 33#include <linux/platform_data/mtd-orion_nand.h>
34#include <linux/platform_data/usb-ehci-orion.h> 34#include <linux/platform_data/usb-ehci-orion.h>
@@ -36,6 +36,7 @@
36#include <plat/time.h> 36#include <plat/time.h>
37#include <linux/platform_data/dma-mv_xor.h> 37#include <linux/platform_data/dma-mv_xor.h>
38#include "common.h" 38#include "common.h"
39#include "pm.h"
39 40
40/* These can go away once Kirkwood uses the mvebu-mbus DT binding */ 41/* These can go away once Kirkwood uses the mvebu-mbus DT binding */
41#define KIRKWOOD_MBUS_NAND_TARGET 0x01 42#define KIRKWOOD_MBUS_NAND_TARGET 0x01
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 05fd648df543..832a4e2ab8d7 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -58,19 +58,6 @@ void kirkwood_cpufreq_init(void);
58void kirkwood_restart(enum reboot_mode, const char *); 58void kirkwood_restart(enum reboot_mode, const char *);
59void kirkwood_clk_init(void); 59void kirkwood_clk_init(void);
60 60
61#ifdef CONFIG_PM
62void kirkwood_pm_init(void);
63#else
64static inline void kirkwood_pm_init(void) {};
65#endif
66
67/* board init functions for boards not fully converted to fdt */
68#ifdef CONFIG_MACH_MV88F6281GTW_GE_DT
69void mv88f6281gtw_ge_init(void);
70#else
71static inline void mv88f6281gtw_ge_init(void) {};
72#endif
73
74/* early init functions not converted to fdt yet */ 61/* early init functions not converted to fdt yet */
75char *kirkwood_id(void); 62char *kirkwood_id(void);
76void kirkwood_l2_init(void); 63void kirkwood_l2_init(void);
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 8b9d1c9ff199..6e5077e2ec26 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -14,6 +14,7 @@
14#include <mach/kirkwood.h> 14#include <mach/kirkwood.h>
15 15
16#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100) 16#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100)
17#define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100)
17#define CPU_CONFIG_ERROR_PROP 0x00000004 18#define CPU_CONFIG_ERROR_PROP 0x00000004
18 19
19#define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104) 20#define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104)
@@ -79,5 +80,6 @@
79#define CGC_RESERVED (0x6 << 21) 80#define CGC_RESERVED (0x6 << 21)
80 81
81#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118) 82#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118)
83#define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x118)
82 84
83#endif 85#endif
diff --git a/arch/arm/mach-kirkwood/pm.c b/arch/arm/mach-kirkwood/pm.c
index c6ab8d9303a5..8e5e0329d04c 100644
--- a/arch/arm/mach-kirkwood/pm.c
+++ b/arch/arm/mach-kirkwood/pm.c
@@ -21,15 +21,16 @@
21#include "common.h" 21#include "common.h"
22 22
23static void __iomem *ddr_operation_base; 23static void __iomem *ddr_operation_base;
24static void __iomem *memory_pm_ctrl;
24 25
25static void kirkwood_low_power(void) 26static void kirkwood_low_power(void)
26{ 27{
27 u32 mem_pm_ctrl; 28 u32 mem_pm_ctrl;
28 29
29 mem_pm_ctrl = readl(MEMORY_PM_CTRL); 30 mem_pm_ctrl = readl(memory_pm_ctrl);
30 31
31 /* Set peripherals to low-power mode */ 32 /* Set peripherals to low-power mode */
32 writel_relaxed(~0, MEMORY_PM_CTRL); 33 writel_relaxed(~0, memory_pm_ctrl);
33 34
34 /* Set DDR in self-refresh */ 35 /* Set DDR in self-refresh */
35 writel_relaxed(0x7, ddr_operation_base); 36 writel_relaxed(0x7, ddr_operation_base);
@@ -41,7 +42,7 @@ static void kirkwood_low_power(void)
41 */ 42 */
42 cpu_do_idle(); 43 cpu_do_idle();
43 44
44 writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL); 45 writel_relaxed(mem_pm_ctrl, memory_pm_ctrl);
45} 46}
46 47
47static int kirkwood_suspend_enter(suspend_state_t state) 48static int kirkwood_suspend_enter(suspend_state_t state)
@@ -69,5 +70,7 @@ static const struct platform_suspend_ops kirkwood_suspend_ops = {
69void __init kirkwood_pm_init(void) 70void __init kirkwood_pm_init(void)
70{ 71{
71 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); 72 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
73 memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4);
74
72 suspend_set_ops(&kirkwood_suspend_ops); 75 suspend_set_ops(&kirkwood_suspend_ops);
73} 76}
diff --git a/arch/arm/mach-kirkwood/pm.h b/arch/arm/mach-kirkwood/pm.h
new file mode 100644
index 000000000000..21e7530f368b
--- /dev/null
+++ b/arch/arm/mach-kirkwood/pm.h
@@ -0,0 +1,26 @@
1/*
2 * Power Management driver for Marvell Kirkwood SoCs
3 *
4 * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
5 * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License,
9 * version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __ARCH_KIRKWOOD_PM_H
18#define __ARCH_KIRKWOOD_PM_H
19
20#ifdef CONFIG_PM
21void kirkwood_pm_init(void);
22#else
23static inline void kirkwood_pm_init(void) {};
24#endif
25
26#endif
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 75062eff2494..e6ac679bece9 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -15,11 +15,11 @@
15#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
16#include <linux/clk-provider.h> 16#include <linux/clk-provider.h>
17#include <linux/ethtool.h> 17#include <linux/ethtool.h>
18#include <asm/hardware/cache-feroceon-l2.h>
18#include <asm/mach/map.h> 19#include <asm/mach/map.h>
19#include <asm/mach/time.h> 20#include <asm/mach/time.h>
20#include <mach/mv78xx0.h> 21#include <mach/mv78xx0.h>
21#include <mach/bridge-regs.h> 22#include <mach/bridge-regs.h>
22#include <plat/cache-feroceon-l2.h>
23#include <linux/platform_data/usb-ehci-orion.h> 23#include <linux/platform_data/usb-ehci-orion.h>
24#include <linux/platform_data/mtd-orion_nand.h> 24#include <linux/platform_data/mtd-orion_nand.h>
25#include <plat/time.h> 25#include <plat/time.h>
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index f961ae4ec4ee..dd35de74efab 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -1,5 +1,5 @@
1config ARCH_MVEBU 1config ARCH_MVEBU
2 bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7 2 bool "Marvell Engineering Business Unit (MVEBU) SoCs" if (ARCH_MULTI_V7 || ARCH_MULTI_V5)
3 select ARCH_SUPPORTS_BIG_ENDIAN 3 select ARCH_SUPPORTS_BIG_ENDIAN
4 select CLKSRC_MMIO 4 select CLKSRC_MMIO
5 select GENERIC_IRQ_CHIP 5 select GENERIC_IRQ_CHIP
@@ -14,7 +14,7 @@ config ARCH_MVEBU
14 14
15if ARCH_MVEBU 15if ARCH_MVEBU
16 16
17menu "Marvell SOC with device tree" 17menu "Marvell EBU SoC variants"
18 18
19config MACH_MVEBU_V7 19config MACH_MVEBU_V7
20 bool 20 bool
@@ -22,7 +22,7 @@ config MACH_MVEBU_V7
22 select CACHE_L2X0 22 select CACHE_L2X0
23 23
24config MACH_ARMADA_370 24config MACH_ARMADA_370
25 bool "Marvell Armada 370 boards" 25 bool "Marvell Armada 370 boards" if ARCH_MULTI_V7
26 select ARMADA_370_CLK 26 select ARMADA_370_CLK
27 select CPU_PJ4B 27 select CPU_PJ4B
28 select MACH_MVEBU_V7 28 select MACH_MVEBU_V7
@@ -32,7 +32,7 @@ config MACH_ARMADA_370
32 on the Marvell Armada 370 SoC with device tree. 32 on the Marvell Armada 370 SoC with device tree.
33 33
34config MACH_ARMADA_375 34config MACH_ARMADA_375
35 bool "Marvell Armada 375 boards" 35 bool "Marvell Armada 375 boards" if ARCH_MULTI_V7
36 select ARM_ERRATA_720789 36 select ARM_ERRATA_720789
37 select ARM_ERRATA_753970 37 select ARM_ERRATA_753970
38 select ARM_GIC 38 select ARM_GIC
@@ -46,7 +46,7 @@ config MACH_ARMADA_375
46 on the Marvell Armada 375 SoC with device tree. 46 on the Marvell Armada 375 SoC with device tree.
47 47
48config MACH_ARMADA_38X 48config MACH_ARMADA_38X
49 bool "Marvell Armada 380/385 boards" 49 bool "Marvell Armada 380/385 boards" if ARCH_MULTI_V7
50 select ARM_ERRATA_720789 50 select ARM_ERRATA_720789
51 select ARM_ERRATA_753970 51 select ARM_ERRATA_753970
52 select ARM_GIC 52 select ARM_GIC
@@ -60,7 +60,7 @@ config MACH_ARMADA_38X
60 on the Marvell Armada 380/385 SoC with device tree. 60 on the Marvell Armada 380/385 SoC with device tree.
61 61
62config MACH_ARMADA_XP 62config MACH_ARMADA_XP
63 bool "Marvell Armada XP boards" 63 bool "Marvell Armada XP boards" if ARCH_MULTI_V7
64 select ARMADA_XP_CLK 64 select ARMADA_XP_CLK
65 select CPU_PJ4B 65 select CPU_PJ4B
66 select MACH_MVEBU_V7 66 select MACH_MVEBU_V7
@@ -69,6 +69,30 @@ config MACH_ARMADA_XP
69 Say 'Y' here if you want your kernel to support boards based 69 Say 'Y' here if you want your kernel to support boards based
70 on the Marvell Armada XP SoC with device tree. 70 on the Marvell Armada XP SoC with device tree.
71 71
72config MACH_KIRKWOOD
73 bool "Marvell Kirkwood boards" if ARCH_MULTI_V5
74 select ARCH_HAS_CPUFREQ
75 select ARCH_REQUIRE_GPIOLIB
76 select CPU_FEROCEON
77 select KIRKWOOD_CLK
78 select OF_IRQ
79 select ORION_IRQCHIP
80 select ORION_TIMER
81 select PCI
82 select PCI_QUIRKS
83 select PINCTRL_KIRKWOOD
84 select USE_OF
85 help
86 Say 'Y' here if you want your kernel to support boards based
87 on the Marvell Kirkwood device tree.
88
89config MACH_T5325
90 bool "HP T5325 thin client"
91 depends on MACH_KIRKWOOD
92 help
93 Say 'Y' here if you want your kernel to support the
94 HP T5325 Thin client
95
72endmenu 96endmenu
73 97
74endif 98endif
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 2c1db29db2ca..bbeb41ee3e75 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -8,3 +8,5 @@ obj-$(CONFIG_MACH_MVEBU_V7) += board-v7.o
8obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o 8obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o
9obj-$(CONFIG_SMP) += platsmp.o headsmp.o 9obj-$(CONFIG_SMP) += platsmp.o headsmp.o
10obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 10obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
11obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o
12obj-$(CONFIG_MACH_T5325) += board-t5325.o
diff --git a/arch/arm/mach-mvebu/board-t5325.c b/arch/arm/mach-mvebu/board-t5325.c
new file mode 100644
index 000000000000..65ace6db9f28
--- /dev/null
+++ b/arch/arm/mach-mvebu/board-t5325.c
@@ -0,0 +1,41 @@
1/*
2 * HP T5325 Board Setup
3 *
4 * Copyright (C) 2014
5 *
6 * Andrew Lunn <andrew@lunn.ch>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/i2c.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <sound/alc5623.h>
18#include "board.h"
19
20static struct platform_device hp_t5325_audio_device = {
21 .name = "t5325-audio",
22 .id = -1,
23};
24
25static struct alc5623_platform_data alc5621_data = {
26 .add_ctrl = 0x3700,
27 .jack_det_ctrl = 0x4810,
28};
29
30static struct i2c_board_info i2c_board_info[] __initdata = {
31 {
32 I2C_BOARD_INFO("alc5621", 0x1a),
33 .platform_data = &alc5621_data,
34 },
35};
36
37void __init t5325_init(void)
38{
39 i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
40 platform_device_register(&hp_t5325_audio_device);
41}
diff --git a/arch/arm/mach-mvebu/board.h b/arch/arm/mach-mvebu/board.h
new file mode 100644
index 000000000000..de7f0a191394
--- /dev/null
+++ b/arch/arm/mach-mvebu/board.h
@@ -0,0 +1,22 @@
1/*
2 * Board functions for Marvell System On Chip
3 *
4 * Copyright (C) 2014
5 *
6 * Andrew Lunn <andrew@lunn.ch>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef __ARCH_MVEBU_BOARD_H
14#define __ARCH_MVEBU_BOARD_H
15
16#ifdef CONFIG_MACH_T5325
17void t5325_init(void);
18#else
19static inline void t5325_init(void) {};
20#endif
21
22#endif
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.c b/arch/arm/mach-mvebu/kirkwood-pm.c
new file mode 100644
index 000000000000..cbb816f2120c
--- /dev/null
+++ b/arch/arm/mach-mvebu/kirkwood-pm.c
@@ -0,0 +1,76 @@
1/*
2 * Power Management driver for Marvell Kirkwood SoCs
3 *
4 * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
5 * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License,
9 * version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <linux/kernel.h>
18#include <linux/suspend.h>
19#include <linux/io.h>
20#include "kirkwood.h"
21
22static void __iomem *ddr_operation_base;
23static void __iomem *memory_pm_ctrl;
24
25static void kirkwood_low_power(void)
26{
27 u32 mem_pm_ctrl;
28
29 mem_pm_ctrl = readl(memory_pm_ctrl);
30
31 /* Set peripherals to low-power mode */
32 writel_relaxed(~0, memory_pm_ctrl);
33
34 /* Set DDR in self-refresh */
35 writel_relaxed(0x7, ddr_operation_base);
36
37 /*
38 * Set CPU in wait-for-interrupt state.
39 * This disables the CPU core clocks,
40 * the array clocks, and also the L2 controller.
41 */
42 cpu_do_idle();
43
44 writel_relaxed(mem_pm_ctrl, memory_pm_ctrl);
45}
46
47static int kirkwood_suspend_enter(suspend_state_t state)
48{
49 switch (state) {
50 case PM_SUSPEND_STANDBY:
51 kirkwood_low_power();
52 break;
53 default:
54 return -EINVAL;
55 }
56 return 0;
57}
58
59static int kirkwood_pm_valid_standby(suspend_state_t state)
60{
61 return state == PM_SUSPEND_STANDBY;
62}
63
64static const struct platform_suspend_ops kirkwood_suspend_ops = {
65 .enter = kirkwood_suspend_enter,
66 .valid = kirkwood_pm_valid_standby,
67};
68
69int __init kirkwood_pm_init(void)
70{
71 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
72 memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4);
73
74 suspend_set_ops(&kirkwood_suspend_ops);
75 return 0;
76}
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.h b/arch/arm/mach-mvebu/kirkwood-pm.h
new file mode 100644
index 000000000000..21e7530f368b
--- /dev/null
+++ b/arch/arm/mach-mvebu/kirkwood-pm.h
@@ -0,0 +1,26 @@
1/*
2 * Power Management driver for Marvell Kirkwood SoCs
3 *
4 * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
5 * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License,
9 * version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __ARCH_KIRKWOOD_PM_H
18#define __ARCH_KIRKWOOD_PM_H
19
20#ifdef CONFIG_PM
21void kirkwood_pm_init(void);
22#else
23static inline void kirkwood_pm_init(void) {};
24#endif
25
26#endif
diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c
new file mode 100644
index 000000000000..120207fc36f1
--- /dev/null
+++ b/arch/arm/mach-mvebu/kirkwood.c
@@ -0,0 +1,199 @@
1/*
2 * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
3 *
4 * arch/arm/mach-mvebu/kirkwood.c
5 *
6 * Flattened Device Tree board initialization
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/clk.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/mbus.h>
17#include <linux/of.h>
18#include <linux/of_address.h>
19#include <linux/of_net.h>
20#include <linux/of_platform.h>
21#include <linux/slab.h>
22#include <asm/hardware/cache-feroceon-l2.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include "kirkwood.h"
26#include "kirkwood-pm.h"
27#include "common.h"
28#include "board.h"
29
30static struct resource kirkwood_cpufreq_resources[] = {
31 [0] = {
32 .start = CPU_CONTROL_PHYS,
33 .end = CPU_CONTROL_PHYS + 3,
34 .flags = IORESOURCE_MEM,
35 },
36};
37
38static struct platform_device kirkwood_cpufreq_device = {
39 .name = "kirkwood-cpufreq",
40 .id = -1,
41 .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources),
42 .resource = kirkwood_cpufreq_resources,
43};
44
45static void __init kirkwood_cpufreq_init(void)
46{
47 platform_device_register(&kirkwood_cpufreq_device);
48}
49
50static struct resource kirkwood_cpuidle_resource[] = {
51 {
52 .flags = IORESOURCE_MEM,
53 .start = DDR_OPERATION_BASE,
54 .end = DDR_OPERATION_BASE + 3,
55 },
56};
57
58static struct platform_device kirkwood_cpuidle = {
59 .name = "kirkwood_cpuidle",
60 .id = -1,
61 .resource = kirkwood_cpuidle_resource,
62 .num_resources = 1,
63};
64
65static void __init kirkwood_cpuidle_init(void)
66{
67 platform_device_register(&kirkwood_cpuidle);
68}
69
70#define MV643XX_ETH_MAC_ADDR_LOW 0x0414
71#define MV643XX_ETH_MAC_ADDR_HIGH 0x0418
72
73static void __init kirkwood_dt_eth_fixup(void)
74{
75 struct device_node *np;
76
77 /*
78 * The ethernet interfaces forget the MAC address assigned by u-boot
79 * if the clocks are turned off. Usually, u-boot on kirkwood boards
80 * has no DT support to properly set local-mac-address property.
81 * As a workaround, we get the MAC address from mv643xx_eth registers
82 * and update the port device node if no valid MAC address is set.
83 */
84 for_each_compatible_node(np, NULL, "marvell,kirkwood-eth-port") {
85 struct device_node *pnp = of_get_parent(np);
86 struct clk *clk;
87 struct property *pmac;
88 void __iomem *io;
89 u8 *macaddr;
90 u32 reg;
91
92 if (!pnp)
93 continue;
94
95 /* skip disabled nodes or nodes with valid MAC address*/
96 if (!of_device_is_available(pnp) || of_get_mac_address(np))
97 goto eth_fixup_skip;
98
99 clk = of_clk_get(pnp, 0);
100 if (IS_ERR(clk))
101 goto eth_fixup_skip;
102
103 io = of_iomap(pnp, 0);
104 if (!io)
105 goto eth_fixup_no_map;
106
107 /* ensure port clock is not gated to not hang CPU */
108 clk_prepare_enable(clk);
109
110 /* store MAC address register contents in local-mac-address */
111 pr_err(FW_INFO "%s: local-mac-address is not set\n",
112 np->full_name);
113
114 pmac = kzalloc(sizeof(*pmac) + 6, GFP_KERNEL);
115 if (!pmac)
116 goto eth_fixup_no_mem;
117
118 pmac->value = pmac + 1;
119 pmac->length = 6;
120 pmac->name = kstrdup("local-mac-address", GFP_KERNEL);
121 if (!pmac->name) {
122 kfree(pmac);
123 goto eth_fixup_no_mem;
124 }
125
126 macaddr = pmac->value;
127 reg = readl(io + MV643XX_ETH_MAC_ADDR_HIGH);
128 macaddr[0] = (reg >> 24) & 0xff;
129 macaddr[1] = (reg >> 16) & 0xff;
130 macaddr[2] = (reg >> 8) & 0xff;
131 macaddr[3] = reg & 0xff;
132
133 reg = readl(io + MV643XX_ETH_MAC_ADDR_LOW);
134 macaddr[4] = (reg >> 8) & 0xff;
135 macaddr[5] = reg & 0xff;
136
137 of_update_property(np, pmac);
138
139eth_fixup_no_mem:
140 iounmap(io);
141 clk_disable_unprepare(clk);
142eth_fixup_no_map:
143 clk_put(clk);
144eth_fixup_skip:
145 of_node_put(pnp);
146 }
147}
148
149/*
150 * Disable propagation of mbus errors to the CPU local bus, as this
151 * causes mbus errors (which can occur for example for PCI aborts) to
152 * throw CPU aborts, which we're not set up to deal with.
153 */
154void kirkwood_disable_mbus_error_propagation(void)
155{
156 void __iomem *cpu_config;
157
158 cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
159 writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
160}
161
162static struct of_dev_auxdata auxdata[] __initdata = {
163 OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000,
164 "mvebu-audio", NULL),
165 { /* sentinel */ }
166};
167
168static void __init kirkwood_dt_init(void)
169{
170 kirkwood_disable_mbus_error_propagation();
171
172 BUG_ON(mvebu_mbus_dt_init());
173
174#ifdef CONFIG_CACHE_FEROCEON_L2
175 feroceon_of_init();
176#endif
177 kirkwood_cpufreq_init();
178 kirkwood_cpuidle_init();
179
180 kirkwood_pm_init();
181 kirkwood_dt_eth_fixup();
182
183 if (of_machine_is_compatible("hp,t5325"))
184 t5325_init();
185
186 of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL);
187}
188
189static const char * const kirkwood_dt_board_compat[] = {
190 "marvell,kirkwood",
191 NULL
192};
193
194DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
195 /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
196 .init_machine = kirkwood_dt_init,
197 .restart = mvebu_restart,
198 .dt_compat = kirkwood_dt_board_compat,
199MACHINE_END
diff --git a/arch/arm/mach-mvebu/kirkwood.h b/arch/arm/mach-mvebu/kirkwood.h
new file mode 100644
index 000000000000..89f3d1f51643
--- /dev/null
+++ b/arch/arm/mach-mvebu/kirkwood.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/mach-mvebu/kirkwood.h
3 *
4 * Generic definitions for Marvell Kirkwood SoC flavors:
5 * 88F6180, 88F6192 and 88F6281.
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#define KIRKWOOD_REGS_PHYS_BASE 0xf1000000
13#define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000)
14#define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000)
15
16#define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418)
17
18#define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100)
19#define CPU_CONFIG_ERROR_PROP 0x00000004
20
21#define CPU_CONTROL_PHYS (BRIDGE_PHYS_BASE + 0x0104)
22#define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x0118)
diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c
index f3b325f6cbd4..f3d4cf53f746 100644
--- a/arch/arm/mach-mvebu/mvebu-soc-id.c
+++ b/arch/arm/mach-mvebu/mvebu-soc-id.c
@@ -38,6 +38,7 @@ static bool is_id_valid;
38static const struct of_device_id mvebu_pcie_of_match_table[] = { 38static const struct of_device_id mvebu_pcie_of_match_table[] = {
39 { .compatible = "marvell,armada-xp-pcie", }, 39 { .compatible = "marvell,armada-xp-pcie", },
40 { .compatible = "marvell,armada-370-pcie", }, 40 { .compatible = "marvell,armada-370-pcie", },
41 { .compatible = "marvell,kirkwood-pcie" },
41 {}, 42 {},
42}; 43};
43 44
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 1f8fed94c2a4..dccd7e177653 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -855,7 +855,7 @@ config OUTER_CACHE_SYNC
855 855
856config CACHE_FEROCEON_L2 856config CACHE_FEROCEON_L2
857 bool "Enable the Feroceon L2 cache controller" 857 bool "Enable the Feroceon L2 cache controller"
858 depends on ARCH_KIRKWOOD || ARCH_MV78XX0 858 depends on ARCH_KIRKWOOD || ARCH_MV78XX0 || ARCH_MVEBU
859 default y 859 default y
860 select OUTER_CACHE 860 select OUTER_CACHE
861 help 861 help
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c
index 48bc3c0a87ce..8dc1a2b5a8ed 100644
--- a/arch/arm/mm/cache-feroceon-l2.c
+++ b/arch/arm/mm/cache-feroceon-l2.c
@@ -13,10 +13,15 @@
13 */ 13 */
14 14
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/of.h>
17#include <linux/of_address.h>
16#include <linux/highmem.h> 18#include <linux/highmem.h>
19#include <linux/io.h>
17#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
18#include <asm/cp15.h> 21#include <asm/cp15.h>
19#include <plat/cache-feroceon-l2.h> 22#include <asm/hardware/cache-feroceon-l2.h>
23
24#define L2_WRITETHROUGH_KIRKWOOD BIT(4)
20 25
21/* 26/*
22 * Low-level cache maintenance operations. 27 * Low-level cache maintenance operations.
@@ -350,3 +355,41 @@ void __init feroceon_l2_init(int __l2_wt_override)
350 printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n", 355 printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n",
351 l2_wt_override ? ", in WT override mode" : ""); 356 l2_wt_override ? ", in WT override mode" : "");
352} 357}
358#ifdef CONFIG_OF
359static const struct of_device_id feroceon_ids[] __initconst = {
360 { .compatible = "marvell,kirkwood-cache"},
361 { .compatible = "marvell,feroceon-cache"},
362 {}
363};
364
365int __init feroceon_of_init(void)
366{
367 struct device_node *node;
368 void __iomem *base;
369 bool l2_wt_override = false;
370 struct resource res;
371
372#if defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH)
373 l2_wt_override = true;
374#endif
375
376 node = of_find_matching_node(NULL, feroceon_ids);
377 if (node && of_device_is_compatible(node, "marvell,kirkwood-cache")) {
378 if (of_address_to_resource(node, 0, &res))
379 return -ENODEV;
380
381 base = ioremap(res.start, resource_size(&res));
382 if (!base)
383 return -ENOMEM;
384
385 if (l2_wt_override)
386 writel(readl(base) | L2_WRITETHROUGH_KIRKWOOD, base);
387 else
388 writel(readl(base) & ~L2_WRITETHROUGH_KIRKWOOD, base);
389 }
390
391 feroceon_l2_init(l2_wt_override);
392
393 return 0;
394}
395#endif