Re: [U-Boot] [PATCH 3/7] ti: wdt: omap: Disable watchdog timer before performing initialization
Hi Tom, > On Sun, Feb 19, 2017 at 11:24:38PM +0100, Lukasz Majewski wrote: > > > The OMAP WDT IP block requires to be stopped before any write to its > > registers is performed. > > > > This problem has been thoroughly described in Linux kernel: > > > > "watchdog: omap: assert the counter being stopped before > > reprogramming: SHA1: 530c11d432727c697629ad5f9d00ee8e2864d453 > > > > Signed-off-by: Lukasz Majewski> > Reviewed-by: Tom Rini > Could this patch be applied alone? Preparing reset of this patch set is a bit more tricky (since includes verbose testing). Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de pgp9sRoNGr4_g.pgp Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 3/7] ti: wdt: omap: Disable watchdog timer before performing initialization
On Sun, Feb 19, 2017 at 11:24:38PM +0100, Lukasz Majewski wrote: > The OMAP WDT IP block requires to be stopped before any write to its > registers is performed. > > This problem has been thoroughly described in Linux kernel: > > "watchdog: omap: assert the counter being stopped before reprogramming: > SHA1: 530c11d432727c697629ad5f9d00ee8e2864d453 > > Signed-off-by: Lukasz MajewskiReviewed-by: Tom Rini -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/7] ti: wdt: omap: Disable watchdog timer before performing initialization
The OMAP WDT IP block requires to be stopped before any write to its registers is performed. This problem has been thoroughly described in Linux kernel: "watchdog: omap: assert the counter being stopped before reprogramming: SHA1: 530c11d432727c697629ad5f9d00ee8e2864d453 Signed-off-by: Lukasz Majewski--- drivers/watchdog/omap_wdt.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 7ea4b60..7b1f429 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -81,10 +81,32 @@ static int omap_wdt_set_timeout(unsigned int timeout) return 0; } +void hw_watchdog_disable(void) +{ + struct wd_timer *wdt = (struct wd_timer *)WDT_BASE; + + /* +* Disable watchdog +*/ + writel(0x, >wdtwspr); + while (readl(>wdtwwps) != 0x0) + ; + writel(0x, >wdtwspr); + while (readl(>wdtwwps) != 0x0) + ; +} + void hw_watchdog_init(void) { struct wd_timer *wdt = (struct wd_timer *)WDT_BASE; + /* +* Make sure the watchdog is disabled. This is unfortunately required +* because writing to various registers with the watchdog running has no +* effect. +*/ + hw_watchdog_disable(); + /* initialize prescaler */ while (readl(>wdtwwps) & WDT_WWPS_PEND_WCLR) ; @@ -104,18 +126,3 @@ void hw_watchdog_init(void) while ((readl(>wdtwwps)) & WDT_WWPS_PEND_WSPR) ; } - -void hw_watchdog_disable(void) -{ - struct wd_timer *wdt = (struct wd_timer *)WDT_BASE; - - /* -* Disable watchdog -*/ - writel(0x, >wdtwspr); - while (readl(>wdtwwps) != 0x0) - ; - writel(0x, >wdtwspr); - while (readl(>wdtwwps) != 0x0) - ; -} -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot