wdog: imx7ulp: Enable wdog int_en bit for watchdog any reset
PATCH 1/3 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.
--- drivers/watchdog/imx7ulp_wdt.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/watchdog/imx7ulp_wdt.c +8 -0
@@ -23,6 +23,7 @@#define LPO_CLK_SHIFT 8#define WDOG_CS_CLK (LPO_CLK << LPO_CLK_SHIFT)#define WDOG_CS_EN BIT(7) +#define WDOG_CS_INT_EN BIT(6)#define WDOG_CS_UPDATE BIT(5)#define WDOG_CS_WAIT BIT(1)#define WDOG_CS_STOP BIT(0)
@@ -62,6 +63,7 @@ struct imx7ulp_wdt_device {void __iomem *base;struct clk *clk;bool post_rcs_wait; +bool ext_reset;const struct imx_wdt_hw_feature *hw; };
@@ -285,6 +287,9 @@ static int imx7ulp_wdt_init(struct imx7ulp_wdt_device *wdt, unsigned int timeoutif (wdt->hw->prescaler_enable) val |=WDOG_CS_PRES ; +if (wdt->ext_reset) + val |=WDOG_CS_INT_EN ; + do { ret = _imx7ulp_wdt_init(wdt, timeout, val); toval = readl(wdt->base + WDOG_TOVAL);
@@ -321,6 +326,9 @@ static int imx7ulp_wdt_probe(struct platform_device *pdev)return PTR_ERR (imx7ulp_wdt->clk); } +/* The WDOG may need to do external reset through dedicated pin */ + imx7ulp_wdt->ext_reset =of_property_read_bool (dev->of_node,"fsl,ext-reset-output" ); + imx7ulp_wdt->post_rcs_wait = true;if (of_device_is_compatible (dev->of_node,"fsl,imx8ulp-wdt" )) {
Signature · 1 line
2.34.1
PATCH 2/3 dt-bindings: watchdog: fsl-imx7ulp-wdt: Add 'fsl,ext-reset-output'
The wdog may generate wdog_any external reset if the int_en bit is configured, so add a property for this purpose in dt-binding doc.
--- .../devicetree/bindings/watchdog/fsl-imx7ulp-wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/watchdog/fsl-imx7ulp-wdt.yaml +5 -0
@@ -30,6 +30,11 @@ properties: clocks: maxItems: 1 + fsl,ext-reset-output: + description: + When set, wdog can generate external reset from the wdog_any pin. + type: boolean + required: - compatible - interrupts
Signature · 1 line
2.34.1
Re: [PATCH 2/3] dt-bindings: watchdog: fsl-imx7ulp-wdt: Add 'fsl,ext-reset-output'
Quoted 9 lines · Jacky Bai
The wdog may generate
wdog_anyexternal reset if theint_enbit is configured, so add a property for this purpose in dt-binding doc.Signed-off-by Jacky Bai <[email protected]>Reviewed-by Peng Fan <[email protected]>--- .../devicetree/bindings/watchdog/fsl-imx7ulp-wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Re: [PATCH 2/3] dt-bindings: watchdog: fsl-imx7ulp-wdt: Add 'fsl,ext-reset-output'
In reply to Jacky BaiQuoted 5 lines · Jacky Bai
The wdog may generate
wdog_anyexternal reset if theint_enbit is configured, so add a property for this purpose in dt-binding doc.Signed-off-by Jacky Bai <[email protected]>Reviewed-by Peng Fan <[email protected]>
Quoted 23 lines
--- .../devicetree/bindings/watchdog/fsl-imx7ulp-wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+)Documentation/devicetree/bindings/watchdog/fsl-imx7ulp-wdt.yaml +5
-0@@ -30,6 +30,11 @@ properties: clocks: maxItems: 1 + fsl,ext-reset-output: + description: + When set, wdog can generate external reset from the wdog_any pin. + type: boolean + required: - compatible - interruptsSignature · 1 line
2.34.1
PATCH 3/3 arm64: dts: imx93: Add the 'fsl,ext-reset-output' property for wdog3
In reply to Jacky BaiAdd 'fsl,ext-reset-output' property for wdog3 to let it to trigger external reset through wdog_any pin.
--- arch/arm64/boot/dts/freescale/imx93.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/imx93.dtsi +1 -0
@@ -562,6 +562,7 @@ wdog3: watchdog@42490000 { interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk IMX93_CLK_WDOG3_GATE>; timeout-sec = <40>; + fsl,ext-reset-output; status = "disabled"; };
Signature · 1 line
2.34.1
Re: [PATCH 3/3] arm64: dts: imx93: Add the 'fsl,ext-reset-output' property for wdog3
Quoted 14 lines · Jacky Bai
Add 'fsl,ext-reset-output' property for wdog3 to let it to trigger external reset through
wdog_anypin.Signed-off-by Jacky Bai <[email protected]>Reviewed-by Peng Fan <[email protected]>--- arch/arm64/boot/dts/freescale/imx93.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm64/boot/dts/freescale/imx93.dtsi +0
-0
arch/arm64/boot/dts/freescale/imx93.dtsi wdog3: watchdog@42490000 { · line 565
Quoted 4 lines
arch/arm64/boot/dts/freescale/imx93.dtsi +1
-0@@ -562,6 +562,7 @@ wdog3: watchdog@42490000 { interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk IMX93_CLK_WDOG3_GATE>; timeout-sec = <40>; + fsl,ext-reset-output;
Shouldn't this be a board level setting?
Shawn
Quoted 6 lines
arch/arm64/boot/dts/freescale/imx93.dtsi +0
-0status = "disabled"; };Signature · 1 line
2.34.1
Quoted 5 lines · Jacky Bai
The wdog
INT_ENbit in CS register should be set to '1' to triggerWDOG_ANYexternal reset on i.MX93.Signed-off-by Jacky Bai <[email protected]>Reviewed-by Peng Fan <[email protected]>
Quoted 47 lines
--- drivers/watchdog/imx7ulp_wdt.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/watchdog/imx7ulp_wdt.c +8
-0@@ -23,6 +23,7 @@#define LPO_CLK_SHIFT 8#define WDOG_CS_CLK (LPO_CLK << LPO_CLK_SHIFT)#define WDOG_CS_EN BIT(7) +#define WDOG_CS_INT_EN BIT(6)#define WDOG_CS_UPDATE BIT(5)#define WDOG_CS_WAIT BIT(1)#define WDOG_CS_STOP BIT(0)@@ -62,6 +63,7 @@ struct imx7ulp_wdt_device {void __iomem *base;struct clk *clk;bool post_rcs_wait; +bool ext_reset;const struct imx_wdt_hw_feature *hw; };@@ -285,6 +287,9 @@ static int imx7ulp_wdt_init(struct imx7ulp_wdt_device *wdt, unsigned int timeoutif (wdt->hw->prescaler_enable) val |=WDOG_CS_PRES ; +if (wdt->ext_reset) + val |=WDOG_CS_INT_EN ; + do { ret = _imx7ulp_wdt_init(wdt, timeout, val); toval = readl(wdt->base + WDOG_TOVAL);@@ -321,6 +326,9 @@ static int imx7ulp_wdt_probe(struct platform_device *pdev)return PTR_ERR (imx7ulp_wdt->clk); } +/* The WDOG may need to do external reset through dedicated pin */ + imx7ulp_wdt->ext_reset =of_property_read_bool (dev->of_node,"fsl,ext-reset-output" ); + imx7ulp_wdt->post_rcs_wait = true;if (of_device_is_compatible (dev->of_node,"fsl,imx8ulp-wdt" )) {Signature · 1 line
2.34.1