[ARM] 3540/1: ixp23xx: deal with gap in interrupt bitmasks

Patch from Lennert Buytenhek

On the ixp23xx, the microengine thread interrupt sources are numbered
56..119, but their mask/status bits are located in bit positions 64..127
in the various registers in the interrupt controller (bit positions
56..63 are unused.)

We don't deal with this, so currently, when asked to enable IRQ 64, we
will enable IRQ 56 instead.

The only interrupts >= 64 are the thread interrupt sources, and there
are no in-tree users of those yet, so this is fortunately not a big
problem, but this needs fixing anyway.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Lennert Buytenhek and committed by Russell King ec8510f6 a77bc691

+15 -3
+15 -3
arch/arm/mach-ixp23xx/core.c
··· 178 179 static void ixp23xx_irq_mask(unsigned int irq) 180 { 181 - volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 182 183 *intr_reg &= ~(1 << (irq % 32)); 184 } 185 ··· 203 */ 204 static void ixp23xx_irq_level_unmask(unsigned int irq) 205 { 206 - volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 207 208 ixp23xx_irq_ack(irq); 209 210 *intr_reg |= (1 << (irq % 32)); 211 } 212 213 static void ixp23xx_irq_edge_unmask(unsigned int irq) 214 { 215 - volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 216 217 *intr_reg |= (1 << (irq % 32)); 218 } 219
··· 178 179 static void ixp23xx_irq_mask(unsigned int irq) 180 { 181 + volatile unsigned long *intr_reg; 182 183 + if (irq >= 56) 184 + irq += 8; 185 + 186 + intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 187 *intr_reg &= ~(1 << (irq % 32)); 188 } 189 ··· 199 */ 200 static void ixp23xx_irq_level_unmask(unsigned int irq) 201 { 202 + volatile unsigned long *intr_reg; 203 204 ixp23xx_irq_ack(irq); 205 206 + if (irq >= 56) 207 + irq += 8; 208 + 209 + intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 210 *intr_reg |= (1 << (irq % 32)); 211 } 212 213 static void ixp23xx_irq_edge_unmask(unsigned int irq) 214 { 215 + volatile unsigned long *intr_reg; 216 217 + if (irq >= 56) 218 + irq += 8; 219 + 220 + intr_reg = IXP23XX_INTR_EN1 + (irq / 32); 221 *intr_reg |= (1 << (irq % 32)); 222 } 223