blob: 965c777d356132df575aa6f42534a58b17443415 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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>
Ralf Baechlec4ed38a2005-02-21 16:18:36 +000013#include <linux/interrupt.h>
14#include <linux/pci.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
16#include <asm/i8259.h>
17#include <asm/irq_cpu.h>
Yoichi Yuasad5ab1a62007-09-13 23:51:26 +090018#include <asm/irq_gt641xx.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#include <asm/gt64120.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Yoichi Yuasad5ab1a62007-09-13 23:51:26 +090021#include <irq.h>
Ralf Baechlec4ed38a2005-02-21 16:18:36 +000022
Ralf Baechle937a8012006-10-07 19:44:33 +010023asmlinkage void plat_irq_dispatch(void)
Ralf Baechlec4ed38a2005-02-21 16:18:36 +000024{
Yoichi Yuasad5ab1a62007-09-13 23:51:26 +090025 unsigned pending = read_c0_status() & read_c0_cause() & ST0_IM;
26 int irq;
Ralf Baechlec4ed38a2005-02-21 16:18:36 +000027
Yoichi Yuasad5ab1a62007-09-13 23:51:26 +090028 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();
Ralf Baechlec4ed38a2005-02-21 16:18:36 +000046}
47
Yoichi Yuasad5ab1a62007-09-13 23:51:26 +090048static struct irqaction cascade = {
49 .handler = no_action,
Yoichi Yuasad5ab1a62007-09-13 23:51:26 +090050 .name = "cascade",
Wu Zhangjin5a4a4ad2011-07-23 12:41:24 +000051 .flags = IRQF_NO_THREAD,
Ralf Baechlec4ed38a2005-02-21 16:18:36 +000052};
53
Linus Torvalds1da177e2005-04-16 15:20:36 -070054void __init arch_init_irq(void)
55{
Yoichi Yuasad5ab1a62007-09-13 23:51:26 +090056 mips_cpu_irq_init();
57 gt641xx_irq_init();
58 init_i8259_irqs();
Ralf Baechlec4ed38a2005-02-21 16:18:36 +000059
Yoichi Yuasad5ab1a62007-09-13 23:51:26 +090060 setup_irq(GT641XX_CASCADE_IRQ, &cascade);
61 setup_irq(I8259_CASCADE_IRQ, &cascade);
Linus Torvalds1da177e2005-04-16 15:20:36 -070062}