From: Peng Fan Date: Mon, 14 Sep 2015 05:34:44 +0000 (+0800) Subject: imx: wdog: correct wcr register settings X-Git-Tag: v2015.10-rc4~20^2~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=623d96e89aca6;p=u-boot imx: wdog: correct wcr register settings We should not simple use "writew(WCR_WDE, &wdog->wcr)" to set wcr, since this will override bits set before reset_cpu. Use clrsetbits_le16 instead of writew to fix this issue. Signed-off-by: Peng Fan Cc: Stefano Babic Cc: Fabio Estevam Cc: Sebastian Siewior Tested-by: Fabio Estevam --- diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c index 1d18d4b269..9a77a54192 100644 --- a/drivers/watchdog/imx_watchdog.c +++ b/drivers/watchdog/imx_watchdog.c @@ -55,7 +55,8 @@ void reset_cpu(ulong addr) { struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; - writew(WCR_WDE, &wdog->wcr); + clrsetbits_le16(&wdog->wcr, 0, WCR_WDE); + writew(0x5555, &wdog->wsr); writew(0xaaaa, &wdog->wsr); /* load minimum 1/2 second timeout */ while (1) {