1 // SPDX-License-Identifier: GPL-2.0
3 * Smp support for CHRP machines.
5 * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great
6 * deal of code from the sparc and intel versions.
8 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
12 #include <linux/kernel.h>
13 #include <linux/sched.h>
14 #include <linux/smp.h>
15 #include <linux/interrupt.h>
16 #include <linux/kernel_stat.h>
17 #include <linux/delay.h>
18 #include <linux/spinlock.h>
20 #include <asm/ptrace.h>
21 #include <linux/atomic.h>
24 #include <asm/pgtable.h>
25 #include <asm/sections.h>
29 #include <asm/machdep.h>
33 static int smp_chrp_kick_cpu(int nr
)
35 *(unsigned long *)KERNELBASE
= nr
;
36 asm volatile("dcbf 0,%0"::"r"(KERNELBASE
):"memory");
41 static void smp_chrp_setup_cpu(int cpu_nr
)
43 mpic_setup_this_cpu();
46 /* CHRP with openpic */
47 struct smp_ops_t chrp_smp_ops
= {
48 .cause_nmi_ipi
= NULL
,
49 .message_pass
= smp_mpic_message_pass
,
50 .probe
= smp_mpic_probe
,
51 .kick_cpu
= smp_chrp_kick_cpu
,
52 .setup_cpu
= smp_chrp_setup_cpu
,
53 .give_timebase
= rtas_give_timebase
,
54 .take_timebase
= rtas_take_timebase
,