MIPS: Probe for small (1KiB) page support
authorJames Hogan <james.hogan@imgtec.com>
Wed, 15 Jul 2015 15:17:44 +0000 (16:17 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 3 Sep 2015 10:07:47 +0000 (12:07 +0200)
Probe Config3 for small page support. This will be useful to give clues
as to whether the PageGrain register exists.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10722/
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 f25de771f7ed228478b54c6acbb559d1f36f46d0..9801ac9826554ca0d8ab2e27e21ad6305f18da67 100644 (file)
 # define cpu_has_cdmm          (cpu_data[0].options & MIPS_CPU_CDMM)
 #endif
 
+#ifndef cpu_has_small_pages
+# define cpu_has_small_pages   (cpu_data[0].options & MIPS_CPU_SP)
+#endif
+
 #endif /* __ASM_CPU_FEATURES_H */
index 5fa7b8ba48a90f315bdc26dc0305d48248a19180..cd89e9855775276ea7c3a185d9e61b3702f06b6f 100644 (file)
@@ -384,6 +384,7 @@ enum cpu_type_enum {
 #define MIPS_CPU_XPA           0x2000000000ull /* CPU supports Extended Physical Addressing */
 #define MIPS_CPU_CDMM          0x4000000000ull /* CPU has Common Device Memory Map */
 #define MIPS_CPU_BP_GHIST      0x8000000000ull /* R12K+ Branch Prediction Global History */
+#define MIPS_CPU_SP            0x10000000000ull /* Small (1KB) page support */
 
 /*
  * CPU ASE encodings
index 4e39b340f3b77f3229e8ea431d6a7be8a3a3a9df..987036761fb61f3b1694db73e9c4aa5f8f646d16 100644 (file)
@@ -538,6 +538,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
        }
        if (config3 & MIPS_CONF3_CDMM)
                c->options |= MIPS_CPU_CDMM;
+       if (config3 & MIPS_CONF3_SP)
+               c->options |= MIPS_CPU_SP;
 
        return config3 & MIPS_CONF_M;
 }