1 From 78921f39c6495203bbbf4207c442c2b59f8f11c0 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Mon, 25 Jul 2016 18:03:17 +0200
4 Subject: [PATCH] bcma: support BCM53573 series of wireless SoCs
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 BCM53573 seems to be the first series of Northstar family with wireless
10 on the chip. The base models are BCM53573-s (A0, A1) and there is also
11 BCM47189B0 which seems to be some small modification.
13 The only problem with these chipsets seems to be watchdog. It's totally
14 unavailable on 53573A0 / 53573A1 and preferable PMU watchdog is broken
17 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
19 drivers/bcma/driver_chipcommon.c | 32 +++++++++++++++++++++++++++++---
20 include/linux/bcma/bcma.h | 3 +++
21 2 files changed, 32 insertions(+), 3 deletions(-)
23 --- a/drivers/bcma/driver_chipcommon.c
24 +++ b/drivers/bcma/driver_chipcommon.c
25 @@ -36,12 +36,31 @@ u32 bcma_chipco_get_alp_clock(struct bcm
27 EXPORT_SYMBOL_GPL(bcma_chipco_get_alp_clock);
29 +static bool bcma_core_cc_has_pmu_watchdog(struct bcma_drv_cc *cc)
31 + struct bcma_bus *bus = cc->core->bus;
33 + if (cc->capabilities & BCMA_CC_CAP_PMU) {
34 + if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573) {
35 + WARN(bus->chipinfo.rev <= 1, "No watchdog available\n");
36 + /* 53573B0 and 53573B1 have bugged PMU watchdog. It can
37 + * be enabled but timer can't be bumped. Use CC one
48 static u32 bcma_chipco_watchdog_get_max_timer(struct bcma_drv_cc *cc)
50 struct bcma_bus *bus = cc->core->bus;
53 - if (cc->capabilities & BCMA_CC_CAP_PMU) {
54 + if (bcma_core_cc_has_pmu_watchdog(cc)) {
55 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
57 else if (cc->core->id.rev < 26)
58 @@ -95,9 +114,16 @@ static int bcma_chipco_watchdog_ticks_pe
60 int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc)
62 + struct bcma_bus *bus = cc->core->bus;
63 struct bcm47xx_wdt wdt = {};
64 struct platform_device *pdev;
66 + if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573 &&
67 + bus->chipinfo.rev <= 1) {
68 + pr_debug("No watchdog on 53573A0 / 53573A1\n");
73 wdt.timer_set = bcma_chipco_watchdog_timer_set_wdt;
74 wdt.timer_set_ms = bcma_chipco_watchdog_timer_set_ms_wdt;
75 @@ -105,7 +131,7 @@ int bcma_chipco_watchdog_register(struct
76 bcma_chipco_watchdog_get_max_timer(cc) / cc->ticks_per_ms;
78 pdev = platform_device_register_data(NULL, "bcm47xx-wdt",
79 - cc->core->bus->num, &wdt,
84 @@ -217,7 +243,7 @@ u32 bcma_chipco_watchdog_timer_set(struc
87 maxt = bcma_chipco_watchdog_get_max_timer(cc);
88 - if (cc->capabilities & BCMA_CC_CAP_PMU) {
89 + if (bcma_core_cc_has_pmu_watchdog(cc)) {
92 else if (ticks > maxt)
93 --- a/include/linux/bcma/bcma.h
94 +++ b/include/linux/bcma/bcma.h
95 @@ -204,6 +204,9 @@ struct bcma_host_ops {
96 #define BCMA_PKG_ID_BCM4709 0
97 #define BCMA_CHIP_ID_BCM47094 53030
98 #define BCMA_CHIP_ID_BCM53018 53018
99 +#define BCMA_CHIP_ID_BCM53573 53573
100 +#define BCMA_PKG_ID_BCM53573 0
101 +#define BCMA_PKG_ID_BCM47189 1
103 /* Board types (on PCI usually equals to the subsystem dev id) */