summaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/irq.c
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-01-18 10:42:21 +0100
committerVineet Gupta <vgupta@synopsys.com>2013-02-15 18:45:57 +0100
commitabe11ddea1d759f9995a9a4636c28c9b40856ca8 (patch)
tree53085d131ecbe7a810f9feadcba571f49a2e9465 /arch/arc/kernel/irq.c
parentARC: [DeviceTree] Convert some Kconfig items to runtime values (diff)
downloadlinux-abe11ddea1d759f9995a9a4636c28c9b40856ca8.tar.xz
linux-abe11ddea1d759f9995a9a4636c28c9b40856ca8.zip
ARC: [plat-arcfpga]: Enabling DeviceTree for Angel4 board
* arc-uart platform device now populated dynamically, using of_platform_populate() - applies to any other device whatsoever. * uart in turn requires incore arc-intc to be also present in DT * A irq-domain needs to be instantiated for IRQ requests by DT probed device (e.g. arc-uart) TODO: switch over to linear irq domain once all devs have been transitioned to DT Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arc/kernel/irq.c')
-rw-r--r--arch/arc/kernel/irq.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c
index 2f399eb88f9d..3c18e66386c7 100644
--- a/arch/arc/kernel/irq.c
+++ b/arch/arc/kernel/irq.c
@@ -9,6 +9,8 @@
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/irqdomain.h>
#include <asm/sections.h>
#include <asm/irq.h>
@@ -59,16 +61,40 @@ static struct irq_chip onchip_intc = {
.irq_unmask = arc_unmask_irq,
};
+static int arc_intc_domain_map(struct irq_domain *d, unsigned int irq,
+ irq_hw_number_t hw)
+{
+ if (irq == TIMER0_IRQ)
+ irq_set_chip_and_handler(irq, &onchip_intc, handle_percpu_irq);
+ else
+ irq_set_chip_and_handler(irq, &onchip_intc, handle_level_irq);
+
+ return 0;
+}
+
+static const struct irq_domain_ops arc_intc_domain_ops = {
+ .xlate = irq_domain_xlate_onecell,
+ .map = arc_intc_domain_map,
+};
+
+static struct irq_domain *root_domain;
+
void __init init_onchip_IRQ(void)
{
- int i;
+ struct device_node *intc = NULL;
+
+ intc = of_find_compatible_node(NULL, NULL, "snps,arc700-intc");
+ if(!intc)
+ panic("DeviceTree Missing incore intc\n");
+
+ root_domain = irq_domain_add_legacy(intc, NR_IRQS, 0, 0,
+ &arc_intc_domain_ops, NULL);
- for (i = 0; i < NR_IRQS; i++)
- irq_set_chip_and_handler(i, &onchip_intc, handle_level_irq);
+ if (!root_domain)
+ panic("root irq domain not avail\n");
-#ifdef CONFIG_SMP
- irq_set_chip_and_handler(TIMER0_IRQ, &onchip_intc, handle_percpu_irq);
-#endif
+ /* with this we don't need to export root_domain */
+ irq_set_default_host(root_domain);
}
/*