MLK-22654 mx7ulp: Update wdog disable sequence
authorYe Li <ye.li@nxp.com>
Wed, 18 Sep 2019 08:56:34 +0000 (01:56 -0700)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 07:56:32 +0000 (00:56 -0700)
commitec5ef13f0baf8e5ef706f664733a04ff02f551a2
treec4051d86a57b61dedb984cf6f811dec4168ea9c0
parentb5d21f7860fac0fb93b89999d0b7e59a8b8aa360
MLK-22654 mx7ulp: Update wdog disable sequence

Update the mx7ulp wdog disable sequence to avoid potential reset issue
in unlock or refresh sequence. Both sequence need two words write
to wdog CNT register in 16 bus clocks window, if miss the window,
the write will cause violation in wdog and reset the chip.

Current u-boot code is using writel() function which has a DMB barrier
to order the memory access. The DMB between two words write may introduce
some delay in certain circumstance, causing the wdog reset due to 16 bus
clock window requirement.

This patch replaces writel() function by __raw_writel() to avoid such issue,
and improve to check if watchdog is already disabled or unlocked.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit b8c99d5f5bcc5573d3394b68890db16b6bb5fc88)
(cherry picked from commit 29cf0fa20f54ca80e9ba4baf9eee3e53c1c634fa)
arch/arm/mach-imx/mx7ulp/soc.c