devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema
@ 2025-10-13 21:31 Rob Herring (Arm)
  2025-10-14  9:45 ` Gregory CLEMENT
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rob Herring (Arm) @ 2025-10-13 21:31 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Krzysztof Kozlowski,
	Conor Dooley, Andrew Lunn, Gregory Clement
  Cc: linux-watchdog, devicetree, linux-kernel

Convert the Marvell Orion and Armada watchdog binding to DT schema
format. It's a straight-forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 .../devicetree/bindings/watchdog/marvel.txt   | 45 ---------
 .../bindings/watchdog/marvell,orion-wdt.yaml  | 97 +++++++++++++++++++
 2 files changed, 97 insertions(+), 45 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/marvel.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/marvell,orion-wdt.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/marvel.txt b/Documentation/devicetree/bindings/watchdog/marvel.txt
deleted file mode 100644
index c1b67a78f00c..000000000000
--- a/Documentation/devicetree/bindings/watchdog/marvel.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-* Marvell Orion Watchdog Time
-
-Required Properties:
-
-- Compatibility : "marvell,orion-wdt"
-		  "marvell,armada-370-wdt"
-		  "marvell,armada-xp-wdt"
-		  "marvell,armada-375-wdt"
-		  "marvell,armada-380-wdt"
-
-- reg		: Should contain two entries: first one with the
-		  timer control address, second one with the
-		  rstout enable address.
-
-For "marvell,armada-375-wdt" and "marvell,armada-380-wdt":
-
-- reg		: A third entry is mandatory and should contain the
-                  shared mask/unmask RSTOUT address.
-
-Clocks required for compatibles = "marvell,orion-wdt",
-				  "marvell,armada-370-wdt":
-- clocks : Must contain a single entry describing the clock input
-
-Clocks required for compatibles = "marvell,armada-xp-wdt"
-				  "marvell,armada-375-wdt"
-				  "marvell,armada-380-wdt":
-- clocks : Must contain an entry for each entry in clock-names.
-- clock-names : Must include the following entries:
-  "nbclk" (L2/coherency fabric clock),
-  "fixed" (Reference 25 MHz fixed-clock).
-
-Optional properties:
-
-- interrupts	: Contains the IRQ for watchdog expiration
-- timeout-sec	: Contains the watchdog timeout in seconds
-
-Example:
-
-	wdt@20300 {
-		compatible = "marvell,orion-wdt";
-		reg = <0x20300 0x28>, <0x20108 0x4>;
-		interrupts = <3>;
-		timeout-sec = <10>;
-		clocks = <&gate_clk 7>;
-	};
diff --git a/Documentation/devicetree/bindings/watchdog/marvell,orion-wdt.yaml b/Documentation/devicetree/bindings/watchdog/marvell,orion-wdt.yaml
new file mode 100644
index 000000000000..95704079463f
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/marvell,orion-wdt.yaml
@@ -0,0 +1,97 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/marvell,orion-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell Orion Watchdog Timer
+
+maintainers:
+  - Andrew Lunn <andrew@lunn.ch>
+  - Gregory Clement <gregory.clement@bootlin.com>
+
+properties:
+  compatible:
+    enum:
+      - marvell,orion-wdt
+      - marvell,armada-370-wdt
+      - marvell,armada-xp-wdt
+      - marvell,armada-375-wdt
+      - marvell,armada-380-wdt
+
+  reg:
+    minItems: 2
+    items:
+      - description: Timer control register address.
+      - description: RSTOUT enable register address.
+      - description: Shared mask/unmask RSTOUT register address.
+
+  clocks:
+    minItems: 1
+    items:
+      - description: Reference 25 MHz fixed-clock supply.
+      - description: L2/coherency fabric clock input ("nbclk").
+
+  clock-names:
+    minItems: 1
+    items:
+      - const: nbclk
+      - const: fixed
+
+  interrupts:
+    maxItems: 1
+
+  timeout-sec:
+    description: Watchdog timeout in seconds.
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - marvell,armada-375-wdt
+              - marvell,armada-380-wdt
+    then:
+      properties:
+        reg:
+          minItems: 3
+    else:
+      properties:
+        reg:
+          maxItems: 2
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - marvell,armada-xp-wdt
+              - marvell,armada-375-wdt
+              - marvell,armada-380-wdt
+    then:
+      properties:
+        clocks:
+          minItems: 2
+        clock-names:
+          minItems: 2
+
+      required:
+        - clock-names
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    watchdog@20300 {
+        compatible = "marvell,orion-wdt";
+        reg = <0x20300 0x28>, <0x20108 0x4>;
+        interrupts = <3>;
+        timeout-sec = <10>;
+        clocks = <&gate_clk 7>;
+    };
-- 
2.51.0


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

* Re: [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema
  2025-10-13 21:31 [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema Rob Herring (Arm)
@ 2025-10-14  9:45 ` Gregory CLEMENT
  2025-10-14 11:21   ` Rob Herring
  2025-10-14 14:56 ` Guenter Roeck
  2025-10-14 20:22 ` Sander Vanheule
  2 siblings, 1 reply; 7+ messages in thread
From: Gregory CLEMENT @ 2025-10-14  9:45 UTC (permalink / raw)
  To: Rob Herring (Arm), Wim Van Sebroeck, Guenter Roeck,
	Krzysztof Kozlowski, Conor Dooley, Andrew Lunn
  Cc: linux-watchdog, devicetree, linux-kernel

Hello Rob,

Thank you for your work. I have one question:

> +  reg:
> +    minItems: 2

Should we also include this constraint here?

    maxItems: 3

This would further restrict the binding.

Gregory

> +    items:
> +      - description: Timer control register address.
> +      - description: RSTOUT enable register address.
> +      - description: Shared mask/unmask RSTOUT register address.
> +

[...]

> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - marvell,armada-375-wdt
> +              - marvell,armada-380-wdt
> +    then:
> +      properties:
> +        reg:
> +          minItems: 3
> +    else:
> +      properties:
> +        reg:
> +          maxItems: 2
> +

-- 
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema
  2025-10-14  9:45 ` Gregory CLEMENT
@ 2025-10-14 11:21   ` Rob Herring
  2025-10-14 12:39     ` Gregory CLEMENT
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2025-10-14 11:21 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: Wim Van Sebroeck, Guenter Roeck, Krzysztof Kozlowski,
	Conor Dooley, Andrew Lunn, linux-watchdog, devicetree,
	linux-kernel

On Tue, Oct 14, 2025 at 4:45 AM Gregory CLEMENT
<gregory.clement@bootlin.com> wrote:
>
> Hello Rob,
>
> Thank you for your work. I have one question:
>
> > +  reg:
> > +    minItems: 2
>
> Should we also include this constraint here?
>
>     maxItems: 3

No, that is implicit with the length of 'items'. (For json-schema,
it's not though. The tools add it automatically.)

>
> This would further restrict the binding.
>
> Gregory
>
> > +    items:
> > +      - description: Timer control register address.
> > +      - description: RSTOUT enable register address.
> > +      - description: Shared mask/unmask RSTOUT register address.
> > +

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

* Re: [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema
  2025-10-14 11:21   ` Rob Herring
@ 2025-10-14 12:39     ` Gregory CLEMENT
  0 siblings, 0 replies; 7+ messages in thread
From: Gregory CLEMENT @ 2025-10-14 12:39 UTC (permalink / raw)
  To: Rob Herring
  Cc: Wim Van Sebroeck, Guenter Roeck, Krzysztof Kozlowski,
	Conor Dooley, Andrew Lunn, linux-watchdog, devicetree,
	linux-kernel

Rob Herring <robh@kernel.org> writes:

> On Tue, Oct 14, 2025 at 4:45 AM Gregory CLEMENT
> <gregory.clement@bootlin.com> wrote:
>>
>> Hello Rob,
>>
>> Thank you for your work. I have one question:
>>
>> > +  reg:
>> > +    minItems: 2
>>
>> Should we also include this constraint here?
>>
>>     maxItems: 3
>
> No, that is implicit with the length of 'items'. (For json-schema,
> it's not though. The tools add it automatically.)

Thanks for the explanation!

then for this patch:

Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com>

Gregory

>
>>
>> This would further restrict the binding.
>>
>> Gregory
>>
>> > +    items:
>> > +      - description: Timer control register address.
>> > +      - description: RSTOUT enable register address.
>> > +      - description: Shared mask/unmask RSTOUT register address.
>> > +

-- 
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema
  2025-10-13 21:31 [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema Rob Herring (Arm)
  2025-10-14  9:45 ` Gregory CLEMENT
@ 2025-10-14 14:56 ` Guenter Roeck
  2025-10-14 20:22 ` Sander Vanheule
  2 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2025-10-14 14:56 UTC (permalink / raw)
  To: Rob Herring (Arm), Wim Van Sebroeck, Krzysztof Kozlowski,
	Conor Dooley, Andrew Lunn, Gregory Clement
  Cc: linux-watchdog, devicetree, linux-kernel

On 10/13/25 14:31, Rob Herring (Arm) wrote:
> Convert the Marvell Orion and Armada watchdog binding to DT schema
> format. It's a straight-forward conversion.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

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


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

* Re: [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema
  2025-10-13 21:31 [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema Rob Herring (Arm)
  2025-10-14  9:45 ` Gregory CLEMENT
  2025-10-14 14:56 ` Guenter Roeck
@ 2025-10-14 20:22 ` Sander Vanheule
  2025-10-14 22:33   ` Rob Herring
  2 siblings, 1 reply; 7+ messages in thread
From: Sander Vanheule @ 2025-10-14 20:22 UTC (permalink / raw)
  To: Rob Herring (Arm), Wim Van Sebroeck, Guenter Roeck,
	Krzysztof Kozlowski, Conor Dooley, Andrew Lunn, Gregory Clement
  Cc: linux-watchdog, devicetree, linux-kernel

Hi Rob,

On Mon, 2025-10-13 at 16:31 -0500, Rob Herring (Arm) wrote:
> -Clocks required for compatibles = "marvell,orion-wdt",
> -				  "marvell,armada-370-wdt":
> -- clocks : Must contain a single entry describing the clock input
> -
> -Clocks required for compatibles = "marvell,armada-xp-wdt"
> -				  "marvell,armada-375-wdt"
> -				  "marvell,armada-380-wdt":
> -- clocks : Must contain an entry for each entry in clock-names.
> -- clock-names : Must include the following entries:
> -  "nbclk" (L2/coherency fabric clock),
> -  "fixed" (Reference 25 MHz fixed-clock).

> +  clocks:
> +    minItems: 1
> +    items:
> +      - description: Reference 25 MHz fixed-clock supply.
> +      - description: L2/coherency fabric clock input ("nbclk").
> +
> +  clock-names:
> +    minItems: 1
> +    items:
> +      - const: nbclk
> +      - const: fixed

Shouldn't the "clock-names" items be in the same order as the "clocks" items?
(With nbclk first)

Best,
Sander

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

* Re: [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema
  2025-10-14 20:22 ` Sander Vanheule
@ 2025-10-14 22:33   ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2025-10-14 22:33 UTC (permalink / raw)
  To: Sander Vanheule
  Cc: Wim Van Sebroeck, Guenter Roeck, Krzysztof Kozlowski,
	Conor Dooley, Andrew Lunn, Gregory Clement, linux-watchdog,
	devicetree, linux-kernel

On Tue, Oct 14, 2025 at 3:22 PM Sander Vanheule <sander@svanheule.net> wrote:
>
> Hi Rob,
>
> On Mon, 2025-10-13 at 16:31 -0500, Rob Herring (Arm) wrote:
> > -Clocks required for compatibles = "marvell,orion-wdt",
> > -                               "marvell,armada-370-wdt":
> > -- clocks : Must contain a single entry describing the clock input
> > -
> > -Clocks required for compatibles = "marvell,armada-xp-wdt"
> > -                               "marvell,armada-375-wdt"
> > -                               "marvell,armada-380-wdt":
> > -- clocks : Must contain an entry for each entry in clock-names.
> > -- clock-names : Must include the following entries:
> > -  "nbclk" (L2/coherency fabric clock),
> > -  "fixed" (Reference 25 MHz fixed-clock).
>
> > +  clocks:
> > +    minItems: 1
> > +    items:
> > +      - description: Reference 25 MHz fixed-clock supply.
> > +      - description: L2/coherency fabric clock input ("nbclk").
> > +
> > +  clock-names:
> > +    minItems: 1
> > +    items:
> > +      - const: nbclk
> > +      - const: fixed
>
> Shouldn't the "clock-names" items be in the same order as the "clocks" items?
> (With nbclk first)

Ah yes, I flipped the order of the names to match the .dts files, but
not clocks.

Also, I found there is a 2nd interrupt in some cases.

Rob

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

end of thread, other threads:[~2025-10-14 22:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13 21:31 [PATCH] dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema Rob Herring (Arm)
2025-10-14  9:45 ` Gregory CLEMENT
2025-10-14 11:21   ` Rob Herring
2025-10-14 12:39     ` Gregory CLEMENT
2025-10-14 14:56 ` Guenter Roeck
2025-10-14 20:22 ` Sander Vanheule
2025-10-14 22:33   ` 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).