Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

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.
  • Dependencies:
    • On
ZynqMP


Kernel Configuration

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




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

For Zynq7000:
Example: In <plnx-proj-root>/components/plnx_workspace/device-tree/device-tree-generation/zynq-7000.dtsi
Code Block
themeMidnight
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 <plnx-proj-root>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi as below and rebuild your project.
Code Block
themeMidnight
&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.
Code Block
themeMidnight
&watchdog0 {
    status = "okay";
    reset-on-timeout;
};
For ZynqMP:
Example: In <plnx-proj-root>/components/plnx_workspace/device-tree/device-tree-generation/zynqmp.dtsi
Code Block
themeMidnight
# timeout-sec value is set to 10s in 2018.2 and below release and 60s in 2018.3 and above release.
watchdog0: watchdog@fd4d0000 {
        compatible = "cdns,wdt-r1p2";
        status = disabled;
        interrupt-parent = <&gic>;
        interrupts = <0 113 1>;
        reg = <0x0 0xfd4d0000 0x1000>;
        timeout-sec = <60>;
};
 
Modify the device tree source in <plnx-proj-root>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi as below and rebuild your project.
Code Block
themeMidnight
&watchdog0 {
    status = "okay";
};
If user 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
Code Block
themeMidnight
&watchdog0 {
    status = "okay";
    reset-on-timeout;
    timeout-sec = <10>;
};
Note: For 2017.1 or later PetaLinux ENABLE_EM needs to be enabled from PMUFW
Reference Link: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842475/PetaLinux+Yocto+Tips  PMU Firmware#PMUFWBuildFlags

...