@@ -9,6 +9,7 @@ config ARCH_MVEBU
select PINCTRL
select PLAT_ORION
select SPARSE_IRQ
+ select USE_IRQCHIP
if ARCH_MVEBU
@@ -2,4 +2,4 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
-I$(srctree)/arch/arm/plat-orion/include
obj-y += system-controller.o
-obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o addr-map.o
+obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o addr-map.o
@@ -16,6 +16,7 @@
#include <linux/init.h>
#include <linux/of_platform.h>
#include <linux/io.h>
+#include <linux/irqchip.h>
#include <linux/time-armada-370-xp.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -56,8 +57,7 @@ static const char * const armada_370_xp_dt_board_dt_compat[] = {
DT_MACHINE_START(ARMADA_XP_DT, "Marvell Aramada 370/XP (Device Tree)")
.init_machine = armada_370_xp_dt_init,
.map_io = armada_370_xp_map_io,
- .init_irq = armada_370_xp_init_irq,
- .handle_irq = armada_370_xp_handle_irq,
+ .init_irq = irqchip_init,
.timer = &armada_370_xp_timer,
.restart = mvebu_restart,
.dt_compat = armada_370_xp_dt_board_dt_compat,
@@ -17,7 +17,4 @@
void mvebu_restart(char mode, const char *cmd);
-void armada_370_xp_init_irq(void);
-void armada_370_xp_handle_irq(struct pt_regs *regs);
-
#endif
@@ -1,2 +1,3 @@
obj-$(CONFIG_USE_IRQCHIP) += irqchip.o
obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o
+obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o
similarity index 87%
rename from arch/arm/mach-mvebu/irq-armada-370-xp.c
rename to drivers/irqchip/irq-armada-370-xp.c
@@ -23,6 +23,7 @@
#include <linux/of_irq.h>
#include <linux/irqdomain.h>
#include <asm/mach/arch.h>
+#include <asm/mach/irq.h>
#include <asm/exception.h>
/* Interrupt Controller Registers Map */
@@ -77,8 +78,11 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
.xlate = irq_domain_xlate_onecell,
};
-static int __init armada_370_xp_mpic_of_init(struct device_node *node,
- struct device_node *parent)
+static asmlinkage void
+armada_370_xp_handle_irq(struct pt_regs *regs);
+
+int __init armada_370_xp_mpic_of_init(struct device_node *node,
+ struct device_node *parent)
{
u32 control;
@@ -98,11 +102,14 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
irq_set_default_host(armada_370_xp_mpic_domain);
+
+ handle_arch_irq = armada_370_xp_handle_irq;
+
return 0;
}
-asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs
- *regs)
+static asmlinkage void __exception_irq_entry
+armada_370_xp_handle_irq(struct pt_regs *regs)
{
u32 irqstat, irqnr;
@@ -121,13 +128,3 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs
break;
} while (1);
}
-
-static const struct of_device_id mpic_of_match[] __initconst = {
- {.compatible = "marvell,mpic", .data = armada_370_xp_mpic_of_init},
- {},
-};
-
-void __init armada_370_xp_init_irq(void)
-{
- of_irq_init(mpic_of_match);
-}
@@ -20,6 +20,12 @@ static const struct of_device_id irqchip_of_match[] __initconst = {
.data = bcm2835_irqchip_init,
},
#endif
+#ifdef CONFIG_ARCH_MVEBU
+ {
+ .compatible = "marvell,mpic",
+ .data = armada_370_xp_mpic_of_init,
+ },
+#endif
{},
};
@@ -12,5 +12,7 @@
#define _IRQCHIP_H
int bcm2835_irqchip_init(struct device_node *node, struct device_node *parent);
+int armada_370_xp_mpic_of_init(struct device_node *node,
+ struct device_node *parent);
#endif