From patchwork Tue May 28 02:21:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 17238 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46B37238E8 for ; Tue, 28 May 2013 02:23:24 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id k13sf5530799wgh.11 for ; Mon, 27 May 2013 19:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=v9RzOSNqeZfn8C9sEEDfQt/NBwYjrAFXboBZRyAf0xE=; b=DCqDfKEaVN1rq43RXYykOTXRU4P3mSOQ1jB9aA6uXtRkzzegbdvQOjKN4N7ZhpWi1P 2j7mfBvWiQxrFhx58955rxrelWpXNwRZst3TvK5XnXjTAYH178Pb611qVeDMd2vBntgN yjKiRQsfjK7vfqCBZb2JPmQCiOIREXOuivBybVOaEqZ7A5B7wKDO23ugNPhxf5PPUW/X Cqji3vI9Gbr4VXJSqlIC8tj9PXZdv8KBISukxHqPt0rcZo6tzqrSazWhgkK17vIzNTsn NFMrYLZWuHTW3iXO6QEheQ23B+EZSsHfxXygPUUi1nOq8gUTaFFj7/Sk1og8cGkhecAo xdsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=v9RzOSNqeZfn8C9sEEDfQt/NBwYjrAFXboBZRyAf0xE=; b=IeJKhB83h+usZzxbAJQ5z+Xtz0/oxQa9ug6+pmP2bxvwv3LsUBcwmedbXbF5AZY6DA nNK1MrFt4y0hFdkZK+qpnInFG1sih2JCddNznxpSHN90RdPfMY1JG1XeHrEsyaK4LURC Josrm1bljAqdOiFiL84jFyqAZlbcTJZngQhuuiXfLSLIfNA/5E9zkq9SstvJtOdgDupW UbvpVVH7+k69u6RuZc7uP45CGQcxja0d0qDQCAObbQhcfIxKO5Y9wA6AlYDMbHwrCXN8 /fvGrH0J8EjpTICFci6pGHBvlFl15TtD/OL69QwLBaQXVQ6G1Fc0HqLjGVpYeFN7HYW/ e2kw== X-Received: by 10.180.21.226 with SMTP id y2mr4250083wie.5.1369707737527; Mon, 27 May 2013 19:22:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.108.135 with SMTP id hk7ls825082wib.54.gmail; Mon, 27 May 2013 19:22:17 -0700 (PDT) X-Received: by 10.180.160.167 with SMTP id xl7mr10183639wib.62.1369707737426; Mon, 27 May 2013 19:22:17 -0700 (PDT) Received: from mail-ve0-x234.google.com (mail-ve0-x234.google.com [2607:f8b0:400c:c01::234]) by mx.google.com with ESMTPS id j17si5251701wjq.177.2013.05.27.19.22.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 19:22:17 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::234; Received: by mail-ve0-f180.google.com with SMTP id pa12so548694veb.39 for ; Mon, 27 May 2013 19:22:16 -0700 (PDT) X-Received: by 10.58.225.228 with SMTP id rn4mr16636247vec.35.1369707736276; Mon, 27 May 2013 19:22:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp19358vcb; Mon, 27 May 2013 19:22:15 -0700 (PDT) X-Received: by 10.68.194.169 with SMTP id hx9mr4128356pbc.210.1369707735241; Mon, 27 May 2013 19:22:15 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPS id v10si22318188pav.10.2013.05.27.19.22.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 19:22:15 -0700 (PDT) Received-SPF: pass (google.com: domain of haojian.zhuang@gmail.com designates 209.85.192.173 as permitted sender) client-ip=209.85.192.173; Received: by mail-pd0-f173.google.com with SMTP id v14so5864284pde.18 for ; Mon, 27 May 2013 19:22:14 -0700 (PDT) X-Received: by 10.66.250.164 with SMTP id zd4mr32366135pac.141.1369707734848; Mon, 27 May 2013 19:22:14 -0700 (PDT) Received: from localhost.localdomain ([27.115.121.40]) by mx.google.com with ESMTPSA id zs12sm32959785pab.0.2013.05.27.19.22.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 19:22:13 -0700 (PDT) From: Haojian Zhuang To: linux-arm-kernel@lists.infradead.org, chao.xie@marvell.com, zhangwm@marvell.com, tglx@linutronix.de, arnd@arndb.de Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH v2 3/5] irqchip: mmp: support MULTI_IRQ_HANDLER Date: Tue, 28 May 2013 10:21:45 +0800 Message-Id: <1369707707-30295-4-git-send-email-haojian.zhuang@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369707707-30295-1-git-send-email-haojian.zhuang@gmail.com> References: <1369707707-30295-1-git-send-email-haojian.zhuang@gmail.com> X-Gm-Message-State: ALoCoQl8OYyx5xycouVCWBriVERVsnzkfbP5IeyChjeWUiRPpRhKi4kwuAksBKTWGFda6mSnuTFM X-Original-Sender: haojian.zhuang@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gmail.com Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Support CONFIG_MULTI_IRQ_HANDLER in ARCH_MMP. So remove entry-macro.S. Signed-off-by: Haojian Zhuang --- arch/arm/Kconfig | 1 + arch/arm/mach-mmp/include/mach/entry-macro.S | 26 ----------------- drivers/irqchip/irq-mmp.c | 42 +++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 27 deletions(-) delete mode 100644 arch/arm/mach-mmp/include/mach/entry-macro.S diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 49d993c..b8ba50b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -550,6 +550,7 @@ config ARCH_MMP select GENERIC_CLOCKEVENTS select GPIO_PXA select IRQ_DOMAIN + select MULTI_IRQ_HANDLER select NEED_MACH_GPIO_H select PINCTRL select PLAT_PXA diff --git a/arch/arm/mach-mmp/include/mach/entry-macro.S b/arch/arm/mach-mmp/include/mach/entry-macro.S deleted file mode 100644 index bd152e2..0000000 --- a/arch/arm/mach-mmp/include/mach/entry-macro.S +++ /dev/null @@ -1,26 +0,0 @@ -/* - * linux/arch/arm/mach-mmp/include/mach/entry-macro.S - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include - - .macro get_irqnr_preamble, base, tmp - mrc p15, 0, \tmp, c0, c0, 0 @ CPUID - and \tmp, \tmp, #0xff00 - cmp \tmp, #0x5800 - ldr \base, =mmp_icu_base - ldr \base, [\base, #0] - addne \base, \base, #0x10c @ PJ1 AP INT SEL register - addeq \base, \base, #0x104 @ PJ4 IRQ SEL register - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \tmp, [\base, #0] - and \irqnr, \tmp, #0x3f - tst \tmp, #(1 << 6) - .endm diff --git a/drivers/irqchip/irq-mmp.c b/drivers/irqchip/irq-mmp.c index 2f088ba..f54ebca 100644 --- a/drivers/irqchip/irq-mmp.c +++ b/drivers/irqchip/irq-mmp.c @@ -21,6 +21,9 @@ #include #include +#include +#include + #include #ifdef CONFIG_CPU_MMP2 @@ -34,6 +37,13 @@ #define MAX_ICU_NR 16 +#define PJ1_INT_SEL 0x10c +#define PJ4_INT_SEL 0x104 + +/* bit fields in PJ1_INT_SEL and PJ4_INT_SEL */ +#define SEL_INT_PENDING (1 << 6) +#define SEL_INT_NUM_MASK 0x3f + struct icu_chip_data { int nr_irqs; unsigned int virq_base; @@ -54,7 +64,7 @@ struct mmp_intc_conf { unsigned int conf_mask; }; -void __iomem *mmp_icu_base; +static void __iomem *mmp_icu_base; static struct icu_chip_data icu_data[MAX_ICU_NR]; static int max_icu_nr; @@ -193,6 +203,32 @@ static struct mmp_intc_conf mmp2_conf = { .conf_mask = 0x7f, }; +static asmlinkage void __exception_irq_entry +mmp_handle_irq(struct pt_regs *regs) +{ + int irq, hwirq; + + hwirq = readl_relaxed(mmp_icu_base + PJ1_INT_SEL); + if (!(hwirq & SEL_INT_PENDING)) + return; + hwirq &= SEL_INT_NUM_MASK; + irq = irq_find_mapping(icu_data[0].domain, hwirq); + handle_IRQ(irq, regs); +} + +static asmlinkage void __exception_irq_entry +mmp2_handle_irq(struct pt_regs *regs) +{ + int irq, hwirq; + + hwirq = readl_relaxed(mmp_icu_base + PJ4_INT_SEL); + if (!(hwirq & SEL_INT_PENDING)) + return; + hwirq &= SEL_INT_NUM_MASK; + irq = irq_find_mapping(icu_data[0].domain, hwirq); + handle_IRQ(irq, regs); +} + /* MMP (ARMv5) */ void __init icu_init_irq(void) { @@ -214,6 +250,7 @@ void __init icu_init_irq(void) set_irq_flags(irq, IRQF_VALID); } irq_set_default_host(icu_data[0].domain); + set_handle_irq(mmp_handle_irq); #ifdef CONFIG_CPU_PXA910 icu_irq_chip.irq_set_wake = pxa910_set_wake; #endif @@ -320,6 +357,7 @@ void __init mmp2_init_icu(void) set_irq_flags(irq, IRQF_VALID); } irq_set_default_host(icu_data[0].domain); + set_handle_irq(mmp2_handle_irq); #ifdef CONFIG_CPU_MMP2 icu_irq_chip.irq_set_wake = mmp2_set_wake; #endif @@ -378,6 +416,7 @@ static int __init mmp_of_init(struct device_node *node, icu_data[0].conf_disable = mmp_conf.conf_disable; icu_data[0].conf_mask = mmp_conf.conf_mask; irq_set_default_host(icu_data[0].domain); + set_handle_irq(mmp_handle_irq); max_icu_nr = 1; return 0; } @@ -395,6 +434,7 @@ static int __init mmp2_of_init(struct device_node *node, icu_data[0].conf_disable = mmp2_conf.conf_disable; icu_data[0].conf_mask = mmp2_conf.conf_mask; irq_set_default_host(icu_data[0].domain); + set_handle_irq(mmp2_handle_irq); max_icu_nr = 1; return 0; }