From patchwork Thu Jul 14 11:11:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102014 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp21327qga; Thu, 14 Jul 2016 04:14:31 -0700 (PDT) X-Received: by 10.66.49.134 with SMTP id u6mr21872830pan.118.1468494871747; Thu, 14 Jul 2016 04:14:31 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id xg7si2495844pab.222.2016.07.14.04.14.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 04:14:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNeaC-0007v5-8v; Thu, 14 Jul 2016 11:13:32 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNeZ4-000713-Bm for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2016 11:12:25 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0Ls5U3-1bFAmN0FJP-013wvd; Thu, 14 Jul 2016 13:11:52 +0200 From: Arnd Bergmann To: Wan Zongshun Subject: [PATCH 6/7] ARM: nuc900: use SPARSE_IRQ Date: Thu, 14 Jul 2016 13:11:34 +0200 Message-Id: <20160714111135.2476095-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160714111135.2476095-1-arnd@arndb.de> References: <20160714111135.2476095-1-arnd@arndb.de> X-Provags-ID: V03:K0:JCTypzBxqFl1GsmFPS/t0e0f7OtN5nE1XhYv+df3r5M2GBxrWqP WQHUCKMwyOccR2oaaWPfvq0d7lzgcbLvLVKGH6J+DKOkvAkyJvzpBByGnDz5x9+/gYlA5Hr B8+/mptyRdH2ZwwUVLOXNVSBccm+qUJaqzsbl17fyFb7Y5HpT6esw1IAw9vrW/xpkbTJh31 Ms9lLE9LM+jkfY6HPK/qQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Bj4/BTrTo+k=:QOnLJG4LVuMKeDBBOVTbaB NklqzEGsqkRMz2QRk+rgUbrW6XOH61HiMWCa5KxL5r/iCrB82drGZd6jtxeDIwvu/Rhpt9ntJ SkK3FVfJC7S1mtDSMfilCZbhS360c9+wRqAKabbXOEY0GZ9so20l6qklzANVYrXsMw+xGESPt bp/IKjx4QPZAEtdEMXC749K+LglFTFuHPjx+OceniVOYPDjLra//9jXCWm0WmD27gUHUJGz0Q 3apaO2LLQrB4nop0UH/pMOiW4BtrwqMZ9xdEBdeRxB3iy+K82XGWi+XY7OylhINfWl21nPJaW Q7J7sC+ywS74mGtUG0CZFHSLCgRisfnETyc4KVkGjFeMUiQ3hyNC72fDYeh04l0IvvIM1NaCm aUzDAeuayrmV9iPi/AI1J/Fc6J1SVyE+lk2Em5lglvVDohQkfuyyMUqtiVVt+vzz+19aQZzlO BUcxmOG057eM9yZ3Ng7idpVDYWNPu3TQa0vro/NpPqwAze2rUCPb9olrCNoQuUUw6Us6mYs6Q T5rYHYYgaiRd7hL909U2ui7MoKt18MxpqlenYXM6iSxlK7JXU7ofr9NA/MYpugAkmpnlo6A6i 68Xvb8gC3Gs3tzcuA2ArgXBIEj6QrRFPmRsDtv46RCEd4rXWDetUWlsYGv0PsW+f5X3UJv6JW HazRcYSA1zTY+YAVhiNde88oqFeGieIchP2n99slE6m3qY3oRxVFP+O0coof0DfiRb4s= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160714_041222_903729_295D4316 X-CRM114-Status: GOOD ( 15.28 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.134 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.134 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Wan Zongshun , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org ARCH_MULTIPLATFORM implies sparse IRQs, so in we first have to make sure that actually works. This enables CONFIG_SPARSE_IRQ for all of mach-w90x900. Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig | 1 + arch/arm/mach-w90x900/include/mach/irqs.h | 5 ----- arch/arm/mach-w90x900/irq.c | 22 +++++++++++++++++++++- drivers/irqchip/irq-nuc900.c | 2 +- 4 files changed, 23 insertions(+), 7 deletions(-) delete mode 100644 arch/arm/mach-w90x900/include/mach/irqs.h -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 908694886088..160dbf993660 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -504,6 +504,7 @@ config ARCH_W90X900 select GENERIC_CLOCKEVENTS select GPIOLIB select MULTI_IRQ_HANDLER + select SPARSE_IRQ help Support for Nuvoton (Winbond logic dept.) ARM9 processor, At present, the w90x900 has been renamed nuc900, regarding diff --git a/arch/arm/mach-w90x900/include/mach/irqs.h b/arch/arm/mach-w90x900/include/mach/irqs.h deleted file mode 100644 index 277903857030..000000000000 --- a/arch/arm/mach-w90x900/include/mach/irqs.h +++ /dev/null @@ -1,5 +0,0 @@ -#if !defined(CONFIG_SOC_NUC900) -#define NR_IRQS (IRQ_ADC+1) -#else -#define NR_IRQS 62 -#endif diff --git a/arch/arm/mach-w90x900/irq.c b/arch/arm/mach-w90x900/irq.c index 42d9af897c42..726f646c992b 100644 --- a/arch/arm/mach-w90x900/irq.c +++ b/arch/arm/mach-w90x900/irq.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -203,6 +204,8 @@ static struct irq_chip nuc900_irq_chip = { .irq_unmask = nuc900_irq_unmask, }; +static struct irq_domain *aic_domain; + static void __exception_irq_entry nuc900_handle_irq(struct pt_regs *regs) { int hwirq; @@ -210,15 +213,32 @@ static void __exception_irq_entry nuc900_handle_irq(struct pt_regs *regs) (void)readl(REG_AIC_IPER); hwirq = readl(REG_AIC_ISNR); - handle_IRQ(hwirq, regs); + handle_domain_irq(aic_domain, hwirq, regs); } +static int aic_irq_domain_map(struct irq_domain *d, unsigned int virq, + irq_hw_number_t hw) +{ + irq_set_chip_and_handler(virq, &nuc900_irq_chip, handle_level_irq); + irq_clear_status_flags(virq, IRQ_NOREQUEST); + + return 0; +} + +static struct irq_domain_ops aic_irq_domain_ops = { + .map = aic_irq_domain_map, + .xlate = irq_domain_xlate_onecell, +}; + void __init nuc900_init_irq(void) { int irqno; set_handle_irq(nuc900_handle_irq); + aic_domain = irq_domain_add_simple(NULL, 31, 1, + &aic_irq_domain_ops, NULL); + __raw_writel(0xFFFFFFFE, REG_AIC_MDCR); for (irqno = IRQ_WDT; irqno <= IRQ_ADC; irqno++) { diff --git a/drivers/irqchip/irq-nuc900.c b/drivers/irqchip/irq-nuc900.c index c4b2e39f7662..a595139f2f9c 100644 --- a/drivers/irqchip/irq-nuc900.c +++ b/drivers/irqchip/irq-nuc900.c @@ -129,7 +129,7 @@ static int __init aic_of_init(struct device_node *node, writel(0xFFFFFFFC, aic_base + REG_AIC_MDCR); writel(0xFFFFFFFF, aic_base + REG_AIC_MDCRH); - aic_domain = irq_domain_add_linear(node, NR_IRQS, + aic_domain = irq_domain_add_linear(node, 64, &aic_irq_domain_ops, NULL); if (!aic_domain) {