aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2008-12-11 18:33:26 -0500
committerRalf Baechle <ralf@linux-mips.org>2009-01-11 04:57:22 -0500
commit0dd4781bca56871434507ed35d5bb8ef92077907 (patch)
tree70304b84fd7a264a4e1756c485ad5a0bf1630282 /arch
parent25c3000300163e2ebf68d94425088de35ead3d76 (diff)
MIPS: Add Cavium OCTEON processor constants and CPU probe.
Add OCTEON constants to asm/cpu.h and asm/module.h. Add probe function for Cavium OCTEON CPUs and hook it up. Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com> Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/cpu.h14
-rw-r--r--arch/mips/include/asm/module.h2
-rw-r--r--arch/mips/kernel/cpu-probe.c25
3 files changed, 41 insertions, 0 deletions
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 229a786101d9..c018727c7ddc 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -33,6 +33,7 @@
33#define PRID_COMP_TOSHIBA 0x070000 33#define PRID_COMP_TOSHIBA 0x070000
34#define PRID_COMP_LSI 0x080000 34#define PRID_COMP_LSI 0x080000
35#define PRID_COMP_LEXRA 0x0b0000 35#define PRID_COMP_LEXRA 0x0b0000
36#define PRID_COMP_CAVIUM 0x0d0000
36 37
37 38
38/* 39/*
@@ -114,6 +115,18 @@
114#define PRID_IMP_BCM3302 0x9000 115#define PRID_IMP_BCM3302 0x9000
115 116
116/* 117/*
118 * These are the PRID's for when 23:16 == PRID_COMP_CAVIUM
119 */
120
121#define PRID_IMP_CAVIUM_CN38XX 0x0000
122#define PRID_IMP_CAVIUM_CN31XX 0x0100
123#define PRID_IMP_CAVIUM_CN30XX 0x0200
124#define PRID_IMP_CAVIUM_CN58XX 0x0300
125#define PRID_IMP_CAVIUM_CN56XX 0x0400
126#define PRID_IMP_CAVIUM_CN50XX 0x0600
127#define PRID_IMP_CAVIUM_CN52XX 0x0700
128
129/*
117 * Definitions for 7:0 on legacy processors 130 * Definitions for 7:0 on legacy processors
118 */ 131 */
119 132
@@ -203,6 +216,7 @@ enum cpu_type_enum {
203 * MIPS64 class processors 216 * MIPS64 class processors
204 */ 217 */
205 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, 218 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
219 CPU_CAVIUM_OCTEON,
206 220
207 CPU_LAST 221 CPU_LAST
208}; 222};
diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h
index e2e09b2cd265..d94085a3eafb 100644
--- a/arch/mips/include/asm/module.h
+++ b/arch/mips/include/asm/module.h
@@ -116,6 +116,8 @@ search_module_dbetables(unsigned long addr)
116#define MODULE_PROC_FAMILY "SB1 " 116#define MODULE_PROC_FAMILY "SB1 "
117#elif defined CONFIG_CPU_LOONGSON2 117#elif defined CONFIG_CPU_LOONGSON2
118#define MODULE_PROC_FAMILY "LOONGSON2 " 118#define MODULE_PROC_FAMILY "LOONGSON2 "
119#elif defined CONFIG_CPU_CAVIUM_OCTEON
120#define MODULE_PROC_FAMILY "OCTEON "
119#else 121#else
120#error MODULE_PROC_FAMILY undefined for your processor configuration 122#error MODULE_PROC_FAMILY undefined for your processor configuration
121#endif 123#endif
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index c9207b5fd923..6b3c63dd1818 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -154,6 +154,7 @@ void __init check_wait(void)
154 case CPU_25KF: 154 case CPU_25KF:
155 case CPU_PR4450: 155 case CPU_PR4450:
156 case CPU_BCM3302: 156 case CPU_BCM3302:
157 case CPU_CAVIUM_OCTEON:
157 cpu_wait = r4k_wait; 158 cpu_wait = r4k_wait;
158 break; 159 break;
159 160
@@ -875,6 +876,27 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
875 } 876 }
876} 877}
877 878
879static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
880{
881 decode_configs(c);
882 switch (c->processor_id & 0xff00) {
883 case PRID_IMP_CAVIUM_CN38XX:
884 case PRID_IMP_CAVIUM_CN31XX:
885 case PRID_IMP_CAVIUM_CN30XX:
886 case PRID_IMP_CAVIUM_CN58XX:
887 case PRID_IMP_CAVIUM_CN56XX:
888 case PRID_IMP_CAVIUM_CN50XX:
889 case PRID_IMP_CAVIUM_CN52XX:
890 c->cputype = CPU_CAVIUM_OCTEON;
891 __cpu_name[cpu] = "Cavium Octeon";
892 break;
893 default:
894 printk(KERN_INFO "Unknown Octeon chip!\n");
895 c->cputype = CPU_UNKNOWN;
896 break;
897 }
898}
899
878const char *__cpu_name[NR_CPUS]; 900const char *__cpu_name[NR_CPUS];
879 901
880__cpuinit void cpu_probe(void) 902__cpuinit void cpu_probe(void)
@@ -909,6 +931,9 @@ __cpuinit void cpu_probe(void)
909 case PRID_COMP_NXP: 931 case PRID_COMP_NXP:
910 cpu_probe_nxp(c, cpu); 932 cpu_probe_nxp(c, cpu);
911 break; 933 break;
934 case PRID_COMP_CAVIUM:
935 cpu_probe_cavium(c, cpu);
936 break;
912 } 937 }
913 938
914 BUG_ON(!__cpu_name[cpu]); 939 BUG_ON(!__cpu_name[cpu]);