aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/gemini
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-05-18 20:56:56 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-05-18 20:56:56 +0000
commit5bad9df354c05a1bb64ea3af6dcf1fa8a2f63a9b (patch)
tree4e7eb42d3a33561820fef4afde5470821157e3c1 /target/linux/gemini
parent5d9d9837ac7ceb409b753e225fcdc204ec1c6c2a (diff)
downloadupstream-5bad9df354c05a1bb64ea3af6dcf1fa8a2f63a9b.tar.gz
upstream-5bad9df354c05a1bb64ea3af6dcf1fa8a2f63a9b.tar.bz2
upstream-5bad9df354c05a1bb64ea3af6dcf1fa8a2f63a9b.zip
disable the watchdog if the bootloader left it enabled
SVN-Revision: 15920
Diffstat (limited to 'target/linux/gemini')
-rw-r--r--target/linux/gemini/patches/004-gemini-disable-watchdog-in-probe.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/target/linux/gemini/patches/004-gemini-disable-watchdog-in-probe.patch b/target/linux/gemini/patches/004-gemini-disable-watchdog-in-probe.patch
new file mode 100644
index 0000000000..d1f5c340da
--- /dev/null
+++ b/target/linux/gemini/patches/004-gemini-disable-watchdog-in-probe.patch
@@ -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;