Skip to content

Commit

Permalink
ARM: imx: improve mxc_restart() on the SRC bit writes
Browse files Browse the repository at this point in the history
The current comment in the code does not make it clear why the double writes
on SRC bit is needed.  Let's quote the errata to get it clear.  Also, to
ensure there are at least 2 writes happen in the same one 32kHz period,
we actually need 3 writes.  Let's add the third one.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
  • Loading branch information
Shawn Guo committed Nov 11, 2013
1 parent b6e23bb commit 2c11b57
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arch/arm/mach-imx/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)

/* Assert SRS signal */
__raw_writew(wcr_enable, wdog_base);
/* write twice to ensure the request will not get ignored */
/*
* Due to imx6q errata ERR004346 (WDOG: WDOG SRS bit requires to be
* written twice), we add another two writes to ensure there must be at
* least two writes happen in the same one 32kHz clock period. We save
* the target check here, since the writes shouldn't be a huge burden
* for other platforms.
*/
__raw_writew(wcr_enable, wdog_base);
__raw_writew(wcr_enable, wdog_base);

/* wait for reset to assert... */
Expand Down

0 comments on commit 2c11b57

Please sign in to comment.