aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-2.6.33/020-watchdog.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/brcm63xx/patches-2.6.33/020-watchdog.patch')
-rw-r--r--target/linux/brcm63xx/patches-2.6.33/020-watchdog.patch30
1 files changed, 25 insertions, 5 deletions
diff --git a/target/linux/brcm63xx/patches-2.6.33/020-watchdog.patch b/target/linux/brcm63xx/patches-2.6.33/020-watchdog.patch
index b4204d8f10..2b3e6c1b4e 100644
--- a/target/linux/brcm63xx/patches-2.6.33/020-watchdog.patch
+++ b/target/linux/brcm63xx/patches-2.6.33/020-watchdog.patch
@@ -29,7 +29,7 @@
# POWERPC Architecture
--- /dev/null
+++ b/drivers/watchdog/bcm63xx_wdt.c
-@@ -0,0 +1,334 @@
+@@ -0,0 +1,354 @@
+/*
+ * Broadcom BCM63xx SoC watchdog driver
+ *
@@ -56,12 +56,15 @@
+#include <linux/watchdog.h>
+#include <linux/timer.h>
+#include <linux/jiffies.h>
++#include <linux/interrupt.h>
++#include <linux/ptrace.h>
+#include <linux/resource.h>
+#include <linux/platform_device.h>
+
+#include <bcm63xx_cpu.h>
+#include <bcm63xx_io.h>
+#include <bcm63xx_regs.h>
++#include <bcm63xx_timer.h>
+
+#define PFX KBUILD_MODNAME
+
@@ -78,7 +81,6 @@
+} bcm63xx_wdt_device;
+
+static int expect_close;
-+static int timeout;
+
+static int wdt_time = WDT_DEFAULT_TIME;
+static int nowayout = WATCHDOG_NOWAYOUT;
@@ -100,6 +102,13 @@
+ 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)) {
@@ -292,6 +301,13 @@
+ 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
@@ -303,22 +319,25 @@
+ 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");
pre { line-height: 125%; margin: 0; } td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } .highlight .hll { background-color: #ffffcc } .highlight { background: #ffffff; } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddff