023-bcma-from-4.9.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --- a/drivers/bcma/driver_chipcommon.c
  2. +++ b/drivers/bcma/driver_chipcommon.c
  3. @@ -36,12 +36,31 @@ u32 bcma_chipco_get_alp_clock(struct bcm
  4. }
  5. EXPORT_SYMBOL_GPL(bcma_chipco_get_alp_clock);
  6. +static bool bcma_core_cc_has_pmu_watchdog(struct bcma_drv_cc *cc)
  7. +{
  8. + struct bcma_bus *bus = cc->core->bus;
  9. +
  10. + if (cc->capabilities & BCMA_CC_CAP_PMU) {
  11. + if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573) {
  12. + WARN(bus->chipinfo.rev <= 1, "No watchdog available\n");
  13. + /* 53573B0 and 53573B1 have bugged PMU watchdog. It can
  14. + * be enabled but timer can't be bumped. Use CC one
  15. + * instead.
  16. + */
  17. + return false;
  18. + }
  19. + return true;
  20. + } else {
  21. + return false;
  22. + }
  23. +}
  24. +
  25. static u32 bcma_chipco_watchdog_get_max_timer(struct bcma_drv_cc *cc)
  26. {
  27. struct bcma_bus *bus = cc->core->bus;
  28. u32 nb;
  29. - if (cc->capabilities & BCMA_CC_CAP_PMU) {
  30. + if (bcma_core_cc_has_pmu_watchdog(cc)) {
  31. if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
  32. nb = 32;
  33. else if (cc->core->id.rev < 26)
  34. @@ -95,9 +114,16 @@ static int bcma_chipco_watchdog_ticks_pe
  35. int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc)
  36. {
  37. + struct bcma_bus *bus = cc->core->bus;
  38. struct bcm47xx_wdt wdt = {};
  39. struct platform_device *pdev;
  40. + if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573 &&
  41. + bus->chipinfo.rev <= 1) {
  42. + pr_debug("No watchdog on 53573A0 / 53573A1\n");
  43. + return 0;
  44. + }
  45. +
  46. wdt.driver_data = cc;
  47. wdt.timer_set = bcma_chipco_watchdog_timer_set_wdt;
  48. wdt.timer_set_ms = bcma_chipco_watchdog_timer_set_ms_wdt;
  49. @@ -105,7 +131,7 @@ int bcma_chipco_watchdog_register(struct
  50. bcma_chipco_watchdog_get_max_timer(cc) / cc->ticks_per_ms;
  51. pdev = platform_device_register_data(NULL, "bcm47xx-wdt",
  52. - cc->core->bus->num, &wdt,
  53. + bus->num, &wdt,
  54. sizeof(wdt));
  55. if (IS_ERR(pdev))
  56. return PTR_ERR(pdev);
  57. @@ -217,7 +243,7 @@ u32 bcma_chipco_watchdog_timer_set(struc
  58. u32 maxt;
  59. maxt = bcma_chipco_watchdog_get_max_timer(cc);
  60. - if (cc->capabilities & BCMA_CC_CAP_PMU) {
  61. + if (bcma_core_cc_has_pmu_watchdog(cc)) {
  62. if (ticks == 1)
  63. ticks = 2;
  64. else if (ticks > maxt)
  65. --- a/include/linux/bcma/bcma.h
  66. +++ b/include/linux/bcma/bcma.h
  67. @@ -204,6 +204,9 @@ struct bcma_host_ops {
  68. #define BCMA_PKG_ID_BCM4709 0
  69. #define BCMA_CHIP_ID_BCM47094 53030
  70. #define BCMA_CHIP_ID_BCM53018 53018
  71. +#define BCMA_CHIP_ID_BCM53573 53573
  72. +#define BCMA_PKG_ID_BCM53573 0
  73. +#define BCMA_PKG_ID_BCM47189 1
  74. /* Board types (on PCI usually equals to the subsystem dev id) */
  75. /* BCM4313 */