Commit f84f1f462bfaf0e45511f97ef54068b8539a7af6

Authored by Mark Salter
1 parent b3f8956210

C6X: remove dependence on legacy IRQs

The core priority PIC code uses legacy irq support to facilitate direct
mapping of core hw interrupt numbers to linux interrupt numbers. This
patch removes the legacy irq usage and replaces it with a generic linear
mapping.

Signed-off-by: Mark Salter <msalter@redhat.com>

Showing 2 changed files with 10 additions and 13 deletions Side-by-side Diff

arch/c6x/include/asm/irq.h
... ... @@ -34,8 +34,6 @@
34 34 */
35 35 #define NR_PRIORITY_IRQS 16
36 36  
37   -#define NR_IRQS_LEGACY NR_PRIORITY_IRQS
38   -
39 37 /* Total number of virq in the platform */
40 38 #define NR_IRQS 256
41 39  
arch/c6x/kernel/irq.c
1 1 /*
2   - * Copyright (C) 2011 Texas Instruments Incorporated
  2 + * Copyright (C) 2011-2012 Texas Instruments Incorporated
3 3 *
4 4 * This borrows heavily from powerpc version, which is:
5 5 *
6 6  
... ... @@ -35,10 +35,8 @@
35 35  
36 36 static void mask_core_irq(struct irq_data *data)
37 37 {
38   - unsigned int prio = data->irq;
  38 + unsigned int prio = data->hwirq;
39 39  
40   - BUG_ON(prio < 4 || prio >= NR_PRIORITY_IRQS);
41   -
42 40 raw_spin_lock(&core_irq_lock);
43 41 and_creg(IER, ~(1 << prio));
44 42 raw_spin_unlock(&core_irq_lock);
... ... @@ -46,7 +44,7 @@
46 44  
47 45 static void unmask_core_irq(struct irq_data *data)
48 46 {
49   - unsigned int prio = data->irq;
  47 + unsigned int prio = data->hwirq;
50 48  
51 49 raw_spin_lock(&core_irq_lock);
52 50 or_creg(IER, 1 << prio);
53 51  
54 52  
... ... @@ -59,16 +57,16 @@
59 57 .irq_unmask = unmask_core_irq,
60 58 };
61 59  
  60 +static int prio_to_virq[NR_PRIORITY_IRQS];
  61 +
62 62 asmlinkage void c6x_do_IRQ(unsigned int prio, struct pt_regs *regs)
63 63 {
64 64 struct pt_regs *old_regs = set_irq_regs(regs);
65 65  
66 66 irq_enter();
67 67  
68   - BUG_ON(prio < 4 || prio >= NR_PRIORITY_IRQS);
  68 + generic_handle_irq(prio_to_virq[prio]);
69 69  
70   - generic_handle_irq(prio);
71   -
72 70 irq_exit();
73 71  
74 72 set_irq_regs(old_regs);
... ... @@ -82,6 +80,8 @@
82 80 if (hw < 4 || hw >= NR_PRIORITY_IRQS)
83 81 return -EINVAL;
84 82  
  83 + prio_to_virq[hw] = virq;
  84 +
85 85 irq_set_status_flags(virq, IRQ_LEVEL);
86 86 irq_set_chip_and_handler(virq, &core_chip, handle_level_irq);
87 87 return 0;
... ... @@ -102,9 +102,8 @@
102 102 np = of_find_compatible_node(NULL, NULL, "ti,c64x+core-pic");
103 103 if (np != NULL) {
104 104 /* create the core host */
105   - core_domain = irq_domain_add_legacy(np, NR_PRIORITY_IRQS,
106   - 0, 0, &core_domain_ops,
107   - NULL);
  105 + core_domain = irq_domain_add_linear(np, NR_PRIORITY_IRQS,
  106 + &core_domain_ops, NULL);
108 107 if (core_domain)
109 108 irq_set_default_host(core_domain);
110 109 of_node_put(np);