2 * Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc.
3 * Copyright (C) 2001 Ralf Baechle
4 * Copyright (C) 2010 PMC-Sierra, Inc.
6 * VSMP support for MSP platforms . Derived from malta vsmp support.
8 * This program is free software; you can distribute it and/or modify it
9 * under the terms of the GNU General Public License (Version 2) as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 #include <linux/smp.h>
23 #include <linux/interrupt.h>
25 #include <asm/setup.h>
27 #ifdef CONFIG_MIPS_MT_SMP
28 #define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */
29 #define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for call */
32 static void ipi_resched_dispatch(void)
34 do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ);
37 static void ipi_call_dispatch(void)
39 do_IRQ(MIPS_CPU_IPI_CALL_IRQ);
42 static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
47 static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)
49 generic_smp_call_function_interrupt();
54 static struct irqaction irq_resched = {
55 .handler = ipi_resched_interrupt,
60 static struct irqaction irq_call = {
61 .handler = ipi_call_interrupt,
66 void __init arch_init_ipiirq(int irq, struct irqaction *action)
68 setup_irq(irq, action);
69 irq_set_handler(irq, handle_percpu_irq);
72 void __init msp_vsmp_int_init(void)
74 set_vi_handler(MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch);
75 set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
76 arch_init_ipiirq(MIPS_CPU_IPI_RESCHED_IRQ, &irq_resched);
77 arch_init_ipiirq(MIPS_CPU_IPI_CALL_IRQ, &irq_call);
79 #endif /* CONFIG_MIPS_MT_SMP */