2 * arch/mips/vr41xx/nec-cmbvr4133/irq.c
4 * Interrupt routines for the NEC CMB-VR4133 board.
6 * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com> and
7 * Alex Sapkov <asapkov@ru.mvista.com>
9 * 2003-2004 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
14 * Support for NEC-CMBVR4133 in 2.6
15 * Manish Lachwani (mlachwani@mvista.com)
17 #include <linux/bitops.h>
18 #include <linux/errno.h>
19 #include <linux/init.h>
20 #include <linux/ioport.h>
21 #include <linux/interrupt.h>
24 #include <asm/vr41xx/cmbvr4133.h>
26 extern void enable_8259A_irq(unsigned int irq);
27 extern void disable_8259A_irq(unsigned int irq);
28 extern void mask_and_ack_8259A(unsigned int irq);
29 extern void init_8259A(int hoge);
31 extern int vr4133_rockhopper;
33 static unsigned int startup_i8259_irq(unsigned int irq)
35 enable_8259A_irq(irq - I8259_IRQ_BASE);
39 static void shutdown_i8259_irq(unsigned int irq)
41 disable_8259A_irq(irq - I8259_IRQ_BASE);
44 static void enable_i8259_irq(unsigned int irq)
46 enable_8259A_irq(irq - I8259_IRQ_BASE);
49 static void disable_i8259_irq(unsigned int irq)
51 disable_8259A_irq(irq - I8259_IRQ_BASE);
54 static void ack_i8259_irq(unsigned int irq)
56 mask_and_ack_8259A(irq - I8259_IRQ_BASE);
59 static void end_i8259_irq(unsigned int irq)
61 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
62 enable_8259A_irq(irq - I8259_IRQ_BASE);
65 static struct hw_interrupt_type i8259_irq_type = {
67 .startup = startup_i8259_irq,
68 .shutdown = shutdown_i8259_irq,
69 .enable = enable_i8259_irq,
70 .disable = disable_i8259_irq,
75 static int i8259_get_irq_number(int irq)
86 if (irq < 0 || irq > 15)
89 return I8259_IRQ_BASE + irq;
92 static struct irqaction i8259_slave_cascade = {
93 .handler = &no_action,
97 void __init rockhopper_init_irq(void)
101 if(!vr4133_rockhopper) {
102 printk(KERN_ERR "Not a Rockhopper Board \n");
106 for (i = I8259_IRQ_BASE; i <= I8259_IRQ_LAST; i++)
107 irq_desc[i].chip = &i8259_irq_type;
109 setup_irq(I8259_SLAVE_IRQ, &i8259_slave_cascade);
111 vr41xx_set_irq_trigger(CMBVR41XX_INTC_PIN, TRIGGER_LEVEL, SIGNAL_THROUGH);
112 vr41xx_set_irq_level(CMBVR41XX_INTC_PIN, LEVEL_HIGH);
113 vr41xx_cascade_irq(CMBVR41XX_INTC_IRQ, i8259_get_irq_number);