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