MIPS: micromips: Fix improper definition of ISA exception bit.
PATCH v2 1/1 MIPS: micromips: Fix improper definition of ISA exception bit.
The ISA exception bit selects whether exceptions are taken in classic MIPS or microMIPS mode. This bit is Config3.ISAOnExc and is bit 16. It It was improperly defined as bits 16 and 17. Fortunately, bit 17 is read-only and did not effect microMIPS operation. However, detecting a classic or microMIPS kernel when examining the /proc/cpuinfo file, the result always showed a microMIPS kernel.
Signed-off-by Steven J. Hill <[email protected]>
--- arch/mips/include/asm/mipsregs.h | 2 +- arch/mips/kernel/cpu-probe.c | 11 ++++++----- arch/mips/mti-malta/malta-init.c | 7 +++++++ arch/mips/mti-sead3/sead3-init.c | 7 +++++++ 4 files changed, 21 insertions(+), 6 deletions(-)
arch/mips/include/asm/mipsregs.h +1 -1
@@ -596,7 +596,7 @@#define MIPS_CONF3_RXI (_ULCAST_(1) << 12)#define MIPS_CONF3_ULRI (_ULCAST_(1) << 13)#define MIPS_CONF3_ISA (_ULCAST_(3) << 14) -#define MIPS_CONF3_ISA_OE (_ULCAST_(3) << 16) +#define MIPS_CONF3_ISA_OE (_ULCAST_(1) << 16)#define MIPS_CONF3_VZ (_ULCAST_(1) << 23)#define MIPS_CONF4_MMUSIZEEXT (_ULCAST_(255) << 0)
arch/mips/kernel/cpu-probe.c +6 -5
@@ -256,6 +256,12 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c) c->ases |=MIPS_ASE_SMARTMIPS ; c->options |=MIPS_CPU_RIXI ; } +if (config3 &MIPS_CONF3_ISA ) { + c->options |=MIPS_CPU_MICROMIPS ; +#ifdef CONFIG_CPU_MICROMIPS +write_c0_config3 (config3 |MIPS_CONF3_ISA_OE ); +#endif + }if (config3 &MIPS_CONF3_RXI ) c->options |=MIPS_CPU_RIXI ;if (config3 &MIPS_CONF3_DSP )
@@ -270,11 +276,6 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c) c->ases |=MIPS_ASE_MIPSMT ;if (config3 &MIPS_CONF3_ULRI ) c->options |=MIPS_CPU_ULRI ; -if (config3 &MIPS_CONF3_ISA ) - c->options |=MIPS_CPU_MICROMIPS ; -#ifdef CONFIG_CPU_MICROMIPS -write_c0_config3 (read_c0_config3 () |MIPS_CONF3_ISA_OE ); -#endif if (config3 &MIPS_CONF3_VZ ) c->ases |=MIPS_ASE_VZ ;
arch/mips/mti-malta/malta-init.c +7 -0
@@ -106,6 +106,13 @@ extern struct plat_smp_ops msmtc_smp_ops;void __init prom_init (void ) { +#ifdef CONFIG_CPU_MICROMIPS +unsigned int config3 =read_c0_config3 (); + +if (config3 &MIPS_CONF3_ISA ) +write_c0_config3 (config3 |MIPS_CONF3_ISA_OE ); +#endif +mips_display_message ("LINUX" );/*
arch/mips/mti-sead3/sead3-init.c +7 -0
@@ -130,6 +130,13 @@ static void __init mips_ejtag_setup(void)void __init prom_init (void ) { +#ifdef CONFIG_CPU_MICROMIPS +unsigned int config3 =read_c0_config3 (); + +if (config3 &MIPS_CONF3_ISA ) +write_c0_config3 (config3 |MIPS_CONF3_ISA_OE ); +#endif + board_nmi_handler_setup = mips_nmi_setup; board_ejtag_handler_setup = mips_ejtag_setup;
Signature · 1 line
1.7.2.5