mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 14:13:16 +00:00
74d00a8c38
* properly format/comment all patches * merge debloat patches * merge Kconfig patches * merge swconfig patches * merge hotplug patches * drop 200-fix_localversion.patch - upstream * drop 222-arm_zimage_none.patch - unused * drop 252-mv_cesa_depends.patch - no longer required * drop 410-mtd-move-forward-declaration-of-struct-mtd_info.patch - unused * drop 661-fq_codel_keep_dropped_stats.patch - outdated * drop 702-phy_add_aneg_done_function.patch - upstream * drop 840-rtc7301.patch - unused * drop 841-rtc_pt7c4338.patch - upstream * drop 921-use_preinit_as_init.patch - unused * drop spio-gpio-old and gpio-mmc - unused Signed-off-by: John Crispin <john@phrozen.org>
109 lines
3.2 KiB
Diff
109 lines
3.2 KiB
Diff
--- a/drivers/bcma/driver_chipcommon.c
|
|
+++ b/drivers/bcma/driver_chipcommon.c
|
|
@@ -36,12 +36,31 @@ u32 bcma_chipco_get_alp_clock(struct bcm
|
|
}
|
|
EXPORT_SYMBOL_GPL(bcma_chipco_get_alp_clock);
|
|
|
|
+static bool bcma_core_cc_has_pmu_watchdog(struct bcma_drv_cc *cc)
|
|
+{
|
|
+ struct bcma_bus *bus = cc->core->bus;
|
|
+
|
|
+ if (cc->capabilities & BCMA_CC_CAP_PMU) {
|
|
+ if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573) {
|
|
+ WARN(bus->chipinfo.rev <= 1, "No watchdog available\n");
|
|
+ /* 53573B0 and 53573B1 have bugged PMU watchdog. It can
|
|
+ * be enabled but timer can't be bumped. Use CC one
|
|
+ * instead.
|
|
+ */
|
|
+ return false;
|
|
+ }
|
|
+ return true;
|
|
+ } else {
|
|
+ return false;
|
|
+ }
|
|
+}
|
|
+
|
|
static u32 bcma_chipco_watchdog_get_max_timer(struct bcma_drv_cc *cc)
|
|
{
|
|
struct bcma_bus *bus = cc->core->bus;
|
|
u32 nb;
|
|
|
|
- if (cc->capabilities & BCMA_CC_CAP_PMU) {
|
|
+ if (bcma_core_cc_has_pmu_watchdog(cc)) {
|
|
if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
|
|
nb = 32;
|
|
else if (cc->core->id.rev < 26)
|
|
@@ -95,9 +114,16 @@ static int bcma_chipco_watchdog_ticks_pe
|
|
|
|
int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc)
|
|
{
|
|
+ struct bcma_bus *bus = cc->core->bus;
|
|
struct bcm47xx_wdt wdt = {};
|
|
struct platform_device *pdev;
|
|
|
|
+ if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53573 &&
|
|
+ bus->chipinfo.rev <= 1) {
|
|
+ pr_debug("No watchdog on 53573A0 / 53573A1\n");
|
|
+ return 0;
|
|
+ }
|
|
+
|
|
wdt.driver_data = cc;
|
|
wdt.timer_set = bcma_chipco_watchdog_timer_set_wdt;
|
|
wdt.timer_set_ms = bcma_chipco_watchdog_timer_set_ms_wdt;
|
|
@@ -105,7 +131,7 @@ int bcma_chipco_watchdog_register(struct
|
|
bcma_chipco_watchdog_get_max_timer(cc) / cc->ticks_per_ms;
|
|
|
|
pdev = platform_device_register_data(NULL, "bcm47xx-wdt",
|
|
- cc->core->bus->num, &wdt,
|
|
+ bus->num, &wdt,
|
|
sizeof(wdt));
|
|
if (IS_ERR(pdev))
|
|
return PTR_ERR(pdev);
|
|
@@ -217,7 +243,7 @@ u32 bcma_chipco_watchdog_timer_set(struc
|
|
u32 maxt;
|
|
|
|
maxt = bcma_chipco_watchdog_get_max_timer(cc);
|
|
- if (cc->capabilities & BCMA_CC_CAP_PMU) {
|
|
+ if (bcma_core_cc_has_pmu_watchdog(cc)) {
|
|
if (ticks == 1)
|
|
ticks = 2;
|
|
else if (ticks > maxt)
|
|
--- a/include/linux/bcma/bcma.h
|
|
+++ b/include/linux/bcma/bcma.h
|
|
@@ -204,6 +204,9 @@ struct bcma_host_ops {
|
|
#define BCMA_PKG_ID_BCM4709 0
|
|
#define BCMA_CHIP_ID_BCM47094 53030
|
|
#define BCMA_CHIP_ID_BCM53018 53018
|
|
+#define BCMA_CHIP_ID_BCM53573 53573
|
|
+#define BCMA_PKG_ID_BCM53573 0
|
|
+#define BCMA_PKG_ID_BCM47189 1
|
|
|
|
/* Board types (on PCI usually equals to the subsystem dev id) */
|
|
/* BCM4313 */
|
|
--- a/drivers/bcma/main.c
|
|
+++ b/drivers/bcma/main.c
|
|
@@ -209,6 +209,8 @@ static void bcma_of_fill_device(struct p
|
|
core->dev.of_node = node;
|
|
|
|
core->irq = bcma_of_get_irq(parent, core, 0);
|
|
+
|
|
+ of_dma_configure(&core->dev, node);
|
|
}
|
|
|
|
unsigned int bcma_core_irq(struct bcma_device *core, int num)
|
|
@@ -248,12 +250,12 @@ void bcma_prepare_core(struct bcma_bus *
|
|
core->irq = bus->host_pci->irq;
|
|
break;
|
|
case BCMA_HOSTTYPE_SOC:
|
|
- core->dev.dma_mask = &core->dev.coherent_dma_mask;
|
|
- if (bus->host_pdev) {
|
|
+ if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) {
|
|
core->dma_dev = &bus->host_pdev->dev;
|
|
core->dev.parent = &bus->host_pdev->dev;
|
|
bcma_of_fill_device(bus->host_pdev, core);
|
|
} else {
|
|
+ core->dev.dma_mask = &core->dev.coherent_dma_mask;
|
|
core->dma_dev = &core->dev;
|
|
}
|
|
break;
|