diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-10-24 02:42:40 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-24 21:42:10 -0400 |
commit | 42c4aaadb737e0e672b3fb86b2c41ff59f0fb8bc (patch) | |
tree | 368a26a61085e567357b3974e7799e56069032eb /arch/powerpc/kernel/setup_64.c | |
parent | fb20f65a01a97bdf4bb746eecfc24a08561e2648 (diff) |
[POWERPC] Consolidate feature fixup code
There are currently two versions of the functions for applying the
feature fixups, one for CPU features and one for firmware features. In
addition, they are both in assembly and with separate implementations
for 32 and 64 bits. identify_cpu() is also implemented in assembly and
separately for 32 and 64 bits.
This patch replaces them with a pair of C functions. The call sites are
slightly moved on ppc64 as well to be called from C instead of from
assembly, though it's a very small change, and thus shouldn't cause any
problem.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 4b2e32eab9dc..1969b5686eee 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -170,6 +170,9 @@ void __init setup_paca(int cpu) | |||
170 | 170 | ||
171 | void __init early_setup(unsigned long dt_ptr) | 171 | void __init early_setup(unsigned long dt_ptr) |
172 | { | 172 | { |
173 | /* Identify CPU type */ | ||
174 | identify_cpu(0); | ||
175 | |||
173 | /* Assume we're on cpu 0 for now. Don't write to the paca yet! */ | 176 | /* Assume we're on cpu 0 for now. Don't write to the paca yet! */ |
174 | setup_paca(0); | 177 | setup_paca(0); |
175 | 178 | ||
@@ -348,6 +351,14 @@ void __init setup_system(void) | |||
348 | { | 351 | { |
349 | DBG(" -> setup_system()\n"); | 352 | DBG(" -> setup_system()\n"); |
350 | 353 | ||
354 | /* Apply the CPUs-specific and firmware specific fixups to kernel | ||
355 | * text (nop out sections not relevant to this CPU or this firmware) | ||
356 | */ | ||
357 | do_feature_fixups(0, cur_cpu_spec->cpu_features, | ||
358 | &__start___ftr_fixup, &__stop___ftr_fixup); | ||
359 | do_feature_fixups(0, powerpc_firmware_features, | ||
360 | &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup); | ||
361 | |||
351 | /* | 362 | /* |
352 | * Unflatten the device-tree passed by prom_init or kexec | 363 | * Unflatten the device-tree passed by prom_init or kexec |
353 | */ | 364 | */ |