2 * linux/arch/arm/mach-iop3xx/iop310-irq.c
4 * Generic IOP310 IRQ handling functionality
6 * Author: Nicolas Pitre
7 * Copyright: (C) 2001 MontaVista Software Inc.
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
11 * published by the Free Software Foundation.
13 * Added IOP310 chipset and IQ80310 board demuxing, masking code. - DS
16 #include <linux/init.h>
17 #include <linux/interrupt.h>
18 #include <linux/list.h>
20 #include <asm/mach/irq.h>
22 #include <asm/hardware.h>
24 #include <asm/mach-types.h>
26 extern void xs80200_irq_mask(unsigned int);
27 extern void xs80200_irq_unmask(unsigned int);
28 extern void xs80200_init_irq(void);
30 extern void do_IRQ(int, struct pt_regs *);
32 static u32 iop310_mask /* = 0 */;
34 static void iop310_irq_mask (unsigned int irq)
39 * No mask bits on the 80312, so we have to
40 * mask everything from the outside!
42 if (iop310_mask == 1) {
43 disable_irq(IRQ_XS80200_EXTIRQ);
44 irq_desc[IRQ_XS80200_EXTIRQ].chip->mask(IRQ_XS80200_EXTIRQ);
48 static void iop310_irq_unmask (unsigned int irq)
54 * Check if all 80312 sources are unmasked now
57 enable_irq(IRQ_XS80200_EXTIRQ);
60 struct irqchip ext_chip = {
61 .ack = iop310_irq_mask,
62 .mask = iop310_irq_mask,
63 .unmask = iop310_irq_unmask,
67 iop310_irq_demux(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
69 u32 fiq1isr = *((volatile u32*)IOP310_FIQ1ISR);
70 u32 fiq2isr = *((volatile u32*)IOP310_FIQ2ISR);
72 unsigned int irqno = 0;
77 irqno = IRQ_IOP310_DMA0;
79 irqno = IRQ_IOP310_DMA1;
81 irqno = IRQ_IOP310_DMA2;
83 irqno = IRQ_IOP310_PMON;
85 irqno = IRQ_IOP310_AAU;
90 irqno = IRQ_IOP310_I2C;
92 irqno = IRQ_IOP310_MU;
97 d->handle(irqno, d, regs);
101 void __init iop310_init_irq(void)
105 for(i = IOP310_IRQ_OFS; i < NR_IOP310_IRQS; i++)
107 set_irq_chip(i, &ext_chip);
108 set_irq_handler(i, do_level_IRQ);
109 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);