1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-29 12:24:11 +02:00

disable the watchdog if the bootloader left it enabled

SVN-Revision: 15920
This commit is contained in:
Gabor Juhos 2009-05-18 20:56:56 +00:00
parent 5d9d9837ac
commit 5bad9df354

View File

@ -0,0 +1,24 @@
--- a/drivers/watchdog/gemini_wdt.c
+++ b/drivers/watchdog/gemini_wdt.c
@@ -224,6 +224,7 @@ static int __init gemini_wdt_probe(struc
struct resource *res;
void __iomem *base;
struct gemini_wdt_struct *gemini_wdt;
+ unsigned int reg;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
@@ -267,6 +268,13 @@ static int __init gemini_wdt_probe(struc
gemini_wdt_miscdev.parent = &pdev->dev;
+ reg = __raw_readw(gemini_wdt->base + GEMINI_WDCR);
+ if (reg & WDCR_ENABLE) {
+ /* Watchdog was enabled by the bootloader, disable it. */
+ reg &= ~(WDCR_ENABLE);
+ __raw_writel(reg, gemini_wdt->base + GEMINI_WDCR);
+ }
+
ret = misc_register(&gemini_wdt_miscdev);
if (ret)
goto fail2;