1 --- a/drivers/bcma/driver_chipcommon.c
2 +++ b/drivers/bcma/driver_chipcommon.c
3 @@ -31,6 +31,28 @@ static u32 bcma_chipco_alp_clock(struct
7 +static u32 bcma_chipco_watchdog_get_max_timer(struct bcma_drv_cc *cc)
9 + struct bcma_bus *bus = cc->core->bus;
12 + if (cc->capabilities & BCMA_CC_CAP_PMU) {
13 + if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
15 + else if (cc->core->id.rev < 26)
18 + nb = (cc->core->id.rev >= 37) ? 32 : 24;
25 + return (1 << nb) - 1;
29 void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
31 if (cc->early_setup_done)
32 @@ -87,8 +109,23 @@ void bcma_core_chipcommon_init(struct bc
33 /* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
34 void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks)
37 - bcma_cc_write32(cc, BCMA_CC_WATCHDOG, ticks);
39 + enum bcma_clkmode clkmode;
41 + maxt = bcma_chipco_watchdog_get_max_timer(cc);
42 + if (cc->capabilities & BCMA_CC_CAP_PMU) {
45 + else if (ticks > maxt)
47 + bcma_cc_write32(cc, BCMA_CC_PMU_WATCHDOG, ticks);
49 + clkmode = ticks ? BCMA_CLKMODE_FAST : BCMA_CLKMODE_DYNAMIC;
50 + bcma_core_set_clockmode(cc->core, clkmode);
53 + bcma_cc_write32(cc, BCMA_CC_WATCHDOG, ticks);
57 void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value)