brcm47xx: fix cpu clock detection on ASUS WL-520gU
[openwrt.git] / target / linux / brcm47xx / patches-3.6 / 552-ssb-extif-add-check-for-max-value-in-watchdog.patch
1 --- a/drivers/ssb/driver_extif.c
2 +++ b/drivers/ssb/driver_extif.c
3 @@ -112,9 +112,10 @@ void ssb_extif_get_clockcontrol(struct s
4         *m = extif_read32(extif, SSB_EXTIF_CLOCK_SB);
5  }
6  
7 -void ssb_extif_watchdog_timer_set(struct ssb_extif *extif,
8 -                                 u32 ticks)
9 +void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
10  {
11 +       if (ticks > SSB_EXTIF_WATCHDOG_MAX_TIMER)
12 +               ticks = SSB_EXTIF_WATCHDOG_MAX_TIMER;
13         extif_write32(extif, SSB_EXTIF_WATCHDOG, ticks);
14  }
15  
16 --- a/include/linux/ssb/ssb_driver_extif.h
17 +++ b/include/linux/ssb/ssb_driver_extif.h
18 @@ -152,6 +152,7 @@
19  /* watchdog */
20  #define SSB_EXTIF_WATCHDOG_CLK         48000000        /* Hz */
21  
22 +#define SSB_EXTIF_WATCHDOG_MAX_TIMER   ((1 << 28) - 1)
23  
24  
25  #ifdef CONFIG_SSB_DRIVER_EXTIF