1 From d831de57b1995eff51f43310b4bbfa85b1a3df42 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Fri, 30 Dec 2011 02:37:47 +0100
4 Subject: [PATCH 38/79] MIPS: BCM63XX: use the Chip ID register for
7 Newer BCM63XX SoCs use virtually the same cpu ID. But since they all have
8 the Chip ID register at the same location, we can use that to identify
9 the SoC we are running on.
11 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
13 arch/mips/bcm63xx/cpu.c | 20 ++++++++++++--------
14 1 file changed, 12 insertions(+), 8 deletions(-)
16 --- a/arch/mips/bcm63xx/cpu.c
17 +++ b/arch/mips/bcm63xx/cpu.c
18 @@ -228,17 +228,21 @@ void __init bcm63xx_cpu_init(void)
19 bcm63xx_irqs = bcm6345_irqs;
22 - switch (read_c0_prid() & 0xf0) {
24 + if ((read_c0_prid() & 0xf0) == 0x10) {
25 expected_cpu_id = BCM6358_CPU_ID;
26 bcm63xx_regs_base = bcm6358_regs_base;
27 bcm63xx_irqs = bcm6358_irqs;
30 - expected_cpu_id = BCM6368_CPU_ID;
31 - bcm63xx_regs_base = bcm6368_regs_base;
32 - bcm63xx_irqs = bcm6368_irqs;
35 + /* all newer chips have the same chip id location */
36 + u16 chip_id = bcm_readw(BCM_6368_PERF_BASE);
39 + case BCM6368_CPU_ID:
40 + expected_cpu_id = BCM6368_CPU_ID;
41 + bcm63xx_regs_base = bcm6368_regs_base;
42 + bcm63xx_irqs = bcm6368_irqs;