From ff7712de39c333cf888e497a90f88601ef3e228f Mon Sep 17 00:00:00 2001 From: Stefan Sicleru Date: Fri, 10 Jun 2016 10:42:28 +0200 Subject: [PATCH] watchdog: fix errata ERR004346 Due to errata ERR004346 (WDOG: SRS bit requires to be written twice), two additional writes are added to ensure that at least two writes occur within one period of the 32kHz clock. Replace __raw_writew() calls with *_relaxed() calls in order to be endian-safe. Signed-off-by: Stefan Sicleru --- arch/arm/mach-imx/system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c index 80c177c..6e09ac0 100644 --- a/arch/arm/mach-imx/system.c +++ b/arch/arm/mach-imx/system.c @@ -51,7 +51,10 @@ void mxc_restart(enum reboot_mode mode, const char *cmd) wcr_enable = (1 << 2); /* Assert SRS signal */ - __raw_writew(wcr_enable, wdog_base); + + writew_relaxed(wcr_enable, wdog_base); + writew_relaxed(wcr_enable, wdog_base); + writew_relaxed(wcr_enable, wdog_base); /* wait for reset to assert... */ mdelay(500); -- 1.9.1