diff options
author | Paul Mackerras <paulus@samba.org> | 2005-11-04 18:33:55 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-04 18:33:55 -0500 |
commit | 5ad570786158e327a1c5d32dd3d66f26d8de6340 (patch) | |
tree | 0b4aafe469c72e5887ed0379d62a0ee390db3160 /arch/powerpc/platforms | |
parent | c3df69cd854551cf70e9c63aa509c26621084f60 (diff) |
powerpc: Merge smp.c and smp.h
This also moves setup_cpu_maps to setup-common.c (calling it
smp_setup_cpu_maps) and uses it on both 32-bit and 64-bit.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/chrp/smp.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c index 31ee49c25014..bb2315997d45 100644 --- a/arch/powerpc/platforms/chrp/smp.c +++ b/arch/powerpc/platforms/chrp/smp.c | |||
@@ -35,43 +35,6 @@ | |||
35 | #include <asm/smp.h> | 35 | #include <asm/smp.h> |
36 | #include <asm/mpic.h> | 36 | #include <asm/mpic.h> |
37 | 37 | ||
38 | extern unsigned long smp_chrp_cpu_nr; | ||
39 | |||
40 | static int __init smp_chrp_probe(void) | ||
41 | { | ||
42 | struct device_node *cpus = NULL; | ||
43 | unsigned int *reg; | ||
44 | int reglen; | ||
45 | int ncpus = 0; | ||
46 | int cpuid; | ||
47 | unsigned int phys; | ||
48 | |||
49 | /* Count CPUs in the device-tree */ | ||
50 | cpuid = 1; /* the boot cpu is logical cpu 0 */ | ||
51 | while ((cpus = of_find_node_by_type(cpus, "cpu")) != NULL) { | ||
52 | phys = ncpus; | ||
53 | reg = (unsigned int *) get_property(cpus, "reg", ®len); | ||
54 | if (reg && reglen >= sizeof(unsigned int)) | ||
55 | /* hmmm, not having a reg property would be bad */ | ||
56 | phys = *reg; | ||
57 | if (phys != boot_cpuid_phys) { | ||
58 | set_hard_smp_processor_id(cpuid, phys); | ||
59 | ++cpuid; | ||
60 | } | ||
61 | ++ncpus; | ||
62 | } | ||
63 | |||
64 | printk(KERN_INFO "CHRP SMP probe found %d cpus\n", ncpus); | ||
65 | |||
66 | /* Nothing more to do if less than 2 of them */ | ||
67 | if (ncpus <= 1) | ||
68 | return 1; | ||
69 | |||
70 | mpic_request_ipis(); | ||
71 | |||
72 | return ncpus; | ||
73 | } | ||
74 | |||
75 | static void __devinit smp_chrp_kick_cpu(int nr) | 38 | static void __devinit smp_chrp_kick_cpu(int nr) |
76 | { | 39 | { |
77 | *(unsigned long *)KERNELBASE = nr; | 40 | *(unsigned long *)KERNELBASE = nr; |
@@ -114,7 +77,7 @@ void __devinit smp_chrp_take_timebase(void) | |||
114 | /* CHRP with openpic */ | 77 | /* CHRP with openpic */ |
115 | struct smp_ops_t chrp_smp_ops = { | 78 | struct smp_ops_t chrp_smp_ops = { |
116 | .message_pass = smp_mpic_message_pass, | 79 | .message_pass = smp_mpic_message_pass, |
117 | .probe = smp_chrp_probe, | 80 | .probe = smp_mpic_probe, |
118 | .kick_cpu = smp_chrp_kick_cpu, | 81 | .kick_cpu = smp_chrp_kick_cpu, |
119 | .setup_cpu = smp_chrp_setup_cpu, | 82 | .setup_cpu = smp_chrp_setup_cpu, |
120 | .give_timebase = smp_chrp_give_timebase, | 83 | .give_timebase = smp_chrp_give_timebase, |