aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2012-07-24 10:33:12 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-07-24 10:33:12 -0400
commit288752a8aa1be6cf89ee5066435a617efd97fb86 (patch)
tree233eca59b346fcf7febb039132ea0827a9192cfa /arch
parentaaf3fedb56c95b419eda4c5392e03ad9b82c4847 (diff)
MIPS: BCM63XX: Use the Chip ID register for identifying the SoC
Newer BCM63XX SoCs use virtually the same CPU ID, differing only in the revision bits. But since they all have the Chip ID register at the same location, we can use that to identify the SoC we are running on. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Cc: linux-mips@linux-mips.org Cc: Maxime Bizon <mbizon@freebox.fr> Cc: Florian Fainelli <florian@openwrt.org> Cc: Kevin Cernekee <cernekee@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/3955/ Reviewed-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/bcm63xx/cpu.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
index 8f0d6c7725ea..e3c1da59ea13 100644
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -228,17 +228,21 @@ void __init bcm63xx_cpu_init(void)
228 bcm63xx_irqs = bcm6345_irqs; 228 bcm63xx_irqs = bcm6345_irqs;
229 break; 229 break;
230 case CPU_BMIPS4350: 230 case CPU_BMIPS4350:
231 switch (read_c0_prid() & 0xf0) { 231 if ((read_c0_prid() & 0xf0) == 0x10) {
232 case 0x10:
233 expected_cpu_id = BCM6358_CPU_ID; 232 expected_cpu_id = BCM6358_CPU_ID;
234 bcm63xx_regs_base = bcm6358_regs_base; 233 bcm63xx_regs_base = bcm6358_regs_base;
235 bcm63xx_irqs = bcm6358_irqs; 234 bcm63xx_irqs = bcm6358_irqs;
236 break; 235 } else {
237 case 0x30: 236 /* all newer chips have the same chip id location */
238 expected_cpu_id = BCM6368_CPU_ID; 237 u16 chip_id = bcm_readw(BCM_6368_PERF_BASE);
239 bcm63xx_regs_base = bcm6368_regs_base; 238
240 bcm63xx_irqs = bcm6368_irqs; 239 switch (chip_id) {
241 break; 240 case BCM6368_CPU_ID:
241 expected_cpu_id = BCM6368_CPU_ID;
242 bcm63xx_regs_base = bcm6368_regs_base;
243 bcm63xx_irqs = bcm6368_irqs;
244 break;
245 }
242 } 246 }
243 break; 247 break;
244 } 248 }