diff options
author | Olof Johansson <olof@lixom.net> | 2014-07-05 00:51:19 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-07-05 00:51:19 -0400 |
commit | 25d11631f9a3352f0556f3281b0f692a2b59943d (patch) | |
tree | d40c452a4bd3c8f5f1835d3e3e7e00f66f4cb2a0 /arch/arm/mach-mvebu | |
parent | d767af5e66ee11928bd17df32b342a8737177376 (diff) | |
parent | 6509dc74c9f55ffaa558738b96c4da8b98d39571 (diff) |
Merge tag 'mvebu-fixes-3.16-2' of git://git.infradead.org/linux-mvebu into fixes
mvebu fixes for v3.16 (round #2)
- mvebu
- Fix PCIe deadlock now that SMP is enabled
- Fix cpuidle for big-endian systems
* tag 'mvebu-fixes-3.16-2' of git://git.infradead.org/linux-mvebu:
ARM: mvebu: fix cpuidle implementation to work on big-endian systems
ARM: mvebu: update L2/PCIe deadlock workaround after L2CC cleanup
ARM: mvebu: move Armada 375 external abort logic as a quirk
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r-- | arch/arm/mach-mvebu/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/board-v7.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/pmsu.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/pmsu_ll.S | 25 |
4 files changed, 47 insertions, 18 deletions
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index 2ecb828e4a8b..1636cdbef01a 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile | |||
@@ -7,7 +7,7 @@ CFLAGS_pmsu.o := -march=armv7-a | |||
7 | obj-y += system-controller.o mvebu-soc-id.o | 7 | obj-y += system-controller.o mvebu-soc-id.o |
8 | 8 | ||
9 | ifeq ($(CONFIG_MACH_MVEBU_V7),y) | 9 | ifeq ($(CONFIG_MACH_MVEBU_V7),y) |
10 | obj-y += cpu-reset.o board-v7.o coherency.o coherency_ll.o pmsu.o | 10 | obj-y += cpu-reset.o board-v7.o coherency.o coherency_ll.o pmsu.o pmsu_ll.o |
11 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o platsmp-a9.o headsmp-a9.o | 11 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o platsmp-a9.o headsmp-a9.o |
12 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 12 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
13 | endif | 13 | endif |
diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index 8bb742fdf5ca..b2524d689f21 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/mbus.h> | 23 | #include <linux/mbus.h> |
24 | #include <linux/signal.h> | 24 | #include <linux/signal.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/irqchip.h> | ||
26 | #include <asm/hardware/cache-l2x0.h> | 27 | #include <asm/hardware/cache-l2x0.h> |
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
@@ -71,17 +72,23 @@ static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr, | |||
71 | return 1; | 72 | return 1; |
72 | } | 73 | } |
73 | 74 | ||
74 | static void __init mvebu_timer_and_clk_init(void) | 75 | static void __init mvebu_init_irq(void) |
75 | { | 76 | { |
76 | of_clk_init(NULL); | 77 | irqchip_init(); |
77 | clocksource_of_init(); | ||
78 | mvebu_scu_enable(); | 78 | mvebu_scu_enable(); |
79 | coherency_init(); | 79 | coherency_init(); |
80 | BUG_ON(mvebu_mbus_dt_init(coherency_available())); | 80 | BUG_ON(mvebu_mbus_dt_init(coherency_available())); |
81 | } | ||
82 | |||
83 | static void __init external_abort_quirk(void) | ||
84 | { | ||
85 | u32 dev, rev; | ||
81 | 86 | ||
82 | if (of_machine_is_compatible("marvell,armada375")) | 87 | if (mvebu_get_soc_id(&dev, &rev) == 0 && rev > ARMADA_375_Z1_REV) |
83 | hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0, | 88 | return; |
84 | "imprecise external abort"); | 89 | |
90 | hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0, | ||
91 | "imprecise external abort"); | ||
85 | } | 92 | } |
86 | 93 | ||
87 | static void __init i2c_quirk(void) | 94 | static void __init i2c_quirk(void) |
@@ -169,8 +176,10 @@ static void __init mvebu_dt_init(void) | |||
169 | { | 176 | { |
170 | if (of_machine_is_compatible("plathome,openblocks-ax3-4")) | 177 | if (of_machine_is_compatible("plathome,openblocks-ax3-4")) |
171 | i2c_quirk(); | 178 | i2c_quirk(); |
172 | if (of_machine_is_compatible("marvell,a375-db")) | 179 | if (of_machine_is_compatible("marvell,a375-db")) { |
180 | external_abort_quirk(); | ||
173 | thermal_quirk(); | 181 | thermal_quirk(); |
182 | } | ||
174 | 183 | ||
175 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 184 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
176 | } | 185 | } |
@@ -185,7 +194,7 @@ DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)") | |||
185 | .l2c_aux_mask = ~0, | 194 | .l2c_aux_mask = ~0, |
186 | .smp = smp_ops(armada_xp_smp_ops), | 195 | .smp = smp_ops(armada_xp_smp_ops), |
187 | .init_machine = mvebu_dt_init, | 196 | .init_machine = mvebu_dt_init, |
188 | .init_time = mvebu_timer_and_clk_init, | 197 | .init_irq = mvebu_init_irq, |
189 | .restart = mvebu_restart, | 198 | .restart = mvebu_restart, |
190 | .dt_compat = armada_370_xp_dt_compat, | 199 | .dt_compat = armada_370_xp_dt_compat, |
191 | MACHINE_END | 200 | MACHINE_END |
@@ -198,7 +207,7 @@ static const char * const armada_375_dt_compat[] = { | |||
198 | DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)") | 207 | DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)") |
199 | .l2c_aux_val = 0, | 208 | .l2c_aux_val = 0, |
200 | .l2c_aux_mask = ~0, | 209 | .l2c_aux_mask = ~0, |
201 | .init_time = mvebu_timer_and_clk_init, | 210 | .init_irq = mvebu_init_irq, |
202 | .init_machine = mvebu_dt_init, | 211 | .init_machine = mvebu_dt_init, |
203 | .restart = mvebu_restart, | 212 | .restart = mvebu_restart, |
204 | .dt_compat = armada_375_dt_compat, | 213 | .dt_compat = armada_375_dt_compat, |
@@ -213,7 +222,7 @@ static const char * const armada_38x_dt_compat[] = { | |||
213 | DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)") | 222 | DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)") |
214 | .l2c_aux_val = 0, | 223 | .l2c_aux_val = 0, |
215 | .l2c_aux_mask = ~0, | 224 | .l2c_aux_mask = ~0, |
216 | .init_time = mvebu_timer_and_clk_init, | 225 | .init_irq = mvebu_init_irq, |
217 | .restart = mvebu_restart, | 226 | .restart = mvebu_restart, |
218 | .dt_compat = armada_38x_dt_compat, | 227 | .dt_compat = armada_38x_dt_compat, |
219 | MACHINE_END | 228 | MACHINE_END |
diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c index 53a55c8520bf..a1d407c0febe 100644 --- a/arch/arm/mach-mvebu/pmsu.c +++ b/arch/arm/mach-mvebu/pmsu.c | |||
@@ -66,6 +66,8 @@ static void __iomem *pmsu_mp_base; | |||
66 | extern void ll_disable_coherency(void); | 66 | extern void ll_disable_coherency(void); |
67 | extern void ll_enable_coherency(void); | 67 | extern void ll_enable_coherency(void); |
68 | 68 | ||
69 | extern void armada_370_xp_cpu_resume(void); | ||
70 | |||
69 | static struct platform_device armada_xp_cpuidle_device = { | 71 | static struct platform_device armada_xp_cpuidle_device = { |
70 | .name = "cpuidle-armada-370-xp", | 72 | .name = "cpuidle-armada-370-xp", |
71 | }; | 73 | }; |
@@ -140,13 +142,6 @@ static void armada_370_xp_pmsu_enable_l2_powerdown_onidle(void) | |||
140 | writel(reg, pmsu_mp_base + L2C_NFABRIC_PM_CTL); | 142 | writel(reg, pmsu_mp_base + L2C_NFABRIC_PM_CTL); |
141 | } | 143 | } |
142 | 144 | ||
143 | static void armada_370_xp_cpu_resume(void) | ||
144 | { | ||
145 | asm volatile("bl ll_add_cpu_to_smp_group\n\t" | ||
146 | "bl ll_enable_coherency\n\t" | ||
147 | "b cpu_resume\n\t"); | ||
148 | } | ||
149 | |||
150 | /* No locking is needed because we only access per-CPU registers */ | 145 | /* No locking is needed because we only access per-CPU registers */ |
151 | void armada_370_xp_pmsu_idle_prepare(bool deepidle) | 146 | void armada_370_xp_pmsu_idle_prepare(bool deepidle) |
152 | { | 147 | { |
diff --git a/arch/arm/mach-mvebu/pmsu_ll.S b/arch/arm/mach-mvebu/pmsu_ll.S new file mode 100644 index 000000000000..fc3de68d8c54 --- /dev/null +++ b/arch/arm/mach-mvebu/pmsu_ll.S | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Marvell | ||
3 | * | ||
4 | * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
5 | * Gregory Clement <gregory.clement@free-electrons.com> | ||
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 | #include <linux/linkage.h> | ||
13 | #include <asm/assembler.h> | ||
14 | |||
15 | /* | ||
16 | * This is the entry point through which CPUs exiting cpuidle deep | ||
17 | * idle state are going. | ||
18 | */ | ||
19 | ENTRY(armada_370_xp_cpu_resume) | ||
20 | ARM_BE8(setend be ) @ go BE8 if entered LE | ||
21 | bl ll_add_cpu_to_smp_group | ||
22 | bl ll_enable_coherency | ||
23 | b cpu_resume | ||
24 | ENDPROC(armada_370_xp_cpu_resume) | ||
25 | |||