linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v2,0/2] update mediatek wdt driver and dt-binding
@ 2021-09-03  6:16 Fengquan Chen
  2021-09-03  6:16 ` [v2,1/2] watchdog: mtk: add disable_wdt_extrst support Fengquan Chen
  2021-09-03  6:16 ` [v2,2/2] dt-bindings: watchdog: mtk-wdt: " Fengquan Chen
  0 siblings, 2 replies; 6+ messages in thread
From: Fengquan Chen @ 2021-09-03  6:16 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Matthias Brugger,
	linux-watchdog, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: fengquan.chen, tinghan.shen, randy.wu, rex-bc.chen,
	christine.zhu, joe.yang, zhishuang.zhang

1. add disable_wdt_extrst to support disable reset signal output
2. update watchdog dt-binding

fengquan.chen (2):
  watchdog: mtk: add disable_wdt_extrst support
  dt-bindings: watchdog: mtk-wdt: add disable_wdt_extrst support

 Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 2 ++
 drivers/watchdog/mtk_wdt.c                             | 7 +++++++
 2 files changed, 9 insertions(+)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [v2,1/2] watchdog: mtk: add disable_wdt_extrst support
  2021-09-03  6:16 [v2,0/2] update mediatek wdt driver and dt-binding Fengquan Chen
@ 2021-09-03  6:16 ` Fengquan Chen
  2021-09-03 14:05   ` Guenter Roeck
  2021-09-03  6:16 ` [v2,2/2] dt-bindings: watchdog: mtk-wdt: " Fengquan Chen
  1 sibling, 1 reply; 6+ messages in thread
From: Fengquan Chen @ 2021-09-03  6:16 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Matthias Brugger,
	linux-watchdog, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: fengquan.chen, tinghan.shen, randy.wu, rex-bc.chen,
	christine.zhu, joe.yang, zhishuang.zhang

In some cases, we may need watchdog just to trigger an
internal soc reset without sending any output signal.

Provide a disable_wdt_extrst parameter for configuration.
We can disable or enable it just by configuring dts.

Signed-off-by: fengquan.chen <fengquan.chen@mediatek.com>
---
 drivers/watchdog/mtk_wdt.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
index 97ca993bd009..276b6cb7d225 100644
--- a/drivers/watchdog/mtk_wdt.c
+++ b/drivers/watchdog/mtk_wdt.c
@@ -63,6 +63,7 @@ struct mtk_wdt_dev {
 	void __iomem *wdt_base;
 	spinlock_t lock; /* protects WDT_SWSYSRST reg */
 	struct reset_controller_dev rcdev;
+	bool disable_wdt_extrst;
 };
 
 struct mtk_wdt_data {
@@ -240,6 +241,8 @@ static int mtk_wdt_start(struct watchdog_device *wdt_dev)
 
 	reg = ioread32(wdt_base + WDT_MODE);
 	reg &= ~(WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN);
+	if (mtk_wdt->disable_wdt_extrst)
+		reg &= ~WDT_MODE_EXRST_EN;
 	reg |= (WDT_MODE_EN | WDT_MODE_KEY);
 	iowrite32(reg, wdt_base + WDT_MODE);
 
@@ -309,6 +312,10 @@ static int mtk_wdt_probe(struct platform_device *pdev)
 		if (err)
 			return err;
 	}
+
+	mtk_wdt->disable_wdt_extrst =
+		of_property_read_bool(dev->of_node, "mediatek,disable-extrst");
+
 	return 0;
 }
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [v2,2/2] dt-bindings: watchdog: mtk-wdt: add disable_wdt_extrst support
  2021-09-03  6:16 [v2,0/2] update mediatek wdt driver and dt-binding Fengquan Chen
  2021-09-03  6:16 ` [v2,1/2] watchdog: mtk: add disable_wdt_extrst support Fengquan Chen
@ 2021-09-03  6:16 ` Fengquan Chen
  2021-09-07 19:28   ` Rob Herring
  1 sibling, 1 reply; 6+ messages in thread
From: Fengquan Chen @ 2021-09-03  6:16 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Matthias Brugger,
	linux-watchdog, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: fengquan.chen, tinghan.shen, randy.wu, rex-bc.chen,
	christine.zhu, joe.yang, zhishuang.zhang

This patch add a description and example of disable_wdt_extrst
element for watchdog on MTK Socs

Signed-off-by: fengquan.chen <fengquan.chen@mediatek.com>
---
 Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
index e36ba60de829..c202d6fa5801 100644
--- a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
@@ -17,6 +17,7 @@ Required properties:
 - reg : Specifies base physical address and size of the registers.
 
 Optional properties:
+- mediatek,disable-extrst: disable send output reset signal
 - timeout-sec: contains the watchdog timeout in seconds.
 - #reset-cells: Should be 1.
 
@@ -25,6 +26,7 @@ Example:
 watchdog: watchdog@10007000 {
 	compatible = "mediatek,mt8183-wdt",
 		     "mediatek,mt6589-wdt";
+	mediatek,disable-extrst;
 	reg = <0 0x10007000 0 0x100>;
 	timeout-sec = <10>;
 	#reset-cells = <1>;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2,1/2] watchdog: mtk: add disable_wdt_extrst support
  2021-09-03  6:16 ` [v2,1/2] watchdog: mtk: add disable_wdt_extrst support Fengquan Chen
@ 2021-09-03 14:05   ` Guenter Roeck
  2021-09-14 12:51     ` Fengquan Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2021-09-03 14:05 UTC (permalink / raw)
  To: Fengquan Chen, Wim Van Sebroeck, Rob Herring, Matthias Brugger,
	linux-watchdog, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: tinghan.shen, randy.wu, rex-bc.chen, christine.zhu, joe.yang,
	zhishuang.zhang

On 9/2/21 11:16 PM, Fengquan Chen wrote:
> In some cases, we may need watchdog just to trigger an
> internal soc reset without sending any output signal.
> 
> Provide a disable_wdt_extrst parameter for configuration.
> We can disable or enable it just by configuring dts.
> 
> Signed-off-by: fengquan.chen <fengquan.chen@mediatek.com>

Nit: You should set up git such that it uses "Fengquan Chen", not
"fengquan.chen".

Other than that, for my reference,

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

We'll have to wait for dt property approval before we can apply the patch.

Thanks,
Guenter

> ---
>   drivers/watchdog/mtk_wdt.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
> index 97ca993bd009..276b6cb7d225 100644
> --- a/drivers/watchdog/mtk_wdt.c
> +++ b/drivers/watchdog/mtk_wdt.c
> @@ -63,6 +63,7 @@ struct mtk_wdt_dev {
>   	void __iomem *wdt_base;
>   	spinlock_t lock; /* protects WDT_SWSYSRST reg */
>   	struct reset_controller_dev rcdev;
> +	bool disable_wdt_extrst;
>   };
>   
>   struct mtk_wdt_data {
> @@ -240,6 +241,8 @@ static int mtk_wdt_start(struct watchdog_device *wdt_dev)
>   
>   	reg = ioread32(wdt_base + WDT_MODE);
>   	reg &= ~(WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN);
> +	if (mtk_wdt->disable_wdt_extrst)
> +		reg &= ~WDT_MODE_EXRST_EN;
>   	reg |= (WDT_MODE_EN | WDT_MODE_KEY);
>   	iowrite32(reg, wdt_base + WDT_MODE);
>   
> @@ -309,6 +312,10 @@ static int mtk_wdt_probe(struct platform_device *pdev)
>   		if (err)
>   			return err;
>   	}
> +
> +	mtk_wdt->disable_wdt_extrst =
> +		of_property_read_bool(dev->of_node, "mediatek,disable-extrst");
> +
>   	return 0;
>   }
>   
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2,2/2] dt-bindings: watchdog: mtk-wdt: add disable_wdt_extrst support
  2021-09-03  6:16 ` [v2,2/2] dt-bindings: watchdog: mtk-wdt: " Fengquan Chen
@ 2021-09-07 19:28   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-09-07 19:28 UTC (permalink / raw)
  To: Fengquan Chen
  Cc: randy.wu, Rob Herring, linux-watchdog, rex-bc.chen,
	Guenter Roeck, christine.zhu, linux-kernel, devicetree,
	Matthias Brugger, Wim Van Sebroeck, linux-arm-kernel,
	linux-mediatek, zhishuang.zhang, fengquan.chen, tinghan.shen,
	joe.yang

On Fri, 03 Sep 2021 14:16:23 +0800, Fengquan Chen wrote:
> This patch add a description and example of disable_wdt_extrst
> element for watchdog on MTK Socs
> 
> Signed-off-by: fengquan.chen <fengquan.chen@mediatek.com>
> ---
>  Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2,1/2] watchdog: mtk: add disable_wdt_extrst support
  2021-09-03 14:05   ` Guenter Roeck
@ 2021-09-14 12:51     ` Fengquan Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Fengquan Chen @ 2021-09-14 12:51 UTC (permalink / raw)
  To: Guenter Roeck, Wim Van Sebroeck, Rob Herring, Matthias Brugger,
	linux-watchdog, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: tinghan.shen, randy.wu, rex-bc.chen, christine.zhu, joe.yang,
	zhishuang.zhang

On Fri, 2021-09-03 at 07:05 -0700, Guenter Roeck wrote:
> On 9/2/21 11:16 PM, Fengquan Chen wrote:
> > In some cases, we may need watchdog just to trigger an
> > internal soc reset without sending any output signal.
> > 
> > Provide a disable_wdt_extrst parameter for configuration.
> > We can disable or enable it just by configuring dts.
> > 
> > Signed-off-by: fengquan.chen <fengquan.chen@mediatek.com>
> 
> Nit: You should set up git such that it uses "Fengquan Chen", not
> "fengquan.chen".
> 
> Other than that, for my reference,
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> We'll have to wait for dt property approval before we can apply the
> patch.
> 
> Thanks,
> Guenter

Thanks, i have uploaded a new v3 to fix the signed-off name,
and move the dt-binding patch to the first patch.

Best Regards
Fengquan

> 
> > ---
> >   drivers/watchdog/mtk_wdt.c | 7 +++++++
> >   1 file changed, 7 insertions(+)
> > 
> > diff --git a/drivers/watchdog/mtk_wdt.c
> > b/drivers/watchdog/mtk_wdt.c
> > index 97ca993bd009..276b6cb7d225 100644
> > --- a/drivers/watchdog/mtk_wdt.c
> > +++ b/drivers/watchdog/mtk_wdt.c
> > @@ -63,6 +63,7 @@ struct mtk_wdt_dev {
> >   	void __iomem *wdt_base;
> >   	spinlock_t lock; /* protects WDT_SWSYSRST reg */
> >   	struct reset_controller_dev rcdev;
> > +	bool disable_wdt_extrst;
> >   };
> >   
> >   struct mtk_wdt_data {
> > @@ -240,6 +241,8 @@ static int mtk_wdt_start(struct watchdog_device
> > *wdt_dev)
> >   
> >   	reg = ioread32(wdt_base + WDT_MODE);
> >   	reg &= ~(WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN);
> > +	if (mtk_wdt->disable_wdt_extrst)
> > +		reg &= ~WDT_MODE_EXRST_EN;
> >   	reg |= (WDT_MODE_EN | WDT_MODE_KEY);
> >   	iowrite32(reg, wdt_base + WDT_MODE);
> >   
> > @@ -309,6 +312,10 @@ static int mtk_wdt_probe(struct
> > platform_device *pdev)
> >   		if (err)
> >   			return err;
> >   	}
> > +
> > +	mtk_wdt->disable_wdt_extrst =
> > +		of_property_read_bool(dev->of_node, "mediatek,disable-
> > extrst");
> > +
> >   	return 0;
> >   }
> >   
> > 
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-14 12:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-03  6:16 [v2,0/2] update mediatek wdt driver and dt-binding Fengquan Chen
2021-09-03  6:16 ` [v2,1/2] watchdog: mtk: add disable_wdt_extrst support Fengquan Chen
2021-09-03 14:05   ` Guenter Roeck
2021-09-14 12:51     ` Fengquan Chen
2021-09-03  6:16 ` [v2,2/2] dt-bindings: watchdog: mtk-wdt: " Fengquan Chen
2021-09-07 19:28   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).