1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc.
4 * Copyright (C) 2001 Ralf Baechle
5 * Copyright (C) 2010 PMC-Sierra, Inc.
7 * VSMP support for MSP platforms . Derived from malta vsmp support.
10 #include <linux/interrupt.h>
12 #include <asm/setup.h>
14 #ifdef CONFIG_MIPS_MT_SMP
15 #define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */
16 #define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for call */
19 static void ipi_resched_dispatch(void)
21 do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ
);
24 static void ipi_call_dispatch(void)
26 do_IRQ(MIPS_CPU_IPI_CALL_IRQ
);
29 static irqreturn_t
ipi_resched_interrupt(int irq
, void *dev_id
)
34 static irqreturn_t
ipi_call_interrupt(int irq
, void *dev_id
)
36 generic_smp_call_function_interrupt();
41 static struct irqaction irq_resched
= {
42 .handler
= ipi_resched_interrupt
,
47 static struct irqaction irq_call
= {
48 .handler
= ipi_call_interrupt
,
53 void __init
arch_init_ipiirq(int irq
, struct irqaction
*action
)
55 setup_irq(irq
, action
);
56 irq_set_handler(irq
, handle_percpu_irq
);
59 void __init
msp_vsmp_int_init(void)
61 set_vi_handler(MIPS_CPU_IPI_RESCHED_IRQ
, ipi_resched_dispatch
);
62 set_vi_handler(MIPS_CPU_IPI_CALL_IRQ
, ipi_call_dispatch
);
63 arch_init_ipiirq(MIPS_CPU_IPI_RESCHED_IRQ
, &irq_resched
);
64 arch_init_ipiirq(MIPS_CPU_IPI_CALL_IRQ
, &irq_call
);
66 #endif /* CONFIG_MIPS_MT_SMP */