aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/c-r4k.c
diff options
context:
space:
mode:
authorChris Dearman <chris@mips.com>2006-06-20 12:15:20 -0400
committerRalf Baechle <ralf@linux-mips.org>2006-06-29 16:10:52 -0400
commit9318c51acd9689505850152cc98277a6d6f2d752 (patch)
tree7a8d49a377bed11ba2a45643c08af47f1222c51b /arch/mips/mm/c-r4k.c
parentf7a849153be3b66326b52dce0d07896b56cb4cd7 (diff)
[MIPS] MIPS32/MIPS64 secondary cache management
Signed-off-by: Chris Dearman <chris@mips.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/c-r4k.c')
-rw-r--r--arch/mips/mm/c-r4k.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 4a43924cd4fc..01450938db8b 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -1092,6 +1092,7 @@ static int __init probe_scache(void)
1092 1092
1093extern int r5k_sc_init(void); 1093extern int r5k_sc_init(void);
1094extern int rm7k_sc_init(void); 1094extern int rm7k_sc_init(void);
1095extern int mips_sc_init(void);
1095 1096
1096static void __init setup_scache(void) 1097static void __init setup_scache(void)
1097{ 1098{
@@ -1139,17 +1140,29 @@ static void __init setup_scache(void)
1139 return; 1140 return;
1140 1141
1141 default: 1142 default:
1143 if (c->isa_level == MIPS_CPU_ISA_M32R1 ||
1144 c->isa_level == MIPS_CPU_ISA_M32R2 ||
1145 c->isa_level == MIPS_CPU_ISA_M64R1 ||
1146 c->isa_level == MIPS_CPU_ISA_M64R2) {
1147#ifdef CONFIG_MIPS_CPU_SCACHE
1148 if (mips_sc_init ()) {
1149 scache_size = c->scache.ways * c->scache.sets * c->scache.linesz;
1150 printk("MIPS secondary cache %ldkB, %s, linesize %d bytes.\n",
1151 scache_size >> 10,
1152 way_string[c->scache.ways], c->scache.linesz);
1153 }
1154#else
1155 if (!(c->scache.flags & MIPS_CACHE_NOT_PRESENT))
1156 panic("Dunno how to handle MIPS32 / MIPS64 second level cache");
1157#endif
1158 return;
1159 }
1142 sc_present = 0; 1160 sc_present = 0;
1143 } 1161 }
1144 1162
1145 if (!sc_present) 1163 if (!sc_present)
1146 return; 1164 return;
1147 1165
1148 if ((c->isa_level == MIPS_CPU_ISA_M32R1 ||
1149 c->isa_level == MIPS_CPU_ISA_M64R1) &&
1150 !(c->scache.flags & MIPS_CACHE_NOT_PRESENT))
1151 panic("Dunno how to handle MIPS32 / MIPS64 second level cache");
1152
1153 /* compute a couple of other cache variables */ 1166 /* compute a couple of other cache variables */
1154 c->scache.waysize = scache_size / c->scache.ways; 1167 c->scache.waysize = scache_size / c->scache.ways;
1155 1168