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