MLK-22755 mx7ulp: wdog: Wait for WDOG unlock and reconfiguration to complete
authorBreno Lima <breno.lima@nxp.com>
Mon, 14 Oct 2019 00:35:53 +0000 (21:35 -0300)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 07:56:34 +0000 (00:56 -0700)
commitdda3f846a3700e9da019164f419ccaf59447d659
tree4b91a805bf4621f334f773cac54e41d551568b30
parent0254ecfb5027e1214f1ff869f163fbaadbc38ff3
MLK-22755 mx7ulp: wdog: Wait for WDOG unlock and reconfiguration to complete

According to i.MX7ULP Reference Manual we should wait for WDOG unlock
and reconfiguration to complete.

Section "59.5.3 Configure Watchdog" provides the following example:

DisableInterrupts; //disable global interrupt
WDOG_CNT = 0xD928C520; //unlock watchdog
while(WDOG_CS[ULK]==0); //wait until registers are unlocked
WDOG_TOVAL = 256; //set timeout value
WDOG_CS = WDOG_CS_EN(1) | WDOG_CS_CLK(1) | WDOG_CS_INT(1) |
  WDOG_CS_WIN(0) | WDOG_CS_UPDATE(1);
while(WDOG_CS[RCS]==0); //wait until new configuration takes effect
EnableInterrupts; //enable global interrupt

Update U-Boot WDOG driver to align with i.MX7ULP reference manual.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit 3ffee301cb4570e0e7681448ec434f0689bcbaa3)
(cherry picked from commit c4c929bcb47895ea13057f375579bac5be656ef1)
drivers/watchdog/ulp_wdog.c