diff options
author | Paul Burton <paul.burton@imgtec.com> | 2014-07-14 05:32:14 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-08-01 18:06:45 -0400 |
commit | 1f6c52ff7225789d20c1d69883f263d502b7eda7 (patch) | |
tree | c97ef1d8e597e9b046b6adecf305df488d6543c2 | |
parent | e19d5dbad5b4ea445be29d7146dd6a1cd9b51b97 (diff) |
MIPS: detect presence of MAARs
Detect the presence of MAAR using the MRP bit in Config5, and record
that presence using a CPU option bit. A cpu_has_maar macro will then
allow code to conditionalise upon the presence of MAARs.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7330/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/include/asm/cpu-features.h | 3 | ||||
-rw-r--r-- | arch/mips/include/asm/cpu.h | 1 | ||||
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index eeb5400ed4ee..e079598ae051 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
@@ -35,6 +35,9 @@ | |||
35 | #ifndef cpu_has_rixiex | 35 | #ifndef cpu_has_rixiex |
36 | #define cpu_has_rixiex (cpu_data[0].options & MIPS_CPU_RIXIEX) | 36 | #define cpu_has_rixiex (cpu_data[0].options & MIPS_CPU_RIXIEX) |
37 | #endif | 37 | #endif |
38 | #ifndef cpu_has_maar | ||
39 | #define cpu_has_maar (cpu_data[0].options & MIPS_CPU_MAAR) | ||
40 | #endif | ||
38 | 41 | ||
39 | /* | 42 | /* |
40 | * For the moment we don't consider R6000 and R8000 so we can assume that | 43 | * For the moment we don't consider R6000 and R8000 so we can assume that |
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h index 7ba2a035ad86..dfdc77ed1839 100644 --- a/arch/mips/include/asm/cpu.h +++ b/arch/mips/include/asm/cpu.h | |||
@@ -367,6 +367,7 @@ enum cpu_type_enum { | |||
367 | #define MIPS_CPU_EVA 0x80000000ull /* CPU supports Enhanced Virtual Addressing */ | 367 | #define MIPS_CPU_EVA 0x80000000ull /* CPU supports Enhanced Virtual Addressing */ |
368 | #define MIPS_CPU_HTW 0x100000000ull /* CPU support Hardware Page Table Walker */ | 368 | #define MIPS_CPU_HTW 0x100000000ull /* CPU support Hardware Page Table Walker */ |
369 | #define MIPS_CPU_RIXIEX 0x200000000ull /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */ | 369 | #define MIPS_CPU_RIXIEX 0x200000000ull /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */ |
370 | #define MIPS_CPU_MAAR 0x400000000ull /* MAAR(I) registers are present */ | ||
370 | 371 | ||
371 | /* | 372 | /* |
372 | * CPU ASE encodings | 373 | * CPU ASE encodings |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 66b8fe97f739..e34b10be782e 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -405,6 +405,8 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c) | |||
405 | 405 | ||
406 | if (config5 & MIPS_CONF5_EVA) | 406 | if (config5 & MIPS_CONF5_EVA) |
407 | c->options |= MIPS_CPU_EVA; | 407 | c->options |= MIPS_CPU_EVA; |
408 | if (config5 & MIPS_CONF5_MRP) | ||
409 | c->options |= MIPS_CPU_MAAR; | ||
408 | 410 | ||
409 | return config5 & MIPS_CONF_M; | 411 | return config5 & MIPS_CONF_M; |
410 | } | 412 | } |