summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-04 21:05:55 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-04 21:05:55 +0000
commitc1bb09481ace0acbf1cd7f2de88411ef869bc18c (patch)
tree36bc861a68f72008f9ed258cdf4f02cb7f99dbe6 /target
parent42711a9f68f66e3b944d3802a4d70932021bfb24 (diff)
[ar7] register watchdog only if enabled in hardware (#2378)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17125 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar7/patches-2.6.27/140-watchdog_bootcr.patch29
-rw-r--r--target/linux/ar7/patches-2.6.30/140-watchdog_bootcr.patch31
2 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-2.6.27/140-watchdog_bootcr.patch b/target/linux/ar7/patches-2.6.27/140-watchdog_bootcr.patch
new file mode 100644
index 000000000..95535def0
--- /dev/null
+++ b/target/linux/ar7/patches-2.6.27/140-watchdog_bootcr.patch
@@ -0,0 +1,29 @@
+--- a/drivers/watchdog/ar7_wdt.c 2009-01-25 01:17:01.000000000 +1300
++++ b/drivers/watchdog/ar7_wdt.c 2009-01-25 01:19:15.000000000 +1300
+@@ -293,12 +293,26 @@
+ .fops = &ar7_wdt_fops,
+ };
+
++#define AR7_WDT_HARDWARE_ENABLE 0x10
++
+ static int __init ar7_wdt_init(void)
+ {
+ int rc;
++ u32 *bootcr;
++ u32 bootcr_value;
+
+ ar7_wdt_get_regs();
+
++ /* arch/mips/ar7/clocks.c is the only other thing that reads this */
++ bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
++ bootcr_value = *bootcr;
++ iounmap(bootcr);
++
++ if (!(bootcr_value & AR7_WDT_HARDWARE_ENABLE)) {
++ printk(KERN_INFO DRVNAME ": watchdog disabled in hardware (bootcr=%#x)\n", bootcr_value);
++ return -ENODEV;
++ }
++
+ if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt),
+ LONGNAME)) {
+ printk(KERN_WARNING DRVNAME ": watchdog I/O region busy\n");
diff --git a/target/linux/ar7/patches-2.6.30/140-watchdog_bootcr.patch b/target/linux/ar7/patches-2.6.30/140-watchdog_bootcr.patch
new file mode 100644
index 000000000..21c95a765
--- /dev/null
+++ b/target/linux/ar7/patches-2.6.30/140-watchdog_bootcr.patch
@@ -0,0 +1,31 @@
+--- a/drivers/watchdog/ar7_wdt.c
++++ b/drivers/watchdog/ar7_wdt.c
+@@ -298,14 +298,28 @@ static struct miscdevice ar7_wdt_miscdev
+ .fops = &ar7_wdt_fops,
+ };
+
++#define AR7_WDT_HARDWARE_ENABLE 0x10
++
+ static int __init ar7_wdt_init(void)
+ {
+ int rc;
++ u32 *bootcr;
++ u32 bootcr_value;
+
+ spin_lock_init(&wdt_lock);
+
+ ar7_wdt_get_regs();
+
++ /* arch/mips/ar7/clocks.c is the only other thing that reads this */
++ bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
++ bootcr_value = *bootcr;
++ iounmap(bootcr);
++
++ if (!(bootcr_value & AR7_WDT_HARDWARE_ENABLE)) {
++ printk(KERN_INFO DRVNAME ": watchdog disabled in hardware (bootcr=%#x)\n", bootcr_value);
++ return -ENODEV;
++ }
++
+ if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt),
+ LONGNAME)) {
+ printk(KERN_WARNING DRVNAME ": watchdog I/O region busy\n");