How to enable TX1 Watchdog?

I have studied the Watchdog Timer part of NVIDIA_Tegra_Linux_Driver_Package28.1,
but i still find not the files which are about WDT0。
In which way i can get arch/arm/configs/tegra21/18_defconfig and drivers/watchdog/tegra_wdt.c ?
My requirement is to enable watchdog and modif the timeout.
Thanks!

There are some differences between older releases and newer releases (and I haven’t experimented with it in a long time), but what do you see from your running system via this:

gunzip < /proc/config.gz | grep WATCHDOG

So far as I know it is enabled by default. However, you might be running into documentation differences between 4.x kernels and the older 3.x kernels.

In the kernel source (be sure to use the matching version) you should see directory “Documentation/watchdog/”. Within that one possibility for describing how to use the watchdog will be the sample code in the “src/” subdirectory. Take a look at the samples there.

I get this

# CONFIG_DPM_WATCHDOG is not set
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
CONFIG_WATCHDOG_NOWAYOUT=y
# CONFIG_WATCHDOG_SYSFS is not set
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_SOFT_PLATFORM_WATCHDOG is not set
# CONFIG_GPIO_WATCHDOG is not set
# CONFIG_XILINX_WATCHDOG is not set
# CONFIG_ARM_SP805_WATCHDOG is not set
# CONFIG_CADENCE_WATCHDOG is not set
# CONFIG_DW_WATCHDOG is not set
# CONFIG_MAX63XX_WATCHDOG is not set
# CONFIG_MAX77620_WATCHDOG is not set
CONFIG_TEGRA_WATCHDOG=y
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_USBPCWATCHDOG is not set
# CONFIG_FIQ_WATCHDOG is not set

So this says the watchdog timer is installed and available within the kernel. The only step left is to use it.

A couple of useful URLs:
IOCTL note (an extension to file open and close which works by talking to a driver):
[url]arm - How to change the watchdog timer in linux embedded - Stack Overflow

Just a general watchdog URL:
[url]https://linuxhint.com/linux-kernel-watchdog-explained/[/url]

I suppose you could change the default timeout period by editing in the kernel and then flashing a new kernel and modules (this is an integrated feature), but using an ioctl in a program run as root might be easier.

Hi,linuxdev
Thanks for help,I will study it