summaryrefslogtreecommitdiff
path: root/arch/nds32/kernel/setup.c
diff options
context:
space:
mode:
authorNylon Chen <nylon7@andestech.com>2018-11-08 19:28:15 +0800
committerGreentime Hu <greentime@andestech.com>2018-11-22 18:13:51 +0800
commite2f3f8b4a497d26bdcd55a53246ec2e613ae0fd4 (patch)
treec6cbc184ba802977d2f2bfa44e238e697b4455ac /arch/nds32/kernel/setup.c
parenta5234068e6dc18ae5300d678fbf3e129d9b93f78 (diff)
nds32: support hardware prefetcher
We add a config for user to enable or disable this feature. It can be used to control the hardware prefetch function. Signed-off-by: Nylon Chen <nylon7@andestech.com> Acked-by: Greentime Hu <greentime@andestech.com> Signed-off-by: Greentime Hu <greentime@andestech.com>
Diffstat (limited to 'arch/nds32/kernel/setup.c')
-rw-r--r--arch/nds32/kernel/setup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/nds32/kernel/setup.c b/arch/nds32/kernel/setup.c
index 4b774ca433a9..31d29d92478e 100644
--- a/arch/nds32/kernel/setup.c
+++ b/arch/nds32/kernel/setup.c
@@ -39,6 +39,7 @@
#define HWCAP_FPU_DP 0x040000
#define HWCAP_V2 0x080000
#define HWCAP_DX_REGS 0x100000
+#define HWCAP_HWPRE 0x200000
unsigned long cpu_id, cpu_rev, cpu_cfgid;
bool has_fpu = false;
@@ -75,6 +76,7 @@ static const char *hwcap_str[] = {
"fpu_dp",
"v2",
"dx_regs",
+ "hw_pre",
NULL,
};
@@ -221,6 +223,11 @@ static void __init setup_cpuinfo(void)
if (__nds32__mfsr(NDS32_SR_MSC_CFG) & MSC_CFG_mskL2C)
elf_hwcap |= HWCAP_L2C;
+#ifdef CONFIG_HW_PRE
+ if (__nds32__mfsr(NDS32_SR_MISC_CTL) & MISC_CTL_makHWPRE_EN)
+ elf_hwcap |= HWCAP_HWPRE;
+#endif
+
tmp = __nds32__mfsr(NDS32_SR_CACHE_CTL);
if (!IS_ENABLED(CONFIG_CPU_DCACHE_DISABLE))
tmp |= CACHE_CTL_mskDC_EN;