Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/

authored by

Marcin Nowakowski and committed by
James Hogan
256211f2 ab3d8441

+5
+1
arch/mips/include/asm/mipsregs.h
··· 664 664 #define MIPS_CONF5_FRE (_ULCAST_(1) << 8) 665 665 #define MIPS_CONF5_UFE (_ULCAST_(1) << 9) 666 666 #define MIPS_CONF5_CA2 (_ULCAST_(1) << 14) 667 + #define MIPS_CONF5_CRCP (_ULCAST_(1) << 18) 667 668 #define MIPS_CONF5_MSAEN (_ULCAST_(1) << 27) 668 669 #define MIPS_CONF5_EVA (_ULCAST_(1) << 28) 669 670 #define MIPS_CONF5_CV (_ULCAST_(1) << 29)
+1
arch/mips/include/uapi/asm/hwcap.h
··· 5 5 /* HWCAP flags */ 6 6 #define HWCAP_MIPS_R6 (1 << 0) 7 7 #define HWCAP_MIPS_MSA (1 << 1) 8 + #define HWCAP_MIPS_CRC32 (1 << 2) 8 9 9 10 #endif /* _UAPI_ASM_HWCAP_H */
+3
arch/mips/kernel/cpu-probe.c
··· 848 848 if (config5 & MIPS_CONF5_CA2) 849 849 c->ases |= MIPS_ASE_MIPS16E2; 850 850 851 + if (config5 & MIPS_CONF5_CRCP) 852 + elf_hwcap |= HWCAP_MIPS_CRC32; 853 + 851 854 return config5 & MIPS_CONF_M; 852 855 } 853 856