aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-04-09 17:26:15 -0400
committerJason Cooper <jason@lakedaemon.net>2013-04-15 15:34:36 -0400
commit9339d432fdf4b492d2209316791b6e54cdae0242 (patch)
tree7ae6520bbff2508776bb04c41ee48e15d9cb74e7
parente33369cbf346a41daab7d2eaf23c7e5bb76ef67c (diff)
irqchip: move IRQ driver for Armada 370/XP
When the Marvell Armada 370/XP support was included in the kernel, the drivers/irqchip/ directory didn't exist and the minimal infrastructure in it also didn't exist. Now that we have those things in place, we move the Armada 370/XP IRQ controller driver from arch/arm/mach-mvebu/irq-armada-370-xp.c to drivers/irqchip/irq-armada-370-xp.c. Note in order to reduce code movement and therefore ease the review of this patch, we intentionally introduce a forward declaration of armada_370_xp_handle_irq(). It is in fact not needed because this handler can now simply be implemented before armada_370_xp_mpic_of_init(). That will be done in the next commit. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r--arch/arm/mach-mvebu/Makefile2
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.c4
-rw-r--r--drivers/irqchip/Makefile1
-rw-r--r--drivers/irqchip/irq-armada-370-xp.c (renamed from arch/arm/mach-mvebu/irq-armada-370-xp.c)22
4 files changed, 15 insertions, 14 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
6obj-y += system-controller.o 6obj-y += system-controller.o
7obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o 7obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
8obj-$(CONFIG_ARCH_MVEBU) += addr-map.o coherency.o coherency_ll.o pmsu.o irq-armada-370-xp.o 8obj-$(CONFIG_ARCH_MVEBU) += addr-map.o 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
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index c1bbfa74e646..433e8c5343b2 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -19,6 +19,7 @@
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>
22#include <asm/hardware/cache-l2x0.h> 23#include <asm/hardware/cache-l2x0.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <asm/mach/map.h> 25#include <asm/mach/map.h>
@@ -77,8 +78,7 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
77 .init_machine = armada_370_xp_dt_init, 78 .init_machine = armada_370_xp_dt_init,
78 .map_io = armada_370_xp_map_io, 79 .map_io = armada_370_xp_map_io,
79 .init_early = armada_370_xp_init_early, 80 .init_early = armada_370_xp_init_early,
80 .init_irq = armada_370_xp_init_irq, 81 .init_irq = irqchip_init,
81 .handle_irq = armada_370_xp_handle_irq,
82 .init_time = armada_370_xp_timer_and_clk_init, 82 .init_time = armada_370_xp_timer_and_clk_init,
83 .restart = mvebu_restart, 83 .restart = mvebu_restart,
84 .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
3obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o 3obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o
4obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o 4obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o
5obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o
5obj-$(CONFIG_METAG) += irq-metag-ext.o 6obj-$(CONFIG_METAG) += irq-metag-ext.o
6obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o 7obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o
7obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o 8obj-$(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 f6699f303e6d..d20a832ba86b 100644
--- a/arch/arm/mach-mvebu/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -25,6 +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/mach/irq.h>
29
30#include "irqchip.h"
28 31
29/* Interrupt Controller Registers Map */ 32/* Interrupt Controller Registers Map */
30#define ARMADA_370_XP_INT_SET_MASK_OFFS (0x48) 33#define ARMADA_370_XP_INT_SET_MASK_OFFS (0x48)
@@ -202,6 +205,9 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
202 .xlate = irq_domain_xlate_onecell, 205 .xlate = irq_domain_xlate_onecell,
203}; 206};
204 207
208static asmlinkage void __exception_irq_entry
209armada_370_xp_handle_irq(struct pt_regs *regs);
210
205static int __init armada_370_xp_mpic_of_init(struct device_node *node, 211static int __init armada_370_xp_mpic_of_init(struct device_node *node,
206 struct device_node *parent) 212 struct device_node *parent)
207{ 213{
@@ -237,11 +243,13 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
237 243
238#endif 244#endif
239 245
246 set_handle_irq(armada_370_xp_handle_irq);
247
240 return 0; 248 return 0;
241} 249}
242 250
243asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs 251static asmlinkage void __exception_irq_entry
244 *regs) 252armada_370_xp_handle_irq(struct pt_regs *regs)
245{ 253{
246 u32 irqstat, irqnr; 254 u32 irqstat, irqnr;
247 255
@@ -283,12 +291,4 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs
283 } while (1); 291 } while (1);
284} 292}
285 293
286static const struct of_device_id mpic_of_match[] __initconst = { 294IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init);
287 {.compatible = "marvell,mpic", .data = armada_370_xp_mpic_of_init},
288 {},
289};
290
291void __init armada_370_xp_init_irq(void)
292{
293 of_irq_init(mpic_of_match);
294}