aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Nowakowski <marcin.nowakowski@mips.com>2018-02-09 17:11:05 -0500
committerJames Hogan <jhogan@kernel.org>2018-02-19 15:50:35 -0500
commit256211f2b0b251e532d1899b115e374feb16fa7a (patch)
tree6f47ee172a9a91d405677cf2dff8af919930b799
parentab3d8441290bcd648f487b69ea87cfe5b37d9e02 (diff)
MIPS: Add crc instruction support flag to elf_hwcap
Indicate that CRC32 and CRC32C instuctions are supported by the CPU through elf_hwcap flags. This will be used by a follow-up commit that introduces crc32(c) crypto acceleration modules and is required by GENERIC_CPU_AUTOPROBE feature. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@mips.com> Signed-off-by: James Hogan <jhogan@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/18600/
-rw-r--r--arch/mips/include/asm/mipsregs.h1
-rw-r--r--arch/mips/include/uapi/asm/hwcap.h1
-rw-r--r--arch/mips/kernel/cpu-probe.c3
3 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 858752dac337..f65859784a4c 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -664,6 +664,7 @@
664#define MIPS_CONF5_FRE (_ULCAST_(1) << 8) 664#define MIPS_CONF5_FRE (_ULCAST_(1) << 8)
665#define MIPS_CONF5_UFE (_ULCAST_(1) << 9) 665#define MIPS_CONF5_UFE (_ULCAST_(1) << 9)
666#define MIPS_CONF5_CA2 (_ULCAST_(1) << 14) 666#define MIPS_CONF5_CA2 (_ULCAST_(1) << 14)
667#define MIPS_CONF5_CRCP (_ULCAST_(1) << 18)
667#define MIPS_CONF5_MSAEN (_ULCAST_(1) << 27) 668#define MIPS_CONF5_MSAEN (_ULCAST_(1) << 27)
668#define MIPS_CONF5_EVA (_ULCAST_(1) << 28) 669#define MIPS_CONF5_EVA (_ULCAST_(1) << 28)
669#define MIPS_CONF5_CV (_ULCAST_(1) << 29) 670#define MIPS_CONF5_CV (_ULCAST_(1) << 29)
diff --git a/arch/mips/include/uapi/asm/hwcap.h b/arch/mips/include/uapi/asm/hwcap.h
index 600ad8fd6835..a2aba4b059e6 100644
--- a/arch/mips/include/uapi/asm/hwcap.h
+++ b/arch/mips/include/uapi/asm/hwcap.h
@@ -5,5 +5,6 @@
5/* HWCAP flags */ 5/* HWCAP flags */
6#define HWCAP_MIPS_R6 (1 << 0) 6#define HWCAP_MIPS_R6 (1 << 0)
7#define HWCAP_MIPS_MSA (1 << 1) 7#define HWCAP_MIPS_MSA (1 << 1)
8#define HWCAP_MIPS_CRC32 (1 << 2)
8 9
9#endif /* _UAPI_ASM_HWCAP_H */ 10#endif /* _UAPI_ASM_HWCAP_H */
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index cf3fd549e16d..6b07b739f914 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -848,6 +848,9 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c)
848 if (config5 & MIPS_CONF5_CA2) 848 if (config5 & MIPS_CONF5_CA2)
849 c->ases |= MIPS_ASE_MIPS16E2; 849 c->ases |= MIPS_ASE_MIPS16E2;
850 850
851 if (config5 & MIPS_CONF5_CRCP)
852 elf_hwcap |= HWCAP_MIPS_CRC32;
853
851 return config5 & MIPS_CONF_M; 854 return config5 & MIPS_CONF_M;
852} 855}
853 856