diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-10-10 11:45:29 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-10-25 11:22:34 -0400 |
commit | 74fde6de4f33e6d6bc3120ad517b8a4e4eae1851 (patch) | |
tree | 199f44057c02740360a2f97d195cc882167f9e9f /arch/arm/mach-clps711x/common.c | |
parent | 66e972b4bd98cdf82ad6d04051a5f508ad73a8dd (diff) |
ARM: clps711x: rework IRQ sybsustem initialization
Reworked IRQ subsystem to be able to use some interrupts
with "End of interrupt" handler.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-clps711x/common.c')
-rw-r--r-- | arch/arm/mach-clps711x/common.c | 73 |
1 files changed, 53 insertions, 20 deletions
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c index 218684f0d7b4..47fb496ceae7 100644 --- a/arch/arm/mach-clps711x/common.c +++ b/arch/arm/mach-clps711x/common.c | |||
@@ -66,6 +66,10 @@ static void int1_mask(struct irq_data *d) | |||
66 | 66 | ||
67 | static void int1_ack(struct irq_data *d) | 67 | static void int1_ack(struct irq_data *d) |
68 | { | 68 | { |
69 | } | ||
70 | |||
71 | static void int1_eoi(struct irq_data *d) | ||
72 | { | ||
69 | switch (d->irq) { | 73 | switch (d->irq) { |
70 | case IRQ_CSINT: clps_writel(0, COEOI); break; | 74 | case IRQ_CSINT: clps_writel(0, COEOI); break; |
71 | case IRQ_TC1OI: clps_writel(0, TC1EOI); break; | 75 | case IRQ_TC1OI: clps_writel(0, TC1EOI); break; |
@@ -86,7 +90,9 @@ static void int1_unmask(struct irq_data *d) | |||
86 | } | 90 | } |
87 | 91 | ||
88 | static struct irq_chip int1_chip = { | 92 | static struct irq_chip int1_chip = { |
93 | .name = "Interrupt Vector 1 ", | ||
89 | .irq_ack = int1_ack, | 94 | .irq_ack = int1_ack, |
95 | .irq_eoi = int1_eoi, | ||
90 | .irq_mask = int1_mask, | 96 | .irq_mask = int1_mask, |
91 | .irq_unmask = int1_unmask, | 97 | .irq_unmask = int1_unmask, |
92 | }; | 98 | }; |
@@ -102,6 +108,10 @@ static void int2_mask(struct irq_data *d) | |||
102 | 108 | ||
103 | static void int2_ack(struct irq_data *d) | 109 | static void int2_ack(struct irq_data *d) |
104 | { | 110 | { |
111 | } | ||
112 | |||
113 | static void int2_eoi(struct irq_data *d) | ||
114 | { | ||
105 | switch (d->irq) { | 115 | switch (d->irq) { |
106 | case IRQ_KBDINT: clps_writel(0, KBDEOI); break; | 116 | case IRQ_KBDINT: clps_writel(0, KBDEOI); break; |
107 | } | 117 | } |
@@ -117,45 +127,68 @@ static void int2_unmask(struct irq_data *d) | |||
117 | } | 127 | } |
118 | 128 | ||
119 | static struct irq_chip int2_chip = { | 129 | static struct irq_chip int2_chip = { |
130 | .name = "Interrupt Vector 2 ", | ||
120 | .irq_ack = int2_ack, | 131 | .irq_ack = int2_ack, |
132 | .irq_eoi = int2_eoi, | ||
121 | .irq_mask = int2_mask, | 133 | .irq_mask = int2_mask, |
122 | .irq_unmask = int2_unmask, | 134 | .irq_unmask = int2_unmask, |
123 | }; | 135 | }; |
124 | 136 | ||
137 | struct clps711x_irqdesc { | ||
138 | int nr; | ||
139 | struct irq_chip *chip; | ||
140 | irq_flow_handler_t handle; | ||
141 | }; | ||
142 | |||
143 | static struct clps711x_irqdesc clps711x_irqdescs[] __initdata = { | ||
144 | { IRQ_CSINT, &int1_chip, handle_fasteoi_irq, }, | ||
145 | { IRQ_EINT1, &int1_chip, handle_level_irq, }, | ||
146 | { IRQ_EINT2, &int1_chip, handle_level_irq, }, | ||
147 | { IRQ_EINT3, &int1_chip, handle_level_irq, }, | ||
148 | { IRQ_TC1OI, &int1_chip, handle_fasteoi_irq, }, | ||
149 | { IRQ_TC2OI, &int1_chip, handle_fasteoi_irq, }, | ||
150 | { IRQ_RTCMI, &int1_chip, handle_fasteoi_irq, }, | ||
151 | { IRQ_TINT, &int1_chip, handle_fasteoi_irq, }, | ||
152 | { IRQ_UTXINT1, &int1_chip, handle_level_irq, }, | ||
153 | { IRQ_URXINT1, &int1_chip, handle_level_irq, }, | ||
154 | { IRQ_UMSINT, &int1_chip, handle_fasteoi_irq, }, | ||
155 | { IRQ_SSEOTI, &int1_chip, handle_level_irq, }, | ||
156 | { IRQ_KBDINT, &int2_chip, handle_fasteoi_irq, }, | ||
157 | { IRQ_SS2RX, &int2_chip, handle_level_irq, }, | ||
158 | { IRQ_SS2TX, &int2_chip, handle_level_irq, }, | ||
159 | { IRQ_UTXINT2, &int2_chip, handle_level_irq, }, | ||
160 | { IRQ_URXINT2, &int2_chip, handle_level_irq, }, | ||
161 | }; | ||
162 | |||
125 | void __init clps711x_init_irq(void) | 163 | void __init clps711x_init_irq(void) |
126 | { | 164 | { |
127 | unsigned int i; | 165 | unsigned int i; |
128 | 166 | ||
129 | for (i = 0; i < NR_IRQS; i++) { | 167 | /* Disable interrupts */ |
130 | if (INT1_IRQS & (1 << i)) { | ||
131 | irq_set_chip_and_handler(i, &int1_chip, | ||
132 | handle_level_irq); | ||
133 | set_irq_flags(i, IRQF_VALID | IRQF_PROBE); | ||
134 | } | ||
135 | if (INT2_IRQS & (1 << i)) { | ||
136 | irq_set_chip_and_handler(i, &int2_chip, | ||
137 | handle_level_irq); | ||
138 | set_irq_flags(i, IRQF_VALID | IRQF_PROBE); | ||
139 | } | ||
140 | } | ||
141 | |||
142 | /* | ||
143 | * Disable interrupts | ||
144 | */ | ||
145 | clps_writel(0, INTMR1); | 168 | clps_writel(0, INTMR1); |
146 | clps_writel(0, INTMR2); | 169 | clps_writel(0, INTMR2); |
170 | clps_writel(0, INTMR3); | ||
147 | 171 | ||
148 | /* | 172 | /* Clear down any pending interrupts */ |
149 | * Clear down any pending interrupts | 173 | clps_writel(0, BLEOI); |
150 | */ | 174 | clps_writel(0, MCEOI); |
151 | clps_writel(0, COEOI); | 175 | clps_writel(0, COEOI); |
152 | clps_writel(0, TC1EOI); | 176 | clps_writel(0, TC1EOI); |
153 | clps_writel(0, TC2EOI); | 177 | clps_writel(0, TC2EOI); |
154 | clps_writel(0, RTCEOI); | 178 | clps_writel(0, RTCEOI); |
155 | clps_writel(0, TEOI); | 179 | clps_writel(0, TEOI); |
156 | clps_writel(0, UMSEOI); | 180 | clps_writel(0, UMSEOI); |
157 | clps_writel(0, SYNCIO); | ||
158 | clps_writel(0, KBDEOI); | 181 | clps_writel(0, KBDEOI); |
182 | clps_writel(0, SRXEOF); | ||
183 | clps_writel(0xffffffff, DAISR); | ||
184 | |||
185 | for (i = 0; i < ARRAY_SIZE(clps711x_irqdescs); i++) { | ||
186 | irq_set_chip_and_handler(clps711x_irqdescs[i].nr, | ||
187 | clps711x_irqdescs[i].chip, | ||
188 | clps711x_irqdescs[i].handle); | ||
189 | set_irq_flags(clps711x_irqdescs[i].nr, | ||
190 | IRQF_VALID | IRQF_PROBE); | ||
191 | } | ||
159 | } | 192 | } |
160 | 193 | ||
161 | static void clps711x_clockevent_set_mode(enum clock_event_mode mode, | 194 | static void clps711x_clockevent_set_mode(enum clock_event_mode mode, |