aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-12-05 12:45:59 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-12-06 14:58:56 -0500
commit56fd5f077223df1284a3501d1e3ba2e5b19d154a (patch)
treebb5497de18ab83940fb62d4dc2a888bff611e28c /drivers/bcma
parentbc245cc36c5687dd3fbf6d4a1b3c13d41f9cb189 (diff)
bcma: add bcma_chipco_alp_clock
For devices without a PMU the alp clock is always 20000000. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/driver_chipcommon.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/bcma/driver_chipcommon.c b/drivers/bcma/driver_chipcommon.c
index ffd74e51f02d..ef6855398b86 100644
--- a/drivers/bcma/driver_chipcommon.c
+++ b/drivers/bcma/driver_chipcommon.c
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright 2005, Broadcom Corporation 5 * Copyright 2005, Broadcom Corporation
6 * Copyright 2006, 2007, Michael Buesch <m@bues.ch> 6 * Copyright 2006, 2007, Michael Buesch <m@bues.ch>
7 * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
7 * 8 *
8 * Licensed under the GNU/GPL. See COPYING for details. 9 * Licensed under the GNU/GPL. See COPYING for details.
9 */ 10 */
@@ -22,6 +23,14 @@ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
22 return value; 23 return value;
23} 24}
24 25
26static u32 bcma_chipco_alp_clock(struct bcma_drv_cc *cc)
27{
28 if (cc->capabilities & BCMA_CC_CAP_PMU)
29 return bcma_pmu_alp_clock(cc);
30
31 return 20000000;
32}
33
25void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc) 34void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
26{ 35{
27 if (cc->early_setup_done) 36 if (cc->early_setup_done)
@@ -131,8 +140,7 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
131 struct bcma_serial_port *ports = cc->serial_ports; 140 struct bcma_serial_port *ports = cc->serial_ports;
132 141
133 if (ccrev >= 11 && ccrev != 15) { 142 if (ccrev >= 11 && ccrev != 15) {
134 /* Fixed ALP clock */ 143 baud_base = bcma_chipco_alp_clock(cc);
135 baud_base = bcma_pmu_alp_clock(cc);
136 if (ccrev >= 21) { 144 if (ccrev >= 21) {
137 /* Turn off UART clock before switching clocksource. */ 145 /* Turn off UART clock before switching clocksource. */
138 bcma_cc_write32(cc, BCMA_CC_CORECTL, 146 bcma_cc_write32(cc, BCMA_CC_CORECTL,