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