Skip to content

Watchdog Timers Driver for Hard Processor System

Last updated: December 10, 2025

Upstream Status: Upstreamed

Device Supported: Agilex 5

Introduction

The watchdog timers are peripherals you can use to recover from system lockup that might be caused by software or system related issues. The hard processor system (HPS) provides five programmable watchdog timers, which are connected to the level 4 (L4) peripheral bus.

Each watchdog timer consists of a slave interface for control and status register (CSR) access, a register block, and a 32-bit down counter that operates on the slave interface clock (l4_sys_free_clk). A pause input, driven by the system manager, optionally pauses the counter when a CPU is being debugged.The watchdog timer drives an interrupt request to the MPU and a reset request to the reset manager.

For more information please refer to the Agilex 5 Hard Processor System Technical Reference Manual.

watchdog_timers_block_diagram

Driver Sources

The source code for this driver can be found at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/watchdog/dw_wdt.c.

Driver Capabilities

  • Allows configuration of the watchdog timer timeout period, specifying the duration after which the watchdog will trigger a system reset if not reset by the software
  • Initializes the watchdog timer hardware during system boot, setting up the necessary registers and configurations to enable watchdog functionality.
  • Handles interrupts generated by the watchdog timer hardware, allowing the system to respond appropriately to watchdog events, such as timer expiration.

Kernel Configurations

CONFIG_DW_WATCHDOG

watchdog_config_path

Device Tree

Example Device tree location:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi

watchdog_device_tree

Test Procedures

This test procedure was exercised on Agilex 5 E-Series Premium Development Kit using the GSRD for HPS Enablement Board (booting from SD Card) from 24.3.1 release which uses Linux Kernel 6.6.51.

Step 1: Verify that the Watchdog Node is in the Device Tree

First, verify that the watchdog node is present in the device tree. You can do this by booting the system and running:

ls /proc/device-tree/soc\@0/watchdog*
/proc/device-tree/soc@0/watchdog@10d00200:
clocks    compatible  interrupts  name  phandle  reg  resets  status

/proc/device-tree/soc@0/watchdog@10d00300:
clocks    compatible  interrupts  name  phandle  reg  resets  status

/proc/device-tree/soc@0/watchdog@10d00400:
clocks    compatible  interrupts  name  phandle  reg  resets  status

/proc/device-tree/soc@0/watchdog@10d00500:
clocks    compatible  interrupts  name  phandle  reg  resets  status

/proc/device-tree/soc@0/watchdog@10d00600:
clocks    compatible  disable-over-current  interrupts  name  phandle  reg  resets  status

Read the status of the watchdog that is present.

cat /proc/device-tree/soc\@0/watchdog\@10d00200/status
okay

You should see output indicating the presence of the watchdog node (The printout of the following cat command should be 'okay' as shown above)

Step 2: Check Watchdog Status

Next, check the status of the watchdog to ensure it is active. Run the following command:

ls /dev/watchdog*
/dev/watchdog   /dev/watchdog1  /dev/watchdog3
/dev/watchdog0  /dev/watchdog2  /dev/watchdog4
This command will display the watchdog timers that are active.

Step 3: Test Watchdog Reset Functionality

To test the watchdog's ability to reset the system, you can disable the watchdog by writing to its control register. Run the following command:

cat >> /dev/watchdog

After running this command, the system should reset within a few seconds. You will see the login prompt reappear after the reset.

Step 4: Verify System Recovery

Once the system has recovered from the reset, all the services and applications should run as expected.

Known Issues

None known

Notices & Disclaimers

Altera® Corporation technologies may require enabled hardware, software or service activation. No product or component can be absolutely secure. Performance varies by use, configuration and other factors. Your costs and results may vary. You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Altera or Intel products described herein. You agree to grant Altera Corporation a non-exclusive, royalty-free license to any patent claim thereafter drafted which includes subject matter disclosed herein. No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document, with the sole exception that you may publish an unmodified copy. You may create software implementations based on this document and in compliance with the foregoing that are intended to execute on the Altera or Intel product(s) referenced in this document. No rights are granted to create modifications or derivatives of this document. The products described may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. Altera disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade. You are responsible for safety of the overall system, including compliance with applicable safety-related requirements or standards. © Altera Corporation. Altera, the Altera logo, and other Altera marks are trademarks of Altera Corporation. Other names and brands may be claimed as the property of others.

OpenCL* and the OpenCL* logo are trademarks of Apple Inc. used by permission of the Khronos Group™.


Last update: December 10, 2025
Created: May 25, 2024
Ask in the Forum