Skip to content

Commit 423fc66

Browse files
JackyBaiWim Van Sebroeck
authored andcommitted
wdog: imx7ulp: Enable wdog int_en bit for watchdog any reset
The wdog INT_EN bit in CS register should be set to '1' to trigger WDOG_ANY external reset on i.MX93. Signed-off-by: Jacky Bai <[email protected]> Reviewed-by: Peng Fan <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 946af15 commit 423fc66

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/watchdog/imx7ulp_wdt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define LPO_CLK_SHIFT 8
2424
#define WDOG_CS_CLK (LPO_CLK << LPO_CLK_SHIFT)
2525
#define WDOG_CS_EN BIT(7)
26+
#define WDOG_CS_INT_EN BIT(6)
2627
#define WDOG_CS_UPDATE BIT(5)
2728
#define WDOG_CS_WAIT BIT(1)
2829
#define WDOG_CS_STOP BIT(0)
@@ -62,6 +63,7 @@ struct imx7ulp_wdt_device {
6263
void __iomem *base;
6364
struct clk *clk;
6465
bool post_rcs_wait;
66+
bool ext_reset;
6567
const struct imx_wdt_hw_feature *hw;
6668
};
6769

@@ -285,6 +287,9 @@ static int imx7ulp_wdt_init(struct imx7ulp_wdt_device *wdt, unsigned int timeout
285287
if (wdt->hw->prescaler_enable)
286288
val |= WDOG_CS_PRES;
287289

290+
if (wdt->ext_reset)
291+
val |= WDOG_CS_INT_EN;
292+
288293
do {
289294
ret = _imx7ulp_wdt_init(wdt, timeout, val);
290295
toval = readl(wdt->base + WDOG_TOVAL);
@@ -321,6 +326,9 @@ static int imx7ulp_wdt_probe(struct platform_device *pdev)
321326
return PTR_ERR(imx7ulp_wdt->clk);
322327
}
323328

329+
/* The WDOG may need to do external reset through dedicated pin */
330+
imx7ulp_wdt->ext_reset = of_property_read_bool(dev->of_node, "fsl,ext-reset-output");
331+
324332
imx7ulp_wdt->post_rcs_wait = true;
325333
if (of_device_is_compatible(dev->of_node,
326334
"fsl,imx8ulp-wdt")) {

0 commit comments

Comments
 (0)