Linux 5.7.6
[linux/fpc-iii.git] / arch / mips / pmcs-msp71xx / msp_smp.c
blob00092e2924ecb72c26937df474dd2d2237b59979
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
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.
8 */
9 #include <linux/smp.h>
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)
31 return IRQ_HANDLED;
34 static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)
36 generic_smp_call_function_interrupt();
38 return IRQ_HANDLED;
41 void __init arch_init_ipiirq(int irq, const char *name, irq_handler_t handler)
43 if (request_irq(irq, handler, IRQF_PERCPU, name, NULL))
44 pr_err("Failed to request irq %d (%s)\n", irq, name);
45 irq_set_handler(irq, handle_percpu_irq);
48 void __init msp_vsmp_int_init(void)
50 set_vi_handler(MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch);
51 set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
52 arch_init_ipiirq(MIPS_CPU_IPI_RESCHED_IRQ, "IPI_resched",
53 ipi_resched_interrupt);
54 arch_init_ipiirq(MIPS_CPU_IPI_CALL_IRQ, "IPI_call", ipi_call_interrupt);
56 #endif /* CONFIG_MIPS_MT_SMP */