From patchwork Sun Apr 21 09:46:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 16276 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BFF2320F45 for ; Sun, 21 Apr 2013 09:49:06 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id w16sf10244003vbb.6 for ; Sun, 21 Apr 2013 02:48:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received: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=j3EucLFLgXrrwA1+YrjCdGMBK6uUo3ymRn238jgTlIM=; b=lUuIHod9andMo/uJ2ID3/eWkcV3/l0gFHX+Mr3maBlz7QYDTnw3Fhx4GFWBtxfHIqg SMMyJPPEt5KVi1lrTOraFo+2EzM6Edri2T7UxcOG5QvLhqd9b7RPS2Erdi5Jq+/LE/JS rizZSSvAQxizj8HZGbJfyj1RKGgN/+/gplfi1XxPR8ncaUmLDgs/5PmctpOarUfNgRHd xJCG7phMgsRABd1vlUie7hGA1ZrwimKEojFDGekusn638y9ZW3WyaNfHcR5s65NgMDhI xrFq5OA2KW7nZ7yD7yO3n1OvCS7aOuZWXuN2G17y341yjvYTXqz6/MirItfwd0dqtCT1 B93Q== X-Received: by 10.224.185.17 with SMTP id cm17mr2464863qab.6.1366537702916; Sun, 21 Apr 2013 02:48:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.33 with SMTP id d1ls2695159qes.88.gmail; Sun, 21 Apr 2013 02:48:22 -0700 (PDT) X-Received: by 10.58.90.5 with SMTP id bs5mr15829968veb.60.1366537702691; Sun, 21 Apr 2013 02:48:22 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id u16si13667980vcj.24.2013.04.21.02.48.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Apr 2013 02:48:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id kw10so5129725vcb.19 for ; Sun, 21 Apr 2013 02:48:22 -0700 (PDT) X-Received: by 10.52.166.103 with SMTP id zf7mr13784943vdb.94.1366537702431; Sun, 21 Apr 2013 02:48:22 -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.58.127.98 with SMTP id nf2csp36328veb; Sun, 21 Apr 2013 02:48:21 -0700 (PDT) X-Received: by 10.66.102.106 with SMTP id fn10mr23061895pab.192.1366537701573; Sun, 21 Apr 2013 02:48:21 -0700 (PDT) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id ny1si18323055pbb.161.2013.04.21.02.48.21 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Apr 2013 02:48:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id r11so2967730pdi.7 for ; Sun, 21 Apr 2013 02:48:21 -0700 (PDT) X-Received: by 10.66.183.10 with SMTP id ei10mr6748572pac.39.1366537701141; Sun, 21 Apr 2013 02:48:21 -0700 (PDT) Received: from localhost.localdomain ([67.198.145.34]) by mx.google.com with ESMTPS id b3sm20462002pbw.4.2013.04.21.02.48.17 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Apr 2013 02:48:20 -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 3/3] irqchip: mmp: support MULTI_IRQ_HANDLER Date: Sun, 21 Apr 2013 17:46:57 +0800 Message-Id: <1366537617-11328-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366537617-11328-1-git-send-email-haojian.zhuang@linaro.org> References: <1366537617-11328-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQmewWJ7N9Y5kg8g8jmx1DnsFSQydTkTOWo0M0UPoFoTHl6dBs81OkrAspPamHFAybAqKw/Y X-Original-Sender: haojian.zhuang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 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 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 8b6694b..832ce62 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; }