The watchdog timer, set to specific time intervals, handles gross system misbehavior. The watchdog timer can be enabled or disabled depending on the operating condition. Once the watchdog timer is activated, it must be serviced by software on a periodic basis. If servicing does not take place in time, the watchdog times out and issues a system reset.

The ConnectCore 6 Plus has:

  • Two watchdogs available on the i.MX6 system-on-chip

  • One watchdog available on the DA9063 PMIC

The Board Support Package (BSP) only supports the i.MX6 watchdogs.

Features

The features of the i.MX6 watchdog include:

  • Configurable timeout counter between 0.5s and 128s

  • Time resolution of 0.5s

  • Option to disable the watchdog timer count during low power mode

  • Assertion of WDOG_RESET_B_DEB reset signal on timeout

  • Inability to stop watchdog once started

Kernel configuration

You can manage the i.MX6 watchdog driver support through the kernel configuration option IMX2+ Watchdog (CONFIG_IMX2_WDT).

This option is enabled as built-in on the ConnectCore 6 Plus SBC kernel configuration file.

Kernel driver

The watchdog driver for the i.MX6 is located at drivers/watchdog/imx2_wdt.c.

Device tree bindings and customization

The watchdog device tree binding is documented at Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt.

The i.MX6 watchdog timers are defined in the common i.MX6 device tree file:

Common ConnectCore 6 Plus device tree
wdog1: wdog@20bc000 {
	compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
	reg = <0x020bc000 0x4000>;
	interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
	clocks = <&clks IMX6QDL_CLK_DUMMY>;
};
wdog2: wdog@20c0000 {
	compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
	reg = <0x020c0000 0x4000>;
	interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
	clocks = <&clks IMX6QDL_CLK_DUMMY>;
	status = "disabled";
};

The ConnectCore 6 Plus uses watchdog 1 (WDOG1) on the i.MX6 CPU to reset the system.

ConnectCore 6 Plus SBC device tree
&gpc {
	fsl,cpu_pupscr_sw2iso = <0xf>;
	fsl,cpu_pupscr_sw = <0xf>;
	fsl,cpu_pdnscr_iso2sw = <0x1>;
	fsl,cpu_pdnscr_iso = <0x1>;
	fsl,ldo-bypass = <0>; /* No ldo-bypass */
	fsl,wdog-reset = <1>; /* watchdog select of reset source */
	pu-supply = <&reg_pu>;
};

Using the watchdog

The watchdog is accessible via the file descriptor /dev/watchdog0.

For information about the watchdog API, see the Linux kernel documentation at Documentation/watchdog/watchdog-api.txt.

Sample application

An example application called apix-watchdog-example is included in the dey-examples-digiapix recipe (part of dey-examples package) of meta-digi layer. This application uses the Digi APIx library to enable a watchdog device on the ConnectCore 6 Plus.

Go to GitHub to see the application instructions and source code.

See Watchdog API for more information about the watchdog APIx.