diff options
author | Rebecca Schultz Zavin <rebecca@android.com> | 2011-01-11 15:35:47 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 00:47:34 -0700 |
commit | f02207fb368a37bbbb35b434229ecdea27b7a941 (patch) | |
tree | fdb90e25175fb0a837e93bb6b5429de95bacf4ac /drivers/watchdog | |
parent | 1ed9fe992e732a825f981a6da342917203b212fe (diff) |
watchdog: tegra_wdt: Several changes to watchdog driver
Add a config option to enable the watchdog driver from probe
Reduce the default timeout to 30 seconds
Read the reset reason and print a messge if the last reboot was
due to watchdog reset
Change-Id: I7500ef236089b06ffcff3d8e7d86a5b9060b59cb
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebase-Id: R120a350e6eee17d286555670d070584624b654cb
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/Kconfig | 6 | ||||
-rw-r--r-- | drivers/watchdog/tegra_wdt.c | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index e01aadf8383d..ca691c2ac3d9 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -240,6 +240,12 @@ config TEGRA_WATCHDOG To compile this driver as a module, choose M here: the module will be called tegra_wdt. +config TEGRA_WATCHDOG_ENABLE_ON_PROBE + tristate "Tegra watchdog" + depends on ARCH_TEGRA && TEGRA_WATCHDOG + help + Say Y here to enable the tegra watchdog at driver + probe time, rather than when the device is opened. config EP93XX_WATCHDOG tristate "EP93xx Watchdog" diff --git a/drivers/watchdog/tegra_wdt.c b/drivers/watchdog/tegra_wdt.c index 6dcc073245e3..8762d747f7f5 100644 --- a/drivers/watchdog/tegra_wdt.c +++ b/drivers/watchdog/tegra_wdt.c @@ -50,7 +50,7 @@ #define WDT_SEL_TMR1 (0 << 4) #define WDT_SYS_RST (1 << 2) -static int heartbeat = 60; +static int heartbeat = 30; struct tegra_wdt { struct miscdevice miscdev; @@ -208,6 +208,7 @@ static int tegra_wdt_probe(struct platform_device *pdev) { struct resource *res_src, *res_wdt, *res_irq; struct tegra_wdt *wdt; + u32 src; int ret = 0; if (pdev->id != -1) { @@ -262,6 +263,10 @@ static int tegra_wdt_probe(struct platform_device *pdev) goto fail; } + src = readl(wdt->wdt_source); + if (src & BIT(12)) + dev_info(&pdev->dev, "last reset due to watchdog timeout\n"); + tegra_wdt_disable(wdt); ret = request_irq(res_irq->start, tegra_wdt_interrupt, IRQF_DISABLED, @@ -292,6 +297,9 @@ static int tegra_wdt_probe(struct platform_device *pdev) platform_set_drvdata(pdev, wdt); tegra_wdt_dev = wdt; +#ifdef CONFIG_TEGRA_WATCHDOG_ENABLE_ON_PROBE + tegra_wdt_enable(wdt); +#endif return 0; fail: if (wdt->irq != -1) |