irq.c (bacdf4809afade180a8f2171adb4cf7ec715d139) | irq.c (abe11ddea1d759f9995a9a4636c28c9b40856ca8) |
---|---|
1/* 2 * Copyright (C) 2011-12 Synopsys, Inc. (www.synopsys.com) 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 * 8 */ 9 10#include <linux/interrupt.h> 11#include <linux/module.h> | 1/* 2 * Copyright (C) 2011-12 Synopsys, Inc. (www.synopsys.com) 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 * 8 */ 9 10#include <linux/interrupt.h> 11#include <linux/module.h> |
12#include <linux/of.h> 13#include <linux/irqdomain.h> |
|
12#include <asm/sections.h> 13#include <asm/irq.h> 14 15/* 16 * Early Hardware specific Interrupt setup 17 * -Called very early (start_kernel -> setup_arch -> setup_processor) 18 * -Platform Independent (must for any ARC700) 19 * -Needed for each CPU (hence not foldable into init_IRQ) --- 34 unchanged lines hidden (view full) --- 54} 55 56static struct irq_chip onchip_intc = { 57 .name = "ARC In-core Intc", 58 .irq_mask = arc_mask_irq, 59 .irq_unmask = arc_unmask_irq, 60}; 61 | 14#include <asm/sections.h> 15#include <asm/irq.h> 16 17/* 18 * Early Hardware specific Interrupt setup 19 * -Called very early (start_kernel -> setup_arch -> setup_processor) 20 * -Platform Independent (must for any ARC700) 21 * -Needed for each CPU (hence not foldable into init_IRQ) --- 34 unchanged lines hidden (view full) --- 56} 57 58static struct irq_chip onchip_intc = { 59 .name = "ARC In-core Intc", 60 .irq_mask = arc_mask_irq, 61 .irq_unmask = arc_unmask_irq, 62}; 63 |
64static int arc_intc_domain_map(struct irq_domain *d, unsigned int irq, 65 irq_hw_number_t hw) 66{ 67 if (irq == TIMER0_IRQ) 68 irq_set_chip_and_handler(irq, &onchip_intc, handle_percpu_irq); 69 else 70 irq_set_chip_and_handler(irq, &onchip_intc, handle_level_irq); 71 72 return 0; 73} 74 75static const struct irq_domain_ops arc_intc_domain_ops = { 76 .xlate = irq_domain_xlate_onecell, 77 .map = arc_intc_domain_map, 78}; 79 80static struct irq_domain *root_domain; 81 |
|
62void __init init_onchip_IRQ(void) 63{ | 82void __init init_onchip_IRQ(void) 83{ |
64 int i; | 84 struct device_node *intc = NULL; |
65 | 85 |
66 for (i = 0; i < NR_IRQS; i++) 67 irq_set_chip_and_handler(i, &onchip_intc, handle_level_irq); | 86 intc = of_find_compatible_node(NULL, NULL, "snps,arc700-intc"); 87 if(!intc) 88 panic("DeviceTree Missing incore intc\n"); |
68 | 89 |
69#ifdef CONFIG_SMP 70 irq_set_chip_and_handler(TIMER0_IRQ, &onchip_intc, handle_percpu_irq); 71#endif | 90 root_domain = irq_domain_add_legacy(intc, NR_IRQS, 0, 0, 91 &arc_intc_domain_ops, NULL); 92 93 if (!root_domain) 94 panic("root irq domain not avail\n"); 95 96 /* with this we don't need to export root_domain */ 97 irq_set_default_host(root_domain); |
72} 73 74/* 75 * Late Interrupt system init called from start_kernel for Boot CPU only 76 * 77 * Since slab must already be initialized, platforms can start doing any 78 * needed request_irq( )s 79 */ --- 56 unchanged lines hidden --- | 98} 99 100/* 101 * Late Interrupt system init called from start_kernel for Boot CPU only 102 * 103 * Since slab must already be initialized, platforms can start doing any 104 * needed request_irq( )s 105 */ --- 56 unchanged lines hidden --- |