Skip to content

Commit 288752a

Browse files
KanjiMonsterralfbaechle
authored andcommitted
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>
1 parent aaf3fed commit 288752a

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

‎arch/mips/bcm63xx/cpu.c‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,21 @@ void __init bcm63xx_cpu_init(void)
228228
bcm63xx_irqs = bcm6345_irqs;
229229
break;
230230
case CPU_BMIPS4350:
231-
switch (read_c0_prid() & 0xf0) {
232-
case 0x10:
231+
if ((read_c0_prid() & 0xf0) == 0x10) {
233232
expected_cpu_id = BCM6358_CPU_ID;
234233
bcm63xx_regs_base = bcm6358_regs_base;
235234
bcm63xx_irqs = bcm6358_irqs;
236-
break;
237-
case 0x30:
238-
expected_cpu_id = BCM6368_CPU_ID;
239-
bcm63xx_regs_base = bcm6368_regs_base;
240-
bcm63xx_irqs = bcm6368_irqs;
241-
break;
235+
} else {
236+
/* all newer chips have the same chip id location */
237+
u16 chip_id = bcm_readw(BCM_6368_PERF_BASE);
238+
239+
switch (chip_id) {
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+
}
242246
}
243247
break;
244248
}

0 commit comments

Comments
 (0)