2005-10-26 19:45:56 +08:00
|
|
|
/*
|
|
|
|
* Smp support for CHRP machines.
|
|
|
|
*
|
|
|
|
* Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great
|
|
|
|
* deal of code from the sparc and intel versions.
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <linux/smp.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/kernel_stat.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
|
|
|
|
#include <asm/ptrace.h>
|
2011-07-27 07:09:06 +08:00
|
|
|
#include <linux/atomic.h>
|
2005-10-26 19:45:56 +08:00
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/page.h>
|
|
|
|
#include <asm/pgtable.h>
|
|
|
|
#include <asm/sections.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/prom.h>
|
|
|
|
#include <asm/smp.h>
|
|
|
|
#include <asm/machdep.h>
|
2005-10-27 20:42:04 +08:00
|
|
|
#include <asm/mpic.h>
|
2005-11-18 12:54:12 +08:00
|
|
|
#include <asm/rtas.h>
|
2005-10-26 19:45:56 +08:00
|
|
|
|
2012-12-22 06:04:10 +08:00
|
|
|
static int smp_chrp_kick_cpu(int nr)
|
2005-10-26 19:45:56 +08:00
|
|
|
{
|
|
|
|
*(unsigned long *)KERNELBASE = nr;
|
|
|
|
asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
|
2011-04-12 05:46:19 +08:00
|
|
|
|
|
|
|
return 0;
|
2005-10-26 19:45:56 +08:00
|
|
|
}
|
|
|
|
|
2012-12-22 06:04:10 +08:00
|
|
|
static void smp_chrp_setup_cpu(int cpu_nr)
|
2005-10-26 19:45:56 +08:00
|
|
|
{
|
2005-10-27 20:42:04 +08:00
|
|
|
mpic_setup_this_cpu();
|
2005-10-26 19:45:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* CHRP with openpic */
|
|
|
|
struct smp_ops_t chrp_smp_ops = {
|
2005-10-27 20:42:04 +08:00
|
|
|
.message_pass = smp_mpic_message_pass,
|
2005-11-05 07:33:55 +08:00
|
|
|
.probe = smp_mpic_probe,
|
2005-10-26 19:45:56 +08:00
|
|
|
.kick_cpu = smp_chrp_kick_cpu,
|
|
|
|
.setup_cpu = smp_chrp_setup_cpu,
|
2009-06-17 00:42:50 +08:00
|
|
|
.give_timebase = rtas_give_timebase,
|
|
|
|
.take_timebase = rtas_take_timebase,
|
2005-10-26 19:45:56 +08:00
|
|
|
};
|