Commit | Line | Data |
---|---|---|
bbd0abda PM |
1 | /* |
2 | * Smp support for CHRP machines. | |
3 | * | |
4 | * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great | |
5 | * deal of code from the sparc and intel versions. | |
6 | * | |
7 | * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> | |
8 | * | |
9 | */ | |
10 | ||
bbd0abda PM |
11 | #include <linux/kernel.h> |
12 | #include <linux/sched.h> | |
13 | #include <linux/smp.h> | |
bbd0abda PM |
14 | #include <linux/interrupt.h> |
15 | #include <linux/kernel_stat.h> | |
16 | #include <linux/delay.h> | |
bbd0abda PM |
17 | #include <linux/spinlock.h> |
18 | ||
19 | #include <asm/ptrace.h> | |
60063497 | 20 | #include <linux/atomic.h> |
bbd0abda PM |
21 | #include <asm/irq.h> |
22 | #include <asm/page.h> | |
23 | #include <asm/pgtable.h> | |
24 | #include <asm/sections.h> | |
25 | #include <asm/io.h> | |
26 | #include <asm/prom.h> | |
27 | #include <asm/smp.h> | |
bbd0abda | 28 | #include <asm/machdep.h> |
80579e1f | 29 | #include <asm/mpic.h> |
44aedfe7 | 30 | #include <asm/rtas.h> |
bbd0abda | 31 | |
cad5cef6 | 32 | static int smp_chrp_kick_cpu(int nr) |
bbd0abda PM |
33 | { |
34 | *(unsigned long *)KERNELBASE = nr; | |
35 | asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory"); | |
de300974 ME |
36 | |
37 | return 0; | |
bbd0abda PM |
38 | } |
39 | ||
cad5cef6 | 40 | static void smp_chrp_setup_cpu(int cpu_nr) |
bbd0abda | 41 | { |
80579e1f | 42 | mpic_setup_this_cpu(); |
bbd0abda PM |
43 | } |
44 | ||
bbd0abda PM |
45 | /* CHRP with openpic */ |
46 | struct smp_ops_t chrp_smp_ops = { | |
80579e1f | 47 | .message_pass = smp_mpic_message_pass, |
5ad57078 | 48 | .probe = smp_mpic_probe, |
bbd0abda PM |
49 | .kick_cpu = smp_chrp_kick_cpu, |
50 | .setup_cpu = smp_chrp_setup_cpu, | |
c4007a2f BH |
51 | .give_timebase = rtas_give_timebase, |
52 | .take_timebase = rtas_take_timebase, | |
bbd0abda | 53 | }; |