diff options
author | David Daney <ddaney@caviumnetworks.com> | 2010-10-07 19:03:44 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-10-29 14:08:36 -0400 |
commit | f8bf7e688c226ba83b35a1547146e296e14b33c7 (patch) | |
tree | c46c98c7cb29e3c93d4b54c5e8e991e19485b79d /arch | |
parent | 1584d7f2d58999c00066a4afc4ad95e07b2a04e8 (diff) |
MIPS: Octeon: Handle Octeon II caches.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Patchwork: http://patchwork.linux-mips.org/patch/1664/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/mm/c-octeon.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c index 0f9c488044d1..16c4d256b76f 100644 --- a/arch/mips/mm/c-octeon.c +++ b/arch/mips/mm/c-octeon.c | |||
@@ -181,10 +181,10 @@ static void __cpuinit probe_octeon(void) | |||
181 | unsigned int config1; | 181 | unsigned int config1; |
182 | struct cpuinfo_mips *c = ¤t_cpu_data; | 182 | struct cpuinfo_mips *c = ¤t_cpu_data; |
183 | 183 | ||
184 | config1 = read_c0_config1(); | ||
184 | switch (c->cputype) { | 185 | switch (c->cputype) { |
185 | case CPU_CAVIUM_OCTEON: | 186 | case CPU_CAVIUM_OCTEON: |
186 | case CPU_CAVIUM_OCTEON_PLUS: | 187 | case CPU_CAVIUM_OCTEON_PLUS: |
187 | config1 = read_c0_config1(); | ||
188 | c->icache.linesz = 2 << ((config1 >> 19) & 7); | 188 | c->icache.linesz = 2 << ((config1 >> 19) & 7); |
189 | c->icache.sets = 64 << ((config1 >> 22) & 7); | 189 | c->icache.sets = 64 << ((config1 >> 22) & 7); |
190 | c->icache.ways = 1 + ((config1 >> 16) & 7); | 190 | c->icache.ways = 1 + ((config1 >> 16) & 7); |
@@ -204,6 +204,20 @@ static void __cpuinit probe_octeon(void) | |||
204 | c->options |= MIPS_CPU_PREFETCH; | 204 | c->options |= MIPS_CPU_PREFETCH; |
205 | break; | 205 | break; |
206 | 206 | ||
207 | case CPU_CAVIUM_OCTEON2: | ||
208 | c->icache.linesz = 2 << ((config1 >> 19) & 7); | ||
209 | c->icache.sets = 8; | ||
210 | c->icache.ways = 37; | ||
211 | c->icache.flags |= MIPS_CACHE_VTAG; | ||
212 | icache_size = c->icache.sets * c->icache.ways * c->icache.linesz; | ||
213 | |||
214 | c->dcache.linesz = 128; | ||
215 | c->dcache.ways = 32; | ||
216 | c->dcache.sets = 8; | ||
217 | dcache_size = c->dcache.sets * c->dcache.ways * c->dcache.linesz; | ||
218 | c->options |= MIPS_CPU_PREFETCH; | ||
219 | break; | ||
220 | |||
207 | default: | 221 | default: |
208 | panic("Unsupported Cavium Networks CPU type\n"); | 222 | panic("Unsupported Cavium Networks CPU type\n"); |
209 | break; | 223 | break; |