aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/jmr3927
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/jmr3927')
-rw-r--r--arch/mips/jmr3927/rbhma3100/irq.c28
-rw-r--r--arch/mips/jmr3927/rbhma3100/setup.c2
2 files changed, 21 insertions, 9 deletions
diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c
index 7cbe14483f13..2810727f1d4e 100644
--- a/arch/mips/jmr3927/rbhma3100/irq.c
+++ b/arch/mips/jmr3927/rbhma3100/irq.c
@@ -113,7 +113,8 @@ static void jmr3927_irq_ack(unsigned int irq)
113 113
114static void jmr3927_irq_end(unsigned int irq) 114static void jmr3927_irq_end(unsigned int irq)
115{ 115{
116 jmr3927_irq_enable(irq); 116 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
117 jmr3927_irq_enable(irq);
117} 118}
118 119
119static void jmr3927_irq_disable(unsigned int irq_nr) 120static void jmr3927_irq_disable(unsigned int irq_nr)
@@ -121,7 +122,7 @@ static void jmr3927_irq_disable(unsigned int irq_nr)
121 struct tb_irq_space* sp; 122 struct tb_irq_space* sp;
122 unsigned long flags; 123 unsigned long flags;
123 124
124 spinlock_irqsave(&jmr3927_irq_lock, flags); 125 spin_lock_irqsave(&jmr3927_irq_lock, flags);
125 for (sp = tb_irq_spaces; sp; sp = sp->next) { 126 for (sp = tb_irq_spaces; sp; sp = sp->next) {
126 if (sp->start_irqno <= irq_nr && 127 if (sp->start_irqno <= irq_nr &&
127 irq_nr < sp->start_irqno + sp->nr_irqs) { 128 irq_nr < sp->start_irqno + sp->nr_irqs) {
@@ -131,7 +132,7 @@ static void jmr3927_irq_disable(unsigned int irq_nr)
131 break; 132 break;
132 } 133 }
133 } 134 }
134 spinlock_irqrestore(&jmr3927_irq_lock, flags); 135 spin_unlock_irqrestore(&jmr3927_irq_lock, flags);
135} 136}
136 137
137static void jmr3927_irq_enable(unsigned int irq_nr) 138static void jmr3927_irq_enable(unsigned int irq_nr)
@@ -139,7 +140,7 @@ static void jmr3927_irq_enable(unsigned int irq_nr)
139 struct tb_irq_space* sp; 140 struct tb_irq_space* sp;
140 unsigned long flags; 141 unsigned long flags;
141 142
142 spinlock_irqsave(&jmr3927_irq_lock, flags); 143 spin_lock_irqsave(&jmr3927_irq_lock, flags);
143 for (sp = tb_irq_spaces; sp; sp = sp->next) { 144 for (sp = tb_irq_spaces; sp; sp = sp->next) {
144 if (sp->start_irqno <= irq_nr && 145 if (sp->start_irqno <= irq_nr &&
145 irq_nr < sp->start_irqno + sp->nr_irqs) { 146 irq_nr < sp->start_irqno + sp->nr_irqs) {
@@ -149,7 +150,7 @@ static void jmr3927_irq_enable(unsigned int irq_nr)
149 break; 150 break;
150 } 151 }
151 } 152 }
152 spinlock_irqrestore(&jmr3927_irq_lock, flags); 153 spin_unlock_irqrestore(&jmr3927_irq_lock, flags);
153} 154}
154 155
155/* 156/*
@@ -205,7 +206,10 @@ static void mask_irq_irc(int irq_nr, int space_id)
205 /* update IRCSR */ 206 /* update IRCSR */
206 tx3927_ircptr->imr = 0; 207 tx3927_ircptr->imr = 0;
207 tx3927_ircptr->imr = irc_elevel; 208 tx3927_ircptr->imr = irc_elevel;
209 /* flush write buffer */
210 (void)tx3927_ircptr->ssr;
208} 211}
212
209static void unmask_irq_irc(int irq_nr, int space_id) 213static void unmask_irq_irc(int irq_nr, int space_id)
210{ 214{
211 volatile unsigned long *ilrp = &tx3927_ircptr->ilr[irq_nr / 2]; 215 volatile unsigned long *ilrp = &tx3927_ircptr->ilr[irq_nr / 2];
@@ -276,7 +280,7 @@ void jmr3927_irc_irqdispatch(struct pt_regs *regs)
276 do_IRQ(irq + JMR3927_IRQ_IRC, regs); 280 do_IRQ(irq + JMR3927_IRQ_IRC, regs);
277} 281}
278 282
279static void jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs *regs) 283static irqreturn_t jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
280{ 284{
281 unsigned char istat = jmr3927_ioc_reg_in(JMR3927_IOC_INTS2_ADDR); 285 unsigned char istat = jmr3927_ioc_reg_in(JMR3927_IOC_INTS2_ADDR);
282 int i; 286 int i;
@@ -287,13 +291,14 @@ static void jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
287 do_IRQ(irq, regs); 291 do_IRQ(irq, regs);
288 } 292 }
289 } 293 }
294 return IRQ_HANDLED;
290} 295}
291 296
292static struct irqaction ioc_action = { 297static struct irqaction ioc_action = {
293 jmr3927_ioc_interrupt, 0, CPU_MASK_NONE, "IOC", NULL, NULL, 298 jmr3927_ioc_interrupt, 0, CPU_MASK_NONE, "IOC", NULL, NULL,
294}; 299};
295 300
296static void jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs *regs) 301static irqreturn_t jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs *regs)
297{ 302{
298 unsigned char istat = jmr3927_isac_reg_in(JMR3927_ISAC_INTS2_ADDR); 303 unsigned char istat = jmr3927_isac_reg_in(JMR3927_ISAC_INTS2_ADDR);
299 int i; 304 int i;
@@ -304,6 +309,7 @@ static void jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs *regs)
304 do_IRQ(irq, regs); 309 do_IRQ(irq, regs);
305 } 310 }
306 } 311 }
312 return IRQ_HANDLED;
307} 313}
308 314
309static struct irqaction isac_action = { 315static struct irqaction isac_action = {
@@ -311,19 +317,23 @@ static struct irqaction isac_action = {
311}; 317};
312 318
313 319
314static void jmr3927_isaerr_interrupt(int irq, void * dev_id, struct pt_regs * regs) 320static irqreturn_t jmr3927_isaerr_interrupt(int irq, void * dev_id, struct pt_regs * regs)
315{ 321{
316 printk(KERN_WARNING "ISA error interrupt (irq 0x%x).\n", irq); 322 printk(KERN_WARNING "ISA error interrupt (irq 0x%x).\n", irq);
323
324 return IRQ_HANDLED;
317} 325}
318static struct irqaction isaerr_action = { 326static struct irqaction isaerr_action = {
319 jmr3927_isaerr_interrupt, 0, CPU_MASK_NONE, "ISA error", NULL, NULL, 327 jmr3927_isaerr_interrupt, 0, CPU_MASK_NONE, "ISA error", NULL, NULL,
320}; 328};
321 329
322static void jmr3927_pcierr_interrupt(int irq, void * dev_id, struct pt_regs * regs) 330static irqreturn_t jmr3927_pcierr_interrupt(int irq, void * dev_id, struct pt_regs * regs)
323{ 331{
324 printk(KERN_WARNING "PCI error interrupt (irq 0x%x).\n", irq); 332 printk(KERN_WARNING "PCI error interrupt (irq 0x%x).\n", irq);
325 printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n", 333 printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n",
326 tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat); 334 tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat);
335
336 return IRQ_HANDLED;
327} 337}
328static struct irqaction pcierr_action = { 338static struct irqaction pcierr_action = {
329 jmr3927_pcierr_interrupt, 0, CPU_MASK_NONE, "PCI error", NULL, NULL, 339 jmr3927_pcierr_interrupt, 0, CPU_MASK_NONE, "PCI error", NULL, NULL,
diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c
index 55ad0a578794..4763957df8fc 100644
--- a/arch/mips/jmr3927/rbhma3100/setup.c
+++ b/arch/mips/jmr3927/rbhma3100/setup.c
@@ -60,6 +60,8 @@
60#include <asm/mipsregs.h> 60#include <asm/mipsregs.h>
61#include <asm/traps.h> 61#include <asm/traps.h>
62 62
63extern void puts(unsigned char *cp);
64
63/* Tick Timer divider */ 65/* Tick Timer divider */
64#define JMR3927_TIMER_CCD 0 /* 1/2 */ 66#define JMR3927_TIMER_CCD 0 /* 1/2 */
65#define JMR3927_TIMER_CLK (JMR3927_IMCLK / (2 << JMR3927_TIMER_CCD)) 67#define JMR3927_TIMER_CLK (JMR3927_IMCLK / (2 << JMR3927_TIMER_CCD))