summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/include/asm/arch/entry-macro.S29
1 files changed, 20 insertions, 9 deletions
diff --git a/common/include/asm/arch/entry-macro.S b/common/include/asm/arch/entry-macro.S
index 84589aa18f..39fe9d372e 100644
--- a/common/include/asm/arch/entry-macro.S
+++ b/common/include/asm/arch/entry-macro.S
@@ -29,7 +29,7 @@
/******************
* IRQ Workflow !!
******************/
- .macro get_irqnr_and_base, irqnr, level, base, tmp
+ .macro get_irqnr_and_base, irqnr, level, base, tmp, tmp2
ldr \base, =IO_ADDRESS(ARM_ICTL_BASE)
@@ -49,7 +49,8 @@
str \level, [\base, #IRQ_PLEVEL_OFFSET]
/* Save final status register to get IRQ number. */
- ldr \irqnr, [\base, #IRQ_FINALSTATUS_OFFSET]
+ ldr \irqnr, [\base, #IRQ_FINALSTATUS_OFFSET_L]
+ ldr \tmp2, [\base, #IRQ_FINALSTATUS_OFFSET_H]
/* Check vector offset consistency. */
ldr \tmp, [\base, #IRQ_VECTOR_OFFSET]
@@ -64,13 +65,22 @@
cmp \level, #16
bne 2f
mov \tmp, #0xFFFFFFFF
- str \tmp, [\base, #IRQ_INTMASK_OFFSET]
+ str \tmp, [\base, #IRQ_INTMASK_OFFSET_L]
+ str \tmp, [\base, #IRQ_INTMASK_OFFSET_H]
2:
- clz \irqnr, \irqnr @ find the upper active it
- cmp \irqnr, #32 @ is there a pending it
- beq 1001f @ no
+ clz \irqnr, \irqnr @ find the upper active IRQ
+ cmp \irqnr, #32 @ is there a pending IRQ in the first 32 sources
+ beq 3f @ no, see the the sources 32 to 63
rsb \irqnr, \irqnr, #31 @ yes find the correct irqnr (32 - nbzero-1)
+ b 1001f @ end function
+
+3:
+ clz \irqnr, \tmp2 @ find the upper active IRQ
+ cmp \irqnr, #32 @ is there a pending it in the sources 32 to 63
+ moveq \irqnr, #64 @ no, return 64 to warn that that there is a problem
+ beq 1001f @ no, end function
+ rsb \irqnr, \irqnr, #63 @ yes find the correct irqnr (64 - nbzero-1)
1001:
/* WARNING: These lines override the default behaviour, */
@@ -102,7 +112,8 @@
ldr \tmp, =IO_ADDRESS(ARM_ICTL_BASE) @ change to this priority
str \level, [\tmp, #IRQ_PLEVEL_OFFSET]
mov \table, #0
- str \table, [\tmp, #IRQ_INTMASK_OFFSET]
+ str \table, [\tmp, #IRQ_INTMASK_OFFSET_L]
+ str \table, [\tmp, #IRQ_INTMASK_OFFSET_H]
.endm
/* This macro is called only for MSE500 platform because some processing
@@ -112,8 +123,8 @@
/* This macro is called only for SPC300 platform */
/* beacuse some processing must be done after the handler */
- .macro irq_handler_spc300 reg0, reg6, reg5, reg1, reglr
- get_irqnr_and_base \reg0, \reg6, \reg5, \reglr
+ .macro irq_handler_spc300 reg0, reg6, reg5, reg1, reglr, reg2
+ get_irqnr_and_base \reg0, \reg6, \reg5, \reglr, \reg2
@
@ routine called with r0 = irq number, r1 = struct pt_regs *
@