diff options
author | Olof Johansson <olof@lixom.net> | 2013-04-18 02:37:36 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-04-18 02:37:53 -0400 |
commit | 981c448014557d6f9d7289567137c38adddd94e5 (patch) | |
tree | 3f24f8662b9f51e3de0ce17e3bfcb6c88a51d6ec | |
parent | 31880c37c11e28cb81c70757e38392b42e695dc6 (diff) | |
parent | 5ec69017cc944f3ed88362d4b60818713a45e616 (diff) |
Merge tag 'irqchip-3.10' of git://git.infradead.org/users/jcooper/linux into late/cleanup
From Jason Cooper:
mvebu driver irqchip for v3.10
- move the armada irqchip driver to drivers/irqchip/
* tag 'irqchip-3.10' of git://git.infradead.org/users/jcooper/linux:
irqchip: armada-370-xp: slightly cleanup irq controller driver
irqchip: armada-370-xp: move IRQ handler to avoid forward declaration
irqchip: move IRQ driver for Armada 370/XP
ARM: mvebu: move L2 cache initialization in init_early()
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | arch/arm/mach-mvebu/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/armada-370-xp.c | 9 | ||||
-rw-r--r-- | drivers/irqchip/Makefile | 1 | ||||
-rw-r--r-- | drivers/irqchip/irq-armada-370-xp.c (renamed from arch/arm/mach-mvebu/irq-armada-370-xp.c) | 106 |
4 files changed, 60 insertions, 58 deletions
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index da93bcbc74c1..c3be068f1c96 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile | |||
@@ -5,6 +5,6 @@ AFLAGS_coherency_ll.o := -Wa,-march=armv7-a | |||
5 | 5 | ||
6 | obj-y += system-controller.o | 6 | obj-y += system-controller.o |
7 | obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o | 7 | obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o |
8 | obj-$(CONFIG_ARCH_MVEBU) += addr-map.o coherency.o coherency_ll.o pmsu.o irq-armada-370-xp.o | 8 | obj-$(CONFIG_ARCH_MVEBU) += addr-map.o coherency.o coherency_ll.o pmsu.o |
9 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 9 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
10 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 10 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c index a5ea616d6d12..433e8c5343b2 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/armada-370-xp.c | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <linux/time-armada-370-xp.h> | 19 | #include <linux/time-armada-370-xp.h> |
20 | #include <linux/clk/mvebu.h> | 20 | #include <linux/clk/mvebu.h> |
21 | #include <linux/dma-mapping.h> | 21 | #include <linux/dma-mapping.h> |
22 | #include <linux/irqchip.h> | ||
23 | #include <asm/hardware/cache-l2x0.h> | ||
22 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
24 | #include <asm/mach/time.h> | 26 | #include <asm/mach/time.h> |
@@ -54,6 +56,10 @@ void __init armada_370_xp_init_early(void) | |||
54 | * to make sure such the allocations won't fail. | 56 | * to make sure such the allocations won't fail. |
55 | */ | 57 | */ |
56 | init_dma_coherent_pool_size(SZ_1M); | 58 | init_dma_coherent_pool_size(SZ_1M); |
59 | |||
60 | #ifdef CONFIG_CACHE_L2X0 | ||
61 | l2x0_of_init(0, ~0UL); | ||
62 | #endif | ||
57 | } | 63 | } |
58 | 64 | ||
59 | static void __init armada_370_xp_dt_init(void) | 65 | static void __init armada_370_xp_dt_init(void) |
@@ -72,8 +78,7 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)") | |||
72 | .init_machine = armada_370_xp_dt_init, | 78 | .init_machine = armada_370_xp_dt_init, |
73 | .map_io = armada_370_xp_map_io, | 79 | .map_io = armada_370_xp_map_io, |
74 | .init_early = armada_370_xp_init_early, | 80 | .init_early = armada_370_xp_init_early, |
75 | .init_irq = armada_370_xp_init_irq, | 81 | .init_irq = irqchip_init, |
76 | .handle_irq = armada_370_xp_handle_irq, | ||
77 | .init_time = armada_370_xp_timer_and_clk_init, | 82 | .init_time = armada_370_xp_timer_and_clk_init, |
78 | .restart = mvebu_restart, | 83 | .restart = mvebu_restart, |
79 | .dt_compat = armada_370_xp_dt_compat, | 84 | .dt_compat = armada_370_xp_dt_compat, |
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index 98e3b87bdf1b..dae27a77c1e1 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile | |||
@@ -2,6 +2,7 @@ obj-$(CONFIG_IRQCHIP) += irqchip.o | |||
2 | 2 | ||
3 | obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o | 3 | obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o |
4 | obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o | 4 | obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o |
5 | obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o | ||
5 | obj-$(CONFIG_METAG) += irq-metag-ext.o | 6 | obj-$(CONFIG_METAG) += irq-metag-ext.o |
6 | obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o | 7 | obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o |
7 | obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o | 8 | obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o |
diff --git a/arch/arm/mach-mvebu/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 6a9195e10579..ad1e6422a732 100644 --- a/arch/arm/mach-mvebu/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c | |||
@@ -25,7 +25,9 @@ | |||
25 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
26 | #include <asm/exception.h> | 26 | #include <asm/exception.h> |
27 | #include <asm/smp_plat.h> | 27 | #include <asm/smp_plat.h> |
28 | #include <asm/hardware/cache-l2x0.h> | 28 | #include <asm/mach/irq.h> |
29 | |||
30 | #include "irqchip.h" | ||
29 | 31 | ||
30 | /* Interrupt Controller Registers Map */ | 32 | /* Interrupt Controller Registers Map */ |
31 | #define ARMADA_370_XP_INT_SET_MASK_OFFS (0x48) | 33 | #define ARMADA_370_XP_INT_SET_MASK_OFFS (0x48) |
@@ -46,7 +48,9 @@ | |||
46 | 48 | ||
47 | #define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5) | 49 | #define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5) |
48 | 50 | ||
49 | #define ACTIVE_DOORBELLS (8) | 51 | #define IPI_DOORBELL_START (0) |
52 | #define IPI_DOORBELL_END (8) | ||
53 | #define IPI_DOORBELL_MASK 0xFF | ||
50 | 54 | ||
51 | static DEFINE_RAW_SPINLOCK(irq_controller_lock); | 55 | static DEFINE_RAW_SPINLOCK(irq_controller_lock); |
52 | 56 | ||
@@ -190,7 +194,7 @@ void armada_xp_mpic_smp_cpu_init(void) | |||
190 | writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); | 194 | writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); |
191 | 195 | ||
192 | /* Enable first 8 IPIs */ | 196 | /* Enable first 8 IPIs */ |
193 | writel((1 << ACTIVE_DOORBELLS) - 1, per_cpu_int_base + | 197 | writel(IPI_DOORBELL_MASK, per_cpu_int_base + |
194 | ARMADA_370_XP_IN_DRBEL_MSK_OFFS); | 198 | ARMADA_370_XP_IN_DRBEL_MSK_OFFS); |
195 | 199 | ||
196 | /* Unmask IPI interrupt */ | 200 | /* Unmask IPI interrupt */ |
@@ -203,46 +207,8 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = { | |||
203 | .xlate = irq_domain_xlate_onecell, | 207 | .xlate = irq_domain_xlate_onecell, |
204 | }; | 208 | }; |
205 | 209 | ||
206 | static int __init armada_370_xp_mpic_of_init(struct device_node *node, | 210 | static asmlinkage void __exception_irq_entry |
207 | struct device_node *parent) | 211 | armada_370_xp_handle_irq(struct pt_regs *regs) |
208 | { | ||
209 | u32 control; | ||
210 | |||
211 | main_int_base = of_iomap(node, 0); | ||
212 | per_cpu_int_base = of_iomap(node, 1); | ||
213 | |||
214 | BUG_ON(!main_int_base); | ||
215 | BUG_ON(!per_cpu_int_base); | ||
216 | |||
217 | control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL); | ||
218 | |||
219 | armada_370_xp_mpic_domain = | ||
220 | irq_domain_add_linear(node, (control >> 2) & 0x3ff, | ||
221 | &armada_370_xp_mpic_irq_ops, NULL); | ||
222 | |||
223 | if (!armada_370_xp_mpic_domain) | ||
224 | panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n"); | ||
225 | |||
226 | irq_set_default_host(armada_370_xp_mpic_domain); | ||
227 | |||
228 | #ifdef CONFIG_SMP | ||
229 | armada_xp_mpic_smp_cpu_init(); | ||
230 | |||
231 | /* | ||
232 | * Set the default affinity from all CPUs to the boot cpu. | ||
233 | * This is required since the MPIC doesn't limit several CPUs | ||
234 | * from acknowledging the same interrupt. | ||
235 | */ | ||
236 | cpumask_clear(irq_default_affinity); | ||
237 | cpumask_set_cpu(smp_processor_id(), irq_default_affinity); | ||
238 | |||
239 | #endif | ||
240 | |||
241 | return 0; | ||
242 | } | ||
243 | |||
244 | asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs | ||
245 | *regs) | ||
246 | { | 212 | { |
247 | u32 irqstat, irqnr; | 213 | u32 irqstat, irqnr; |
248 | 214 | ||
@@ -267,13 +233,14 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs | |||
267 | 233 | ||
268 | ipimask = readl_relaxed(per_cpu_int_base + | 234 | ipimask = readl_relaxed(per_cpu_int_base + |
269 | ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS) | 235 | ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS) |
270 | & 0xFF; | 236 | & IPI_DOORBELL_MASK; |
271 | 237 | ||
272 | writel(0x0, per_cpu_int_base + | 238 | writel(~IPI_DOORBELL_MASK, per_cpu_int_base + |
273 | ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); | 239 | ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); |
274 | 240 | ||
275 | /* Handle all pending doorbells */ | 241 | /* Handle all pending doorbells */ |
276 | for (ipinr = 0; ipinr < ACTIVE_DOORBELLS; ipinr++) { | 242 | for (ipinr = IPI_DOORBELL_START; |
243 | ipinr < IPI_DOORBELL_END; ipinr++) { | ||
277 | if (ipimask & (0x1 << ipinr)) | 244 | if (ipimask & (0x1 << ipinr)) |
278 | handle_IPI(ipinr, regs); | 245 | handle_IPI(ipinr, regs); |
279 | } | 246 | } |
@@ -284,15 +251,44 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs | |||
284 | } while (1); | 251 | } while (1); |
285 | } | 252 | } |
286 | 253 | ||
287 | static const struct of_device_id mpic_of_match[] __initconst = { | 254 | static int __init armada_370_xp_mpic_of_init(struct device_node *node, |
288 | {.compatible = "marvell,mpic", .data = armada_370_xp_mpic_of_init}, | 255 | struct device_node *parent) |
289 | {}, | ||
290 | }; | ||
291 | |||
292 | void __init armada_370_xp_init_irq(void) | ||
293 | { | 256 | { |
294 | of_irq_init(mpic_of_match); | 257 | u32 control; |
295 | #ifdef CONFIG_CACHE_L2X0 | 258 | |
296 | l2x0_of_init(0, ~0UL); | 259 | main_int_base = of_iomap(node, 0); |
260 | per_cpu_int_base = of_iomap(node, 1); | ||
261 | |||
262 | BUG_ON(!main_int_base); | ||
263 | BUG_ON(!per_cpu_int_base); | ||
264 | |||
265 | control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL); | ||
266 | |||
267 | armada_370_xp_mpic_domain = | ||
268 | irq_domain_add_linear(node, (control >> 2) & 0x3ff, | ||
269 | &armada_370_xp_mpic_irq_ops, NULL); | ||
270 | |||
271 | if (!armada_370_xp_mpic_domain) | ||
272 | panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n"); | ||
273 | |||
274 | irq_set_default_host(armada_370_xp_mpic_domain); | ||
275 | |||
276 | #ifdef CONFIG_SMP | ||
277 | armada_xp_mpic_smp_cpu_init(); | ||
278 | |||
279 | /* | ||
280 | * Set the default affinity from all CPUs to the boot cpu. | ||
281 | * This is required since the MPIC doesn't limit several CPUs | ||
282 | * from acknowledging the same interrupt. | ||
283 | */ | ||
284 | cpumask_clear(irq_default_affinity); | ||
285 | cpumask_set_cpu(smp_processor_id(), irq_default_affinity); | ||
286 | |||
297 | #endif | 287 | #endif |
288 | |||
289 | set_handle_irq(armada_370_xp_handle_irq); | ||
290 | |||
291 | return 0; | ||
298 | } | 292 | } |
293 | |||
294 | IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init); | ||