Commit 5602b0af authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux-watchdog-5.7-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

 - add TI K3 RTI watchdog

 - add stop_on_reboot parameter to control reboot policy

 - wm831x_wdt: Remove GPIO handling

 - several small fixes, improvements and clean-ups

* tag 'linux-watchdog-5.7-rc1' of git://www.linux-watchdog.org/linux-watchdog:
  watchdog: Add K3 RTI watchdog support
  dt-bindings: watchdog: Add support for TI K3 RTI watchdog
  watchdog: ziirave_wdt: change name to be more specific
  watchdog: orion: use 0 for unset heartbeat
  watchdog: npcm: remove whitespaces
  watchdog: reset last_hw_keepalive time at start
  watchdog: imx2_wdt: Drop .remove callback
  watchdog: Add stop_on_reboot parameter to control reboot policy
  watchdog: wm831x_wdt: Remove GPIO handling
  watchdog: imx7ulp: Remove unused include of init.h
  watchdog: imx_sc_wdt: Remove unused includes
  watchdog: qcom: Use irq flags from firmware
  watchdog: pm8916_wdt: Add system sleep callbacks
  watchdog: qcom-wdt: disable pretimeout on timer platform
parents 413a103c 2d63908b
Loading
Loading
Loading
Loading
+65 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/watchdog/ti,rti-wdt.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments K3 SoC Watchdog Timer

maintainers:
  - Tero Kristo <t-kristo@ti.com>

description:
  The TI K3 SoC watchdog timer is implemented via the RTI (Real Time
  Interrupt) IP module. This timer adds a support for windowed watchdog
  mode, which will signal an error if it is pinged outside the watchdog
  time window, meaning either too early or too late. The error signal
  generated can be routed to either interrupt a safety controller or
  to directly reset the SoC.

allOf:
  - $ref: "watchdog.yaml#"

properties:
  compatible:
    enum:
      - ti,j7-rti-wdt

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  power-domains:
    maxItems: 1

  assigned-clocks:
    maxItems: 1

  assigned-clocks-parents:
    maxItems: 1

required:
  - compatible
  - reg
  - clocks
  - power-domains

examples:
  - |
    /*
     * RTI WDT in main domain on J721e SoC. Assigned clocks are used to
     * select the source clock for the watchdog, forcing it to tick with
     * a 32kHz clock in this case.
     */
    #include <dt-bindings/soc/ti,sci_pm_domain.h>

    watchdog0: rti@2200000 {
        compatible = "ti,rti-wdt";
        reg = <0x0 0x2200000 0x0 0x100>;
        clocks = <&k3_clks 252 1>;
        power-domains = <&k3_pds 252 TI_SCI_PD_EXCLUSIVE>;
        assigned-clocks = <&k3_clks 252 1>;
        assigned-clock-parents = <&k3_clks 252 5>;
    };
+8 −0
Original line number Diff line number Diff line
@@ -584,6 +584,14 @@ config DAVINCI_WATCHDOG
	  NOTE: once enabled, this timer cannot be disabled.
	  Say N if you are unsure.

config K3_RTI_WATCHDOG
	tristate "Texas Instruments K3 RTI watchdog"
	depends on ARCH_K3 || COMPILE_TEST
	select WATCHDOG_CORE
	help
	  Say Y here if you want to include support for the K3 watchdog
	  timer (RTI module) available in the K3 generation of processors.

config ORION_WATCHDOG
	tristate "Orion watchdog"
	depends on ARCH_ORION5X || ARCH_DOVE || MACH_DOVE || ARCH_MVEBU || (COMPILE_TEST && !ARCH_EBSA110)
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
obj-$(CONFIG_K3_RTI_WATCHDOG) += rti_wdt.o
obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o
obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
+10 −27
Original line number Diff line number Diff line
@@ -244,6 +244,11 @@ static const struct regmap_config imx2_wdt_regmap_config = {
	.max_register = 0x8,
};

static void imx2_wdt_action(void *data)
{
	clk_disable_unprepare(data);
}

static int __init imx2_wdt_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
@@ -292,6 +297,10 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
	if (ret)
		return ret;

	ret = devm_add_action_or_reset(dev, imx2_wdt_action, wdev->clk);
	if (ret)
		return ret;

	regmap_read(wdev->regmap, IMX2_WDT_WRSR, &val);
	wdog->bootstatus = val & IMX2_WDT_WRSR_TOUT ? WDIOF_CARDRESET : 0;

@@ -315,32 +324,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
	 */
	regmap_write(wdev->regmap, IMX2_WDT_WMCR, 0);

	ret = watchdog_register_device(wdog);
	if (ret)
		goto disable_clk;

	dev_info(dev, "timeout %d sec (nowayout=%d)\n",
		 wdog->timeout, nowayout);

	return 0;

disable_clk:
	clk_disable_unprepare(wdev->clk);
	return ret;
}

static int __exit imx2_wdt_remove(struct platform_device *pdev)
{
	struct watchdog_device *wdog = platform_get_drvdata(pdev);
	struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);

	watchdog_unregister_device(wdog);

	if (imx2_wdt_is_running(wdev)) {
		imx2_wdt_ping(wdog);
		dev_crit(&pdev->dev, "Device removed: Expect reboot!\n");
	}
	return 0;
	return devm_watchdog_register_device(dev, wdog);
}

static void imx2_wdt_shutdown(struct platform_device *pdev)
@@ -417,7 +401,6 @@ static const struct of_device_id imx2_wdt_dt_ids[] = {
MODULE_DEVICE_TABLE(of, imx2_wdt_dt_ids);

static struct platform_driver imx2_wdt_driver = {
	.remove		= __exit_p(imx2_wdt_remove),
	.shutdown	= imx2_wdt_shutdown,
	.driver		= {
		.name	= DRIVER_NAME,
+0 −1
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
 */

#include <linux/clk.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
Loading