aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-armada-370-xp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/irqchip/irq-armada-370-xp.c')
-rw-r--r--drivers/irqchip/irq-armada-370-xp.c83
1 files changed, 40 insertions, 43 deletions
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index d20a832ba86b..1115bf878ca0 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -206,49 +206,6 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
206}; 206};
207 207
208static asmlinkage void __exception_irq_entry 208static asmlinkage void __exception_irq_entry
209armada_370_xp_handle_irq(struct pt_regs *regs);
210
211static int __init armada_370_xp_mpic_of_init(struct device_node *node,
212 struct device_node *parent)
213{
214 u32 control;
215
216 main_int_base = of_iomap(node, 0);
217 per_cpu_int_base = of_iomap(node, 1);
218
219 BUG_ON(!main_int_base);
220 BUG_ON(!per_cpu_int_base);
221
222 control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
223
224 armada_370_xp_mpic_domain =
225 irq_domain_add_linear(node, (control >> 2) & 0x3ff,
226 &armada_370_xp_mpic_irq_ops, NULL);
227
228 if (!armada_370_xp_mpic_domain)
229 panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
230
231 irq_set_default_host(armada_370_xp_mpic_domain);
232
233#ifdef CONFIG_SMP
234 armada_xp_mpic_smp_cpu_init();
235
236 /*
237 * Set the default affinity from all CPUs to the boot cpu.
238 * This is required since the MPIC doesn't limit several CPUs
239 * from acknowledging the same interrupt.
240 */
241 cpumask_clear(irq_default_affinity);
242 cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
243
244#endif
245
246 set_handle_irq(armada_370_xp_handle_irq);
247
248 return 0;
249}
250
251static asmlinkage void __exception_irq_entry
252armada_370_xp_handle_irq(struct pt_regs *regs) 209armada_370_xp_handle_irq(struct pt_regs *regs)
253{ 210{
254 u32 irqstat, irqnr; 211 u32 irqstat, irqnr;
@@ -291,4 +248,44 @@ armada_370_xp_handle_irq(struct pt_regs *regs)
291 } while (1); 248 } while (1);
292} 249}
293 250
251static int __init armada_370_xp_mpic_of_init(struct device_node *node,
252 struct device_node *parent)
253{
254 u32 control;
255
256 main_int_base = of_iomap(node, 0);
257 per_cpu_int_base = of_iomap(node, 1);
258
259 BUG_ON(!main_int_base);
260 BUG_ON(!per_cpu_int_base);
261
262 control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
263
264 armada_370_xp_mpic_domain =
265 irq_domain_add_linear(node, (control >> 2) & 0x3ff,
266 &armada_370_xp_mpic_irq_ops, NULL);
267
268 if (!armada_370_xp_mpic_domain)
269 panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
270
271 irq_set_default_host(armada_370_xp_mpic_domain);
272
273#ifdef CONFIG_SMP
274 armada_xp_mpic_smp_cpu_init();
275
276 /*
277 * Set the default affinity from all CPUs to the boot cpu.
278 * This is required since the MPIC doesn't limit several CPUs
279 * from acknowledging the same interrupt.
280 */
281 cpumask_clear(irq_default_affinity);
282 cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
283
284#endif
285
286 set_handle_irq(armada_370_xp_handle_irq);
287
288 return 0;
289}
290
294IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init); 291IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init);