Skip to content

Commit 354b8bf

Browse files
committed
Merge tag 'linux-watchdog-5.18-rc1' of git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck: - add support for BCM4908 - renesas_wdt: add R-Car Gen4 support - improve watchdog_dev function documentation - sp5100_tco: replace the cd6h/cd7h port I/O with MMIO accesses during initialization - several other small improvements and fixes * tag 'linux-watchdog-5.18-rc1' of git://www.linux-watchdog.org/linux-watchdog: Watchdog: sp5100_tco: Enable Family 17h+ CPUs Watchdog: sp5100_tco: Add initialization using EFCH MMIO Watchdog: sp5100_tco: Refactor MMIO base address initialization Watchdog: sp5100_tco: Move timer initialization into function watchdog: ixp4xx: Implement restart watchdog: orion_wdt: support pretimeout on Armada-XP watchdog: allow building BCM7038_WDT for BCM4908 watchdog: renesas_wdt: Add R-Car Gen4 support dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support watchdog: Improve watchdog_dev function documentation watchdog: aspeed: add nowayout support watchdog: rti-wdt: Add missing pm_runtime_disable() in probe function watchdog: imx2_wdg: Alow ping on suspend
2 parents d4f1db7 + 8262703 commit 354b8bf

File tree

11 files changed

+409
-246
lines changed

11 files changed

+409
-246
lines changed

Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ properties:
5555
- renesas,r8a779a0-wdt # R-Car V3U
5656
- const: renesas,rcar-gen3-wdt # R-Car Gen3 and RZ/G2
5757

58+
- items:
59+
- enum:
60+
- renesas,r8a779f0-wdt # R-Car S4-8
61+
- const: renesas,rcar-gen4-wdt # R-Car Gen4
62+
5863
reg:
5964
maxItems: 1
6065

drivers/watchdog/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ config BCM7038_WDT
17791779
tristate "BCM63xx/BCM7038 Watchdog"
17801780
select WATCHDOG_CORE
17811781
depends on HAS_IOMEM
1782-
depends on ARCH_BRCMSTB || BMIPS_GENERIC || BCM63XX || COMPILE_TEST
1782+
depends on ARCH_BCM4908 || ARCH_BRCMSTB || BMIPS_GENERIC || BCM63XX || COMPILE_TEST
17831783
help
17841784
Watchdog driver for the built-in hardware in Broadcom 7038 and
17851785
later SoCs used in set-top boxes. BCM7038 was made public

drivers/watchdog/aspeed_wdt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
#include <linux/platform_device.h>
1414
#include <linux/watchdog.h>
1515

16+
static bool nowayout = WATCHDOG_NOWAYOUT;
17+
module_param(nowayout, bool, 0);
18+
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
19+
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
20+
1621
struct aspeed_wdt {
1722
struct watchdog_device wdd;
1823
void __iomem *base;
@@ -266,6 +271,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
266271
wdt->wdd.timeout = WDT_DEFAULT_TIMEOUT;
267272
watchdog_init_timeout(&wdt->wdd, 0, dev);
268273

274+
watchdog_set_nowayout(&wdt->wdd, nowayout);
275+
269276
np = dev->of_node;
270277

271278
ofdid = of_match_node(aspeed_wdt_of_table, np);

drivers/watchdog/imx2_wdt.c

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ struct imx2_wdt_device {
6666
struct watchdog_device wdog;
6767
bool ext_reset;
6868
bool clk_is_on;
69+
bool no_ping;
6970
};
7071

7172
static bool nowayout = WATCHDOG_NOWAYOUT;
@@ -312,12 +313,18 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
312313

313314
wdev->ext_reset = of_property_read_bool(dev->of_node,
314315
"fsl,ext-reset-output");
316+
/*
317+
* The i.MX7D doesn't support low power mode, so we need to ping the watchdog
318+
* during suspend.
319+
*/
320+
wdev->no_ping = !of_device_is_compatible(dev->of_node, "fsl,imx7d-wdt");
315321
platform_set_drvdata(pdev, wdog);
316322
watchdog_set_drvdata(wdog, wdev);
317323
watchdog_set_nowayout(wdog, nowayout);
318324
watchdog_set_restart_priority(wdog, 128);
319325
watchdog_init_timeout(wdog, timeout, dev);
320-
watchdog_stop_ping_on_suspend(wdog);
326+
if (wdev->no_ping)
327+
watchdog_stop_ping_on_suspend(wdog);
321328

322329
if (imx2_wdt_is_running(wdev)) {
323330
imx2_wdt_set_timeout(wdog, wdog->timeout);
@@ -366,9 +373,11 @@ static int __maybe_unused imx2_wdt_suspend(struct device *dev)
366373
imx2_wdt_ping(wdog);
367374
}
368375

369-
clk_disable_unprepare(wdev->clk);
376+
if (wdev->no_ping) {
377+
clk_disable_unprepare(wdev->clk);
370378

371-
wdev->clk_is_on = false;
379+
wdev->clk_is_on = false;
380+
}
372381

373382
return 0;
374383
}
@@ -380,11 +389,14 @@ static int __maybe_unused imx2_wdt_resume(struct device *dev)
380389
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
381390
int ret;
382391

383-
ret = clk_prepare_enable(wdev->clk);
384-
if (ret)
385-
return ret;
392+
if (wdev->no_ping) {
393+
ret = clk_prepare_enable(wdev->clk);
386394

387-
wdev->clk_is_on = true;
395+
if (ret)
396+
return ret;
397+
398+
wdev->clk_is_on = true;
399+
}
388400

389401
if (watchdog_active(wdog) && !imx2_wdt_is_running(wdev)) {
390402
/*
@@ -407,6 +419,7 @@ static SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
407419

408420
static const struct of_device_id imx2_wdt_dt_ids[] = {
409421
{ .compatible = "fsl,imx21-wdt", },
422+
{ .compatible = "fsl,imx7d-wdt", },
410423
{ /* sentinel */ }
411424
};
412425
MODULE_DEVICE_TABLE(of, imx2_wdt_dt_ids);

drivers/watchdog/ixp4xx_wdt.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,24 @@ static int ixp4xx_wdt_set_timeout(struct watchdog_device *wdd,
8484
return 0;
8585
}
8686

87+
static int ixp4xx_wdt_restart(struct watchdog_device *wdd,
88+
unsigned long action, void *data)
89+
{
90+
struct ixp4xx_wdt *iwdt = to_ixp4xx_wdt(wdd);
91+
92+
__raw_writel(IXP4XX_WDT_KEY, iwdt->base + IXP4XX_OSWK_OFFSET);
93+
__raw_writel(0, iwdt->base + IXP4XX_OSWT_OFFSET);
94+
__raw_writel(IXP4XX_WDT_COUNT_ENABLE | IXP4XX_WDT_RESET_ENABLE,
95+
iwdt->base + IXP4XX_OSWE_OFFSET);
96+
97+
return 0;
98+
}
99+
87100
static const struct watchdog_ops ixp4xx_wdt_ops = {
88101
.start = ixp4xx_wdt_start,
89102
.stop = ixp4xx_wdt_stop,
90103
.set_timeout = ixp4xx_wdt_set_timeout,
104+
.restart = ixp4xx_wdt_restart,
91105
.owner = THIS_MODULE,
92106
};
93107

drivers/watchdog/orion_wdt.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ static int armada370_start(struct watchdog_device *wdt_dev)
238238
atomic_io_modify(dev->reg + TIMER_A370_STATUS, WDT_A370_EXPIRED, 0);
239239

240240
/* Enable watchdog timer */
241-
atomic_io_modify(dev->reg + TIMER_CTRL, dev->data->wdt_enable_bit,
242-
dev->data->wdt_enable_bit);
241+
reg = dev->data->wdt_enable_bit;
242+
if (dev->wdt.info->options & WDIOF_PRETIMEOUT)
243+
reg |= TIMER1_ENABLE_BIT;
244+
atomic_io_modify(dev->reg + TIMER_CTRL, reg, reg);
243245

244246
/* Enable reset on watchdog */
245247
reg = readl(dev->rstout);
@@ -312,15 +314,18 @@ static int armada375_stop(struct watchdog_device *wdt_dev)
312314
static int armada370_stop(struct watchdog_device *wdt_dev)
313315
{
314316
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
315-
u32 reg;
317+
u32 reg, mask;
316318

317319
/* Disable reset on watchdog */
318320
reg = readl(dev->rstout);
319321
reg &= ~dev->data->rstout_enable_bit;
320322
writel(reg, dev->rstout);
321323

322324
/* Disable watchdog timer */
323-
atomic_io_modify(dev->reg + TIMER_CTRL, dev->data->wdt_enable_bit, 0);
325+
mask = dev->data->wdt_enable_bit;
326+
if (wdt_dev->info->options & WDIOF_PRETIMEOUT)
327+
mask |= TIMER1_ENABLE_BIT;
328+
atomic_io_modify(dev->reg + TIMER_CTRL, mask, 0);
324329

325330
return 0;
326331
}

drivers/watchdog/renesas_wdt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);
327327
static const struct of_device_id rwdt_ids[] = {
328328
{ .compatible = "renesas,rcar-gen2-wdt", },
329329
{ .compatible = "renesas,rcar-gen3-wdt", },
330+
{ .compatible = "renesas,rcar-gen4-wdt", },
330331
{ /* sentinel */ }
331332
};
332333
MODULE_DEVICE_TABLE(of, rwdt_ids);

drivers/watchdog/rti_wdt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
228228
ret = pm_runtime_get_sync(dev);
229229
if (ret) {
230230
pm_runtime_put_noidle(dev);
231+
pm_runtime_disable(&pdev->dev);
231232
return dev_err_probe(dev, ret, "runtime pm failed\n");
232233
}
233234

0 commit comments

Comments
 (0)