aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>2013-11-14 11:12:23 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-01-22 14:18:58 -0500
commit1745c1ef88c095a99c95d13b275774d18774465d (patch)
tree9ea07338f8852f3a6db815e8ce945023c99248ad /arch
parentc01905eeee579db98dd6b39d3f41497065ecc273 (diff)
MIPS: features: Add initial support for TLBINVF capable cores
New Aptiv cores support the TLBINVF instruction for flushing the VTLB. Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6130/
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/cpu-features.h3
-rw-r--r--arch/mips/include/asm/cpu.h1
-rw-r--r--arch/mips/kernel/cpu-probe.c5
3 files changed, 9 insertions, 0 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index d445d060e346..296606b19186 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -20,6 +20,9 @@
20#ifndef cpu_has_tlb 20#ifndef cpu_has_tlb
21#define cpu_has_tlb (cpu_data[0].options & MIPS_CPU_TLB) 21#define cpu_has_tlb (cpu_data[0].options & MIPS_CPU_TLB)
22#endif 22#endif
23#ifndef cpu_has_tlbinv
24#define cpu_has_tlbinv (cpu_data[0].options & MIPS_CPU_TLBINV)
25#endif
23 26
24/* 27/*
25 * For the moment we don't consider R6000 and R8000 so we can assume that 28 * For the moment we don't consider R6000 and R8000 so we can assume that
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index e71b49156c0c..e0a215f33d45 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -351,6 +351,7 @@ enum cpu_type_enum {
351#define MIPS_CPU_PCI 0x00400000 /* CPU has Perf Ctr Int indicator */ 351#define MIPS_CPU_PCI 0x00400000 /* CPU has Perf Ctr Int indicator */
352#define MIPS_CPU_RIXI 0x00800000 /* CPU has TLB Read/eXec Inhibit */ 352#define MIPS_CPU_RIXI 0x00800000 /* CPU has TLB Read/eXec Inhibit */
353#define MIPS_CPU_MICROMIPS 0x01000000 /* CPU has microMIPS capability */ 353#define MIPS_CPU_MICROMIPS 0x01000000 /* CPU has microMIPS capability */
354#define MIPS_CPU_TLBINV 0x02000000 /* CPU supports TLBINV/F */
354 355
355/* 356/*
356 * CPU ASE encodings 357 * CPU ASE encodings
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index e2b2d2043701..a284e8cb8c28 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -286,6 +286,11 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c)
286 && cpu_has_tlb) 286 && cpu_has_tlb)
287 c->tlbsize += (config4 & MIPS_CONF4_MMUSIZEEXT) * 0x40; 287 c->tlbsize += (config4 & MIPS_CONF4_MMUSIZEEXT) * 0x40;
288 288
289 if (cpu_has_tlb) {
290 if (((config4 & MIPS_CONF4_IE) >> 29) == 2)
291 c->options |= MIPS_CPU_TLBINV;
292 }
293
289 c->kscratch_mask = (config4 >> 16) & 0xff; 294 c->kscratch_mask = (config4 >> 16) & 0xff;
290 295
291 return config4 & MIPS_CONF_M; 296 return config4 & MIPS_CONF_M;