summaryrefslogtreecommitdiff
path: root/cpu/microblaze/interrupts.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2007-05-07 17:22:25 +0200
committerMichal Simek <monstr@monstr.eu>2007-05-07 17:22:25 +0200
commit42efed6130c8fcf7da881385b5427065d2801757 (patch)
tree091c29ef7ddf2420171455327c353654f2d8162f /cpu/microblaze/interrupts.c
parent48fbd3a4cdabbebc1debd7eed73c00c2caf914f6 (diff)
downloadu-boot-imx-42efed6130c8fcf7da881385b5427065d2801757.zip
u-boot-imx-42efed6130c8fcf7da881385b5427065d2801757.tar.gz
u-boot-imx-42efed6130c8fcf7da881385b5427065d2801757.tar.bz2
fix: interrupt handler for multiple sources
Diffstat (limited to 'cpu/microblaze/interrupts.c')
-rw-r--r--cpu/microblaze/interrupts.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/cpu/microblaze/interrupts.c b/cpu/microblaze/interrupts.c
index 2db847c..115e58d 100644
--- a/cpu/microblaze/interrupts.c
+++ b/cpu/microblaze/interrupts.c
@@ -27,6 +27,7 @@
#include <common.h>
#include <command.h>
#include <asm/microblaze_intc.h>
+#include <asm/asm.h>
#undef DEBUG_INT
@@ -106,7 +107,6 @@ void install_interrupt_handler (int irq, interrupt_handler_t * hdlr, void *arg)
act->count = 0;
enable_one_interrupt (irq);
} else { /* disable */
-
act->handler = (interrupt_handler_t *) def_hdlr;
act->arg = (void *)irq;
disable_one_interrupt (irq);
@@ -147,12 +147,13 @@ int interrupts_init (void)
void interrupt_handler (void)
{
- int irqs;
- irqs = (intc->isr & intc->ier); /* find active interrupt */
-
+ int irqs = (intc->isr & intc->ier); /* find active interrupt */
+ int i = 1;
#ifdef DEBUG_INT
+ int value;
printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
intc->iar, intc->mer);
+ R14(value);
printf ("Interrupt handler on %x line, r14 %x\n", irqs, value);
#endif
struct irq_action *act = vecs;
@@ -165,15 +166,19 @@ void interrupt_handler (void)
#endif
act->handler (act->arg);
act->count++;
+ intc->iar = i;
+ return;
}
irqs >>= 1;
act++;
+ i <<= 1;
}
- intc->iar = 0xFFFFFFFF; /* erase all events */
-#ifdef DEBUG
+
+#ifdef DEBUG_INT
printf ("Dump INTC reg, isr %x, ier %x, iar %x, mer %x\n", intc->isr,
intc->ier, intc->iar, intc->mer);
- printf ("Interrupt handler on %x line, r14\n", irqs);
+ R14(value);
+ printf ("Interrupt handler on %x line, r14 %x\n", irqs, value);
#endif
}
#endif