Skip to contentSkip to conversation

4xx: Use virtual PVR value to init FPU on arch/ppc 440EP

PATCH In review Josh Boyer 2 participants 3 messages Nov 16, 2007

lore
Share & tools
lore

Josh Boyer

author
#0 lore raw

PATCH 1/1 4xx: Use virtual PVR value to init FPU on arch/ppc 440EP

This fixes arch/ppc 440EP platforms to setup the FPU correctly. A virtual PVR is used, as 440GR platforms share an identical hardware PVR value and do not have an FPU.

arch/ppc/kernel/setup.c +7 -0
Index: linux-2.6/arch/ppc/kernel/setup.c
===================================================================
@@ -312,7 +312,14 @@ early_init(int r3, int r4, int r5)
 	 * Identify the CPU type and fix up code sections
 	 * that depend on which cpu we have.
 	 */
+#if defined(CONFIG_440EP) && defined(CONFIG_PPC_FPU)
+	/* We pass the virtual PVR here for 440EP as 440EP and 440GR have
+	 * identical PVRs and there is no reliable way to check for the FPU
+	 */
+	spec = identify_cpu(offset, (mfspr(SPRN_PVR) | 0x8));
+#else
 	spec = identify_cpu(offset, mfspr(SPRN_PVR));
+#endif
 	do_feature_fixups(spec->cpu_features,
 			  PTRRELOC(&__start___ftr_fixup),
 			  PTRRELOC(&__stop___ftr_fixup));
#1 lore raw
Quoted 14 lines · Josh Boyer

This fixes arch/ppc 440EP platforms to setup the FPU correctly. A virtual PVR is used, as 440GR platforms share an identical hardware PVR value and do not have an FPU.

Index: linux-2.6/arch/ppc/kernel/setup.c
===================================================================

arch/ppc/kernel/setup.c +1 -0
@@ -312,7 +312,14 @@ early_init(int r3, int r4, int r5)
 	 * Identify the CPU type and fix up code sections
 	 * that depend on which cpu we have.
 	 */
+#if defined(CONFIG_440EP) && defined(CONFIG_PPC_FPU)

arch/ppc/kernel/setup.c early_init(int r3, int r4, int r5) · line 325

Quoted 10 lines
arch/ppc/kernel/setup.c +6 -0
+	/* We pass the virtual PVR here for 440EP as 440EP and 440GR have
+	 * identical PVRs and there is no reliable way to check for the FPU
+	 */
+	spec = identify_cpu(offset, (mfspr(SPRN_PVR) | 0x8));
+#else
 	spec = identify_cpu(offset, mfspr(SPRN_PVR));
+#endif
 	do_feature_fixups(spec->cpu_features,
 			  PTRRELOC(&__start___ftr_fixup),
 			  PTRRELOC(&__stop___ftr_fixup));

Are we really adding support for new processors to arch/ppc?

- k

author
#2 lore raw
Quoted 23 lines · On Fri, 16 Nov 2007 13:20:09 -0600 Kumar Gala <[email protected]> wrote:
Quoted 20 lines · Josh Boyer

This fixes arch/ppc 440EP platforms to setup the FPU correctly. A virtual
PVR is used, as 440GR platforms share an identical hardware PVR value and do
not have an FPU.

Index: linux-2.6/arch/ppc/kernel/setup.c
===================================================================

arch/ppc/kernel/setup.c +5 -0
@@ -312,7 +312,14 @@ early_init(int r3, int r4, int r5)
 	 * Identify the CPU type and fix up code sections
 	 * that depend on which cpu we have.
 	 */
+#if defined(CONFIG_440EP) && defined(CONFIG_PPC_FPU)
+	/* We pass the virtual PVR here for 440EP as 440EP and 440GR have
+	 * identical PVRs and there is no reliable way to check for the FPU
+	 */
+	spec = identify_cpu(offset, (mfspr(SPRN_PVR) | 0x8));
Quoted 8 lines

arch/ppc/kernel/setup.c early_init(int r3, int r4, int r5) · line 325

Quoted 6 lines
arch/ppc/kernel/setup.c +2 -0
+#else
 	spec = identify_cpu(offset, mfspr(SPRN_PVR));
+#endif
 	do_feature_fixups(spec->cpu_features,
 			  PTRRELOC(&__start___ftr_fixup),
 			  PTRRELOC(&__stop___ftr_fixup));

Are we really adding support for new processors to arch/ppc?

No. This is to continue to support 440EP FPU in arch/ppc. Commit
d1dfc35d3a62 switched the cputable around for EP(x)/GR(x) and arch/ppc wasn't fixed up. So without the above patch, 440EP gets detected as 440GR and the FPU isn't initialized properly.

josh