diff options
Diffstat (limited to 'arch/mips/txx9/jmr3927/irq.c')
-rw-r--r-- | arch/mips/txx9/jmr3927/irq.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/arch/mips/txx9/jmr3927/irq.c b/arch/mips/txx9/jmr3927/irq.c index b97d22e15da6..070c9a115e57 100644 --- a/arch/mips/txx9/jmr3927/irq.c +++ b/arch/mips/txx9/jmr3927/irq.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <asm/system.h> | 39 | #include <asm/system.h> |
40 | 40 | ||
41 | #include <asm/processor.h> | 41 | #include <asm/processor.h> |
42 | #include <asm/txx9/generic.h> | ||
42 | #include <asm/txx9/jmr3927.h> | 43 | #include <asm/txx9/jmr3927.h> |
43 | 44 | ||
44 | #if JMR3927_IRQ_END > NR_IRQS | 45 | #if JMR3927_IRQ_END > NR_IRQS |
@@ -77,37 +78,30 @@ static void unmask_irq_ioc(unsigned int irq) | |||
77 | (void)jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR); | 78 | (void)jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR); |
78 | } | 79 | } |
79 | 80 | ||
80 | asmlinkage void plat_irq_dispatch(void) | 81 | static int jmr3927_ioc_irqroute(void) |
81 | { | ||
82 | unsigned long cp0_cause = read_c0_cause(); | ||
83 | int irq; | ||
84 | |||
85 | if ((cp0_cause & CAUSEF_IP7) == 0) | ||
86 | return; | ||
87 | irq = (cp0_cause >> CAUSEB_IP2) & 0x0f; | ||
88 | |||
89 | do_IRQ(irq + JMR3927_IRQ_IRC); | ||
90 | } | ||
91 | |||
92 | static irqreturn_t jmr3927_ioc_interrupt(int irq, void *dev_id) | ||
93 | { | 82 | { |
94 | unsigned char istat = jmr3927_ioc_reg_in(JMR3927_IOC_INTS2_ADDR); | 83 | unsigned char istat = jmr3927_ioc_reg_in(JMR3927_IOC_INTS2_ADDR); |
95 | int i; | 84 | int i; |
96 | 85 | ||
97 | for (i = 0; i < JMR3927_NR_IRQ_IOC; i++) { | 86 | for (i = 0; i < JMR3927_NR_IRQ_IOC; i++) { |
98 | if (istat & (1 << i)) { | 87 | if (istat & (1 << i)) |
99 | irq = JMR3927_IRQ_IOC + i; | 88 | return JMR3927_IRQ_IOC + i; |
100 | do_IRQ(irq); | ||
101 | } | ||
102 | } | 89 | } |
103 | return IRQ_HANDLED; | 90 | return -1; |
104 | } | 91 | } |
105 | 92 | ||
106 | static struct irqaction ioc_action = { | 93 | static int jmr3927_irq_dispatch(int pending) |
107 | .handler = jmr3927_ioc_interrupt, | 94 | { |
108 | .mask = CPU_MASK_NONE, | 95 | int irq; |
109 | .name = "IOC", | 96 | |
110 | }; | 97 | if ((pending & CAUSEF_IP7) == 0) |
98 | return -1; | ||
99 | irq = (pending >> CAUSEB_IP2) & 0x0f; | ||
100 | irq += JMR3927_IRQ_IRC; | ||
101 | if (irq == JMR3927_IRQ_IOCINT) | ||
102 | irq = jmr3927_ioc_irqroute(); | ||
103 | return irq; | ||
104 | } | ||
111 | 105 | ||
112 | #ifdef CONFIG_PCI | 106 | #ifdef CONFIG_PCI |
113 | static irqreturn_t jmr3927_pcierr_interrupt(int irq, void *dev_id) | 107 | static irqreturn_t jmr3927_pcierr_interrupt(int irq, void *dev_id) |
@@ -127,8 +121,9 @@ static struct irqaction pcierr_action = { | |||
127 | 121 | ||
128 | static void __init jmr3927_irq_init(void); | 122 | static void __init jmr3927_irq_init(void); |
129 | 123 | ||
130 | void __init arch_init_irq(void) | 124 | void __init jmr3927_irq_setup(void) |
131 | { | 125 | { |
126 | txx9_irq_dispatch = jmr3927_irq_dispatch; | ||
132 | /* Now, interrupt control disabled, */ | 127 | /* Now, interrupt control disabled, */ |
133 | /* all IRC interrupts are masked, */ | 128 | /* all IRC interrupts are masked, */ |
134 | /* all IRC interrupt mode are Low Active. */ | 129 | /* all IRC interrupt mode are Low Active. */ |
@@ -146,7 +141,7 @@ void __init arch_init_irq(void) | |||
146 | jmr3927_irq_init(); | 141 | jmr3927_irq_init(); |
147 | 142 | ||
148 | /* setup IOC interrupt 1 (PCI, MODEM) */ | 143 | /* setup IOC interrupt 1 (PCI, MODEM) */ |
149 | setup_irq(JMR3927_IRQ_IOCINT, &ioc_action); | 144 | set_irq_chained_handler(JMR3927_IRQ_IOCINT, handle_simple_irq); |
150 | 145 | ||
151 | #ifdef CONFIG_PCI | 146 | #ifdef CONFIG_PCI |
152 | setup_irq(JMR3927_IRQ_IRC_PCI, &pcierr_action); | 147 | setup_irq(JMR3927_IRQ_IRC_PCI, &pcierr_action); |