Introduction

This page gives an overview of the WDT driver which is available as part of the Zynq and ZynqMP Linux distribution and in the mainline.
Paths, files, links and documentation on this page are given relative to the Linux kernel source tree.

HW IP Features

  • Configurable timeout interval in seconds.
  • Reset on timeout can be selected.

Known Issues and Limitations

  • None.

Kernel Configuration

The following config options should be enabled in order to build the wdt driver:
CONFIG_CADENCE_WATCHDOG
CONFIG_XILINX_WATCHDOG

2.JPG


Devicetree
For more details, please refer "Documentation/devicetree/bindings/watchdog/cadence-wdt.txt"

For Zynq7000:
Example: In ${PETALINUX_PROJECT}/subsystems/linux/configs/device-tree/zynq-7000.dtsi
watchdog0: watchdog@f8005000 {
        clocks = <&clkc45>;
        compatible = "cdns,wdt-r1p2";
        interrupt-parent = <&intc>;
        interrupts = <0 9 1>;
        reg = <0xf8005000 0x1000>;
        timeout-sec = <10>;
};
 
Modify the device tree source in ${PETALINUX_PROJECT}/subsystems/linux/configs/device-tree/system-top.dts as below and rebuild your project.
&watchdog0 {
    status = "okay";
};
If you want the watchdog to trigger a software reset/reboot upon time out then add "reset-on-timeout" in device tree node.
&watchdog0 {
    status = "okay";
    reset-on-timeout;
};
For ZynqMP:
Example: In ${PETALINUX_PROJECT}/subsystems/linux/configs/device-tree/zynqmp.dtsi
watchdog0: watchdog@fd4d0000 {
        compatible = "cdns,wdt-r1p2";
        status = disabled;
        interrupt-parent = <&gic>;
        interrupts = <0 113 1>;
        reg = <0x0 0xfd4d0000 0x1000>;
        timeout-sec = <10>;
};
 
Modify the device tree source in ${PETALINUX_PROJECT}/subsystems/linux/configs/device-tree/system-top.dts as below and rebuild your project.
&watchdog0 {
    status = "okay";
    clocks = <&clk100>;
};
If you want the watchdog to trigger a software reset/reboot upon time out then add "reset-on-timeout" in device tree node. Software reset is handled in PMU firmware for ZynqMP so you need add PMU firmware in your BOOT.bin
&watchdog0 {
    status = "okay";
    clocks = <&clk100>;
    reset-on-timeout;
};

Note: ENABLE_EM is not enabled by default in PMUFW you need to enable this. For 2017.1 or later PetaLinux refer http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips (Section: Configuring FSBL and PMUFW debugs in PetaLinux)

Test procedure

Start the watchdog timer and see if it runs out without enabling reset.
echo s > /dev/watchdog0

Expected Output

// after 10 seconds timeout
cdns-wdt fd4d0000.watchdog: Watchdog timed out.
If reset is enabled the print above indicating reset won't show up and instead software reset/reboot is observed.

Mainline Status

  • This driver is currently in sync with mainline kernel

Change Log

  • 2016.3
    • None
  • 2016.4
    • None
  • 2017.1
    • Summary
      • watchdog: cadence_wdt: Fix the suspend resume.
      • watchdog: constify watchdog_ops structures.

    • Commits
      • eadc4fe watchdog: cadence_wdt: Fix the suspend resume.
      • 85f15cf watchdog: constify watchdog_ops structures.

  • 2017.2
    • None
  • 2017.3
    • Summary
      • watchdog: cadence_wdt: Fix issue with timeout-sec dt property
      • watchdog: cadence_wdt: make of_device_ids const.
      • watchdog: cadence_wdt: Enable access to module parameters
      • watchdog: cadence_wdt: Show information when driver is probed
    • Commits
      • 33ca085 watchdog: cadence_wdt: Fix issue with timeout-sec dt property
      • e51604b watchdog: cadence_wdt: make of_device_ids const.
      • 98dde08 watchdog: cadence_wdt: Enable access to module parameters
      • cf698e7 watchdog: cadence_wdt: Show information when driver is probed

Related Links