MIPS: detect presence of the FRE & UFR bits
authorPaul Burton <paul.burton@imgtec.com>
Thu, 11 Sep 2014 07:30:18 +0000 (08:30 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 24 Nov 2014 06:45:06 +0000 (07:45 +0100)
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>
arch/mips/include/asm/cpu-features.h
arch/mips/include/asm/cpu.h
arch/mips/kernel/cpu-probe.c

index 3325f3eb248c4cebabe44b9579d733f6a65046ae..2897cfafcaf097f01e17a561488eafe032924933 100644 (file)
 # define cpu_has_msa           0
 #endif
 
+#ifndef cpu_has_fre
+# define cpu_has_fre           (cpu_data[0].options & MIPS_CPU_FRE)
+#endif
+
 #endif /* __ASM_CPU_FEATURES_H */
index dfdc77ed18396a7d793c85183d9101deecd43f96..11025bfbd8db144f3a84bcaf5203e9a98c6bc0f6 100644 (file)
@@ -368,6 +368,7 @@ enum cpu_type_enum {
 #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 */
+#define MIPS_CPU_FRE           0x800000000ull /* FRE & UFE bits implemented */
 
 /*
  * CPU ASE encodings
index b27e7ffd1112ac2e28cc943b61e643fcae7d8027..d76f189291bc67b6ccb4c89b51dc740102d9415b 100644 (file)
@@ -1317,6 +1317,8 @@ void cpu_probe(void)
                                    MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) {
                        if (c->fpu_id & MIPS_FPIR_3D)
                                c->ases |= MIPS_ASE_MIPS3D;
+                       if (c->fpu_id & MIPS_FPIR_FREP)
+                               c->options |= MIPS_CPU_FRE;
                }
        }