Skip to contentSkip to conversation

MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2

PATCH In review Paul Bolle 5 participants 5 messages Feb 9, 2014 – Apr 9, 2014 MIPS

lore
Share & tools
lore

Paul Bolle

author
#0 lore raw

PATCH 1/1 MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2

Commit 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries") introduced references to two undefined Kconfig macros. CONFIG_MIPS32_R2 should clearly be replaced with CONFIG_CPU_MIPS32_R2. And CONFIG_MIPS64 should apparently be replaced with CONFIG_64BIT.

---
Untested!

 arch/mips/include/asm/asmmacro.h | 4 ++--
 arch/mips/include/asm/fpu.h      | 2 +-
 arch/mips/kernel/r4k_fpu.S       | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)
arch/mips/include/asm/asmmacro.h +2 -2
index 3220c93..69a9a22 100644
@@ -106,7 +106,7 @@
 	.endm
 
 	.macro	fpu_save_double thread status tmp
-#if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	sll	\tmp, \status, 5
 	bgez	\tmp, 10f
 	fpu_save_16odd \thread
@@ -159,7 +159,7 @@
 	.endm
 
 	.macro	fpu_restore_double thread status tmp
-#if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	sll	\tmp, \status, 5
 	bgez	\tmp, 10f				# 16 register mode?
 
arch/mips/include/asm/fpu.h +1 -1
index cfe092f..f80a07e 100644
@@ -57,7 +57,7 @@ static inline int __enable_fpu(enum fpu_mode mode)
 		return 0;
 
 	case FPU_64BIT:
-#if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_MIPS64))
+#if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_64BIT))
 		/* we only have a 32-bit FPU */
 		return SIGFPE;
 #endif
arch/mips/kernel/r4k_fpu.S +4 -4
index 253b2fb..841ffc2 100644
@@ -35,9 +35,9 @@
 LEAF(_save_fp_context)
 	cfc1	t1, fcr31
 
-#if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	.set	push
-#ifdef CONFIG_MIPS32_R2
+#ifdef CONFIG_CPU_MIPS32_R2
 	.set	mips64r2
 	mfc0	t0, CP0_STATUS
 	sll	t0, t0, 5
@@ -148,9 +148,9 @@ LEAF(_save_fp_context32)
 LEAF(_restore_fp_context)
 	EX	lw t0, SC_FPC_CSR(a0)
 
-#if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2)
+#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
 	.set	push
-#ifdef CONFIG_MIPS32_R2
+#ifdef CONFIG_CPU_MIPS32_R2
 	.set	mips64r2
 	mfc0	t0, CP0_STATUS
 	sll	t0, t0, 5
Signature · 1 line
1.8.5.3
#1 lore raw
Quoted 4 lines · Paul Bolle

Commit 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries") introduced references to two undefined Kconfig macros. CONFIG_MIPS32_R2 should clearly be replaced with CONFIG_CPU_MIPS32_R2. And CONFIG_MIPS64 should apparently be replaced with CONFIG_64BIT.

While I agree about the CONFIG_MIPS64 => CONFIG_64BIT replacement, I wonder if CONFIG_MIPS32_R2 shouldn't rather be CONFIG_CPU_MIPSR2 (maybe even the existing CONFIG_CPU_MIPS32_R2 are wrong here). CPU_XLP selects CPU_MIPSR2, and CPU_LONGSOON1 selects CPU_MIPS32 and CPU_MIPSR2, so they should probably be treated the same way as CPU_MIPS32_R2 (for e.g. the di/ei availability), but since all three are choice values, there can't be CPU_MIPS32_R2 selected if CPU_LONGSOON1 or CPU_XLP is chosen.

Regards
Jonas

#2 lore raw

Hi,

Quoted 9 lines · Jonas Gorski
Quoted 4 lines · Paul Bolle

Commit 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries") introduced references to two undefined Kconfig macros. CONFIG_MIPS32_R2 should clearly be replaced with CONFIG_CPU_MIPS32_R2. And CONFIG_MIPS64 should apparently be replaced with CONFIG_64BIT.

While I agree about the CONFIG_MIPS64 => CONFIG_64BIT replacement, I wonder if CONFIG_MIPS32_R2 shouldn't rather be CONFIG_CPU_MIPSR2 (maybe even the existing CONFIG_CPU_MIPS32_R2 are wrong here).

FYI, the 64BIT part is already fixed by
<http://patchwork.linux-mips.org/patch/6506/>. I guess these two changes could be separate patches.

A.

#3 lore raw

I think Paul Bolle's patch is correct and my first patch is not enough. So it needn't to make a separate patch, just take Paul's patch and my second patch is enough.

Quoted 19 lines · Aaro Koskinen

Hi,

Quoted 9 lines · Jonas Gorski
Quoted 4 lines · Paul Bolle

Commit 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries") introduced references to two undefined Kconfig macros. CONFIG_MIPS32_R2 should clearly be replaced with CONFIG_CPU_MIPS32_R2. And CONFIG_MIPS64 should apparently be replaced with CONFIG_64BIT.

While I agree about the CONFIG_MIPS64 => CONFIG_64BIT replacement, I wonder if CONFIG_MIPS32_R2 shouldn't rather be CONFIG_CPU_MIPSR2 (maybe even the existing CONFIG_CPU_MIPS32_R2 are wrong here).

FYI, the 64BIT part is already fixed by
<http://patchwork.linux-mips.org/patch/6506/>. I guess these two changes could be separate patches.

A.

#4 lore raw
In reply to Jonas Gorski
Quoted 3 lines · Jonas Gorski

While I agree about the CONFIG_MIPS64 => CONFIG_64BIT replacement, I wonder if CONFIG_MIPS32_R2 shouldn't rather be CONFIG_CPU_MIPSR2 (maybe even the existing CONFIG_CPU_MIPS32_R2 are wrong here).

Absolutely. You should be able to build a 32-bit kernel (32BIT) for a
MIPS64r2 processor (CPU_MIPS64_R2) and use the FP64 feature.

Maciej