]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: detect presence of MAARs
authorPaul Burton <paul.burton@imgtec.com>
Mon, 14 Jul 2014 09:32:14 +0000 (10:32 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 1 Aug 2014 22:06:45 +0000 (00:06 +0200)
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>
arch/mips/include/asm/cpu-features.h
arch/mips/include/asm/cpu.h
arch/mips/kernel/cpu-probe.c

index eeb5400ed4ee75d0297a73991e1a9f2948d0e474..e079598ae0516b9db2ae674ae15e89e00527d422 100644 (file)
@@ -35,6 +35,9 @@
 #ifndef cpu_has_rixiex
 #define cpu_has_rixiex         (cpu_data[0].options & MIPS_CPU_RIXIEX)
 #endif
+#ifndef cpu_has_maar
+#define cpu_has_maar           (cpu_data[0].options & MIPS_CPU_MAAR)
+#endif
 
 /*
  * For the moment we don't consider R6000 and R8000 so we can assume that
index 7ba2a035ad866416f147819700e7f145f015e0f0..dfdc77ed18396a7d793c85183d9101deecd43f96 100644 (file)
@@ -367,6 +367,7 @@ enum cpu_type_enum {
 #define MIPS_CPU_EVA           0x80000000ull /* CPU supports Enhanced Virtual Addressing */
 #define MIPS_CPU_HTW           0x100000000ull /* CPU support Hardware Page Table Walker */
 #define MIPS_CPU_RIXIEX                0x200000000ull /* CPU has unique exception codes for {Read, Execute}-Inhibit exceptions */
+#define MIPS_CPU_MAAR          0x400000000ull /* MAAR(I) registers are present */
 
 /*
  * CPU ASE encodings
index 66b8fe97f739c4a91ef1f1c8c7ef524061405f96..e34b10be782e1dc4e81012078919029c9baad7e0 100644 (file)
@@ -405,6 +405,8 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c)
 
        if (config5 & MIPS_CONF5_EVA)
                c->options |= MIPS_CPU_EVA;
+       if (config5 & MIPS_CONF5_MRP)
+               c->options |= MIPS_CPU_MAAR;
 
        return config5 & MIPS_CONF_M;
 }