diff options
Diffstat (limited to 'arch/arm/mach-iop33x/irq.c')
-rw-r--r-- | arch/arm/mach-iop33x/irq.c | 95 |
1 files changed, 43 insertions, 52 deletions
diff --git a/arch/arm/mach-iop33x/irq.c b/arch/arm/mach-iop33x/irq.c index 3c720551ac12..63304b3d0d76 100644 --- a/arch/arm/mach-iop33x/irq.c +++ b/arch/arm/mach-iop33x/irq.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-iop33x/irq.c | 2 | * arch/arm/mach-iop33x/irq.c |
3 | * | 3 | * |
4 | * Generic IOP331 IRQ handling functionality | 4 | * Generic IOP331 IRQ handling functionality |
5 | * | 5 | * |
@@ -9,51 +9,44 @@ | |||
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | * | ||
13 | * | ||
14 | */ | 12 | */ |
13 | |||
15 | #include <linux/init.h> | 14 | #include <linux/init.h> |
16 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
17 | #include <linux/list.h> | 16 | #include <linux/list.h> |
18 | |||
19 | #include <asm/mach/irq.h> | 17 | #include <asm/mach/irq.h> |
20 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
21 | #include <asm/hardware.h> | 19 | #include <asm/hardware.h> |
22 | |||
23 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
24 | 21 | ||
25 | static u32 iop331_mask0 = 0; | 22 | static u32 iop33x_mask0; |
26 | static u32 iop331_mask1 = 0; | 23 | static u32 iop33x_mask1; |
27 | 24 | ||
28 | static inline void intctl_write0(u32 val) | 25 | static inline void intctl0_write(u32 val) |
29 | { | 26 | { |
30 | // INTCTL0 | ||
31 | iop3xx_cp6_enable(); | 27 | iop3xx_cp6_enable(); |
32 | asm volatile("mcr p6,0,%0,c0,c0,0"::"r" (val)); | 28 | asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val)); |
33 | iop3xx_cp6_disable(); | 29 | iop3xx_cp6_disable(); |
34 | } | 30 | } |
35 | 31 | ||
36 | static inline void intctl_write1(u32 val) | 32 | static inline void intctl1_write(u32 val) |
37 | { | 33 | { |
38 | // INTCTL1 | ||
39 | iop3xx_cp6_enable(); | 34 | iop3xx_cp6_enable(); |
40 | asm volatile("mcr p6,0,%0,c1,c0,0"::"r" (val)); | 35 | asm volatile("mcr p6, 0, %0, c1, c0, 0" : : "r" (val)); |
41 | iop3xx_cp6_disable(); | 36 | iop3xx_cp6_disable(); |
42 | } | 37 | } |
43 | 38 | ||
44 | static inline void intstr_write0(u32 val) | 39 | static inline void intstr0_write(u32 val) |
45 | { | 40 | { |
46 | // INTSTR0 | ||
47 | iop3xx_cp6_enable(); | 41 | iop3xx_cp6_enable(); |
48 | asm volatile("mcr p6,0,%0,c2,c0,0"::"r" (val)); | 42 | asm volatile("mcr p6, 0, %0, c2, c0, 0" : : "r" (val)); |
49 | iop3xx_cp6_disable(); | 43 | iop3xx_cp6_disable(); |
50 | } | 44 | } |
51 | 45 | ||
52 | static inline void intstr_write1(u32 val) | 46 | static inline void intstr1_write(u32 val) |
53 | { | 47 | { |
54 | // INTSTR1 | ||
55 | iop3xx_cp6_enable(); | 48 | iop3xx_cp6_enable(); |
56 | asm volatile("mcr p6,0,%0,c3,c0,0"::"r" (val)); | 49 | asm volatile("mcr p6, 0, %0, c3, c0, 0" : : "r" (val)); |
57 | iop3xx_cp6_disable(); | 50 | iop3xx_cp6_disable(); |
58 | } | 51 | } |
59 | 52 | ||
@@ -72,65 +65,63 @@ static inline void intsize_write(u32 val) | |||
72 | } | 65 | } |
73 | 66 | ||
74 | static void | 67 | static void |
75 | iop331_irq_mask1 (unsigned int irq) | 68 | iop33x_irq_mask1 (unsigned int irq) |
76 | { | 69 | { |
77 | iop331_mask0 &= ~(1 << irq); | 70 | iop33x_mask0 &= ~(1 << irq); |
78 | intctl_write0(iop331_mask0); | 71 | intctl0_write(iop33x_mask0); |
79 | } | 72 | } |
80 | 73 | ||
81 | static void | 74 | static void |
82 | iop331_irq_mask2 (unsigned int irq) | 75 | iop33x_irq_mask2 (unsigned int irq) |
83 | { | 76 | { |
84 | iop331_mask1 &= ~(1 << (irq - 32)); | 77 | iop33x_mask1 &= ~(1 << (irq - 32)); |
85 | intctl_write1(iop331_mask1); | 78 | intctl1_write(iop33x_mask1); |
86 | } | 79 | } |
87 | 80 | ||
88 | static void | 81 | static void |
89 | iop331_irq_unmask1(unsigned int irq) | 82 | iop33x_irq_unmask1(unsigned int irq) |
90 | { | 83 | { |
91 | iop331_mask0 |= (1 << irq); | 84 | iop33x_mask0 |= 1 << irq; |
92 | intctl_write0(iop331_mask0); | 85 | intctl0_write(iop33x_mask0); |
93 | } | 86 | } |
94 | 87 | ||
95 | static void | 88 | static void |
96 | iop331_irq_unmask2(unsigned int irq) | 89 | iop33x_irq_unmask2(unsigned int irq) |
97 | { | 90 | { |
98 | iop331_mask1 |= (1 << (irq - 32)); | 91 | iop33x_mask1 |= (1 << (irq - 32)); |
99 | intctl_write1(iop331_mask1); | 92 | intctl1_write(iop33x_mask1); |
100 | } | 93 | } |
101 | 94 | ||
102 | struct irq_chip iop331_irqchip1 = { | 95 | struct irq_chip iop33x_irqchip1 = { |
103 | .name = "IOP-1", | 96 | .name = "IOP33x-1", |
104 | .ack = iop331_irq_mask1, | 97 | .ack = iop33x_irq_mask1, |
105 | .mask = iop331_irq_mask1, | 98 | .mask = iop33x_irq_mask1, |
106 | .unmask = iop331_irq_unmask1, | 99 | .unmask = iop33x_irq_unmask1, |
107 | }; | 100 | }; |
108 | 101 | ||
109 | struct irq_chip iop331_irqchip2 = { | 102 | struct irq_chip iop33x_irqchip2 = { |
110 | .name = "IOP-2", | 103 | .name = "IOP33x-2", |
111 | .ack = iop331_irq_mask2, | 104 | .ack = iop33x_irq_mask2, |
112 | .mask = iop331_irq_mask2, | 105 | .mask = iop33x_irq_mask2, |
113 | .unmask = iop331_irq_unmask2, | 106 | .unmask = iop33x_irq_unmask2, |
114 | }; | 107 | }; |
115 | 108 | ||
116 | void __init iop331_init_irq(void) | 109 | void __init iop33x_init_irq(void) |
117 | { | 110 | { |
118 | unsigned int i; | 111 | int i; |
119 | 112 | ||
120 | intctl_write0(0); // disable all interrupts | 113 | intctl0_write(0); |
121 | intctl_write1(0); | 114 | intctl1_write(0); |
122 | intstr_write0(0); // treat all as IRQ | 115 | intstr0_write(0); |
123 | intstr_write1(0); | 116 | intstr1_write(0); |
124 | intbase_write(0); | 117 | intbase_write(0); |
125 | intsize_write(1); | 118 | intsize_write(1); |
126 | if(machine_is_iq80331()) // all interrupts are inputs to chip | 119 | if (machine_is_iq80331()) |
127 | *IOP3XX_PCIIRSR = 0x0f; | 120 | *IOP3XX_PCIIRSR = 0x0f; |
128 | 121 | ||
129 | for(i = 0; i < NR_IRQS; i++) | 122 | for (i = 0; i < NR_IRQS; i++) { |
130 | { | 123 | set_irq_chip(i, (i < 32) ? &iop33x_irqchip1 : &iop33x_irqchip2); |
131 | set_irq_chip(i, (i < 32) ? &iop331_irqchip1 : &iop331_irqchip2); | ||
132 | set_irq_handler(i, do_level_IRQ); | 124 | set_irq_handler(i, do_level_IRQ); |
133 | set_irq_flags(i, IRQF_VALID | IRQF_PROBE); | 125 | set_irq_flags(i, IRQF_VALID | IRQF_PROBE); |
134 | } | 126 | } |
135 | } | 127 | } |
136 | |||