Ralf Baechle | 0711962 | 2005-09-03 15:56:11 -0700 | [diff] [blame] | 1 | #include <linux/init.h> |
| 2 | #include <linux/linkage.h> |
| 3 | |
| 4 | #include <asm/i8259.h> |
Ralf Baechle | 7bcf771 | 2007-10-11 23:46:09 +0100 | [diff] [blame^] | 5 | #include <asm/irq_cpu.h> |
Ralf Baechle | 0711962 | 2005-09-03 15:56:11 -0700 | [diff] [blame] | 6 | #include <asm/mipsregs.h> |
| 7 | #include <asm/qemu.h> |
| 8 | #include <asm/system.h> |
| 9 | #include <asm/time.h> |
| 10 | |
Ralf Baechle | 937a801 | 2006-10-07 19:44:33 +0100 | [diff] [blame] | 11 | asmlinkage void plat_irq_dispatch(void) |
Ralf Baechle | 0711962 | 2005-09-03 15:56:11 -0700 | [diff] [blame] | 12 | { |
| 13 | unsigned int pending = read_c0_status() & read_c0_cause(); |
| 14 | |
| 15 | if (pending & 0x8000) { |
Ralf Baechle | 7bcf771 | 2007-10-11 23:46:09 +0100 | [diff] [blame^] | 16 | do_IRQ(Q_COUNT_COMPARE_IRQ); |
Ralf Baechle | 0711962 | 2005-09-03 15:56:11 -0700 | [diff] [blame] | 17 | return; |
| 18 | } |
| 19 | if (pending & 0x0400) { |
| 20 | int irq = i8259_irq(); |
| 21 | |
| 22 | if (likely(irq >= 0)) |
Ralf Baechle | 937a801 | 2006-10-07 19:44:33 +0100 | [diff] [blame] | 23 | do_IRQ(irq); |
Ralf Baechle | 0711962 | 2005-09-03 15:56:11 -0700 | [diff] [blame] | 24 | |
| 25 | return; |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | void __init arch_init_irq(void) |
| 30 | { |
Ralf Baechle | 0711962 | 2005-09-03 15:56:11 -0700 | [diff] [blame] | 31 | mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK; /* 100MHz */ |
| 32 | |
Ralf Baechle | 7bcf771 | 2007-10-11 23:46:09 +0100 | [diff] [blame^] | 33 | mips_cpu_irq_init(); |
Ralf Baechle | 0711962 | 2005-09-03 15:56:11 -0700 | [diff] [blame] | 34 | init_i8259_irqs(); |
| 35 | set_c0_status(0x8400); |
| 36 | } |