Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Smp support for CHRP machines.
0004  *
0005  * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great
0006  * deal of code from the sparc and intel versions.
0007  *
0008  * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
0009  *
0010  */
0011 
0012 #include <linux/kernel.h>
0013 #include <linux/sched.h>
0014 #include <linux/smp.h>
0015 #include <linux/interrupt.h>
0016 #include <linux/kernel_stat.h>
0017 #include <linux/delay.h>
0018 #include <linux/spinlock.h>
0019 #include <linux/pgtable.h>
0020 
0021 #include <asm/ptrace.h>
0022 #include <linux/atomic.h>
0023 #include <asm/irq.h>
0024 #include <asm/page.h>
0025 #include <asm/sections.h>
0026 #include <asm/io.h>
0027 #include <asm/smp.h>
0028 #include <asm/machdep.h>
0029 #include <asm/mpic.h>
0030 #include <asm/rtas.h>
0031 
0032 static int smp_chrp_kick_cpu(int nr)
0033 {
0034     *(unsigned long *)KERNELBASE = nr;
0035     asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
0036 
0037     return 0;
0038 }
0039 
0040 static void smp_chrp_setup_cpu(int cpu_nr)
0041 {
0042     mpic_setup_this_cpu();
0043 }
0044 
0045 /* CHRP with openpic */
0046 struct smp_ops_t chrp_smp_ops = {
0047     .cause_nmi_ipi = NULL,
0048     .message_pass = smp_mpic_message_pass,
0049     .probe = smp_mpic_probe,
0050     .kick_cpu = smp_chrp_kick_cpu,
0051     .setup_cpu = smp_chrp_setup_cpu,
0052     .give_timebase = rtas_give_timebase,
0053     .take_timebase = rtas_take_timebase,
0054 };