watchdog: Add tegra watchdog
Subsystems (3)
PATCH v7 1/1 watchdog: Add tegra watchdog
Add a driver for the hardware watchdogs in NVIDIA Tegra SoCs (Tegra30 and later). This driver will configure one watchdog timer that will reset the system in the case of a watchdog timeout.
This driver binds to the nvidia,tegra30-timer device node and gets its register base from there.
---
Changes from v6:
Removed kref stuff. We can't think of why it's needed here.
Changes from v5:
Changed license to GPL v2 per Stephen Warren's guidance.
Changes from v4:
Skip the error check from the platform_get_resources() call, because devm_ioremap_resource() correctly handles the case when res is NULL.
Changes from v3:
Applied Cuenter Roeck <[email protected]>'s comments. In particular, since tegra_wdt_start() and tegra_wdt_stop() always return success, skip error checking for these calls. Also, removed some unnecessarily verbose logging around which watchdog and timer ID is being used. Fixed typo regarding the ref and unref callback setup. Removed miscdev stuff.
Cuenter was right in that the watchdog doesn't need to be stopped prior to changing the timeout. It is sufficient to just reprogram the watchdog with the new timeout.
Tested on T124.
To do a simple test, "echo 0 > /dev/watchdog0". The target will reset when two minutes (the default heartbeat interval) have expired since the last write to /dev/watchdog0.
Documentation/watchdog/watchdog-parameters.txt | 5 + drivers/watchdog/Kconfig | 11 + drivers/watchdog/Makefile | 1 + drivers/watchdog/tegra_wdt.c | 302 +++++++++++++++++++++++++ 4 files changed, 319 insertions(+) create mode 100644 drivers/watchdog/tegra_wdt.c
Documentation/watchdog/watchdog-parameters.txt +5 -0
@@ -325,6 +325,11 @@ soft_noboot: Softdog action, set to 1 to ignore reboots, 0 to reboot stmp3xxx_wdt: heartbeat: Watchdog heartbeat period in seconds from 1 to 4194304, default 19 ------------------------------------------------- +tegra_wdt: +heartbeat: Watchdog heartbeats in seconds. (default = 120) +nowayout: Watchdog cannot be stopped once started + (default=kernel config parameter) +------------------------------------------------- ts72xx_wdt: timeout: Watchdog timeout in seconds. (1 <= timeout <= 8, default=8) nowayout: Disable watchdog shutdown on close
drivers/watchdog/Kconfig +11 -0
@@ -420,6 +420,17 @@ config SIRFSOC_WATCHDOG Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When the watchdog triggers the system will be reset. +config TEGRA_WATCHDOG + tristate "Tegra watchdog" + depends on ARCH_TEGRA || COMPILE_TEST + select WATCHDOG_CORE + help + Say Y here to include support for the watchdog timer + embedded in NVIDIA Tegra SoCs. + + To compile this driver as a module, choose M here: the + module will be called tegra_wdt. + # AVR32 Architecture config AT32AP700X_WDT
drivers/watchdog/Makefile +1 -0
@@ -58,6 +58,7 @@ obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o +obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o # AVR32 Architecture obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
drivers/watchdog/tegra_wdt.c new file +302 -0
302 lines not on this page · raw message
Signature · 1 line
1.8.1.5
Guenter Roeck
maintainerHi Andrew,
Quoted 7 lines · Andrew Chew
Add a driver for the hardware watchdogs in NVIDIA Tegra SoCs (Tegra30 and later). This driver will configure one watchdog timer that will reset the system in the case of a watchdog timeout.
This driver binds to the nvidia,tegra30-timer device node and gets its register base from there.
Quoted 9 lines
Signed-off-by Andrew Chew <[email protected]>Reviewed-by Guenter Roeck <[email protected]>Tested-by Stephen Warren <[email protected]>Reviewed-by Stephen Warren <[email protected]>---
Changes from v6:Removed kref stuff. We can't think of why it's needed here.
Me likes that :-)
Many changes since my original review, but I re-confirm my Reviewed-by: above.
Guenter
Hi Andrew,
Quoted 43 lines
Add a driver for the hardware watchdogs in NVIDIA Tegra SoCs (Tegra30 and later). This driver will configure one watchdog timer that will reset the system in the case of a watchdog timeout.
This driver binds to the nvidia,tegra30-timer device node and gets its register base from there.
Signed-off-by Andrew Chew <[email protected]>Reviewed-by Guenter Roeck <[email protected]>Tested-by Stephen Warren <[email protected]>Reviewed-by Stephen Warren <[email protected]>---
Changes from v6:Removed kref stuff. We can't think of why it's needed here.
Changes from v5:
Changed license to GPL v2 per Stephen Warren's guidance.
Changes from v4:
Skip the error check from the
platform_get_resources()call, becausedevm_ioremap_resource()correctly handles the case when res is NULL.Changes from v3:
Applied Cuenter Roeck <[email protected]>'s comments. In particular, since
tegra_wdt_start()andtegra_wdt_stop()always return success, skip error checking for these calls. Also, removed some unnecessarily verbose logging around which watchdog and timer ID is being used. Fixed typo regarding the ref and unref callback setup. Removed miscdev stuff.Cuenter was right in that the watchdog doesn't need to be stopped prior to changing the timeout. It is sufficient to just reprogram the watchdog with the new timeout.
Tested on T124.
To do a simple test, "echo 0 >
/dev/watchdog0". The target will reset when two minutes (the default heartbeat interval) have expired since the last write to/dev/watchdog0.
Quoted 7 lines
Documentation/watchdog/watchdog-parameters.txt | 5 + drivers/watchdog/Kconfig | 11 + drivers/watchdog/Makefile | 1 + drivers/watchdog/tegra_wdt.c | 302 +++++++++++++++++++++++++ 4 files changed, 319 insertions(+) create mode 100644 drivers/watchdog/tegra_wdt.c
Patch added to linux-watchdog-next.
Kind regards,
Wim.