Commit 641e7912 authored by Russell King's avatar Russell King Committed by Russell King

[ARM] Use new get_irqnr_preamble

Use the new get_irqnr_preamble macro to move the address of the IRQ
controller outside the IRQ handling loop.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 3b938be6
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/hardware/entry-macro-iomd.S> #include <asm/hardware/entry-macro-iomd.S>
.equ ioc_base_high, IOC_BASE & 0xff000000
.equ ioc_base_low, IOC_BASE & 0x00ff0000
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
mov \base, #ioc_base_high @ point at IOC
.if ioc_base_low
orr \base, \base, #ioc_base_low
.endif
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
.endm .endm
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
mov \base, #IRQ_STAT
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
.endm .endm
.macro get_irqnr_and_base, irqnr, stat, base, tmp .macro get_irqnr_and_base, irqnr, stat, base, tmp
mov \base, #IRQ_STAT
ldrb \stat, [\base] @ get interrupts ldrb \stat, [\base] @ get interrupts
mov \irqnr, #0 mov \irqnr, #0
tst \stat, #15 tst \stat, #15
......
...@@ -11,24 +11,24 @@ ...@@ -11,24 +11,24 @@
#include <asm/arch/irqs.h> #include <asm/arch/irqs.h>
#include <asm/hardware/dec21285.h> #include <asm/hardware/dec21285.h>
.equ dc21285_high, ARMCSR_BASE & 0xff000000
.equ dc21285_low, ARMCSR_BASE & 0x00ffffff
.macro disable_fiq .macro disable_fiq
.endm .endm
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
mov \base, #dc21285_high
.if dc21285_low
orr \base, \base, #dc21285_low
.endif
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
.endm .endm
.equ dc21285_high, ARMCSR_BASE & 0xff000000
.equ dc21285_low, ARMCSR_BASE & 0x00ffffff
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
mov r4, #dc21285_high ldr \irqstat, [\base, #0x180] @ get interrupts
.if dc21285_low
orr r4, r4, #dc21285_low
.endif
ldr \irqstat, [r4, #0x180] @ get interrupts
mov \irqnr, #IRQ_SDRAMPARITY mov \irqnr, #IRQ_SDRAMPARITY
tst \irqstat, #IRQ_MASK_SDRAMPARITY tst \irqstat, #IRQ_MASK_SDRAMPARITY
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
.endm .endm
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
ldr \base, =IO_ADDRESS(REALVIEW_GIC_CPU_BASE)
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
...@@ -40,7 +41,6 @@ ...@@ -40,7 +41,6 @@
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
ldr \base, =IO_ADDRESS(REALVIEW_GIC_CPU_BASE)
ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */
ldr \tmp, =1021 ldr \tmp, =1021
......
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/hardware/entry-macro-iomd.S> #include <asm/hardware/entry-macro-iomd.S>
.equ ioc_base_high, IOC_BASE & 0xff000000
.equ ioc_base_low, IOC_BASE & 0x00ff0000
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
mov \base, #ioc_base_high @ point at IOC
.if ioc_base_low
orr \base, \base, #ioc_base_low
.endif
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
......
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
.endm .endm
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
mov \base, #0xfa000000 @ ICIP = 0xfa050000
add \base, \base, #0x00050000
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
.endm .endm
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
mov r4, #0xfa000000 @ ICIP = 0xfa050000 ldr \irqstat, [\base] @ get irqs
add r4, r4, #0x00050000 ldr \irqnr, [\base, #4] @ ICMR = 0xfa050004
ldr \irqstat, [r4] @ get irqs
ldr \irqnr, [r4, #4] @ ICMR = 0xfa050004
ands \irqstat, \irqstat, \irqnr ands \irqstat, \irqstat, \irqnr
mov \irqnr, #0 mov \irqnr, #0
beq 1001f beq 1001f
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
.endm .endm
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE)
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
.endm .endm
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE)
ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
mov \irqnr, #0 mov \irqnr, #0
teq \irqstat, #0 teq \irqstat, #0
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
/* IOC / IOMD based hardware */ /* IOC / IOMD based hardware */
#include <asm/hardware/iomd.h> #include <asm/hardware/iomd.h>
.equ ioc_base_high, IOC_BASE & 0xff000000
.equ ioc_base_low, IOC_BASE & 0x00ff0000
.macro disable_fiq .macro disable_fiq
mov r12, #ioc_base_high mov r12, #ioc_base_high
.if ioc_base_low .if ioc_base_low
...@@ -22,33 +20,29 @@ ...@@ -22,33 +20,29 @@
.endm .endm
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
mov r4, #ioc_base_high @ point at IOC ldrb \irqstat, [\base, #IOMD_IRQREQB] @ get high priority first
.if ioc_base_low ldr \tmp, =irq_prio_h
orr r4, r4, #ioc_base_low
.endif
ldrb \irqstat, [r4, #IOMD_IRQREQB] @ get high priority first
ldr \base, =irq_prio_h
teq \irqstat, #0 teq \irqstat, #0
#ifdef IOMD_BASE #ifdef IOMD_BASE
ldreqb \irqstat, [r4, #IOMD_DMAREQ] @ get dma ldreqb \irqstat, [\base, #IOMD_DMAREQ] @ get dma
addeq \base, \base, #256 @ irq_prio_h table size addeq \tmp, \tmp, #256 @ irq_prio_h table size
teqeq \irqstat, #0 teqeq \irqstat, #0
bne 2406f bne 2406f
#endif #endif
ldreqb \irqstat, [r4, #IOMD_IRQREQA] @ get low priority ldreqb \irqstat, [\base, #IOMD_IRQREQA] @ get low priority
addeq \base, \base, #256 @ irq_prio_d table size addeq \tmp, \tmp, #256 @ irq_prio_d table size
teqeq \irqstat, #0 teqeq \irqstat, #0
#ifdef IOMD_IRQREQC #ifdef IOMD_IRQREQC
ldreqb \irqstat, [r4, #IOMD_IRQREQC] ldreqb \irqstat, [\base, #IOMD_IRQREQC]
addeq \base, \base, #256 @ irq_prio_l table size addeq \tmp, \tmp, #256 @ irq_prio_l table size
teqeq \irqstat, #0 teqeq \irqstat, #0
#endif #endif
#ifdef IOMD_IRQREQD #ifdef IOMD_IRQREQD
ldreqb \irqstat, [r4, #IOMD_IRQREQD] ldreqb \irqstat, [\base, #IOMD_IRQREQD]
addeq \base, \base, #256 @ irq_prio_lc table size addeq \tmp, \tmp, #256 @ irq_prio_lc table size
teqeq \irqstat, #0 teqeq \irqstat, #0
#endif #endif
2406: ldrneb \irqnr, [\base, \irqstat] @ get IRQ number 2406: ldrneb \irqnr, [\tmp, \irqstat] @ get IRQ number
.endm .endm
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment