X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/a1bd9bdd429c9139a9e4bfd76adb2e491391dc7e..347c600521d2864d728e192cff1c1124d54b23ea:/target/linux/brcm63xx/patches-2.6.32/020-watchdog.patch diff --git a/target/linux/brcm63xx/patches-2.6.32/020-watchdog.patch b/target/linux/brcm63xx/patches-2.6.32/020-watchdog.patch index 1702113d8..511bce711 100644 --- a/target/linux/brcm63xx/patches-2.6.32/020-watchdog.patch +++ b/target/linux/brcm63xx/patches-2.6.32/020-watchdog.patch @@ -1,8 +1,6 @@ -Index: linux-2.6.32.9/drivers/watchdog/Makefile -=================================================================== ---- linux-2.6.32.9.orig/drivers/watchdog/Makefile 2010-02-23 16:38:51.000000000 +0100 -+++ linux-2.6.32.9/drivers/watchdog/Makefile 2010-02-28 18:13:51.000000000 +0100 -@@ -113,6 +113,7 @@ +--- a/drivers/watchdog/Makefile ++++ b/drivers/watchdog/Makefile +@@ -113,6 +113,7 @@ obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o obj-$(CONFIG_AR7_WDT) += ar7_wdt.o obj-$(CONFIG_TXX9_WDT) += txx9wdt.o @@ -10,11 +8,9 @@ Index: linux-2.6.32.9/drivers/watchdog/Makefile # PARISC Architecture -Index: linux-2.6.32.9/drivers/watchdog/Kconfig -=================================================================== ---- linux-2.6.32.9.orig/drivers/watchdog/Kconfig 2010-02-23 16:38:51.000000000 +0100 -+++ linux-2.6.32.9/drivers/watchdog/Kconfig 2010-02-28 18:13:51.000000000 +0100 -@@ -850,6 +850,16 @@ +--- a/drivers/watchdog/Kconfig ++++ b/drivers/watchdog/Kconfig +@@ -850,6 +850,16 @@ config TXX9_WDT help Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs. @@ -31,11 +27,9 @@ Index: linux-2.6.32.9/drivers/watchdog/Kconfig # PARISC Architecture # POWERPC Architecture -Index: linux-2.6.32.9/drivers/watchdog/bcm63xx_wdt.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.32.9/drivers/watchdog/bcm63xx_wdt.c 2010-02-28 18:17:15.000000000 +0100 -@@ -0,0 +1,334 @@ +--- /dev/null ++++ b/drivers/watchdog/bcm63xx_wdt.c +@@ -0,0 +1,354 @@ +/* + * Broadcom BCM63xx SoC watchdog driver + * @@ -62,12 +56,15 @@ Index: linux-2.6.32.9/drivers/watchdog/bcm63xx_wdt.c +#include +#include +#include ++#include ++#include +#include +#include + +#include +#include +#include ++#include + +#define PFX KBUILD_MODNAME + @@ -84,7 +81,6 @@ Index: linux-2.6.32.9/drivers/watchdog/bcm63xx_wdt.c +} bcm63xx_wdt_device; + +static int expect_close; -+static int timeout; + +static int wdt_time = WDT_DEFAULT_TIME; +static int nowayout = WATCHDOG_NOWAYOUT; @@ -106,6 +102,13 @@ Index: linux-2.6.32.9/drivers/watchdog/bcm63xx_wdt.c + bcm_writel(WDT_STOP_2, bcm63xx_wdt_device.regs + WDT_CTL_REG); +} + ++static void bcm63xx_wdt_isr(void *data) ++{ ++ struct pt_regs *regs = get_irq_regs(); ++ ++ die(PFX " fire", regs); ++} ++ +static void bcm63xx_timer_tick(unsigned long unused) +{ + if (!atomic_dec_and_test(&bcm63xx_wdt_device.ticks)) { @@ -298,6 +301,13 @@ Index: linux-2.6.32.9/drivers/watchdog/bcm63xx_wdt.c + return -ENXIO; + } + ++ ret = bcm63xx_timer_register(TIMER_WDT_ID, bcm63xx_wdt_isr, NULL); ++ if (ret < 0) { ++ printk(KERN_ERR PFX ++ "failed to register wdt timer isr\n"); ++ goto unmap; ++ } ++ + if (bcm63xx_wdt_settimeout(wdt_time)) { + bcm63xx_wdt_settimeout(WDT_DEFAULT_TIME); + printk(KERN_INFO PFX @@ -309,22 +319,25 @@ Index: linux-2.6.32.9/drivers/watchdog/bcm63xx_wdt.c + if (ret) { + printk(KERN_ERR PFX + "failed to register reboot_notifier\n"); -+ return ret; ++ goto unregister_timer; + } + + ret = misc_register(&bcm63xx_wdt_miscdev); + if (ret < 0) { + printk(KERN_ERR PFX + "failed to register watchdog device\n"); -+ goto unmap; ++ goto unregister_reboot_notifier; + } + + printk(KERN_INFO PFX " started, timer margin: %d sec\n", WDT_DEFAULT_TIME); + + return 0; + -+unmap: ++unregister_reboot_notifier: + unregister_reboot_notifier(&bcm63xx_wdt_notifier); ++unregister_timer: ++ bcm63xx_timer_unregister(TIMER_WDT_ID); ++unmap: + iounmap(bcm63xx_wdt_device.regs); + return ret; +} @@ -339,6 +352,7 @@ Index: linux-2.6.32.9/drivers/watchdog/bcm63xx_wdt.c + iounmap(bcm63xx_wdt_device.regs); + + unregister_reboot_notifier(&bcm63xx_wdt_notifier); ++ bcm63xx_timer_unregister(TIMER_WDT_ID); + + return 0; +}