diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2006-05-19 00:24:18 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-05-19 00:24:18 -0400 |
commit | b26f100d89c87060b561c3108582b7cb81521df8 (patch) | |
tree | 57e566bb4f1411e059e59b0f43bc9544e15616e8 | |
parent | 4240545661fc0ac25122f166e96633527150300c (diff) |
[PATCH] powerpc: remove do-nothing cpu setup routines
Removed the do-nothing routines __setup_cpu_power3 and
__setup_cpu_power4 and replaced them with a null pointer check
in the caller. Also removed the Cell processor specific
routine __setup_cpu_be which improperly accessed the
hypervisor page size configuration at SPR HID6.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_power4.S | 17 | ||||
-rw-r--r-- | arch/powerpc/kernel/cputable.c | 19 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_32.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_64.S | 5 |
4 files changed, 4 insertions, 39 deletions
diff --git a/arch/powerpc/kernel/cpu_setup_power4.S b/arch/powerpc/kernel/cpu_setup_power4.S index b61d86e7ceb6..271418308d53 100644 --- a/arch/powerpc/kernel/cpu_setup_power4.S +++ b/arch/powerpc/kernel/cpu_setup_power4.S | |||
@@ -73,23 +73,6 @@ _GLOBAL(__970_cpu_preinit) | |||
73 | isync | 73 | isync |
74 | blr | 74 | blr |
75 | 75 | ||
76 | _GLOBAL(__setup_cpu_power4) | ||
77 | blr | ||
78 | |||
79 | _GLOBAL(__setup_cpu_be) | ||
80 | /* Set large page sizes LP=0: 16MB, LP=1: 64KB */ | ||
81 | addi r3, 0, 0 | ||
82 | ori r3, r3, HID6_LB | ||
83 | sldi r3, r3, 32 | ||
84 | nor r3, r3, r3 | ||
85 | mfspr r4, SPRN_HID6 | ||
86 | and r4, r4, r3 | ||
87 | addi r3, 0, 0x02000 | ||
88 | sldi r3, r3, 32 | ||
89 | or r4, r4, r3 | ||
90 | mtspr SPRN_HID6, r4 | ||
91 | blr | ||
92 | |||
93 | _GLOBAL(__setup_cpu_ppc970) | 76 | _GLOBAL(__setup_cpu_ppc970) |
94 | mfspr r0,SPRN_HID0 | 77 | mfspr r0,SPRN_HID0 |
95 | li r11,5 /* clear DOZE and SLEEP */ | 78 | li r11,5 /* clear DOZE and SLEEP */ |
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 3f7182db9ed5..0c487ee4d483 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -30,11 +30,7 @@ EXPORT_SYMBOL(cur_cpu_spec); | |||
30 | * part of the cputable though. That has to be fixed for both ppc32 | 30 | * part of the cputable though. That has to be fixed for both ppc32 |
31 | * and ppc64 | 31 | * and ppc64 |
32 | */ | 32 | */ |
33 | #ifdef CONFIG_PPC64 | 33 | #ifdef CONFIG_PPC32 |
34 | extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec); | ||
35 | extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec); | ||
36 | extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec); | ||
37 | #else | ||
38 | extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec); | 34 | extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec); |
39 | extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec); | 35 | extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec); |
40 | extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec); | 36 | extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec); |
@@ -82,7 +78,6 @@ struct cpu_spec cpu_specs[] = { | |||
82 | .icache_bsize = 128, | 78 | .icache_bsize = 128, |
83 | .dcache_bsize = 128, | 79 | .dcache_bsize = 128, |
84 | .num_pmcs = 8, | 80 | .num_pmcs = 8, |
85 | .cpu_setup = __setup_cpu_power3, | ||
86 | .oprofile_cpu_type = "ppc64/power3", | 81 | .oprofile_cpu_type = "ppc64/power3", |
87 | .oprofile_type = PPC_OPROFILE_RS64, | 82 | .oprofile_type = PPC_OPROFILE_RS64, |
88 | .platform = "power3", | 83 | .platform = "power3", |
@@ -96,7 +91,6 @@ struct cpu_spec cpu_specs[] = { | |||
96 | .icache_bsize = 128, | 91 | .icache_bsize = 128, |
97 | .dcache_bsize = 128, | 92 | .dcache_bsize = 128, |
98 | .num_pmcs = 8, | 93 | .num_pmcs = 8, |
99 | .cpu_setup = __setup_cpu_power3, | ||
100 | .oprofile_cpu_type = "ppc64/power3", | 94 | .oprofile_cpu_type = "ppc64/power3", |
101 | .oprofile_type = PPC_OPROFILE_RS64, | 95 | .oprofile_type = PPC_OPROFILE_RS64, |
102 | .platform = "power3", | 96 | .platform = "power3", |
@@ -110,7 +104,6 @@ struct cpu_spec cpu_specs[] = { | |||
110 | .icache_bsize = 128, | 104 | .icache_bsize = 128, |
111 | .dcache_bsize = 128, | 105 | .dcache_bsize = 128, |
112 | .num_pmcs = 8, | 106 | .num_pmcs = 8, |
113 | .cpu_setup = __setup_cpu_power3, | ||
114 | .oprofile_cpu_type = "ppc64/rs64", | 107 | .oprofile_cpu_type = "ppc64/rs64", |
115 | .oprofile_type = PPC_OPROFILE_RS64, | 108 | .oprofile_type = PPC_OPROFILE_RS64, |
116 | .platform = "rs64", | 109 | .platform = "rs64", |
@@ -124,7 +117,6 @@ struct cpu_spec cpu_specs[] = { | |||
124 | .icache_bsize = 128, | 117 | .icache_bsize = 128, |
125 | .dcache_bsize = 128, | 118 | .dcache_bsize = 128, |
126 | .num_pmcs = 8, | 119 | .num_pmcs = 8, |
127 | .cpu_setup = __setup_cpu_power3, | ||
128 | .oprofile_cpu_type = "ppc64/rs64", | 120 | .oprofile_cpu_type = "ppc64/rs64", |
129 | .oprofile_type = PPC_OPROFILE_RS64, | 121 | .oprofile_type = PPC_OPROFILE_RS64, |
130 | .platform = "rs64", | 122 | .platform = "rs64", |
@@ -138,7 +130,6 @@ struct cpu_spec cpu_specs[] = { | |||
138 | .icache_bsize = 128, | 130 | .icache_bsize = 128, |
139 | .dcache_bsize = 128, | 131 | .dcache_bsize = 128, |
140 | .num_pmcs = 8, | 132 | .num_pmcs = 8, |
141 | .cpu_setup = __setup_cpu_power3, | ||
142 | .oprofile_cpu_type = "ppc64/rs64", | 133 | .oprofile_cpu_type = "ppc64/rs64", |
143 | .oprofile_type = PPC_OPROFILE_RS64, | 134 | .oprofile_type = PPC_OPROFILE_RS64, |
144 | .platform = "rs64", | 135 | .platform = "rs64", |
@@ -152,7 +143,6 @@ struct cpu_spec cpu_specs[] = { | |||
152 | .icache_bsize = 128, | 143 | .icache_bsize = 128, |
153 | .dcache_bsize = 128, | 144 | .dcache_bsize = 128, |
154 | .num_pmcs = 8, | 145 | .num_pmcs = 8, |
155 | .cpu_setup = __setup_cpu_power3, | ||
156 | .oprofile_cpu_type = "ppc64/rs64", | 146 | .oprofile_cpu_type = "ppc64/rs64", |
157 | .oprofile_type = PPC_OPROFILE_RS64, | 147 | .oprofile_type = PPC_OPROFILE_RS64, |
158 | .platform = "rs64", | 148 | .platform = "rs64", |
@@ -166,7 +156,6 @@ struct cpu_spec cpu_specs[] = { | |||
166 | .icache_bsize = 128, | 156 | .icache_bsize = 128, |
167 | .dcache_bsize = 128, | 157 | .dcache_bsize = 128, |
168 | .num_pmcs = 8, | 158 | .num_pmcs = 8, |
169 | .cpu_setup = __setup_cpu_power4, | ||
170 | .oprofile_cpu_type = "ppc64/power4", | 159 | .oprofile_cpu_type = "ppc64/power4", |
171 | .oprofile_type = PPC_OPROFILE_POWER4, | 160 | .oprofile_type = PPC_OPROFILE_POWER4, |
172 | .platform = "power4", | 161 | .platform = "power4", |
@@ -180,7 +169,6 @@ struct cpu_spec cpu_specs[] = { | |||
180 | .icache_bsize = 128, | 169 | .icache_bsize = 128, |
181 | .dcache_bsize = 128, | 170 | .dcache_bsize = 128, |
182 | .num_pmcs = 8, | 171 | .num_pmcs = 8, |
183 | .cpu_setup = __setup_cpu_power4, | ||
184 | .oprofile_cpu_type = "ppc64/power4", | 172 | .oprofile_cpu_type = "ppc64/power4", |
185 | .oprofile_type = PPC_OPROFILE_POWER4, | 173 | .oprofile_type = PPC_OPROFILE_POWER4, |
186 | .platform = "power4", | 174 | .platform = "power4", |
@@ -246,7 +234,6 @@ struct cpu_spec cpu_specs[] = { | |||
246 | .icache_bsize = 128, | 234 | .icache_bsize = 128, |
247 | .dcache_bsize = 128, | 235 | .dcache_bsize = 128, |
248 | .num_pmcs = 6, | 236 | .num_pmcs = 6, |
249 | .cpu_setup = __setup_cpu_power4, | ||
250 | .oprofile_cpu_type = "ppc64/power5", | 237 | .oprofile_cpu_type = "ppc64/power5", |
251 | .oprofile_type = PPC_OPROFILE_POWER4, | 238 | .oprofile_type = PPC_OPROFILE_POWER4, |
252 | .platform = "power5", | 239 | .platform = "power5", |
@@ -260,7 +247,6 @@ struct cpu_spec cpu_specs[] = { | |||
260 | .icache_bsize = 128, | 247 | .icache_bsize = 128, |
261 | .dcache_bsize = 128, | 248 | .dcache_bsize = 128, |
262 | .num_pmcs = 6, | 249 | .num_pmcs = 6, |
263 | .cpu_setup = __setup_cpu_power4, | ||
264 | .oprofile_cpu_type = "ppc64/power5+", | 250 | .oprofile_cpu_type = "ppc64/power5+", |
265 | .oprofile_type = PPC_OPROFILE_POWER4, | 251 | .oprofile_type = PPC_OPROFILE_POWER4, |
266 | .platform = "power5+", | 252 | .platform = "power5+", |
@@ -274,7 +260,6 @@ struct cpu_spec cpu_specs[] = { | |||
274 | .icache_bsize = 128, | 260 | .icache_bsize = 128, |
275 | .dcache_bsize = 128, | 261 | .dcache_bsize = 128, |
276 | .num_pmcs = 6, | 262 | .num_pmcs = 6, |
277 | .cpu_setup = __setup_cpu_power4, | ||
278 | .oprofile_cpu_type = "ppc64/power6", | 263 | .oprofile_cpu_type = "ppc64/power6", |
279 | .oprofile_type = PPC_OPROFILE_POWER4, | 264 | .oprofile_type = PPC_OPROFILE_POWER4, |
280 | .platform = "power6", | 265 | .platform = "power6", |
@@ -289,7 +274,6 @@ struct cpu_spec cpu_specs[] = { | |||
289 | PPC_FEATURE_SMT, | 274 | PPC_FEATURE_SMT, |
290 | .icache_bsize = 128, | 275 | .icache_bsize = 128, |
291 | .dcache_bsize = 128, | 276 | .dcache_bsize = 128, |
292 | .cpu_setup = __setup_cpu_be, | ||
293 | .platform = "ppc-cell-be", | 277 | .platform = "ppc-cell-be", |
294 | }, | 278 | }, |
295 | { /* default match */ | 279 | { /* default match */ |
@@ -301,7 +285,6 @@ struct cpu_spec cpu_specs[] = { | |||
301 | .icache_bsize = 128, | 285 | .icache_bsize = 128, |
302 | .dcache_bsize = 128, | 286 | .dcache_bsize = 128, |
303 | .num_pmcs = 6, | 287 | .num_pmcs = 6, |
304 | .cpu_setup = __setup_cpu_power4, | ||
305 | .platform = "power4", | 288 | .platform = "power4", |
306 | } | 289 | } |
307 | #endif /* CONFIG_PPC64 */ | 290 | #endif /* CONFIG_PPC64 */ |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index be982023409e..01d3916c4cb1 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -216,7 +216,7 @@ _GLOBAL(call_setup_cpu) | |||
216 | lwz r4,0(r4) | 216 | lwz r4,0(r4) |
217 | add r4,r4,r3 | 217 | add r4,r4,r3 |
218 | lwz r5,CPU_SPEC_SETUP(r4) | 218 | lwz r5,CPU_SPEC_SETUP(r4) |
219 | cmpi 0,r5,0 | 219 | cmpwi 0,r5,0 |
220 | add r5,r5,r3 | 220 | add r5,r5,r3 |
221 | beqlr | 221 | beqlr |
222 | mtctr r5 | 222 | mtctr r5 |
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index 2778cce058e2..e8883d42c43c 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -482,7 +482,9 @@ _GLOBAL(identify_cpu) | |||
482 | sub r0,r3,r5 | 482 | sub r0,r3,r5 |
483 | std r0,0(r4) | 483 | std r0,0(r4) |
484 | ld r4,CPU_SPEC_SETUP(r3) | 484 | ld r4,CPU_SPEC_SETUP(r3) |
485 | cmpdi 0,r4,0 | ||
485 | add r4,r4,r5 | 486 | add r4,r4,r5 |
487 | beqlr | ||
486 | ld r4,0(r4) | 488 | ld r4,0(r4) |
487 | add r4,r4,r5 | 489 | add r4,r4,r5 |
488 | mtctr r4 | 490 | mtctr r4 |
@@ -768,9 +770,6 @@ _GLOBAL(giveup_altivec) | |||
768 | 770 | ||
769 | #endif /* CONFIG_ALTIVEC */ | 771 | #endif /* CONFIG_ALTIVEC */ |
770 | 772 | ||
771 | _GLOBAL(__setup_cpu_power3) | ||
772 | blr | ||
773 | |||
774 | _GLOBAL(execve) | 773 | _GLOBAL(execve) |
775 | li r0,__NR_execve | 774 | li r0,__NR_execve |
776 | sc | 775 | sc |