aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/kernel/setup.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-10-24 02:42:40 -0400
committerPaul Mackerras <paulus@samba.org>2006-10-24 21:42:10 -0400
commit42c4aaadb737e0e672b3fb86b2c41ff59f0fb8bc (patch)
tree368a26a61085e567357b3974e7799e56069032eb /arch/ppc/kernel/setup.c
parentfb20f65a01a97bdf4bb746eecfc24a08561e2648 (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/ppc/kernel/setup.c')
-rw-r--r--arch/ppc/kernel/setup.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 75fe13815be2..41a640f16bdd 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -38,6 +38,7 @@
38#include <asm/nvram.h> 38#include <asm/nvram.h>
39#include <asm/xmon.h> 39#include <asm/xmon.h>
40#include <asm/ocp.h> 40#include <asm/ocp.h>
41#include <asm/prom.h>
41 42
42#define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \ 43#define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \
43 defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \ 44 defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
@@ -53,8 +54,6 @@
53 54
54extern void platform_init(unsigned long r3, unsigned long r4, 55extern void platform_init(unsigned long r3, unsigned long r4,
55 unsigned long r5, unsigned long r6, unsigned long r7); 56 unsigned long r5, unsigned long r6, unsigned long r7);
56extern void identify_cpu(unsigned long offset, unsigned long cpu);
57extern void do_cpu_ftr_fixups(unsigned long offset);
58extern void reloc_got2(unsigned long offset); 57extern void reloc_got2(unsigned long offset);
59 58
60extern void ppc6xx_idle(void); 59extern void ppc6xx_idle(void);
@@ -301,6 +300,7 @@ early_init(int r3, int r4, int r5)
301{ 300{
302 unsigned long phys; 301 unsigned long phys;
303 unsigned long offset = reloc_offset(); 302 unsigned long offset = reloc_offset();
303 struct cpu_spec *spec;
304 304
305 /* Default */ 305 /* Default */
306 phys = offset + KERNELBASE; 306 phys = offset + KERNELBASE;
@@ -313,8 +313,10 @@ early_init(int r3, int r4, int r5)
313 * Identify the CPU type and fix up code sections 313 * Identify the CPU type and fix up code sections
314 * that depend on which cpu we have. 314 * that depend on which cpu we have.
315 */ 315 */
316 identify_cpu(offset, 0); 316 spec = identify_cpu(offset);
317 do_cpu_ftr_fixups(offset); 317 do_feature_fixups(offset, spec->cpu_features,
318 PTRRELOC(&__start___ftr_fixup),
319 PTRRELOC(&__stop___ftr_fixup));
318 320
319 return phys; 321 return phys;
320} 322}