diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2013-04-09 17:26:17 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2013-04-15 15:35:17 -0400 |
commit | 5ec69017cc944f3ed88362d4b60818713a45e616 (patch) | |
tree | 3f24f8662b9f51e3de0ce17e3bfcb6c88a51d6ec /drivers/irqchip | |
parent | b313ada8c7a45e37e270bcaafef3f455fa9f4abf (diff) |
irqchip: armada-370-xp: slightly cleanup irq controller driver
In preparation for the introduction of MSI support in the IRQ
controller driver, we clarify the implementation of IPI using
additional defines for the manipulation of doorbells. Just like IPIs
are implemented using doorbells, MSIs will also use doorbells, so it
makes sense to do this preparatory cleanup first.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r-- | drivers/irqchip/irq-armada-370-xp.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 1115bf878ca0..ad1e6422a732 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c | |||
@@ -48,7 +48,9 @@ | |||
48 | 48 | ||
49 | #define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5) | 49 | #define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5) |
50 | 50 | ||
51 | #define ACTIVE_DOORBELLS (8) | 51 | #define IPI_DOORBELL_START (0) |
52 | #define IPI_DOORBELL_END (8) | ||
53 | #define IPI_DOORBELL_MASK 0xFF | ||
52 | 54 | ||
53 | static DEFINE_RAW_SPINLOCK(irq_controller_lock); | 55 | static DEFINE_RAW_SPINLOCK(irq_controller_lock); |
54 | 56 | ||
@@ -192,7 +194,7 @@ void armada_xp_mpic_smp_cpu_init(void) | |||
192 | writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); | 194 | writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); |
193 | 195 | ||
194 | /* Enable first 8 IPIs */ | 196 | /* Enable first 8 IPIs */ |
195 | writel((1 << ACTIVE_DOORBELLS) - 1, per_cpu_int_base + | 197 | writel(IPI_DOORBELL_MASK, per_cpu_int_base + |
196 | ARMADA_370_XP_IN_DRBEL_MSK_OFFS); | 198 | ARMADA_370_XP_IN_DRBEL_MSK_OFFS); |
197 | 199 | ||
198 | /* Unmask IPI interrupt */ | 200 | /* Unmask IPI interrupt */ |
@@ -231,13 +233,14 @@ armada_370_xp_handle_irq(struct pt_regs *regs) | |||
231 | 233 | ||
232 | ipimask = readl_relaxed(per_cpu_int_base + | 234 | ipimask = readl_relaxed(per_cpu_int_base + |
233 | ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS) | 235 | ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS) |
234 | & 0xFF; | 236 | & IPI_DOORBELL_MASK; |
235 | 237 | ||
236 | writel(0x0, per_cpu_int_base + | 238 | writel(~IPI_DOORBELL_MASK, per_cpu_int_base + |
237 | ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); | 239 | ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); |
238 | 240 | ||
239 | /* Handle all pending doorbells */ | 241 | /* Handle all pending doorbells */ |
240 | for (ipinr = 0; ipinr < ACTIVE_DOORBELLS; ipinr++) { | 242 | for (ipinr = IPI_DOORBELL_START; |
243 | ipinr < IPI_DOORBELL_END; ipinr++) { | ||
241 | if (ipimask & (0x1 << ipinr)) | 244 | if (ipimask & (0x1 << ipinr)) |
242 | handle_IPI(ipinr, regs); | 245 | handle_IPI(ipinr, regs); |
243 | } | 246 | } |