[ramips] fixes dma hangups in eth
[openwrt.git] / target / linux / ar7 / patches-2.6.27 / 140-watchdog_bootcr.patch
1 --- a/drivers/watchdog/ar7_wdt.c 2009-01-25 01:17:01.000000000 +1300
2 +++ b/drivers/watchdog/ar7_wdt.c 2009-01-25 01:19:15.000000000 +1300
3 @@ -293,12 +293,26 @@
4 .fops = &ar7_wdt_fops,
5 };
6
7 +#define AR7_WDT_HARDWARE_ENABLE 0x10
8 +
9 static int __init ar7_wdt_init(void)
10 {
11 int rc;
12 + u32 *bootcr;
13 + u32 bootcr_value;
14
15 ar7_wdt_get_regs();
16
17 + /* arch/mips/ar7/clocks.c is the only other thing that reads this */
18 + bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
19 + bootcr_value = *bootcr;
20 + iounmap(bootcr);
21 +
22 + if (!(bootcr_value & AR7_WDT_HARDWARE_ENABLE)) {
23 + printk(KERN_INFO DRVNAME ": watchdog disabled in hardware (bootcr=%#x)\n", bootcr_value);
24 + return -ENODEV;
25 + }
26 +
27 if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt),
28 LONGNAME)) {
29 printk(KERN_WARNING DRVNAME ": watchdog I/O region busy\n");
This page took 0.047635 seconds and 5 git commands to generate.