Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752194AbbBVTmq (ORCPT ); Sun, 22 Feb 2015 14:42:46 -0500 Received: from mail-lb0-f182.google.com ([209.85.217.182]:35385 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752006AbbBVTmo (ORCPT ); Sun, 22 Feb 2015 14:42:44 -0500 From: Rabin Vincent To: jesper.nilsson@axis.com Cc: linux-kernel@vger.kernel.org, linux-cris-kernel@axis.com, devicetree@vger.kernel.org, Rabin Vincent Subject: [PATCHv2 1/2] CRISv32: add irq domains support Date: Sun, 22 Feb 2015 20:42:33 +0100 Message-Id: <1424634154-21358-1-git-send-email-rabin@rab.in> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1423409745-2230-1-git-send-email-rabin@rab.in> References: <1423409745-2230-1-git-send-email-rabin@rab.in> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2678 Lines: 92 Add support for IRQ domains to the CRISv32 interrupt controller. Signed-off-by: Rabin Vincent --- V2: No changes, but reorder so that this patch is before the OF patch, to avoid build errors. arch/cris/Kconfig | 1 + arch/cris/arch-v32/kernel/irq.c | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 8474c66..3c94c96 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -53,6 +53,7 @@ config CRIS select OLD_SIGSUSPEND select OLD_SIGACTION select ARCH_REQUIRE_GPIOLIB + select IRQ_DOMAIN if ETRAX_ARCH_V32 config HZ int diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c index 25437ae..bc871d2 100644 --- a/arch/cris/arch-v32/kernel/irq.c +++ b/arch/cris/arch-v32/kernel/irq.c @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include #include @@ -431,6 +433,19 @@ crisv32_do_multiple(struct pt_regs* regs) irq_exit(); } +static int crisv32_irq_map(struct irq_domain *h, unsigned int virq, + irq_hw_number_t hw_irq_num) +{ + irq_set_chip_and_handler(virq, &crisv32_irq_type, handle_simple_irq); + + return 0; +} + +static struct irq_domain_ops crisv32_irq_ops = { + .map = crisv32_irq_map, + .xlate = irq_domain_xlate_onecell, +}; + /* * This is called by start_kernel. It fixes the IRQ masks and setup the * interrupt vector table to point to bad_interrupt pointers. @@ -441,6 +456,8 @@ init_IRQ(void) int i; int j; reg_intr_vect_rw_mask vect_mask = {0}; + struct device_node *np; + struct irq_domain *domain; /* Clear all interrupts masks. */ for (i = 0; i < NBR_REGS; i++) @@ -449,10 +466,15 @@ init_IRQ(void) for (i = 0; i < 256; i++) etrax_irv->v[i] = weird_irq; - /* Point all IRQ's to bad handlers. */ + np = of_find_compatible_node(NULL, NULL, "axis,crisv32-intc"); + domain = irq_domain_add_legacy(np, NR_IRQS - FIRST_IRQ, + FIRST_IRQ, FIRST_IRQ, + &crisv32_irq_ops, NULL); + BUG_ON(!domain); + irq_set_default_host(domain); + of_node_put(np); + for (i = FIRST_IRQ, j = 0; j < NR_IRQS; i++, j++) { - irq_set_chip_and_handler(j, &crisv32_irq_type, - handle_simple_irq); set_exception_vector(i, interrupt[j]); } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/