mvebu driver irqchip for v3.10
- move the armada irqchip driver to drivers/irqchip/ Note: - I asked tglx if it was ok to take this series on 10 Apr due to it's complex dependencies. 5+ days have passed with no objection. - I put this driver in a separate mvebu branch in case tglx or others object, it can be dropped with minimal impact to other work. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAABAgAGBQJRbFiZAAoJEAi3KVZQDZAevf4IAJr33UAWcF1CpNMqrQCJCfem 0uK4WHhE7djgqoypR2zIceCmfbkFwwQAsi9tHob+NOnWLnRTdTDHiU+ICcTaYEuK s0zkibnLnDmupDfNpw/h2UNLXsGhYt6uXkNMt36yKV2V7/q9mscZ4ztPd9/vA6N/ glU2w9MxQiQSg4lGunNQa6zeMz1BB5oXmbAefAiDS6IjiGrajepd+PyIl+Ewq+RH KFnbAcYpc/Cc+8ANfDvY7IMSN2K5zfSTECbqizlCwfIUI7GP/p050OjJdB7eUz77 D8nv4PtXS4TOzAjE1UgY1NRKmHyyt5o/GZR2euu1Q3hqFV2Pb5sHw06P6R383IA= =/Fuw -----END PGP SIGNATURE----- Merge tag 'irqchip-3.10' of git://git.infradead.org/users/jcooper/linux into late/cleanup From Jason Cooper: mvebu driver irqchip for v3.10 - move the armada irqchip driver to drivers/irqchip/ * tag 'irqchip-3.10' of git://git.infradead.org/users/jcooper/linux: irqchip: armada-370-xp: slightly cleanup irq controller driver irqchip: armada-370-xp: move IRQ handler to avoid forward declaration irqchip: move IRQ driver for Armada 370/XP ARM: mvebu: move L2 cache initialization in init_early() Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
commit
981c448014
|
@ -5,6 +5,6 @@ AFLAGS_coherency_ll.o := -Wa,-march=armv7-a
|
|||
|
||||
obj-y += system-controller.o
|
||||
obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
|
||||
obj-$(CONFIG_ARCH_MVEBU) += addr-map.o coherency.o coherency_ll.o pmsu.o irq-armada-370-xp.o
|
||||
obj-$(CONFIG_ARCH_MVEBU) += addr-map.o coherency.o coherency_ll.o pmsu.o
|
||||
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
|
||||
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include <linux/time-armada-370-xp.h>
|
||||
#include <linux/clk/mvebu.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/irqchip.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/mach/time.h>
|
||||
|
@ -54,6 +56,10 @@ void __init armada_370_xp_init_early(void)
|
|||
* to make sure such the allocations won't fail.
|
||||
*/
|
||||
init_dma_coherent_pool_size(SZ_1M);
|
||||
|
||||
#ifdef CONFIG_CACHE_L2X0
|
||||
l2x0_of_init(0, ~0UL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __init armada_370_xp_dt_init(void)
|
||||
|
@ -72,8 +78,7 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
|
|||
.init_machine = armada_370_xp_dt_init,
|
||||
.map_io = armada_370_xp_map_io,
|
||||
.init_early = armada_370_xp_init_early,
|
||||
.init_irq = armada_370_xp_init_irq,
|
||||
.handle_irq = armada_370_xp_handle_irq,
|
||||
.init_irq = irqchip_init,
|
||||
.init_time = armada_370_xp_timer_and_clk_init,
|
||||
.restart = mvebu_restart,
|
||||
.dt_compat = armada_370_xp_dt_compat,
|
||||
|
|
|
@ -2,6 +2,7 @@ obj-$(CONFIG_IRQCHIP) += irqchip.o
|
|||
|
||||
obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o
|
||||
obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o
|
||||
obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o
|
||||
obj-$(CONFIG_METAG) += irq-metag-ext.o
|
||||
obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o
|
||||
obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
#include <asm/mach/arch.h>
|
||||
#include <asm/exception.h>
|
||||
#include <asm/smp_plat.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include <asm/mach/irq.h>
|
||||
|
||||
#include "irqchip.h"
|
||||
|
||||
/* Interrupt Controller Registers Map */
|
||||
#define ARMADA_370_XP_INT_SET_MASK_OFFS (0x48)
|
||||
|
@ -46,7 +48,9 @@
|
|||
|
||||
#define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5)
|
||||
|
||||
#define ACTIVE_DOORBELLS (8)
|
||||
#define IPI_DOORBELL_START (0)
|
||||
#define IPI_DOORBELL_END (8)
|
||||
#define IPI_DOORBELL_MASK 0xFF
|
||||
|
||||
static DEFINE_RAW_SPINLOCK(irq_controller_lock);
|
||||
|
||||
|
@ -190,7 +194,7 @@ void armada_xp_mpic_smp_cpu_init(void)
|
|||
writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
|
||||
|
||||
/* Enable first 8 IPIs */
|
||||
writel((1 << ACTIVE_DOORBELLS) - 1, per_cpu_int_base +
|
||||
writel(IPI_DOORBELL_MASK, per_cpu_int_base +
|
||||
ARMADA_370_XP_IN_DRBEL_MSK_OFFS);
|
||||
|
||||
/* Unmask IPI interrupt */
|
||||
|
@ -203,6 +207,50 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
|
|||
.xlate = irq_domain_xlate_onecell,
|
||||
};
|
||||
|
||||
static asmlinkage void __exception_irq_entry
|
||||
armada_370_xp_handle_irq(struct pt_regs *regs)
|
||||
{
|
||||
u32 irqstat, irqnr;
|
||||
|
||||
do {
|
||||
irqstat = readl_relaxed(per_cpu_int_base +
|
||||
ARMADA_370_XP_CPU_INTACK_OFFS);
|
||||
irqnr = irqstat & 0x3FF;
|
||||
|
||||
if (irqnr > 1022)
|
||||
break;
|
||||
|
||||
if (irqnr > 0) {
|
||||
irqnr = irq_find_mapping(armada_370_xp_mpic_domain,
|
||||
irqnr);
|
||||
handle_IRQ(irqnr, regs);
|
||||
continue;
|
||||
}
|
||||
#ifdef CONFIG_SMP
|
||||
/* IPI Handling */
|
||||
if (irqnr == 0) {
|
||||
u32 ipimask, ipinr;
|
||||
|
||||
ipimask = readl_relaxed(per_cpu_int_base +
|
||||
ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS)
|
||||
& IPI_DOORBELL_MASK;
|
||||
|
||||
writel(~IPI_DOORBELL_MASK, per_cpu_int_base +
|
||||
ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
|
||||
|
||||
/* Handle all pending doorbells */
|
||||
for (ipinr = IPI_DOORBELL_START;
|
||||
ipinr < IPI_DOORBELL_END; ipinr++) {
|
||||
if (ipimask & (0x1 << ipinr))
|
||||
handle_IPI(ipinr, regs);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
} while (1);
|
||||
}
|
||||
|
||||
static int __init armada_370_xp_mpic_of_init(struct device_node *node,
|
||||
struct device_node *parent)
|
||||
{
|
||||
|
@ -238,61 +286,9 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
|
|||
|
||||
#endif
|
||||
|
||||
set_handle_irq(armada_370_xp_handle_irq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs
|
||||
*regs)
|
||||
{
|
||||
u32 irqstat, irqnr;
|
||||
|
||||
do {
|
||||
irqstat = readl_relaxed(per_cpu_int_base +
|
||||
ARMADA_370_XP_CPU_INTACK_OFFS);
|
||||
irqnr = irqstat & 0x3FF;
|
||||
|
||||
if (irqnr > 1022)
|
||||
break;
|
||||
|
||||
if (irqnr > 0) {
|
||||
irqnr = irq_find_mapping(armada_370_xp_mpic_domain,
|
||||
irqnr);
|
||||
handle_IRQ(irqnr, regs);
|
||||
continue;
|
||||
}
|
||||
#ifdef CONFIG_SMP
|
||||
/* IPI Handling */
|
||||
if (irqnr == 0) {
|
||||
u32 ipimask, ipinr;
|
||||
|
||||
ipimask = readl_relaxed(per_cpu_int_base +
|
||||
ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS)
|
||||
& 0xFF;
|
||||
|
||||
writel(0x0, per_cpu_int_base +
|
||||
ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
|
||||
|
||||
/* Handle all pending doorbells */
|
||||
for (ipinr = 0; ipinr < ACTIVE_DOORBELLS; ipinr++) {
|
||||
if (ipimask & (0x1 << ipinr))
|
||||
handle_IPI(ipinr, regs);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
} while (1);
|
||||
}
|
||||
|
||||
static const struct of_device_id mpic_of_match[] __initconst = {
|
||||
{.compatible = "marvell,mpic", .data = armada_370_xp_mpic_of_init},
|
||||
{},
|
||||
};
|
||||
|
||||
void __init armada_370_xp_init_irq(void)
|
||||
{
|
||||
of_irq_init(mpic_of_match);
|
||||
#ifdef CONFIG_CACHE_L2X0
|
||||
l2x0_of_init(0, ~0UL);
|
||||
#endif
|
||||
}
|
||||
IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init);
|
Loading…
Reference in New Issue