Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2
@ 2014-02-09 13:32 Paul Bolle
  2014-02-09 16:26 ` Jonas Gorski
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Bolle @ 2014-02-09 13:32 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, linux-kernel

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.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
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(-)

diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h
index 3220c93..69a9a22 100644
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -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?
 
diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h
index cfe092f..f80a07e 100644
--- a/arch/mips/include/asm/fpu.h
+++ b/arch/mips/include/asm/fpu.h
@@ -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
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index 253b2fb..841ffc2 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -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
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2
  2014-02-09 13:32 [PATCH] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2 Paul Bolle
@ 2014-02-09 16:26 ` Jonas Gorski
  2014-02-09 19:45   ` Aaro Koskinen
  2014-04-09 23:03   ` Maciej W. Rozycki
  0 siblings, 2 replies; 5+ messages in thread
From: Jonas Gorski @ 2014-02-09 16:26 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Ralf Baechle, MIPS Mailing List, linux-kernel@vger.kernel.org

On Sun, Feb 9, 2014 at 2:32 PM, Paul Bolle <pebolle@tiscali.nl> wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2
  2014-02-09 16:26 ` Jonas Gorski
@ 2014-02-09 19:45   ` Aaro Koskinen
  2014-02-15 14:45     ` Huacai Chen
  2014-04-09 23:03   ` Maciej W. Rozycki
  1 sibling, 1 reply; 5+ messages in thread
From: Aaro Koskinen @ 2014-02-09 19:45 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: Paul Bolle, Ralf Baechle, MIPS Mailing List,
	linux-kernel@vger.kernel.org

Hi,

On Sun, Feb 09, 2014 at 05:26:59PM +0100, Jonas Gorski wrote:
> On Sun, Feb 9, 2014 at 2:32 PM, Paul Bolle <pebolle@tiscali.nl> wrote:
> > 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2
  2014-02-09 19:45   ` Aaro Koskinen
@ 2014-02-15 14:45     ` Huacai Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Huacai Chen @ 2014-02-15 14:45 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Jonas Gorski, Paul Bolle, Ralf Baechle, MIPS Mailing List,
	linux-kernel@vger.kernel.org

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.

On Mon, Feb 10, 2014 at 3:45 AM, Aaro Koskinen <aaro.koskinen@iki.fi> wrote:
> Hi,
>
> On Sun, Feb 09, 2014 at 05:26:59PM +0100, Jonas Gorski wrote:
>> On Sun, Feb 9, 2014 at 2:32 PM, Paul Bolle <pebolle@tiscali.nl> wrote:
>> > 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.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2
  2014-02-09 16:26 ` Jonas Gorski
  2014-02-09 19:45   ` Aaro Koskinen
@ 2014-04-09 23:03   ` Maciej W. Rozycki
  1 sibling, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2014-04-09 23:03 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: Paul Bolle, Ralf Baechle, MIPS Mailing List,
	linux-kernel@vger.kernel.org

On Sun, 9 Feb 2014, Jonas Gorski wrote:

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-09 23:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-09 13:32 [PATCH] MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2 Paul Bolle
2014-02-09 16:26 ` Jonas Gorski
2014-02-09 19:45   ` Aaro Koskinen
2014-02-15 14:45     ` Huacai Chen
2014-04-09 23:03   ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox