devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt
@ 2013-06-11 10:51 Boris BREZILLON
  2013-06-11 10:51 ` [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc Boris BREZILLON
  2013-06-21  1:47 ` [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt Yang, Wenyou
  0 siblings, 2 replies; 6+ messages in thread
From: Boris BREZILLON @ 2013-06-11 10:51 UTC (permalink / raw)
  To: Wim Van Sebroeck, Jean-Christophe Plagniol-Villard, Nicolas Ferre,
	linux-watchdog
  Cc: linux-arm-kernel, linux-kernel, Boris BREZILLON,
	devicetree-discuss, linux-doc

Hello,

This patch series is a porposal to enhance the sam9 watchdog timer support.

The at91sam9 watchdog timer cannot configured twice, and the current
implementation only tries to configure in a static way:
- 2 seconds timeout
- wdt restart every 500ms

If the timer has already been configured with different values, it returns an
error and do not create any watchdog device.

This is not critical if the watchdog is disabled, but if it has been enabled with
different timeout values it will lead to a SoC reset.

This patch series tries to address this issue by adapting the heartbeat value
according the WDT timer config:
- it first tries to configure the timer as requested.
- if it fails it fallbacks to the current config, adapting its heartbeat timer
to the needs

This patch series also move to a dynamically allocated at91wdt device instead
of the static instance. I'm not sure this is the best solution, so please tell
me if you prefer to keep static instance of watchdog.

It adds a new at91 wdt type: software. This new type make use of the at91 wdt
interrupt to trigger a software watchdog.

Finally it adds several properties to the device tree bindings.

Best Regards,
Boris

Boris BREZILLON (4):
  watchdog: at91sam9_wdt: better watchdog support
  watchdog: at91sam9_wdt: update device tree doc
  ARM: at91/dt: add sam9 watchdog default options to SoCs
  ARM: at91/dt: add watchdog properties to kizbox board

 .../devicetree/bindings/watchdog/atmel-wdt.txt     |   30 +-
 arch/arm/boot/dts/at91sam9260.dtsi                 |    5 +
 arch/arm/boot/dts/at91sam9263.dtsi                 |    5 +
 arch/arm/boot/dts/at91sam9g45.dtsi                 |    5 +
 arch/arm/boot/dts/at91sam9n12.dtsi                 |    5 +
 arch/arm/boot/dts/at91sam9x5.dtsi                  |    5 +
 arch/arm/boot/dts/kizbox.dts                       |    6 +
 arch/arm/boot/dts/sama5d3.dtsi                     |    5 +
 drivers/watchdog/at91sam9_wdt.c                    |  319 +++++++++++++++-----
 9 files changed, 300 insertions(+), 85 deletions(-)

-- 
1.7.9.5


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

* [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc
  2013-06-11 10:51 [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt Boris BREZILLON
@ 2013-06-11 10:51 ` Boris BREZILLON
  2013-06-11 22:29   ` Grant Likely
  2013-06-21  1:42   ` Yang, Wenyou
  2013-06-21  1:47 ` [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt Yang, Wenyou
  1 sibling, 2 replies; 6+ messages in thread
From: Boris BREZILLON @ 2013-06-11 10:51 UTC (permalink / raw)
  To: Wim Van Sebroeck, Jean-Christophe Plagniol-Villard, Nicolas Ferre
  Cc: linux-watchdog, linux-doc, devicetree-discuss, linux-kernel,
	Rob Herring, Boris BREZILLON, Rob Landley, Grant Likely,
	linux-arm-kernel

Add new at91sam9 watchdog properties to the documentation.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 .../devicetree/bindings/watchdog/atmel-wdt.txt     |   30 ++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
index fcdd48f..e043106 100644
--- a/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
@@ -9,11 +9,37 @@ Required properties:
 
 Optional properties:
 - timeout-sec: contains the watchdog timeout in seconds.
+- interrupts : Should contain WDT interrupt.
+- atmel,max-heartbeat-sec : Should contain the maximum heartbeat value in
+	seconds. This value should be less than 16. It is used to compute the
+	WDV field.
+- atmel,max-heartbeat-sec : Should contain the minimum heartbeat value in
+	seconds. This value should be less than 4 times the max-heartbeat-sec
+	value. It is used to compute the WDD field.
+- atmel,watchdog-type : Should be "hardware" or "software". Hardware watchdog
+	use the at91 watchdog reset. Software watchdog use the watcdog interrup
+	to trigger a software reset.
+- atmel,reset-type : Should be "proc" or "all".
+	"all" : assert peripherals and processor reset signals
+	"proc" : assert the processor reset signal
+	This is valid only when using "hardware" watchdog.
+- atmel,disable : Should be present if you want to disable the watchdog.
+- atmel,idle-halt : Should be present if you want to stop the watchdog when
+	entering idle state.
+- atmel,dbg-halt : Should be present if you want to stop the watchdog when
+	entering debug state.
 
 Example:
-
 	watchdog@fffffd40 {
 		compatible = "atmel,at91sam9260-wdt";
 		reg = <0xfffffd40 0x10>;
-		timeout-sec = <10>;
+		interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+		timeout-sec = <15>;
+		atmel,watchdog-type = "hardware";
+		atmel,reset-type = "all";
+		atmel,dbg-halt;
+		atmel,idle-halt;
+		atmel,max-heartbeat-sec = <16>;
+		atmel,min-heartbeat-sec = <0>;
+		status = "okay";
 	};
-- 
1.7.9.5

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

* Re: [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc
  2013-06-11 10:51 ` [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc Boris BREZILLON
@ 2013-06-11 22:29   ` Grant Likely
  2013-06-21  1:42   ` Yang, Wenyou
  1 sibling, 0 replies; 6+ messages in thread
From: Grant Likely @ 2013-06-11 22:29 UTC (permalink / raw)
  To: Wim Van Sebroeck, Jean-Christophe Plagniol-Villard, Nicolas Ferre
  Cc: linux-arm-kernel, linux-kernel, linux-watchdog, Boris BREZILLON,
	Rob Herring, Rob Landley, devicetree-discuss, linux-doc

On Tue, 11 Jun 2013 12:51:27 +0200, Boris BREZILLON <b.brezillon@overkiz.com> wrote:
> Add new at91sam9 watchdog properties to the documentation.
> 
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

Looks reasonable,

Acked-by: Grant Likely <grant.likely@linaro.org>

> ---
>  .../devicetree/bindings/watchdog/atmel-wdt.txt     |   30 ++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
> index fcdd48f..e043106 100644
> --- a/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
> +++ b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
> @@ -9,11 +9,37 @@ Required properties:
>  
>  Optional properties:
>  - timeout-sec: contains the watchdog timeout in seconds.
> +- interrupts : Should contain WDT interrupt.
> +- atmel,max-heartbeat-sec : Should contain the maximum heartbeat value in
> +	seconds. This value should be less than 16. It is used to compute the
> +	WDV field.
> +- atmel,max-heartbeat-sec : Should contain the minimum heartbeat value in
> +	seconds. This value should be less than 4 times the max-heartbeat-sec
> +	value. It is used to compute the WDD field.
> +- atmel,watchdog-type : Should be "hardware" or "software". Hardware watchdog
> +	use the at91 watchdog reset. Software watchdog use the watcdog interrup
> +	to trigger a software reset.
> +- atmel,reset-type : Should be "proc" or "all".
> +	"all" : assert peripherals and processor reset signals
> +	"proc" : assert the processor reset signal
> +	This is valid only when using "hardware" watchdog.
> +- atmel,disable : Should be present if you want to disable the watchdog.
> +- atmel,idle-halt : Should be present if you want to stop the watchdog when
> +	entering idle state.
> +- atmel,dbg-halt : Should be present if you want to stop the watchdog when
> +	entering debug state.
>  
>  Example:
> -
>  	watchdog@fffffd40 {
>  		compatible = "atmel,at91sam9260-wdt";
>  		reg = <0xfffffd40 0x10>;
> -		timeout-sec = <10>;
> +		interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
> +		timeout-sec = <15>;
> +		atmel,watchdog-type = "hardware";
> +		atmel,reset-type = "all";
> +		atmel,dbg-halt;
> +		atmel,idle-halt;
> +		atmel,max-heartbeat-sec = <16>;
> +		atmel,min-heartbeat-sec = <0>;
> +		status = "okay";
>  	};
> -- 
> 1.7.9.5
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

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

* RE: [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc
  2013-06-11 10:51 ` [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc Boris BREZILLON
  2013-06-11 22:29   ` Grant Likely
@ 2013-06-21  1:42   ` Yang, Wenyou
  1 sibling, 0 replies; 6+ messages in thread
From: Yang, Wenyou @ 2013-06-21  1:42 UTC (permalink / raw)
  To: Boris BREZILLON, Wim Van Sebroeck,
	Jean-Christophe Plagniol-Villard, Ferre, Nicolas
  Cc: linux-watchdog@vger.kernel.org, linux-doc@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Rob Herring, Rob Landley, Grant Likely,
	linux-arm-kernel@lists.infradead.org



> -----Original Message-----
> From: linux-arm-kernel [mailto:linux-arm-kernel-bounces@lists.infradead.org]
> On Behalf Of Boris BREZILLON
> Sent: 2013年6月11日 18:51
> To: Wim Van Sebroeck; Jean-Christophe Plagniol-Villard; Ferre, Nicolas
> Cc: linux-watchdog@vger.kernel.org; linux-doc@vger.kernel.org;
> devicetree-discuss@lists.ozlabs.org; linux-kernel@vger.kernel.org; Rob
> Herring; Boris BREZILLON; Rob Landley; Grant Likely;
> linux-arm-kernel@lists.infradead.org
> Subject: [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc
> 
> Add new at91sam9 watchdog properties to the documentation.
> 
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> ---
>  .../devicetree/bindings/watchdog/atmel-wdt.txt     |   30
> ++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
> b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
> index fcdd48f..e043106 100644
> --- a/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
> +++ b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
> @@ -9,11 +9,37 @@ Required properties:
> 
>  Optional properties:
>  - timeout-sec: contains the watchdog timeout in seconds.
> +- interrupts : Should contain WDT interrupt.
> +- atmel,max-heartbeat-sec : Should contain the maximum heartbeat value in
> +	seconds. This value should be less than 16. It is used to compute the
> +	WDV field.
> +- atmel,max-heartbeat-sec : Should contain the minimum heartbeat value in
Typo, should be,
- atmel,min-heartbeat-sec
> +	seconds. This value should be less than 4 times the max-heartbeat-sec
> +	value. It is used to compute the WDD field.
> +- atmel,watchdog-type : Should be "hardware" or "software". Hardware
> watchdog
> +	use the at91 watchdog reset. Software watchdog use the watcdog
> interrup
> +	to trigger a software reset.
> +- atmel,reset-type : Should be "proc" or "all".
> +	"all" : assert peripherals and processor reset signals
> +	"proc" : assert the processor reset signal
> +	This is valid only when using "hardware" watchdog.
> +- atmel,disable : Should be present if you want to disable the watchdog.
> +- atmel,idle-halt : Should be present if you want to stop the watchdog when
> +	entering idle state.
> +- atmel,dbg-halt : Should be present if you want to stop the watchdog when
> +	entering debug state.
> 
>  Example:
> -
>  	watchdog@fffffd40 {
>  		compatible = "atmel,at91sam9260-wdt";
>  		reg = <0xfffffd40 0x10>;
> -		timeout-sec = <10>;
> +		interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
> +		timeout-sec = <15>;
> +		atmel,watchdog-type = "hardware";
> +		atmel,reset-type = "all";
> +		atmel,dbg-halt;
> +		atmel,idle-halt;
> +		atmel,max-heartbeat-sec = <16>;
> +		atmel,min-heartbeat-sec = <0>;
> +		status = "okay";
>  	};
> --
> 1.7.9.5
> 
> 
Best Regards,
Wenyou Yang
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt
  2013-06-11 10:51 [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt Boris BREZILLON
  2013-06-11 10:51 ` [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc Boris BREZILLON
@ 2013-06-21  1:47 ` Yang, Wenyou
  2013-06-21  6:59   ` boris brezillon
  1 sibling, 1 reply; 6+ messages in thread
From: Yang, Wenyou @ 2013-06-21  1:47 UTC (permalink / raw)
  To: Boris BREZILLON, Wim Van Sebroeck,
	Jean-Christophe Plagniol-Villard, Ferre, Nicolas,
	linux-watchdog@vger.kernel.org
  Cc: devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org



> -----Original Message-----
> From: linux-arm-kernel [mailto:linux-arm-kernel-bounces@lists.infradead.org]
> On Behalf Of Boris BREZILLON
> Sent: 2013年6月11日 18:51
> To: Wim Van Sebroeck; Jean-Christophe Plagniol-Villard; Ferre, Nicolas;
> linux-watchdog@vger.kernel.org
> Cc: devicetree-discuss@lists.ozlabs.org; linux-doc@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Boris
> BREZILLON
> Subject: [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured
> wdt
> 
> Hello,
> 
> This patch series is a porposal to enhance the sam9 watchdog timer support.
> 
> The at91sam9 watchdog timer cannot configured twice, and the current
> implementation only tries to configure in a static way:
> - 2 seconds timeout
> - wdt restart every 500ms
> 
> If the timer has already been configured with different values, it returns an
> error and do not create any watchdog device.
> 
> This is not critical if the watchdog is disabled, but if it has been enabled with
> different timeout values it will lead to a SoC reset.
> 
> This patch series tries to address this issue by adapting the heartbeat value
> according the WDT timer config:
> - it first tries to configure the timer as requested.
> - if it fails it fallbacks to the current config, adapting its heartbeat timer
> to the needs
> 
> This patch series also move to a dynamically allocated at91wdt device instead
> of the static instance. I'm not sure this is the best solution, so please tell
> me if you prefer to keep static instance of watchdog.
> 
> It adds a new at91 wdt type: software. This new type make use of the at91 wdt
> interrupt to trigger a software watchdog.
> 
> Finally it adds several properties to the device tree bindings.
> 
> Best Regards,
> Boris
> 
> Boris BREZILLON (4):
>   watchdog: at91sam9_wdt: better watchdog support
>   watchdog: at91sam9_wdt: update device tree doc
>   ARM: at91/dt: add sam9 watchdog default options to SoCs
>   ARM: at91/dt: add watchdog properties to kizbox board
> 
>  .../devicetree/bindings/watchdog/atmel-wdt.txt     |   30 +-
>  arch/arm/boot/dts/at91sam9260.dtsi                 |    5 +
>  arch/arm/boot/dts/at91sam9263.dtsi                 |    5 +
>  arch/arm/boot/dts/at91sam9g45.dtsi                 |    5 +
>  arch/arm/boot/dts/at91sam9n12.dtsi                 |    5 +
>  arch/arm/boot/dts/at91sam9x5.dtsi                  |    5 +
>  arch/arm/boot/dts/kizbox.dts                       |    6 +
>  arch/arm/boot/dts/sama5d3.dtsi                     |    5 +
>  drivers/watchdog/at91sam9_wdt.c                    |  319
> +++++++++++++++-----
>  9 files changed, 300 insertions(+), 85 deletions(-)
> 
> --
> 1.7.9.5
> 
> 
Tested on sama5d34ek, at91sam9g25ek, linux-next_20130620

Tested by Wenyou Yang <Wenyou.yang@atmel.com>


> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt
  2013-06-21  1:47 ` [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt Yang, Wenyou
@ 2013-06-21  6:59   ` boris brezillon
  0 siblings, 0 replies; 6+ messages in thread
From: boris brezillon @ 2013-06-21  6:59 UTC (permalink / raw)
  To: Yang, Wenyou
  Cc: Wim Van Sebroeck, Jean-Christophe Plagniol-Villard,
	Ferre, Nicolas, linux-watchdog@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org

On 21/06/2013 03:47, Yang, Wenyou wrote:
>
>> -----Original Message-----
>> From: linux-arm-kernel [mailto:linux-arm-kernel-bounces@lists.infradead.org]
>> On Behalf Of Boris BREZILLON
>> Sent: 2013年6月11日 18:51
>> To: Wim Van Sebroeck; Jean-Christophe Plagniol-Villard; Ferre, Nicolas;
>> linux-watchdog@vger.kernel.org
>> Cc: devicetree-discuss@lists.ozlabs.org; linux-doc@vger.kernel.org;
>> linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Boris
>> BREZILLON
>> Subject: [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured
>> wdt
>>
>> Hello,
>>
>> This patch series is a porposal to enhance the sam9 watchdog timer support.
>>
>> The at91sam9 watchdog timer cannot configured twice, and the current
>> implementation only tries to configure in a static way:
>> - 2 seconds timeout
>> - wdt restart every 500ms
>>
>> If the timer has already been configured with different values, it returns an
>> error and do not create any watchdog device.
>>
>> This is not critical if the watchdog is disabled, but if it has been enabled with
>> different timeout values it will lead to a SoC reset.
>>
>> This patch series tries to address this issue by adapting the heartbeat value
>> according the WDT timer config:
>> - it first tries to configure the timer as requested.
>> - if it fails it fallbacks to the current config, adapting its heartbeat timer
>> to the needs
>>
>> This patch series also move to a dynamically allocated at91wdt device instead
>> of the static instance. I'm not sure this is the best solution, so please tell
>> me if you prefer to keep static instance of watchdog.
>>
>> It adds a new at91 wdt type: software. This new type make use of the at91 wdt
>> interrupt to trigger a software watchdog.
>>
>> Finally it adds several properties to the device tree bindings.
>>
>> Best Regards,
>> Boris
>>
>> Boris BREZILLON (4):
>>   watchdog: at91sam9_wdt: better watchdog support
>>   watchdog: at91sam9_wdt: update device tree doc
>>   ARM: at91/dt: add sam9 watchdog default options to SoCs
>>   ARM: at91/dt: add watchdog properties to kizbox board
>>
>>  .../devicetree/bindings/watchdog/atmel-wdt.txt     |   30 +-
>>  arch/arm/boot/dts/at91sam9260.dtsi                 |    5 +
>>  arch/arm/boot/dts/at91sam9263.dtsi                 |    5 +
>>  arch/arm/boot/dts/at91sam9g45.dtsi                 |    5 +
>>  arch/arm/boot/dts/at91sam9n12.dtsi                 |    5 +
>>  arch/arm/boot/dts/at91sam9x5.dtsi                  |    5 +
>>  arch/arm/boot/dts/kizbox.dts                       |    6 +
>>  arch/arm/boot/dts/sama5d3.dtsi                     |    5 +
>>  drivers/watchdog/at91sam9_wdt.c                    |  319
>> +++++++++++++++-----
>>  9 files changed, 300 insertions(+), 85 deletions(-)
>>
>> --
>> 1.7.9.5
>>
>>
> Tested on sama5d34ek, at91sam9g25ek, linux-next_20130620
>
> Tested by Wenyou Yang <Wenyou.yang@atmel.com>
>
Thanks for your tests and review.

Best Regards,

Boris
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2013-06-21  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-11 10:51 [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt Boris BREZILLON
2013-06-11 10:51 ` [RFC PATCH 2/4] watchdog: at91sam9_wdt: update device tree doc Boris BREZILLON
2013-06-11 22:29   ` Grant Likely
2013-06-21  1:42   ` Yang, Wenyou
2013-06-21  1:47 ` [RFC PATCH 0/4] watchdog: at91sam9_wdt: handle already configured wdt Yang, Wenyou
2013-06-21  6:59   ` boris brezillon

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).