2 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
10 #include <linux/interrupt.h>
12 #include <asm/irq_cpu.h>
13 #include <asm/i8259.h>
17 static void i8259_irqdispatch(void)
28 asmlinkage
void mach_irq_dispatch(unsigned int pending
)
30 if (pending
& CAUSEF_IP7
)
31 do_IRQ(MIPS_CPU_IRQ_BASE
+ 7);
32 else if (pending
& CAUSEF_IP6
) /* perf counter loverflow */
33 do_IRQ(LOONGSON2_PERFCNT_IRQ
);
34 else if (pending
& CAUSEF_IP5
)
36 else if (pending
& CAUSEF_IP2
)
42 static struct irqaction cascade_irqaction
= {
47 void __init
set_irq_trigger_mode(void)
49 /* most bonito irq should be level triggered */
50 BONITO_INTEDGE
= BONITO_ICU_SYSTEMERR
| BONITO_ICU_MASTERERR
|
51 BONITO_ICU_RETRYERR
| BONITO_ICU_MBOXES
;
54 void __init
mach_init_irq(void)
56 /* init all controller
57 * 0-15 ------> i8259 interrupt
58 * 16-23 ------> mips cpu interrupt
59 * 32-63 ------> bonito irq
62 /* Sets the first-level interrupt dispatcher. */
67 /* bonito irq at IP2 */
68 setup_irq(MIPS_CPU_IRQ_BASE
+ 2, &cascade_irqaction
);
70 setup_irq(MIPS_CPU_IRQ_BASE
+ 5, &cascade_irqaction
);