From: David Griego <[email protected]>

The davinci reset routine, davinci_watchdog_reset(), sets the
TCR register instead of the TGCR register as it should to put
the WDT into its "Initial State".

It also writes the WDTCR register without the proper WDKEY
which is pointless since the register will be write-protected.

Signed-off-by: David Griego <[email protected]>
Signed-off-by: Mark A. Greer <[email protected]>
---
Applies to current master, 9fb266015aa558e11d5e7ce08c9cfc180cd8ae2f
Tested on a dm355, dm6446, dm6467, and da830.
Reset on the da830 won't work without this patch.

 arch/arm/mach-davinci/time.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 3269585..39677e4 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -411,11 +411,11 @@ void davinci_watchdog_reset(void)
 
        /* reset timer, set mode to 64-bit watchdog, and unreset */
        tgcr = 0;
-       __raw_writel(tgcr, base + TCR);
+       __raw_writel(tgcr, base + TGCR);
        tgcr = TGCR_TIMMODE_64BIT_WDOG << TGCR_TIMMODE_SHIFT;
        tgcr |= (TGCR_UNRESET << TGCR_TIM12RS_SHIFT) |
                (TGCR_UNRESET << TGCR_TIM34RS_SHIFT);
-       __raw_writel(tgcr, base + TCR);
+       __raw_writel(tgcr, base + TGCR);
 
        /* clear counter and period regs */
        __raw_writel(0, base + TIM12);
@@ -423,12 +423,8 @@ void davinci_watchdog_reset(void)
        __raw_writel(0, base + PRD12);
        __raw_writel(0, base + PRD34);
 
-       /* enable */
-       wdtcr = __raw_readl(base + WDTCR);
-       wdtcr |= WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT;
-       __raw_writel(wdtcr, base + WDTCR);
-
        /* put watchdog in pre-active state */
+       wdtcr = __raw_readl(base + WDTCR);
        wdtcr = (WDTCR_WDKEY_SEQ0 << WDTCR_WDKEY_SHIFT) |
                (WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT);
        __raw_writel(wdtcr, base + WDTCR);

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to