aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm47xx
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-09-18 07:32:59 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-10-29 16:24:07 -0400
commit2224de9d152b6fd9faa0df49cf55ca97eab772fa (patch)
tree80503a335a8b04d2a5d5cb71ea940af8a6de1df6 /arch/mips/bcm47xx
parent62cf3bc0b59cfb70a021784af914c6ea464d3af7 (diff)
MIPS: BCM47XX: Fix clock detection for BCM5354 with 200MHz clock
Some BCM5354 SoCs are running at 200MHz, but it is not possible to read the clock from a register like it is done on some other SoC in ssb and bcma. These devices should have a clkfreq nvram configuration value set to 200, read it and set the clock to the correct value. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5842/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/bcm47xx')
-rw-r--r--arch/mips/bcm47xx/time.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/mips/bcm47xx/time.c b/arch/mips/bcm47xx/time.c
index 536374dcba78..5e5d797fa90a 100644
--- a/arch/mips/bcm47xx/time.c
+++ b/arch/mips/bcm47xx/time.c
@@ -27,10 +27,14 @@
27#include <linux/ssb/ssb.h> 27#include <linux/ssb/ssb.h>
28#include <asm/time.h> 28#include <asm/time.h>
29#include <bcm47xx.h> 29#include <bcm47xx.h>
30#include <bcm47xx_nvram.h>
30 31
31void __init plat_time_init(void) 32void __init plat_time_init(void)
32{ 33{
33 unsigned long hz = 0; 34 unsigned long hz = 0;
35 u16 chip_id = 0;
36 char buf[10];
37 int len;
34 38
35 /* 39 /*
36 * Use deterministic values for initial counter interrupt 40 * Use deterministic values for initial counter interrupt
@@ -43,15 +47,23 @@ void __init plat_time_init(void)
43#ifdef CONFIG_BCM47XX_SSB 47#ifdef CONFIG_BCM47XX_SSB
44 case BCM47XX_BUS_TYPE_SSB: 48 case BCM47XX_BUS_TYPE_SSB:
45 hz = ssb_cpu_clock(&bcm47xx_bus.ssb.mipscore) / 2; 49 hz = ssb_cpu_clock(&bcm47xx_bus.ssb.mipscore) / 2;
50 chip_id = bcm47xx_bus.ssb.chip_id;
46 break; 51 break;
47#endif 52#endif
48#ifdef CONFIG_BCM47XX_BCMA 53#ifdef CONFIG_BCM47XX_BCMA
49 case BCM47XX_BUS_TYPE_BCMA: 54 case BCM47XX_BUS_TYPE_BCMA:
50 hz = bcma_cpu_clock(&bcm47xx_bus.bcma.bus.drv_mips) / 2; 55 hz = bcma_cpu_clock(&bcm47xx_bus.bcma.bus.drv_mips) / 2;
56 chip_id = bcm47xx_bus.bcma.bus.chipinfo.id;
51 break; 57 break;
52#endif 58#endif
53 } 59 }
54 60
61 if (chip_id == 0x5354) {
62 len = bcm47xx_nvram_getenv("clkfreq", buf, sizeof(buf));
63 if (len >= 0 && !strncmp(buf, "200", 4))
64 hz = 100000000;
65 }
66
55 if (!hz) 67 if (!hz)
56 hz = 100000000; 68 hz = 100000000;
57 69