diff options
author | Huacai Chen <chenhc@lemote.com> | 2016-03-02 20:45:11 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-05-13 08:02:14 -0400 |
commit | 06e4814eec988f7ee01c29762f945b3ff59355fb (patch) | |
tree | d23c5f9cf1b096b3bc67f458a6b0984b664d7cbf /arch/mips/kernel/cpu-probe.c | |
parent | 37fbe8faa94fa8cae889a3a793fd7b32508b26ab (diff) |
MIPS: Loongson: Invalidate special TLBs when needed
Loongson-2 has a 4 entry itlb which is a subset of jtlb, Loongson-3 has
a 4 entry itlb and a 4 entry dtlb which are subsets of jtlb. We should
write diag register to invalidate itlb/dtlb when flushing jtlb because
itlb/dtlb are not totally transparent to software.
For Loongson-3A R2 (and newer), we should invalidate ITLB, DTLB, VTLB
and FTLB before we enable/disable FTLB.
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Steven J . Hill <sjhill@realitydiluted.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12753/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 2bfd48375b46..515dd1f8901e 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -563,6 +563,9 @@ static int set_ftlb_enable(struct cpuinfo_mips *c, int enable) | |||
563 | << MIPS_CONF7_FTLBP_SHIFT)); | 563 | << MIPS_CONF7_FTLBP_SHIFT)); |
564 | break; | 564 | break; |
565 | case CPU_LOONGSON3: | 565 | case CPU_LOONGSON3: |
566 | /* Flush ITLB, DTLB, VTLB and FTLB */ | ||
567 | write_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB | | ||
568 | LOONGSON_DIAG_VTLB | LOONGSON_DIAG_FTLB); | ||
566 | /* Loongson-3 cores use Config6 to enable the FTLB */ | 569 | /* Loongson-3 cores use Config6 to enable the FTLB */ |
567 | config = read_c0_config6(); | 570 | config = read_c0_config6(); |
568 | if (enable) | 571 | if (enable) |