Skip to contentSkip to conversation

watchdog: Add tegra watchdog

PATCH Superseded Andrew Chew 1 participant 1 message Feb 12, 2014

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 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 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                   | 327 +++++++++++++++++++++++++
 4 files changed, 344 insertions(+)
 create mode 100644 drivers/watchdog/tegra_wdt.c
Documentation/watchdog/watchdog-parameters.txt +5 -0
index f9492fe..b39f355 100644
@@ -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
index 4c4c566..3aae2da 100644
@@ -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
index 985a66c..1b5f3d5 100644
@@ -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 +327 -0

327 lines not on this page · raw message

Signature · 1 line
1.8.1.5