Linux Watchdog driver development
 help / color / mirror / Atom feed
* [PATCH v2 01/12] dt-bindings: watchdog: sunxi: fix F1C100s compatible
       [not found] <20220317162349.739636-1-andre.przywara@arm.com>
@ 2022-03-17 16:23 ` Andre Przywara
  2022-03-20 19:06   ` Rob Herring
  2022-03-28  4:20   ` Samuel Holland
  2022-03-17 16:23 ` [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support Andre Przywara
  2022-03-17 16:23 ` [PATCH v2 03/12] ARM: dts: suniv: F1C100: fix watchdog compatible Andre Przywara
  2 siblings, 2 replies; 8+ messages in thread
From: Andre Przywara @ 2022-03-17 16:23 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: Rob Herring, Mesih Kilinc, Icenowy Zheng, Jesse Taube,
	Giulio Benetti, George Hilliard, devicetree, linux-arm-kernel,
	linux-sunxi, Wim Van Sebroeck, Guenter Roeck, linux-watchdog

The F1C100 series actually features a newer generation watchdog IP, so
the compatible string was wrong.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 .../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml b/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
index 43afa24513b9..7a26cde0afdd 100644
--- a/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
@@ -26,10 +26,8 @@ properties:
               - allwinner,sun50i-h616-wdt
               - allwinner,sun50i-r329-wdt
               - allwinner,sun50i-r329-wdt-reset
+              - allwinner,suniv-f1c100s-wdt
           - const: allwinner,sun6i-a31-wdt
-      - items:
-          - const: allwinner,suniv-f1c100s-wdt
-          - const: allwinner,sun4i-a10-wdt
       - const: allwinner,sun20i-d1-wdt
       - items:
           - const: allwinner,sun20i-d1-wdt-reset
-- 
2.25.1


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

* [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support
       [not found] <20220317162349.739636-1-andre.przywara@arm.com>
  2022-03-17 16:23 ` [PATCH v2 01/12] dt-bindings: watchdog: sunxi: fix F1C100s compatible Andre Przywara
@ 2022-03-17 16:23 ` Andre Przywara
  2022-03-25 21:10   ` Rob Herring
                     ` (2 more replies)
  2022-03-17 16:23 ` [PATCH v2 03/12] ARM: dts: suniv: F1C100: fix watchdog compatible Andre Przywara
  2 siblings, 3 replies; 8+ messages in thread
From: Andre Przywara @ 2022-03-17 16:23 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: Rob Herring, Mesih Kilinc, Icenowy Zheng, Jesse Taube,
	Giulio Benetti, George Hilliard, devicetree, linux-arm-kernel,
	linux-sunxi, Wim Van Sebroeck, Guenter Roeck, linux-watchdog

Most Allwinner SoCs have just one input clock to drive the watchdog
peripheral. So far this is the 24 MHz "HOSC" oscillator, divided down
internally to 32 KHz.
The F1C100 series watchdog however uses the unchanged 32 KHz "LOSC" as
its only clock input, which has the same effect, but let's the binding
description mismatch.

Change the binding description to name the clocks more loosely, so both
the LOSC and divided HOSC match the description. As the fixed clock names
now make less sense, drop them from SoCs supporting just one clock
input, they were not used by any DT anyway.

For the newer SoCs, supporting a choice of two input clocks, we keep
both the description and clock-names requirement.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 .../watchdog/allwinner,sun4i-a10-wdt.yaml     | 20 ++++++++-----------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml b/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
index 7a26cde0afdd..cbcf19f51411 100644
--- a/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
@@ -39,14 +39,8 @@ properties:
   clocks:
     minItems: 1
     items:
-      - description: High-frequency oscillator input, divided internally
-      - description: Low-frequency oscillator input, only found on some variants
-
-  clock-names:
-    minItems: 1
-    items:
-      - const: hosc
-      - const: losc
+      - description: 32 KHz input clock
+      - description: secondary clock source
 
   interrupts:
     maxItems: 1
@@ -71,9 +65,14 @@ then:
   properties:
     clocks:
       minItems: 2
+      items:
+        - description: High-frequency oscillator input, divided internally
+        - description: Low-frequency oscillator input
 
     clock-names:
-      minItems: 2
+      items:
+        - const: hosc
+        - const: losc
 
   required:
     - clock-names
@@ -83,9 +82,6 @@ else:
     clocks:
       maxItems: 1
 
-    clock-names:
-      maxItems: 1
-
 unevaluatedProperties: false
 
 examples:
-- 
2.25.1


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

* [PATCH v2 03/12] ARM: dts: suniv: F1C100: fix watchdog compatible
       [not found] <20220317162349.739636-1-andre.przywara@arm.com>
  2022-03-17 16:23 ` [PATCH v2 01/12] dt-bindings: watchdog: sunxi: fix F1C100s compatible Andre Przywara
  2022-03-17 16:23 ` [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support Andre Przywara
@ 2022-03-17 16:23 ` Andre Przywara
  2 siblings, 0 replies; 8+ messages in thread
From: Andre Przywara @ 2022-03-17 16:23 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: Rob Herring, Mesih Kilinc, Icenowy Zheng, Jesse Taube,
	Giulio Benetti, George Hilliard, devicetree, linux-arm-kernel,
	linux-sunxi, Wim Van Sebroeck, Guenter Roeck, linux-watchdog

The F1C100 series of SoCs actually have their watchdog IP being
compatible with the newer Allwinner generation, not the older one.

The currently described sun4i-a10-wdt actually does not work, neither
the watchdog functionality (just never fires), nor the reset part
(reboot hangs).

Replace the compatible string with the one used by the newer generation.
Verified to work with both the watchdog and reboot functionality on a
LicheePi Nano.

Also add the missing interrupt line and clock source, to make it binding
compliant.

Fixes: 4ba16d17efdd ("ARM: dts: suniv: add initial DTSI file for F1C100s")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
---
 arch/arm/boot/dts/suniv-f1c100s.dtsi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/suniv-f1c100s.dtsi b/arch/arm/boot/dts/suniv-f1c100s.dtsi
index 6100d3b75f61..def830101448 100644
--- a/arch/arm/boot/dts/suniv-f1c100s.dtsi
+++ b/arch/arm/boot/dts/suniv-f1c100s.dtsi
@@ -104,8 +104,10 @@ timer@1c20c00 {
 
 		wdt: watchdog@1c20ca0 {
 			compatible = "allwinner,suniv-f1c100s-wdt",
-				     "allwinner,sun4i-a10-wdt";
+				     "allwinner,sun6i-a31-wdt";
 			reg = <0x01c20ca0 0x20>;
+			interrupts = <16>;
+			clocks = <&osc32k>;
 		};
 
 		uart0: serial@1c25000 {
-- 
2.25.1


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

* Re: [PATCH v2 01/12] dt-bindings: watchdog: sunxi: fix F1C100s compatible
  2022-03-17 16:23 ` [PATCH v2 01/12] dt-bindings: watchdog: sunxi: fix F1C100s compatible Andre Przywara
@ 2022-03-20 19:06   ` Rob Herring
  2022-03-28  4:20   ` Samuel Holland
  1 sibling, 0 replies; 8+ messages in thread
From: Rob Herring @ 2022-03-20 19:06 UTC (permalink / raw)
  To: Andre Przywara
  Cc: linux-arm-kernel, Wim Van Sebroeck, Samuel Holland, Icenowy Zheng,
	linux-sunxi, Guenter Roeck, linux-watchdog, Jernej Skrabec,
	Rob Herring, Mesih Kilinc, George Hilliard, Giulio Benetti,
	devicetree, Jesse Taube, Maxime Ripard, Chen-Yu Tsai

On Thu, 17 Mar 2022 16:23:38 +0000, Andre Przywara wrote:
> The F1C100 series actually features a newer generation watchdog IP, so
> the compatible string was wrong.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  .../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

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

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

* Re: [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support
  2022-03-17 16:23 ` [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support Andre Przywara
@ 2022-03-25 21:10   ` Rob Herring
  2022-03-28  4:20   ` Samuel Holland
  2022-04-04 14:04   ` Guenter Roeck
  2 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2022-03-25 21:10 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Giulio Benetti, devicetree, Maxime Ripard, Jernej Skrabec,
	Mesih Kilinc, Rob Herring, Chen-Yu Tsai, George Hilliard,
	Jesse Taube, Wim Van Sebroeck, Guenter Roeck, linux-watchdog,
	linux-arm-kernel, linux-sunxi, Samuel Holland, Icenowy Zheng

On Thu, 17 Mar 2022 16:23:39 +0000, Andre Przywara wrote:
> Most Allwinner SoCs have just one input clock to drive the watchdog
> peripheral. So far this is the 24 MHz "HOSC" oscillator, divided down
> internally to 32 KHz.
> The F1C100 series watchdog however uses the unchanged 32 KHz "LOSC" as
> its only clock input, which has the same effect, but let's the binding
> description mismatch.
> 
> Change the binding description to name the clocks more loosely, so both
> the LOSC and divided HOSC match the description. As the fixed clock names
> now make less sense, drop them from SoCs supporting just one clock
> input, they were not used by any DT anyway.
> 
> For the newer SoCs, supporting a choice of two input clocks, we keep
> both the description and clock-names requirement.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  .../watchdog/allwinner,sun4i-a10-wdt.yaml     | 20 ++++++++-----------
>  1 file changed, 8 insertions(+), 12 deletions(-)
> 

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

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

* Re: [PATCH v2 01/12] dt-bindings: watchdog: sunxi: fix F1C100s compatible
  2022-03-17 16:23 ` [PATCH v2 01/12] dt-bindings: watchdog: sunxi: fix F1C100s compatible Andre Przywara
  2022-03-20 19:06   ` Rob Herring
@ 2022-03-28  4:20   ` Samuel Holland
  1 sibling, 0 replies; 8+ messages in thread
From: Samuel Holland @ 2022-03-28  4:20 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Rob Herring,
	Mesih Kilinc, Icenowy Zheng, Jesse Taube, Giulio Benetti,
	George Hilliard, devicetree, linux-arm-kernel, linux-sunxi,
	Wim Van Sebroeck, Guenter Roeck, linux-watchdog

On 3/17/22 11:23 AM, Andre Przywara wrote:
> The F1C100 series actually features a newer generation watchdog IP, so
> the compatible string was wrong.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Samuel Holland <samuel@sholland.org>

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

* Re: [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support
  2022-03-17 16:23 ` [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support Andre Przywara
  2022-03-25 21:10   ` Rob Herring
@ 2022-03-28  4:20   ` Samuel Holland
  2022-04-04 14:04   ` Guenter Roeck
  2 siblings, 0 replies; 8+ messages in thread
From: Samuel Holland @ 2022-03-28  4:20 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Rob Herring,
	Mesih Kilinc, Icenowy Zheng, Jesse Taube, Giulio Benetti,
	George Hilliard, devicetree, linux-arm-kernel, linux-sunxi,
	Wim Van Sebroeck, Guenter Roeck, linux-watchdog

On 3/17/22 11:23 AM, Andre Przywara wrote:
> Most Allwinner SoCs have just one input clock to drive the watchdog
> peripheral. So far this is the 24 MHz "HOSC" oscillator, divided down
> internally to 32 KHz.
> The F1C100 series watchdog however uses the unchanged 32 KHz "LOSC" as
> its only clock input, which has the same effect, but let's the binding
> description mismatch.
> 
> Change the binding description to name the clocks more loosely, so both
> the LOSC and divided HOSC match the description. As the fixed clock names
> now make less sense, drop them from SoCs supporting just one clock
> input, they were not used by any DT anyway.
> 
> For the newer SoCs, supporting a choice of two input clocks, we keep
> both the description and clock-names requirement.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Samuel Holland <samuel@sholland.org>

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

* Re: [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support
  2022-03-17 16:23 ` [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support Andre Przywara
  2022-03-25 21:10   ` Rob Herring
  2022-03-28  4:20   ` Samuel Holland
@ 2022-04-04 14:04   ` Guenter Roeck
  2 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2022-04-04 14:04 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Rob Herring, Mesih Kilinc, Icenowy Zheng, Jesse Taube,
	Giulio Benetti, George Hilliard, devicetree, linux-arm-kernel,
	linux-sunxi, Wim Van Sebroeck, linux-watchdog

On Thu, Mar 17, 2022 at 04:23:39PM +0000, Andre Przywara wrote:
> Most Allwinner SoCs have just one input clock to drive the watchdog
> peripheral. So far this is the 24 MHz "HOSC" oscillator, divided down
> internally to 32 KHz.
> The F1C100 series watchdog however uses the unchanged 32 KHz "LOSC" as
> its only clock input, which has the same effect, but let's the binding
> description mismatch.
> 
> Change the binding description to name the clocks more loosely, so both
> the LOSC and divided HOSC match the description. As the fixed clock names
> now make less sense, drop them from SoCs supporting just one clock
> input, they were not used by any DT anyway.
> 
> For the newer SoCs, supporting a choice of two input clocks, we keep
> both the description and clock-names requirement.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Samuel Holland <samuel@sholland.org>

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

> ---
>  .../watchdog/allwinner,sun4i-a10-wdt.yaml     | 20 ++++++++-----------
>  1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml b/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
> index 7a26cde0afdd..cbcf19f51411 100644
> --- a/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
> @@ -39,14 +39,8 @@ properties:
>    clocks:
>      minItems: 1
>      items:
> -      - description: High-frequency oscillator input, divided internally
> -      - description: Low-frequency oscillator input, only found on some variants
> -
> -  clock-names:
> -    minItems: 1
> -    items:
> -      - const: hosc
> -      - const: losc
> +      - description: 32 KHz input clock
> +      - description: secondary clock source
>  
>    interrupts:
>      maxItems: 1
> @@ -71,9 +65,14 @@ then:
>    properties:
>      clocks:
>        minItems: 2
> +      items:
> +        - description: High-frequency oscillator input, divided internally
> +        - description: Low-frequency oscillator input
>  
>      clock-names:
> -      minItems: 2
> +      items:
> +        - const: hosc
> +        - const: losc
>  
>    required:
>      - clock-names
> @@ -83,9 +82,6 @@ else:
>      clocks:
>        maxItems: 1
>  
> -    clock-names:
> -      maxItems: 1
> -
>  unevaluatedProperties: false
>  
>  examples:

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

end of thread, other threads:[~2022-04-04 14:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220317162349.739636-1-andre.przywara@arm.com>
2022-03-17 16:23 ` [PATCH v2 01/12] dt-bindings: watchdog: sunxi: fix F1C100s compatible Andre Przywara
2022-03-20 19:06   ` Rob Herring
2022-03-28  4:20   ` Samuel Holland
2022-03-17 16:23 ` [PATCH v2 02/12] dt-bindings: watchdog: sunxi: clarify clock support Andre Przywara
2022-03-25 21:10   ` Rob Herring
2022-03-28  4:20   ` Samuel Holland
2022-04-04 14:04   ` Guenter Roeck
2022-03-17 16:23 ` [PATCH v2 03/12] ARM: dts: suniv: F1C100: fix watchdog compatible Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox