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 extern void xs80200_irq_mask(unsigned int);
25 extern void xs80200_irq_unmask(unsigned int);
26 extern void xs80200_init_irq(void);
28 extern void do_IRQ(int, struct pt_regs *);
30 static u32 iop310_mask /* = 0 */;
32 static void iop310_irq_mask (unsigned int irq)
37 * No mask bits on the 80312, so we have to
38 * mask everything from the outside!
40 if (iop310_mask == 1) {
41 disable_irq(IRQ_XS80200_EXTIRQ);
42 irq_desc[IRQ_XS80200_EXTIRQ].chip->mask(IRQ_XS80200_EXTIRQ);
46 static void iop310_irq_unmask (unsigned int irq)
52 * Check if all 80312 sources are unmasked now
55 enable_irq(IRQ_XS80200_EXTIRQ);
58 struct irqchip ext_chip = {
59 .ack = iop310_irq_mask,
60 .mask = iop310_irq_mask,
61 .unmask = iop310_irq_unmask,
65 iop310_irq_demux(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
67 u32 fiq1isr = *((volatile u32*)IOP310_FIQ1ISR);
68 u32 fiq2isr = *((volatile u32*)IOP310_FIQ2ISR);
70 unsigned int irqno = 0;
75 irqno = IRQ_IOP310_DMA0;
77 irqno = IRQ_IOP310_DMA1;
79 irqno = IRQ_IOP310_DMA2;
81 irqno = IRQ_IOP310_PMON;
83 irqno = IRQ_IOP310_AAU;
88 irqno = IRQ_IOP310_I2C;
90 irqno = IRQ_IOP310_MU;
95 d->handle(irqno, d, regs);
99 void __init iop310_init_irq(void)
103 for(i = IOP310_IRQ_OFS; i < NR_IOP310_IRQS; i++)
105 set_irq_chip(i, &ext_chip);
106 set_irq_handler(i, do_level_IRQ);
107 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);