提交 288752a8 编写于 作者: J Jonas Gorski 提交者: Ralf Baechle

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: NJonas 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: NFlorian Fainelli <florian@openwrt.org>
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 aaf3fedb
...@@ -228,17 +228,21 @@ void __init bcm63xx_cpu_init(void) ...@@ -228,17 +228,21 @@ void __init bcm63xx_cpu_init(void)
bcm63xx_irqs = bcm6345_irqs; bcm63xx_irqs = bcm6345_irqs;
break; break;
case CPU_BMIPS4350: case CPU_BMIPS4350:
switch (read_c0_prid() & 0xf0) { if ((read_c0_prid() & 0xf0) == 0x10) {
case 0x10:
expected_cpu_id = BCM6358_CPU_ID; expected_cpu_id = BCM6358_CPU_ID;
bcm63xx_regs_base = bcm6358_regs_base; bcm63xx_regs_base = bcm6358_regs_base;
bcm63xx_irqs = bcm6358_irqs; bcm63xx_irqs = bcm6358_irqs;
break; } else {
case 0x30: /* all newer chips have the same chip id location */
expected_cpu_id = BCM6368_CPU_ID; u16 chip_id = bcm_readw(BCM_6368_PERF_BASE);
bcm63xx_regs_base = bcm6368_regs_base;
bcm63xx_irqs = bcm6368_irqs; switch (chip_id) {
break; case BCM6368_CPU_ID:
expected_cpu_id = BCM6368_CPU_ID;
bcm63xx_regs_base = bcm6368_regs_base;
bcm63xx_irqs = bcm6368_irqs;
break;
}
} }
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册