Skip to contentSkip to conversation

Add MIPS64R2 core support.

PATCH In review Steven J. Hill 3 participants 8 messages May 11, 2012 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add MIPS64R2 core support.

From: "Steven J. Hill" <[email protected]>

---
 arch/mips/Kconfig            |    7 +++++++
 arch/mips/include/asm/cpu.h  |    2 +-
 arch/mips/kernel/cpu-probe.c |    4 ++++
 arch/mips/kernel/traps.c     |    1 +
 4 files changed, 13 insertions(+), 1 deletion(-)
arch/mips/Kconfig +7 -0
index d0570f4..862a9c3 100644
@@ -282,6 +282,7 @@ config MIPS_MALTA
 	select SYS_HAS_CPU_MIPS32_R1
 	select SYS_HAS_CPU_MIPS32_R2
 	select SYS_HAS_CPU_MIPS64_R1
+	select SYS_HAS_CPU_MIPS64_R2
 	select SYS_HAS_CPU_NEVADA
 	select SYS_HAS_CPU_RM7000
 	select SYS_HAS_EARLY_PRINTK
@@ -2488,6 +2489,7 @@ config TRAD_SIGNALS
 config MIPS32_COMPAT
 	bool "Kernel support for Linux/MIPS 32-bit binary compatibility"
 	depends on 64BIT
+	default y if CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL
 	help
 	  Select this option if you want Linux/MIPS 32-bit binary
 	  compatibility. Since all software available for Linux/MIPS is
@@ -2507,6 +2509,7 @@ config SYSVIPC_COMPAT
 config MIPS32_O32
 	bool "Kernel support for o32 binaries"
 	depends on MIPS32_COMPAT
+	default y if CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL
 	help
 	  Select this option if you want to run o32 binaries.  These are pure
 	  32-bit binaries as used by the 32-bit Linux/MIPS port.  Most of
@@ -2525,6 +2528,10 @@ config MIPS32_N32
 
 	  If unsure, say N.
 
+comment "64bit kernel, but support of 32bit applications is disabled!"
+	depends on 64BIT && !MIPS32_O32 && !MIPS32_N32
+	depends on CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL
+
 config BINFMT_ELF32
 	bool
 	default y if MIPS32_O32 || MIPS32_N32
arch/mips/include/asm/cpu.h +1 -1
index 0a619f8..559bd12 100644
@@ -268,7 +268,7 @@ enum cpu_type_enum {
 	/*
 	 * MIPS64 class processors
 	 */
-	CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
+	CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
 	CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, CPU_CAVIUM_OCTEON2,
 	CPU_XLR, CPU_XLP,
 
arch/mips/kernel/cpu-probe.c +4 -0
index e5f0b27..fe76d60 100644
@@ -817,6 +817,10 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
 		c->cputype = CPU_5KC;
 		__cpu_name[cpu] = "MIPS 5Kc";
 		break;
+	case PRID_IMP_5KE:
+		c->cputype = CPU_5KE;
+		__cpu_name[cpu] = "MIPS 5KE";
+		break;
 	case PRID_IMP_20KC:
 		c->cputype = CPU_20KC;
 		__cpu_name[cpu] = "MIPS 20Kc";
arch/mips/kernel/traps.c +1 -0
index 7bec6f8..a69edbe 100644
@@ -1349,6 +1349,7 @@ static inline void parity_protection_init(void)
 		break;
 
 	case CPU_5KC:
+	case CPU_5KE:
 		write_c0_ecc(0x80000000);
 		back_to_back_c0_hazard();
 		/* Set the PE bit (bit 31) in the c0_errctl register. */
Signature · 1 line
1.7.10
#1 lore raw
Quoted 1 line · Steven J. Hill

From: "Steven J. Hill"<[email protected]>

Looks like the subject is incorrect. Should be "Add MIPS 5KE support"?

Quoted 2 lines

[...]

Quoted 29 lines
arch/mips/Kconfig +3 -0
index d0570f4..862a9c3 100644
@@ -282,6 +282,7 @@ config MIPS_MALTA
  	select SYS_HAS_CPU_MIPS32_R1
  	select SYS_HAS_CPU_MIPS32_R2
  	select SYS_HAS_CPU_MIPS64_R1
+	select SYS_HAS_CPU_MIPS64_R2
  	select SYS_HAS_CPU_NEVADA
  	select SYS_HAS_CPU_RM7000
  	select SYS_HAS_EARLY_PRINTK
@@ -2488,6 +2489,7 @@ config TRAD_SIGNALS
  config MIPS32_COMPAT
  	bool "Kernel support for Linux/MIPS 32-bit binary compatibility"
  	depends on 64BIT
+	default y if CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL
  	help
  	  Select this option if you want Linux/MIPS 32-bit binary
  	  compatibility. Since all software available for Linux/MIPS is
@@ -2507,6 +2509,7 @@ config SYSVIPC_COMPAT
  config MIPS32_O32
  	bool "Kernel support for o32 binaries"
  	depends on MIPS32_COMPAT
+	default y if CPU_SUPPORTS_32BIT_KERNEL&&  SYS_SUPPORTS_32BIT_KERNEL
  	help
  	  Select this option if you want to run o32 binaries.  These are pure
  	  32-bit binaries as used by the 32-bit Linux/MIPS port.  Most of

arch/mips/Kconfig config MIPS32_N32 · line 2534

Quoted 7 lines
arch/mips/Kconfig +4 -0
@@ -2525,6 +2528,10 @@ config MIPS32_N32
 
  	  If unsure, say N.
 
+comment "64bit kernel, but support of 32bit applications is disabled!"
+	depends on 64BIT&&  !MIPS32_O32&&  !MIPS32_N32
+	depends on CPU_SUPPORTS_32BIT_KERNEL&&  SYS_SUPPORTS_32BIT_KERNEL
+

The above looks like a material for separate patch...

WBR, Sergei

#2 lore raw

Not exactly - it adds 64R2 support in Malta, plus small verification that build kernel could run 32bit binaries.

I don't think it has sense to multiply patches here, there is no sense to have this separated.

5KEc is just test-bed.

Sergei Shtylyov <[email protected]> wrote:

Quoted 1 line · Steven J. Hill

From: "Steven J. Hill"<[email protected]>

Looks like the subject is incorrect. Should be "Add MIPS 5KE support"?

Quoted 2 lines

[...]

Quoted 29 lines
arch/mips/Kconfig +3 -0
index d0570f4..862a9c3 100644
@@ -282,6 +282,7 @@ config MIPS_MALTA
      select SYS_HAS_CPU_MIPS32_R1
      select SYS_HAS_CPU_MIPS32_R2
      select SYS_HAS_CPU_MIPS64_R1
+     select SYS_HAS_CPU_MIPS64_R2
      select SYS_HAS_CPU_NEVADA
      select SYS_HAS_CPU_RM7000
      select SYS_HAS_EARLY_PRINTK
@@ -2488,6 +2489,7 @@ config TRAD_SIGNALS
  config MIPS32_COMPAT
      bool "Kernel support for Linux/MIPS 32-bit binary compatibility"
      depends on 64BIT
+     default y if CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL
      help
        Select this option if you want Linux/MIPS 32-bit binary
        compatibility. Since all software available for Linux/MIPS is
@@ -2507,6 +2509,7 @@ config SYSVIPC_COMPAT
  config MIPS32_O32
      bool "Kernel support for o32 binaries"
      depends on MIPS32_COMPAT
+     default y if CPU_SUPPORTS_32BIT_KERNEL&&  SYS_SUPPORTS_32BIT_KERNEL
      help
        Select this option if you want to run o32 binaries.  These are pure
        32-bit binaries as used by the 32-bit Linux/MIPS port.  Most of

arch/mips/Kconfig config MIPS32_N32 · line 2534

Quoted 7 lines
arch/mips/Kconfig +4 -0
@@ -2525,6 +2528,10 @@ config MIPS32_N32
 
        If unsure, say N.
 
+comment "64bit kernel, but support of 32bit applications is disabled!"
+     depends on 64BIT&&  !MIPS32_O32&&  !MIPS32_N32
+     depends on CPU_SUPPORTS_32BIT_KERNEL&&  SYS_SUPPORTS_32BIT_KERNEL
+

The above looks like a material for separate patch...

WBR, Sergei

#3 lore raw

Hello.

Quoted 5 lines · Leonid

Not exactly - it adds 64R2 support in Malta, plus small verification that build kernel could run 32bit binaries.

I don't think it has sense to multiply patches here, there is no sense to have this separated.

5KEc is just test-bed.

Well, rule of thumb is do one thing per patch. You do three. All that
without proper description.

WBR, Sergei

#4 lore raw

I don't see any advantage in separation of it.

Sergei Shtylyov <[email protected]> wrote:

Hello.

Quoted 5 lines · Leonid

Not exactly - it adds 64R2 support in Malta, plus small verification that build kernel could run 32bit binaries.

I don't think it has sense to multiply patches here, there is no sense to have this separated.

5KEc is just test-bed.

Well, rule of thumb is do one thing per patch. You do three. All that
without proper description.

WBR, Sergei

#5 lore raw

Hello.

Quoted 1 line · Leonid

I don't see any advantage in separation of it.

I do. And I certainly do see an advantage of bothering to describe your
changes, not just throwing in patch with unclear summary, no changelog at all, doing 3 things at once and then hoping for it to be silently accepted.

Quoted 6 lines

Sergei Shtylyov<[email protected]> wrote:

Hello.

On 05/11/2012 09:32 PM, Yegoshin, Leonid wrote:

Quoted 8 lines
Quoted 5 lines

Not exactly - it adds 64R2 support in Malta, plus small verification that build kernel could run 32bit binaries.

I don't think it has sense to multiply patches here, there is no sense to have this separated.

5KEc is just test-bed.

Well, rule of thumb is do one thing per patch. You do three. All that
without proper description.

PS: Please stop top-posting.

WBR, Sergei

#6 lore raw

Sergei,

Stop copying Ralf. Copying the mailing list is sufficient.

Leonid,

Could you please write a couple of sentences describing the 6 lines that you added in 'arch/mips/Kconfig' ? We can then add that with the sentence "Add support for MIPS64R2 on the Malta platform." That will be sufficient and prevents having to split this patch up. Just email it to me internally and I will repost the patch.

-Steve

#7 lore raw

Hello.

Quoted 3 lines · Steven

Sergei,

Stop copying Ralf. Copying the mailing list is sufficient.

I just replied to all, as usual.

Quoted 3 lines

Leonid,

Could you please write a couple of sentences describing the 6 lines that you added in 'arch/mips/Kconfig' ? We can then add that with the sentence "Add support for MIPS64R2 on the Malta platform." That will be sufficient and prevents having to split this patch up. Just email it to me internally and I will repost the patch.

Yeah, that would be a good start. Although I'd still insist on splitting it up.

Quoted 1 line

-Steve

WBR, Sergei