summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <Peng.Fan@freescale.com>2015-09-14 13:34:44 +0800
committerStefano Babic <sbabic@denx.de>2015-09-20 09:39:35 +0200
commit623d96e89aca64c2762150087f4e872c55481f13 (patch)
tree2e5b5b45143720e6352ebe854580eb7f956bc1f6
parentc3c8a5748897b24f18618047804317167a531dd3 (diff)
downloadu-boot-imx-623d96e89aca64c2762150087f4e872c55481f13.zip
u-boot-imx-623d96e89aca64c2762150087f4e872c55481f13.tar.gz
u-boot-imx-623d96e89aca64c2762150087f4e872c55481f13.tar.bz2
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 <Peng.Fan@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Sebastian Siewior <bigeasy@linutronix.de> Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
-rw-r--r--drivers/watchdog/imx_watchdog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 1d18d4b..9a77a54 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) {