From patchwork Tue Nov 20 22:00:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1776281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 075193FCAE for ; Tue, 20 Nov 2012 22:05:25 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tavu6-0003Im-Uk; Tue, 20 Nov 2012 22:02:51 +0000 Received: from mail.free-electrons.com ([88.190.12.23]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tavsp-0002hx-FC for linux-arm-kernel@lists.infradead.org; Tue, 20 Nov 2012 22:01:35 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 54150296; Tue, 20 Nov 2012 23:01:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, TVD_PH_BODY_META_ALL shortcircuit=no autolearn=no version=3.3.1 Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id 465B7261; Tue, 20 Nov 2012 23:01:08 +0100 (CET) From: Thomas Petazzoni To: linux-arm-kernel@lists.infradead.org, Rob Herring , Arnd Bergmann , Olof Johansson Subject: [PATCH 04/16] arm: mvebu: move irq controller driver to drivers/irqchip Date: Tue, 20 Nov 2012 23:00:55 +0100 Message-Id: <1353448867-15008-5-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1353448867-15008-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1353448867-15008-1-git-send-email-thomas.petazzoni@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121120_170132_303225_0C81585C X-CRM114-Status: GOOD ( 17.15 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Andrew Lunn , Russell King , Jason Cooper , Stephen Warren , Linus Walleij , Viresh Kumar , Gregory Clement , Jamie Iles , Thomas Gleixner X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Now that the drivers/irqchip/ directory has a minimal infrastructure to support the addition of irq controller driver, we move the irq controller driver for Armada 370 and Armada XP ARM SoCs from the arch/arm/mach-mvebu/ directory to the drivers/irqchip/ directory and update the irqchip infrastructure to take into account this new driver. Signed-off-by: Thomas Petazzoni Reviewed-by: Stephen Warren Reviewed-by: Rob Herring Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement --- arch/arm/mach-mvebu/Makefile | 2 +- arch/arm/mach-mvebu/armada-370-xp.c | 4 +-- arch/arm/mach-mvebu/common.h | 3 --- drivers/irqchip/Makefile | 1 + .../irqchip}/irq-armada-370-xp.c | 28 +++++++++++--------- 5 files changed, 19 insertions(+), 19 deletions(-) rename {arch/arm/mach-mvebu => drivers/irqchip}/irq-armada-370-xp.c (87%) diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index 57f996b..7f4e9f4 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile @@ -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 diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c index a2f5bbc..5e90401 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/armada-370-xp.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -54,8 +55,7 @@ static const char * const armada_370_xp_dt_compat[] = { DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 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_compat, diff --git a/arch/arm/mach-mvebu/common.h b/arch/arm/mach-mvebu/common.h index 02f89ea..f0eaa21 100644 --- a/arch/arm/mach-mvebu/common.h +++ b/arch/arm/mach-mvebu/common.h @@ -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 diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index 6b5a6e0..5148ffd 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_IRQCHIP) += irqchip.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o +obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o diff --git a/arch/arm/mach-mvebu/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c similarity index 87% rename from arch/arm/mach-mvebu/irq-armada-370-xp.c rename to drivers/irqchip/irq-armada-370-xp.c index 5f5f939..09fad6c 100644 --- a/arch/arm/mach-mvebu/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -23,8 +23,11 @@ #include #include #include +#include #include +#include "irqchip.h" + /* Interrupt Controller Registers Map */ #define ARMADA_370_XP_INT_SET_MASK_OFFS (0x48) #define ARMADA_370_XP_INT_CLEAR_MASK_OFFS (0x4C) @@ -77,8 +80,12 @@ 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); + +static int __init +armada_370_xp_mpic_of_init(struct device_node *node, + struct device_node *parent) { u32 control; @@ -98,11 +105,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); + + set_handle_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; @@ -122,12 +132,4 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs } 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); -} +IRQCHIP_DECLARE(mpic, "marvell,mpic", armada_370_xp_mpic_of_init);