aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2014-09-11 03:30:18 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 01:45:06 -0500
commitadac5d535d4e364324b92798bfb68336197e815e (patch)
tree221874e584f0e401bdce8cd10066307779bd5277 /arch/mips
parent5ff04a8433b0ff396c4adcc03fe7787e22f57cb1 (diff)
MIPS: detect presence of the FRE & UFR bits
Detect the presence of the Config5 FRE & UFE bits, as indicated by the FREP bit in FPIR. Record this as a CPU option bit, and provide a cpu_has_fre macro to ease checking of that option bit. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/7678/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/cpu-features.h4
-rw-r--r--arch/mips/include/asm/cpu.h1
-rw-r--r--arch/mips/kernel/cpu-probe.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 3325f3eb248c..2897cfafcaf0 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -344,4 +344,8 @@
344# define cpu_has_msa 0 344# define cpu_has_msa 0
345#endif 345#endif
346 346
347#ifndef cpu_has_fre
348# define cpu_has_fre (cpu_data[0].options & MIPS_CPU_FRE)
349#endif
350
347#endif /* __ASM_CPU_FEATURES_H */ 351#endif /* __ASM_CPU_FEATURES_H */
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index dfdc77ed1839..11025bfbd8db 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -368,6 +368,7 @@ enum cpu_type_enum {
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#define MIPS_CPU_MAAR 0x400000000ull /* MAAR(I) registers are present */
371#define MIPS_CPU_FRE 0x800000000ull /* FRE & UFE bits implemented */
371 372
372/* 373/*
373 * CPU ASE encodings 374 * CPU ASE encodings
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index b27e7ffd1112..d76f189291bc 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1317,6 +1317,8 @@ void cpu_probe(void)
1317 MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) { 1317 MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) {
1318 if (c->fpu_id & MIPS_FPIR_3D) 1318 if (c->fpu_id & MIPS_FPIR_3D)
1319 c->ases |= MIPS_ASE_MIPS3D; 1319 c->ases |= MIPS_ASE_MIPS3D;
1320 if (c->fpu_id & MIPS_FPIR_FREP)
1321 c->options |= MIPS_CPU_FRE;
1320 } 1322 }
1321 } 1323 }
1322 1324