diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2012-10-23 12:21:34 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2012-10-23 12:21:34 +0000 |
commit | 648f1d01710c2e9d5bb3e296d9553120e5bbe51e (patch) | |
tree | 413eb23081ae9b34b54a6ee479e5a2bf0085877d /target/linux/generic/patches-3.6/994-mpcore_wdt_fix_timer_mode_setup.patch | |
parent | 35c7b0ba8a06d128adf45ca58377299e988d4e84 (diff) | |
download | upstream-648f1d01710c2e9d5bb3e296d9553120e5bbe51e.tar.gz upstream-648f1d01710c2e9d5bb3e296d9553120e5bbe51e.tar.bz2 upstream-648f1d01710c2e9d5bb3e296d9553120e5bbe51e.zip |
[generic]: linux 3.6 support (work in progress)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33897 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/patches-3.6/994-mpcore_wdt_fix_timer_mode_setup.patch')
-rw-r--r-- | target/linux/generic/patches-3.6/994-mpcore_wdt_fix_timer_mode_setup.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/target/linux/generic/patches-3.6/994-mpcore_wdt_fix_timer_mode_setup.patch b/target/linux/generic/patches-3.6/994-mpcore_wdt_fix_timer_mode_setup.patch new file mode 100644 index 0000000000..009092376f --- /dev/null +++ b/target/linux/generic/patches-3.6/994-mpcore_wdt_fix_timer_mode_setup.patch @@ -0,0 +1,57 @@ +Allow watchdog to set its iterrupt as pending when it is configured +for timer mode (in other words, allow emitting interrupt). +Also add macros for all Watchdog Control Register flags. + +Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com> +--- + arch/arm/include/asm/smp_twd.h | 6 ++++++ + drivers/watchdog/mpcore_wdt.c | 15 +++++++++++---- + 2 files changed, 17 insertions(+), 4 deletions(-) + +--- a/arch/arm/include/asm/smp_twd.h ++++ b/arch/arm/include/asm/smp_twd.h +@@ -18,6 +18,12 @@ + #define TWD_TIMER_CONTROL_PERIODIC (1 << 1) + #define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2) + ++#define TWD_WDOG_CONTROL_ENABLE (1 << 0) ++#define TWD_WDOG_CONTROL_PERIODIC (1 << 1) ++#define TWD_WDOG_CONTROL_IT_ENABLE (1 << 2) ++#define TWD_WDOG_CONTROL_TIMER_MODE (0 << 3) ++#define TWD_WDOG_CONTROL_WATCHDOG_MODE (1 << 3) ++ + struct clock_event_device; + + extern void __iomem *twd_base; +--- a/drivers/watchdog/mpcore_wdt.c ++++ b/drivers/watchdog/mpcore_wdt.c +@@ -118,18 +118,25 @@ static void mpcore_wdt_stop(struct mpcor + + static void mpcore_wdt_start(struct mpcore_wdt *wdt) + { ++ u32 mode; ++ + dev_printk(KERN_INFO, wdt->dev, "enabling watchdog.\n"); + + /* This loads the count register but does NOT start the count yet */ + mpcore_wdt_keepalive(wdt); + ++ /* Setup watchdog - prescale=256, enable=1 */ ++ mode = (255 << 8) | TWD_WDOG_CONTROL_ENABLE; ++ + if (mpcore_noboot) { +- /* Enable watchdog - prescale=256, watchdog mode=0, enable=1 */ +- writel(0x0000FF01, wdt->base + TWD_WDOG_CONTROL); ++ /* timer mode, send interrupt */ ++ mode |= TWD_WDOG_CONTROL_TIMER_MODE | ++ TWD_WDOG_CONTROL_IT_ENABLE; + } else { +- /* Enable watchdog - prescale=256, watchdog mode=1, enable=1 */ +- writel(0x0000FF09, wdt->base + TWD_WDOG_CONTROL); ++ /* watchdog mode */ ++ mode |= TWD_WDOG_CONTROL_WATCHDOG_MODE; + } ++ writel(mode, wdt->base + TWD_WDOG_CONTROL); + } + + static int mpcore_wdt_set_heartbeat(int t) |