diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2014-01-30 12:21:29 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-03-06 15:25:21 -0500 |
commit | 02dc6bfb080e8205aacea5c4b4dd6a9bd4c9406e (patch) | |
tree | 08224e4eb6d1b1471cc3322b626250e2d82bce7e /arch | |
parent | 0414855fdc4a40da05221fc6062cccbc0c30f169 (diff) |
MIPS: mm: c-r4k: Detect instruction cache aliases
The *Aptiv cores can use the CONF7/IAR bit to detect if the core
has hardware support to remove instruction cache aliasing.
This also defines the CONF7/AR bit in order to avoid using
the '16' magic number.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6499/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/include/asm/mipsregs.h | 3 | ||||
-rw-r--r-- | arch/mips/mm/c-r4k.c | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index bbc3dd4294bc..0c746176d31c 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
@@ -653,6 +653,9 @@ | |||
653 | 653 | ||
654 | #define MIPS_CONF7_RPS (_ULCAST_(1) << 2) | 654 | #define MIPS_CONF7_RPS (_ULCAST_(1) << 2) |
655 | 655 | ||
656 | #define MIPS_CONF7_IAR (_ULCAST_(1) << 10) | ||
657 | #define MIPS_CONF7_AR (_ULCAST_(1) << 16) | ||
658 | |||
656 | /* EntryHI bit definition */ | 659 | /* EntryHI bit definition */ |
657 | #define MIPS_ENTRYHI_EHINV (_ULCAST_(1) << 10) | 660 | #define MIPS_ENTRYHI_EHINV (_ULCAST_(1) << 10) |
658 | 661 | ||
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index c14259edd53f..8f1d549d5132 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -1117,9 +1117,14 @@ static void probe_pcache(void) | |||
1117 | case CPU_PROAPTIV: | 1117 | case CPU_PROAPTIV: |
1118 | if (current_cpu_type() == CPU_74K) | 1118 | if (current_cpu_type() == CPU_74K) |
1119 | alias_74k_erratum(c); | 1119 | alias_74k_erratum(c); |
1120 | if ((read_c0_config7() & (1 << 16))) { | 1120 | if (!(read_c0_config7() & MIPS_CONF7_IAR) && |
1121 | /* effectively physically indexed dcache, | 1121 | (c->icache.waysize > PAGE_SIZE)) |
1122 | thus no virtual aliases. */ | 1122 | c->icache.flags |= MIPS_CACHE_ALIASES; |
1123 | if (read_c0_config7() & MIPS_CONF7_AR) { | ||
1124 | /* | ||
1125 | * Effectively physically indexed dcache, | ||
1126 | * thus no virtual aliases. | ||
1127 | */ | ||
1123 | c->dcache.flags |= MIPS_CACHE_PINDEX; | 1128 | c->dcache.flags |= MIPS_CACHE_PINDEX; |
1124 | break; | 1129 | break; |
1125 | } | 1130 | } |