From: Bernhard Beschow <[email protected]> The WDT bit gets reset and becomes writeable after power on reset which imx2_wdt_reset() represents. While the WDT bit in the WCR register already gets reset, its locked attribute wasn't. Fix this inconsistency by adding the missing unlock of its locked attribute.
Cc: [email protected] Fixes: daca13d495a1 ("hw/watchdog: Implement full i.MX watchdog support") Reported-by: Peter Maydell <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Bernhard Beschow <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> (cherry picked from commit 98d21eef2c383cd770e3205048a684560128a16d) Signed-off-by: Michael Tokarev <[email protected]> diff --git a/hw/watchdog/wdt_imx2.c b/hw/watchdog/wdt_imx2.c index 58fb4dc69c3..8b54747f9de 100644 --- a/hw/watchdog/wdt_imx2.c +++ b/hw/watchdog/wdt_imx2.c @@ -60,6 +60,7 @@ static void imx2_wdt_reset(DeviceState *dev) s->wicr_locked = false; s->wcr_locked = false; s->wcr_wde_locked = false; + s->wcr_wdt_locked = false; s->wcr = IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS; s->wsr = 0; diff --git a/include/hw/watchdog/wdt_imx2.h b/include/hw/watchdog/wdt_imx2.h index 600a552d2e2..d920c29af78 100644 --- a/include/hw/watchdog/wdt_imx2.h +++ b/include/hw/watchdog/wdt_imx2.h @@ -85,7 +85,7 @@ struct IMX2WdtState { bool wcr_locked; /* affects WDZST, WDBG, and WDW */ bool wcr_wde_locked; /* affects WDE */ - bool wcr_wdt_locked; /* affects WDT (never cleared) */ + bool wcr_wdt_locked; /* affects WDT, cleared on POR */ }; #endif /* WDT_IMX2_H */ -- 2.47.3
