blob: f5ea2fe10f141d598b70a85f3d6514b73c54331c [file] [log] [blame]
Ralf Baechle07119622005-09-03 15:56:11 -07001#include <linux/init.h>
2#include <linux/linkage.h>
3
4#include <asm/i8259.h>
5#include <asm/mipsregs.h>
6#include <asm/qemu.h>
7#include <asm/system.h>
8#include <asm/time.h>
9
10extern asmlinkage void qemu_handle_int(void);
11
Ralf Baechle937a8012006-10-07 19:44:33 +010012asmlinkage void plat_irq_dispatch(void)
Ralf Baechle07119622005-09-03 15:56:11 -070013{
14 unsigned int pending = read_c0_status() & read_c0_cause();
15
16 if (pending & 0x8000) {
Ralf Baechle937a8012006-10-07 19:44:33 +010017 ll_timer_interrupt(Q_COUNT_COMPARE_IRQ);
Ralf Baechle07119622005-09-03 15:56:11 -070018 return;
19 }
20 if (pending & 0x0400) {
21 int irq = i8259_irq();
22
23 if (likely(irq >= 0))
Ralf Baechle937a8012006-10-07 19:44:33 +010024 do_IRQ(irq);
Ralf Baechle07119622005-09-03 15:56:11 -070025
26 return;
27 }
28}
29
30void __init arch_init_irq(void)
31{
Ralf Baechle07119622005-09-03 15:56:11 -070032 mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK; /* 100MHz */
33
34 init_i8259_irqs();
35 set_c0_status(0x8400);
36}