4 * Copyright (C) 1995, 1996, 1997, 2003 by Ralf Baechle
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/irq.h>
14 #include <linux/interrupt.h>
15 #include <linux/ptrace.h>
16 #include <linux/time.h>
18 #include <asm/irq_cpu.h>
22 extern void msp_int_handle(void);
24 /* SLP bases systems */
25 extern void msp_slp_irq_init(void);
26 extern void msp_slp_irq_dispatch(void);
28 /* CIC based systems */
29 extern void msp_cic_irq_init(void);
30 extern void msp_cic_irq_dispatch(void);
33 * The PMC-Sierra MSP interrupts are arranged in a 3 level cascaded
34 * hierarchical system. The first level are the direct MIPS interrupts
35 * and are assigned the interrupt range 0-7. The second level is the SLM
36 * interrupt controller and is assigned the range 8-39. The third level
37 * comprises the Peripherial block, the PCI block, the PCI MSI block and
38 * the SLP. The PCI interrupts and the SLP errors are handled by the
39 * relevant subsystems so the core interrupt code needs only concern
40 * itself with the Peripheral block. These are assigned interrupts in
44 asmlinkage
void plat_irq_dispatch(struct pt_regs
*regs
)
48 pending
= read_c0_status() & read_c0_cause();
51 * jump to the correct interrupt routine
52 * These are arranged in priority order and the timer
56 #ifdef CONFIG_IRQ_MSP_CIC /* break out the CIC stuff for now */
57 if (pending
& C_IRQ4
) /* do the peripherals first, that's the timer */
58 msp_cic_irq_dispatch();
60 else if (pending
& C_IRQ0
)
63 else if (pending
& C_IRQ1
)
66 else if (pending
& C_IRQ2
)
69 else if (pending
& C_IRQ3
)
72 else if (pending
& C_IRQ5
)
77 do_IRQ(MSP_INT_TIMER
);
79 else if (pending
& C_IRQ0
)
82 else if (pending
& C_IRQ1
)
85 else if (pending
& C_IRQ3
)
88 else if (pending
& C_IRQ4
)
89 msp_slp_irq_dispatch();
92 else if (pending
& C_SW0
) /* do software after hardware */
95 else if (pending
& C_SW1
)
99 static struct irqaction cascade_msp
= {
100 .handler
= no_action
,
101 .name
= "MSP cascade"
105 void __init
arch_init_irq(void)
107 /* initialize the 1st-level CPU based interrupt controller */
110 #ifdef CONFIG_IRQ_MSP_CIC
113 /* setup the cascaded interrupts */
114 setup_irq(MSP_INT_CIC
, &cascade_msp
);
115 setup_irq(MSP_INT_PER
, &cascade_msp
);
117 /* setup the 2nd-level SLP register based interrupt controller */
120 /* setup the cascaded SLP/PER interrupts */
121 setup_irq(MSP_INT_SLP
, &cascade_msp
);
122 setup_irq(MSP_INT_PER
, &cascade_msp
);