aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorBarry Song <21cnbao@gmail.com>2013-08-06 01:37:13 -0400
committerOlof Johansson <olof@lixom.net>2013-08-29 12:48:32 -0400
commit29eb51a728f9a67a1e1140490fa188561de56588 (patch)
tree656d13bce040b402a130ff10707c7b911816d475 /drivers/irqchip
parent30ca2226bea6f0db519dc53381b893cd66cb5b66 (diff)
irqchip: sirf: move from legacy mode to linear irqdomain
the series of patches for irqdomain core in 3.11 has broken sirf irq which uses legacy mapping. all users fail in the new kernel while setupping irq. this patch moves to linear irqdomain and drop old legacy irqdomain codes since we don't need it any more, and at the same time, it also fixes the broken interrupts of sirfsoc in 3.11. on the other hand, we actually only have 64 interrupt sources for prima2 and atlas6, but there are 128 interrupt souces for marco which uses GIC. in the legacy codes, sirf gpio also uses legacy irqdomain, so to make gpio interrupt mapping not depend on the prima2/atlas6/marco an use unified marco,we enlarge prima2/atlas6 interrupt number to 128. here we don't need this workaround any more as sirf gpio also moved to linear mode before. so we move SIRFSOC_NUM_IRQS back to 64 too. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-sirfsoc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/irqchip/irq-sirfsoc.c b/drivers/irqchip/irq-sirfsoc.c
index 69ea44ebcf61..4851afae38dc 100644
--- a/drivers/irqchip/irq-sirfsoc.c
+++ b/drivers/irqchip/irq-sirfsoc.c
@@ -23,7 +23,7 @@
23#define SIRFSOC_INT_RISC_LEVEL1 0x0024 23#define SIRFSOC_INT_RISC_LEVEL1 0x0024
24#define SIRFSOC_INIT_IRQ_ID 0x0038 24#define SIRFSOC_INIT_IRQ_ID 0x0038
25 25
26#define SIRFSOC_NUM_IRQS 128 26#define SIRFSOC_NUM_IRQS 64
27 27
28static struct irq_domain *sirfsoc_irqdomain; 28static struct irq_domain *sirfsoc_irqdomain;
29 29
@@ -32,15 +32,18 @@ sirfsoc_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
32{ 32{
33 struct irq_chip_generic *gc; 33 struct irq_chip_generic *gc;
34 struct irq_chip_type *ct; 34 struct irq_chip_type *ct;
35 int ret;
36 unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
35 37
36 gc = irq_alloc_generic_chip("SIRFINTC", 1, irq_start, base, handle_level_irq); 38 ret = irq_alloc_domain_generic_chips(sirfsoc_irqdomain, num, 1, "irq_sirfsoc",
37 ct = gc->chip_types; 39 handle_level_irq, clr, 0, IRQ_GC_INIT_MASK_CACHE);
38 40
41 gc = irq_get_domain_generic_chip(sirfsoc_irqdomain, irq_start);
42 gc->reg_base = base;
43 ct = gc->chip_types;
39 ct->chip.irq_mask = irq_gc_mask_clr_bit; 44 ct->chip.irq_mask = irq_gc_mask_clr_bit;
40 ct->chip.irq_unmask = irq_gc_mask_set_bit; 45 ct->chip.irq_unmask = irq_gc_mask_set_bit;
41 ct->regs.mask = SIRFSOC_INT_RISC_MASK0; 46 ct->regs.mask = SIRFSOC_INT_RISC_MASK0;
42
43 irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST, 0);
44} 47}
45 48
46static asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs) 49static asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs)
@@ -60,9 +63,8 @@ static int __init sirfsoc_irq_init(struct device_node *np, struct device_node *p
60 if (!base) 63 if (!base)
61 panic("unable to map intc cpu registers\n"); 64 panic("unable to map intc cpu registers\n");
62 65
63 /* using legacy because irqchip_generic does not work with linear */ 66 sirfsoc_irqdomain = irq_domain_add_linear(np, SIRFSOC_NUM_IRQS,
64 sirfsoc_irqdomain = irq_domain_add_legacy(np, SIRFSOC_NUM_IRQS, 0, 0, 67 &irq_generic_chip_ops, base);
65 &irq_domain_simple_ops, base);
66 68
67 sirfsoc_alloc_gc(base, 0, 32); 69 sirfsoc_alloc_gc(base, 0, 32);
68 sirfsoc_alloc_gc(base + 4, 32, SIRFSOC_NUM_IRQS - 32); 70 sirfsoc_alloc_gc(base + 4, 32, SIRFSOC_NUM_IRQS - 32);