2005-10-26 11:45:56 +00: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-26 23:09:06 +00:00
|
|
|
#include <linux/atomic.h>
|
2005-10-26 11:45:56 +00: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 12:42:04 +00:00
|
|
|
#include <asm/mpic.h>
|
2005-11-18 04:54:12 +00:00
|
|
|
#include <asm/rtas.h>
|
2005-10-26 11:45:56 +00:00
|
|
|
|
2012-12-21 22:04:10 +00:00
|
|
|
static int smp_chrp_kick_cpu(int nr)
|
2005-10-26 11:45:56 +00:00
|
|
|
{
|
|
|
|
*(unsigned long *)KERNELBASE = nr;
|
|
|
|
asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
|
2011-04-11 21:46:19 +00:00
|
|
|
|
|
|
|
return 0;
|
2005-10-26 11:45:56 +00:00
|
|
|
}
|
|
|
|
|
2012-12-21 22:04:10 +00:00
|
|
|
static void smp_chrp_setup_cpu(int cpu_nr)
|
2005-10-26 11:45:56 +00:00
|
|
|
{
|
2005-10-27 12:42:04 +00:00
|
|
|
mpic_setup_this_cpu();
|
2005-10-26 11:45:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* CHRP with openpic */
|
|
|
|
struct smp_ops_t chrp_smp_ops = {
|
2005-10-27 12:42:04 +00:00
|
|
|
.message_pass = smp_mpic_message_pass,
|
2005-11-04 23:33:55 +00:00
|
|
|
.probe = smp_mpic_probe,
|
2005-10-26 11:45:56 +00:00
|
|
|
.kick_cpu = smp_chrp_kick_cpu,
|
|
|
|
.setup_cpu = smp_chrp_setup_cpu,
|
2009-06-16 16:42:50 +00:00
|
|
|
.give_timebase = rtas_give_timebase,
|
|
|
|
.take_timebase = rtas_take_timebase,
|
2005-10-26 11:45:56 +00:00
|
|
|
};
|