From patchwork Fri Nov 15 08:47:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 3187251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CD4B0C045B for ; Fri, 15 Nov 2013 08:50:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EBEA208CE for ; Fri, 15 Nov 2013 08:50:14 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4C0D208C4 for ; Fri, 15 Nov 2013 08:50:12 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhF5e-0006VU-UD; Fri, 15 Nov 2013 08:49:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhF5T-0001a5-VX; Fri, 15 Nov 2013 08:49:11 +0000 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhF51-0001Ul-Pd for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2013 08:48:44 +0000 Received: by mail-we0-f174.google.com with SMTP id t61so3273161wes.33 for ; Fri, 15 Nov 2013 00:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QKSn9p/wYNEL/XsrQvY13oc75dkjKVTM7ETyQXdB7UA=; b=QUJrdiu3Jvv3s+5PBNiIqY/T1c6UyLELPRqAG4givRSnaxSzSREL35bRV2e/b/dOB/ YAGi3SQ6ifUboCbc3taYxbEcUKfckptMUjC2N6dPq///AmYV+nTufF6eT+KFYf1zyAs2 2B1KfrbD0lftyItc5YnRdwObs+XyxaCylXWBPPvbq/F3hthKEKLKvX9uI3clPDagM5Wz zGSQlJIP6Uiub30kz/nnutK7WEIA//4FdWAbu2EslBJHHHEv2yVPMnU0adzATaWTC41T cr852esVNpGpLdiAhPzarcorjWTOCeQwT12B9+mzELIkyeBTTHIULGVUHhuA7KPC/Yxs Cwzg== X-Received: by 10.194.240.197 with SMTP id wc5mr5879926wjc.23.1384505301832; Fri, 15 Nov 2013 00:48:21 -0800 (PST) Received: from fangorn.rup.mentorg.com (nat-min.mentorg.com. [139.181.32.34]) by mx.google.com with ESMTPSA id qc10sm2856890wic.9.2013.11.15.00.48.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2013 00:48:21 -0800 (PST) From: Dmitry Eremin-Solenikov To: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH 3/9] ARM: sa1100: switch to MULTI_IRQ_HANDLER Date: Fri, 15 Nov 2013 12:47:54 +0400 Message-Id: <1384505280-25389-4-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1384505280-25389-1-git-send-email-dbaryshkov@gmail.com> References: <1384505280-25389-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131115_034843_978672_BACB718F X-CRM114-Status: GOOD ( 15.40 ) X-Spam-Score: 0.5 (/) Cc: Linus Walleij , Russell King , Dmitry Artamonow X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add sa1100_handle_irq implementating handle_irq for sa1100 platform. Install this irq handler from sa1100_init_irq(). Also drop now unused entry-macro.S Signed-off-by: Dmitry Eremin-Solenikov --- arch/arm/Kconfig | 1 + arch/arm/mach-sa1100/include/mach/entry-macro.S | 41 ------------------------- arch/arm/mach-sa1100/irq.c | 20 ++++++++++++ 3 files changed, 21 insertions(+), 41 deletions(-) delete mode 100644 arch/arm/mach-sa1100/include/mach/entry-macro.S diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 6a1d2b4..2e6521927 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -719,6 +719,7 @@ config ARCH_SA1100 select GENERIC_CLOCKEVENTS select HAVE_IDE select ISA + select MULTI_IRQ_HANDLER select NEED_MACH_MEMORY_H select SPARSE_IRQ help diff --git a/arch/arm/mach-sa1100/include/mach/entry-macro.S b/arch/arm/mach-sa1100/include/mach/entry-macro.S deleted file mode 100644 index 8cf7630..0000000 --- a/arch/arm/mach-sa1100/include/mach/entry-macro.S +++ /dev/null @@ -1,41 +0,0 @@ -/* - * arch/arm/mach-sa1100/include/mach/entry-macro.S - * - * Low-level IRQ helper macros for SA1100-based platforms - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - - .macro get_irqnr_preamble, base, tmp - mov \base, #0xfa000000 @ ICIP = 0xfa050000 - add \base, \base, #0x00050000 - .endm - - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqstat, [\base] @ get irqs - ldr \irqnr, [\base, #4] @ ICMR = 0xfa050004 - ands \irqstat, \irqstat, \irqnr - mov \irqnr, #0 - beq 1001f - tst \irqstat, #0xff - moveq \irqstat, \irqstat, lsr #8 - addeq \irqnr, \irqnr, #8 - tsteq \irqstat, #0xff - moveq \irqstat, \irqstat, lsr #8 - addeq \irqnr, \irqnr, #8 - tsteq \irqstat, #0xff - moveq \irqstat, \irqstat, lsr #8 - addeq \irqnr, \irqnr, #8 - tst \irqstat, #0x0f - moveq \irqstat, \irqstat, lsr #4 - addeq \irqnr, \irqnr, #4 - tst \irqstat, #0x03 - moveq \irqstat, \irqstat, lsr #2 - addeq \irqnr, \irqnr, #2 - tst \irqstat, #0x01 - addeqs \irqnr, \irqnr, #1 -1001: - .endm - diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index 2124f1fc..68e8f9d 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "generic.h" @@ -291,6 +292,23 @@ static int __init sa1100irq_init_devicefs(void) device_initcall(sa1100irq_init_devicefs); +static asmlinkage void __exception_irq_entry +sa1100_handle_irq(struct pt_regs *regs) +{ + uint32_t icip, icmr, mask; + + do { + icip = (ICIP); + icmr = (ICMR); + mask = icip & icmr; + + if (mask == 0) + break; + + handle_IRQ(fls(mask) - 1, regs); + } while (1); +} + void __init sa1100_init_irq(void) { unsigned int irq; @@ -338,5 +356,7 @@ void __init sa1100_init_irq(void) irq_set_chip(IRQ_GPIO11_27, &sa1100_normal_chip); irq_set_chained_handler(IRQ_GPIO11_27, sa1100_high_gpio_handler); + set_handle_irq(sa1100_handle_irq); + sa1100_init_gpio(); }