Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * IRQ vector handles | |
3 | * | |
4 | * This file is subject to the terms and conditions of the GNU General Public | |
5 | * License. See the file "COPYING" in the main directory of this archive | |
6 | * for more details. | |
7 | * | |
8 | * Copyright (C) 1995, 1996, 1997, 2003 by Ralf Baechle | |
9 | */ | |
10 | #include <linux/kernel.h> | |
11 | #include <linux/init.h> | |
12 | #include <linux/irq.h> | |
c4ed38a0 RB |
13 | #include <linux/interrupt.h> |
14 | #include <linux/pci.h> | |
1da177e4 LT |
15 | |
16 | #include <asm/i8259.h> | |
17 | #include <asm/irq_cpu.h> | |
d5ab1a69 | 18 | #include <asm/irq_gt641xx.h> |
1da177e4 | 19 | #include <asm/gt64120.h> |
1da177e4 | 20 | |
d5ab1a69 | 21 | #include <irq.h> |
c4ed38a0 | 22 | |
937a8015 | 23 | asmlinkage void plat_irq_dispatch(void) |
c4ed38a0 | 24 | { |
d5ab1a69 YY |
25 | unsigned pending = read_c0_status() & read_c0_cause() & ST0_IM; |
26 | int irq; | |
937a8015 | 27 | |
d5ab1a69 YY |
28 | if (pending & CAUSEF_IP2) |
29 | gt641xx_irq_dispatch(); | |
30 | else if (pending & CAUSEF_IP6) { | |
31 | irq = i8259_irq(); | |
32 | if (irq < 0) | |
33 | spurious_interrupt(); | |
34 | else | |
35 | do_IRQ(irq); | |
36 | } else if (pending & CAUSEF_IP3) | |
37 | do_IRQ(MIPS_CPU_IRQ_BASE + 3); | |
38 | else if (pending & CAUSEF_IP4) | |
39 | do_IRQ(MIPS_CPU_IRQ_BASE + 4); | |
40 | else if (pending & CAUSEF_IP5) | |
41 | do_IRQ(MIPS_CPU_IRQ_BASE + 5); | |
42 | else if (pending & CAUSEF_IP7) | |
43 | do_IRQ(MIPS_CPU_IRQ_BASE + 7); | |
44 | else | |
45 | spurious_interrupt(); | |
c4ed38a0 RB |
46 | } |
47 | ||
d5ab1a69 YY |
48 | static struct irqaction cascade = { |
49 | .handler = no_action, | |
d5ab1a69 | 50 | .name = "cascade", |
5a4a4ad8 | 51 | .flags = IRQF_NO_THREAD, |
c4ed38a0 RB |
52 | }; |
53 | ||
1da177e4 LT |
54 | void __init arch_init_irq(void) |
55 | { | |
d5ab1a69 YY |
56 | mips_cpu_irq_init(); |
57 | gt641xx_irq_init(); | |
58 | init_i8259_irqs(); | |
c4ed38a0 | 59 | |
d5ab1a69 YY |
60 | setup_irq(GT641XX_CASCADE_IRQ, &cascade); |
61 | setup_irq(I8259_CASCADE_IRQ, &cascade); | |
1da177e4 | 62 | } |