aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2010-02-10 18:12:48 -0500
committerRalf Baechle <ralf@linux-mips.org>2010-02-27 06:53:26 -0500
commit6f329468f3086e9d8f3832930fdb09ab3769176b (patch)
treed77b274399cf101fba59b0de01fd9491b4e28fee /arch/mips
parent6dd9344cfc41bcc60a01cdc828cb278be7a10e01 (diff)
MIPS: Give Octeon+ CPUs their own cputype.
This allows us to treat them differently at runtime. Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/951/ Patchwork: http://patchwork.linux-mips.org/patch/987/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/cpu.h2
-rw-r--r--arch/mips/kernel/cpu-probe.c9
-rw-r--r--arch/mips/mm/c-octeon.c7
3 files changed, 12 insertions, 6 deletions
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index cf373a95fe4a..a5acda416946 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -224,7 +224,7 @@ enum cpu_type_enum {
224 * MIPS64 class processors 224 * MIPS64 class processors
225 */ 225 */
226 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, 226 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
227 CPU_CAVIUM_OCTEON, 227 CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS,
228 228
229 CPU_LAST 229 CPU_LAST
230}; 230};
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 9ea5ca89e85f..be5bb16be4e0 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -162,6 +162,7 @@ void __init check_wait(void)
162 case CPU_BCM6348: 162 case CPU_BCM6348:
163 case CPU_BCM6358: 163 case CPU_BCM6358:
164 case CPU_CAVIUM_OCTEON: 164 case CPU_CAVIUM_OCTEON:
165 case CPU_CAVIUM_OCTEON_PLUS:
165 cpu_wait = r4k_wait; 166 cpu_wait = r4k_wait;
166 break; 167 break;
167 168
@@ -911,12 +912,16 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
911 case PRID_IMP_CAVIUM_CN38XX: 912 case PRID_IMP_CAVIUM_CN38XX:
912 case PRID_IMP_CAVIUM_CN31XX: 913 case PRID_IMP_CAVIUM_CN31XX:
913 case PRID_IMP_CAVIUM_CN30XX: 914 case PRID_IMP_CAVIUM_CN30XX:
915 c->cputype = CPU_CAVIUM_OCTEON;
916 __cpu_name[cpu] = "Cavium Octeon";
917 goto platform;
914 case PRID_IMP_CAVIUM_CN58XX: 918 case PRID_IMP_CAVIUM_CN58XX:
915 case PRID_IMP_CAVIUM_CN56XX: 919 case PRID_IMP_CAVIUM_CN56XX:
916 case PRID_IMP_CAVIUM_CN50XX: 920 case PRID_IMP_CAVIUM_CN50XX:
917 case PRID_IMP_CAVIUM_CN52XX: 921 case PRID_IMP_CAVIUM_CN52XX:
918 c->cputype = CPU_CAVIUM_OCTEON; 922 c->cputype = CPU_CAVIUM_OCTEON_PLUS;
919 __cpu_name[cpu] = "Cavium Octeon"; 923 __cpu_name[cpu] = "Cavium Octeon+";
924platform:
920 if (cpu == 0) 925 if (cpu == 0)
921 __elf_platform = "octeon"; 926 __elf_platform = "octeon";
922 break; 927 break;
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c
index af85959e59f5..0f9c488044d1 100644
--- a/arch/mips/mm/c-octeon.c
+++ b/arch/mips/mm/c-octeon.c
@@ -183,6 +183,7 @@ static void __cpuinit probe_octeon(void)
183 183
184 switch (c->cputype) { 184 switch (c->cputype) {
185 case CPU_CAVIUM_OCTEON: 185 case CPU_CAVIUM_OCTEON:
186 case CPU_CAVIUM_OCTEON_PLUS:
186 config1 = read_c0_config1(); 187 config1 = read_c0_config1();
187 c->icache.linesz = 2 << ((config1 >> 19) & 7); 188 c->icache.linesz = 2 << ((config1 >> 19) & 7);
188 c->icache.sets = 64 << ((config1 >> 22) & 7); 189 c->icache.sets = 64 << ((config1 >> 22) & 7);
@@ -192,10 +193,10 @@ static void __cpuinit probe_octeon(void)
192 c->icache.sets * c->icache.ways * c->icache.linesz; 193 c->icache.sets * c->icache.ways * c->icache.linesz;
193 c->icache.waybit = ffs(icache_size / c->icache.ways) - 1; 194 c->icache.waybit = ffs(icache_size / c->icache.ways) - 1;
194 c->dcache.linesz = 128; 195 c->dcache.linesz = 128;
195 if (OCTEON_IS_MODEL(OCTEON_CN3XXX)) 196 if (c->cputype == CPU_CAVIUM_OCTEON_PLUS)
196 c->dcache.sets = 1; /* CN3XXX has one Dcache set */
197 else
198 c->dcache.sets = 2; /* CN5XXX has two Dcache sets */ 197 c->dcache.sets = 2; /* CN5XXX has two Dcache sets */
198 else
199 c->dcache.sets = 1; /* CN3XXX has one Dcache set */
199 c->dcache.ways = 64; 200 c->dcache.ways = 64;
200 dcache_size = 201 dcache_size =
201 c->dcache.sets * c->dcache.ways * c->dcache.linesz; 202 c->dcache.sets * c->dcache.ways * c->dcache.linesz;