2 * Ralink RT305x SoC specific interrupt handling
4 * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/interrupt.h>
14 #include <linux/irq.h>
16 #include <asm/irq_cpu.h>
17 #include <asm/mipsregs.h>
19 #include <asm/mach-ralink/common.h>
20 #include <asm/mach-ralink/rt305x.h>
21 #include <asm/mach-ralink/rt305x_regs.h>
23 static void rt305x_intc_irq_dispatch(void)
27 pending
= ramips_intc_get_status();
29 if (pending
& RT305X_INTC_INT_TIMER0
)
30 do_IRQ(RT305X_INTC_IRQ_TIMER0
);
32 else if (pending
& RT305X_INTC_INT_TIMER1
)
33 do_IRQ(RT305X_INTC_IRQ_TIMER1
);
35 else if (pending
& RT305X_INTC_INT_UART0
)
36 do_IRQ(RT305X_INTC_IRQ_UART0
);
38 else if (pending
& RT305X_INTC_INT_UART1
)
39 do_IRQ(RT305X_INTC_IRQ_UART1
);
41 /* TODO: handle PIO interrupts as well */
47 asmlinkage
void plat_irq_dispatch(void)
49 unsigned long pending
;
51 pending
= read_c0_status() & read_c0_cause() & ST0_IM
;
53 if (pending
& STATUSF_IP7
)
54 do_IRQ(RT305X_CPU_IRQ_COUNTER
);
56 else if (pending
& STATUSF_IP5
)
57 do_IRQ(RT305X_CPU_IRQ_FE
);
59 else if (pending
& STATUSF_IP6
)
60 do_IRQ(RT305X_CPU_IRQ_WNIC
);
62 else if (pending
& STATUSF_IP2
)
63 rt305x_intc_irq_dispatch();
69 void __init
arch_init_irq(void)
72 ramips_intc_irq_init(RT305X_INTC_BASE
, RT305X_CPU_IRQ_INTC
,
73 RT305X_INTC_IRQ_BASE
);
This page took 0.046411 seconds and 5 git commands to generate.