diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2006-09-18 18:24:10 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-25 05:25:49 -0400 |
commit | 7412b10f7967ef4210ed6f793004d23642dc5140 (patch) | |
tree | f82586f106e50c16b84878cee8e9265dfd9db5e5 | |
parent | d7d214e974b94e8332d1f6c16f6f19b661dfa855 (diff) |
[ARM] 3829/1: iop3xx: optimise irq entry macros
Squeeze three instructions out of the iop32x irq demuxer, and nine
out of the iop33x irq demuxer by using the hardware vector generator.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-iop33x/irq.c | 16 | ||||
-rw-r--r-- | include/asm-arm/arch-iop32x/entry-macro.S | 10 | ||||
-rw-r--r-- | include/asm-arm/arch-iop33x/entry-macro.S | 22 |
3 files changed, 24 insertions, 24 deletions
diff --git a/arch/arm/mach-iop33x/irq.c b/arch/arm/mach-iop33x/irq.c index 675ed3989973..3c720551ac12 100644 --- a/arch/arm/mach-iop33x/irq.c +++ b/arch/arm/mach-iop33x/irq.c | |||
@@ -57,6 +57,20 @@ static inline void intstr_write1(u32 val) | |||
57 | iop3xx_cp6_disable(); | 57 | iop3xx_cp6_disable(); |
58 | } | 58 | } |
59 | 59 | ||
60 | static inline void intbase_write(u32 val) | ||
61 | { | ||
62 | iop3xx_cp6_enable(); | ||
63 | asm volatile("mcr p6, 0, %0, c12, c0, 0" : : "r" (val)); | ||
64 | iop3xx_cp6_disable(); | ||
65 | } | ||
66 | |||
67 | static inline void intsize_write(u32 val) | ||
68 | { | ||
69 | iop3xx_cp6_enable(); | ||
70 | asm volatile("mcr p6, 0, %0, c13, c0, 0" : : "r" (val)); | ||
71 | iop3xx_cp6_disable(); | ||
72 | } | ||
73 | |||
60 | static void | 74 | static void |
61 | iop331_irq_mask1 (unsigned int irq) | 75 | iop331_irq_mask1 (unsigned int irq) |
62 | { | 76 | { |
@@ -107,6 +121,8 @@ void __init iop331_init_irq(void) | |||
107 | intctl_write1(0); | 121 | intctl_write1(0); |
108 | intstr_write0(0); // treat all as IRQ | 122 | intstr_write0(0); // treat all as IRQ |
109 | intstr_write1(0); | 123 | intstr_write1(0); |
124 | intbase_write(0); | ||
125 | intsize_write(1); | ||
110 | if(machine_is_iq80331()) // all interrupts are inputs to chip | 126 | if(machine_is_iq80331()) // all interrupts are inputs to chip |
111 | *IOP3XX_PCIIRSR = 0x0f; | 127 | *IOP3XX_PCIIRSR = 0x0f; |
112 | 128 | ||
diff --git a/include/asm-arm/arch-iop32x/entry-macro.S b/include/asm-arm/arch-iop32x/entry-macro.S index c5ec1e23cbea..3497fef0b890 100644 --- a/include/asm-arm/arch-iop32x/entry-macro.S +++ b/include/asm-arm/arch-iop32x/entry-macro.S | |||
@@ -16,13 +16,9 @@ | |||
16 | * Note: only deal with normal interrupts, not FIQ | 16 | * Note: only deal with normal interrupts, not FIQ |
17 | */ | 17 | */ |
18 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 18 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
19 | mov \irqnr, #0 | ||
20 | ldr \base, =IOP3XX_REG_ADDR(0x07D8) | 19 | ldr \base, =IOP3XX_REG_ADDR(0x07D8) |
21 | ldr \irqstat, [\base] @ Read IINTSRC | 20 | ldr \irqstat, [\base] @ Read IINTSRC |
22 | cmp \irqstat, #0 | 21 | cmp \irqstat, #0 |
23 | beq 1001f | 22 | clzne \irqnr, \irqstat |
24 | clz \irqnr, \irqstat | 23 | rsbne \irqnr, \irqnr, #31 |
25 | mov \base, #31 | ||
26 | subs \irqnr,\base,\irqnr | ||
27 | 1001: | ||
28 | .endm | 24 | .endm |
diff --git a/include/asm-arm/arch-iop33x/entry-macro.S b/include/asm-arm/arch-iop33x/entry-macro.S index 425aa7aafa0e..4750e98e9b4a 100644 --- a/include/asm-arm/arch-iop33x/entry-macro.S +++ b/include/asm-arm/arch-iop33x/entry-macro.S | |||
@@ -12,23 +12,11 @@ | |||
12 | .macro disable_fiq | 12 | .macro disable_fiq |
13 | .endm | 13 | .endm |
14 | 14 | ||
15 | /* | ||
16 | * Note: only deal with normal interrupts, not FIQ | ||
17 | */ | ||
18 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
19 | mov \irqnr, #0 | 16 | ldr \base, =IOP3XX_REG_ADDR(0x07C8) |
20 | ldr \base, =IOP3XX_REG_ADDR(0x7A0) | 17 | ldr \irqstat, [\base] @ Read IINTVEC |
21 | ldr \irqstat, [\base] @ Read IINTSRC0 | ||
22 | cmp \irqstat, #0 | ||
23 | bne 1002f | ||
24 | ldr \irqstat, [\base, #4] @ Read IINTSRC1 | ||
25 | cmp \irqstat, #0 | 18 | cmp \irqstat, #0 |
26 | beq 1001f | 19 | ldreq \irqstat, [\base] @ erratum 63 workaround |
27 | clz \irqnr, \irqstat | 20 | adds \irqnr, \irqstat, #1 |
28 | rsbs \irqnr,\irqnr,#31 @ recommend by RMK | 21 | movne \irqnr, \irqstat, lsr #2 |
29 | add \irqnr,\irqnr,#IRQ_IOP331_XINT8 | ||
30 | b 1001f | ||
31 | 1002: clz \irqnr, \irqstat | ||
32 | rsbs \irqnr,\irqnr,#31 @ recommend by RMK | ||
33 | 1001: | ||
34 | .endm | 22 | .endm |