aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/cpu-probe.c
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2010-10-16 17:22:30 -0400
committerRalf Baechle <ralf@linux-mips.org>2010-10-29 14:08:50 -0400
commit602977b0d672687909b0cb0542ede134ed6ef858 (patch)
tree8f40b3cfbf2cc32a445a69a548837521fcdfd7d6 /arch/mips/kernel/cpu-probe.c
parent3a9ab99e0341558e451327fbbfc39b0d3cff7e9a (diff)
MIPS: Decouple BMIPS CPU support from bcm47xx/bcm63xx SoC code
BMIPS processor cores are used in 50+ different chipsets spread across 5+ product lines. In many cases the chipsets do not share the same peripheral register layouts, the same register blocks, the same interrupt controllers, the same memory maps, or much of anything else. But, across radically different SoCs that share nothing more than the same BMIPS CPU, a few things are still mostly constant: SMP operations Access to performance counters DMA cache coherency quirks Cache and memory bus configuration So, it makes sense to treat each BMIPS processor type as a generic "building block," rather than tying it to a specific SoC. This makes it easier to support a large number of BMIPS-based chipsets without unnecessary duplication of code, and provides the infrastructure needed to support BMIPS-proprietary features. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Cc: mbizon@freebox.fr Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Tested-by: Florian Fainelli <ffainelli@freebox.fr> Patchwork: https://patchwork.linux-mips.org/patch/1706/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r--arch/mips/kernel/cpu-probe.c62
1 files changed, 33 insertions, 29 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index b9378cd0ce0d..f7faa3fb79b2 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -181,10 +181,10 @@ void __init check_wait(void)
181 case CPU_5KC: 181 case CPU_5KC:
182 case CPU_25KF: 182 case CPU_25KF:
183 case CPU_PR4450: 183 case CPU_PR4450:
184 case CPU_BCM3302: 184 case CPU_BMIPS3300:
185 case CPU_BCM6338: 185 case CPU_BMIPS4350:
186 case CPU_BCM6348: 186 case CPU_BMIPS4380:
187 case CPU_BCM6358: 187 case CPU_BMIPS5000:
188 case CPU_CAVIUM_OCTEON: 188 case CPU_CAVIUM_OCTEON:
189 case CPU_CAVIUM_OCTEON_PLUS: 189 case CPU_CAVIUM_OCTEON_PLUS:
190 case CPU_CAVIUM_OCTEON2: 190 case CPU_CAVIUM_OCTEON2:
@@ -903,33 +903,37 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
903{ 903{
904 decode_configs(c); 904 decode_configs(c);
905 switch (c->processor_id & 0xff00) { 905 switch (c->processor_id & 0xff00) {
906 case PRID_IMP_BCM3302: 906 case PRID_IMP_BMIPS32:
907 /* same as PRID_IMP_BCM6338 */ 907 c->cputype = CPU_BMIPS32;
908 c->cputype = CPU_BCM3302; 908 __cpu_name[cpu] = "Broadcom BMIPS32";
909 __cpu_name[cpu] = "Broadcom BCM3302"; 909 break;
910 break; 910 case PRID_IMP_BMIPS3300:
911 case PRID_IMP_BCM4710: 911 case PRID_IMP_BMIPS3300_ALT:
912 c->cputype = CPU_BCM4710; 912 case PRID_IMP_BMIPS3300_BUG:
913 __cpu_name[cpu] = "Broadcom BCM4710"; 913 c->cputype = CPU_BMIPS3300;
914 break; 914 __cpu_name[cpu] = "Broadcom BMIPS3300";
915 case PRID_IMP_BCM6345: 915 break;
916 c->cputype = CPU_BCM6345; 916 case PRID_IMP_BMIPS43XX: {
917 __cpu_name[cpu] = "Broadcom BCM6345"; 917 int rev = c->processor_id & 0xff;
918
919 if (rev >= PRID_REV_BMIPS4380_LO &&
920 rev <= PRID_REV_BMIPS4380_HI) {
921 c->cputype = CPU_BMIPS4380;
922 __cpu_name[cpu] = "Broadcom BMIPS4380";
923 } else {
924 c->cputype = CPU_BMIPS4350;
925 __cpu_name[cpu] = "Broadcom BMIPS4350";
926 }
918 break; 927 break;
919 case PRID_IMP_BCM6348: 928 }
920 c->cputype = CPU_BCM6348; 929 case PRID_IMP_BMIPS5000:
921 __cpu_name[cpu] = "Broadcom BCM6348"; 930 c->cputype = CPU_BMIPS5000;
931 __cpu_name[cpu] = "Broadcom BMIPS5000";
932 c->options |= MIPS_CPU_ULRI;
922 break; 933 break;
923 case PRID_IMP_BCM4350: 934 case PRID_IMP_BMIPS4KC:
924 switch (c->processor_id & 0xf0) { 935 c->cputype = CPU_4KC;
925 case PRID_REV_BCM6358: 936 __cpu_name[cpu] = "MIPS 4Kc";
926 c->cputype = CPU_BCM6358;
927 __cpu_name[cpu] = "Broadcom BCM6358";
928 break;
929 default:
930 c->cputype = CPU_UNKNOWN;
931 break;
932 }
933 break; 937 break;
934 } 938 }
935} 939}