Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] dt-bindings: watchdog: renesas-wdt: Convert to json-schema
@ 2020-04-27 19:25 Geert Uytterhoeven
  2020-04-28 11:59 ` Niklas Söderlund
  2020-05-12  1:55 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2020-04-27 19:25 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Wolfram Sang
  Cc: linux-watchdog, devicetree, linux-renesas-soc, Geert Uytterhoeven

Convert the Renesas Watchdog Timer (WDT) Controller Device Tree binding
documentation to json-schema.

Add missing "renesas,r8a77980-wdt" compatible value.
Document missing properties.
Update the example to match reality.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 .../bindings/watchdog/renesas,wdt.txt         |  50 ---------
 .../bindings/watchdog/renesas,wdt.yaml        | 100 ++++++++++++++++++
 2 files changed, 100 insertions(+), 50 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/renesas,wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.txt b/Documentation/devicetree/bindings/watchdog/renesas,wdt.txt
deleted file mode 100644
index 79b3c62f183d26dc..0000000000000000
--- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-Renesas Watchdog Timer (WDT) Controller
-
-Required properties:
- - compatible : Must be "renesas,<soctype>-wdt", followed by a generic
-		fallback compatible string when compatible with the generic
-		version.
-	       Examples with soctypes are:
-		 - "renesas,r8a7743-wdt" (RZ/G1M)
-		 - "renesas,r8a7744-wdt" (RZ/G1N)
-		 - "renesas,r8a7745-wdt" (RZ/G1E)
-		 - "renesas,r8a77470-wdt" (RZ/G1C)
-		 - "renesas,r8a774a1-wdt" (RZ/G2M)
-		 - "renesas,r8a774b1-wdt" (RZ/G2N)
-		 - "renesas,r8a774c0-wdt" (RZ/G2E)
-	         - "renesas,r8a7790-wdt" (R-Car H2)
-	         - "renesas,r8a7791-wdt" (R-Car M2-W)
-	         - "renesas,r8a7792-wdt" (R-Car V2H)
-	         - "renesas,r8a7793-wdt" (R-Car M2-N)
-	         - "renesas,r8a7794-wdt" (R-Car E2)
-	         - "renesas,r8a7795-wdt" (R-Car H3)
-	         - "renesas,r8a7796-wdt" (R-Car M3-W)
-	         - "renesas,r8a77961-wdt" (R-Car M3-W+)
-		 - "renesas,r8a77965-wdt" (R-Car M3-N)
-	         - "renesas,r8a77970-wdt" (R-Car V3M)
-	         - "renesas,r8a77990-wdt" (R-Car E3)
-	         - "renesas,r8a77995-wdt" (R-Car D3)
-	         - "renesas,r7s72100-wdt" (RZ/A1)
-	         - "renesas,r7s9210-wdt"  (RZ/A2)
-		The generic compatible string must be:
-		 - "renesas,rza-wdt" for RZ/A
-		 - "renesas,rcar-gen2-wdt" for R-Car Gen2 and RZ/G1
-		 - "renesas,rcar-gen3-wdt" for R-Car Gen3 and RZ/G2
-
-- reg : Should contain WDT registers location and length
-- clocks : the clock feeding the watchdog timer.
-
-Optional properties:
-- timeout-sec : Contains the watchdog timeout in seconds
-- power-domains : the power domain the WDT belongs to
-- interrupts: Some WDTs have an interrupt when used in interval timer mode
-
-Examples:
-
-	wdt0: watchdog@e6020000 {
-		compatible = "renesas,r8a7795-wdt", "renesas,rcar-gen3-wdt";
-		reg = <0 0xe6020000 0 0x0c>;
-		clocks = <&cpg CPG_MOD 402>;
-		power-domains = <&cpg>;
-		timeout-sec = <60>;
-	};
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
new file mode 100644
index 0000000000000000..27e8c4accd67bfff
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
@@ -0,0 +1,100 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/renesas,wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Watchdog Timer (WDT) Controller
+
+maintainers:
+  - Wolfram Sang <wsa+renesas@sang-engineering.com>
+  - Geert Uytterhoeven <geert+renesas@glider.be>
+
+allOf:
+  - $ref: "watchdog.yaml#"
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - renesas,r7s72100-wdt     # RZ/A1
+              - renesas,r7s9210-wdt      # RZ/A2
+          - const: renesas,rza-wdt       # RZ/A
+
+      - items:
+          - enum:
+              - renesas,r8a7743-wdt      # RZ/G1M
+              - renesas,r8a7744-wdt      # RZ/G1N
+              - renesas,r8a7745-wdt      # RZ/G1E
+              - renesas,r8a77470-wdt     # RZ/G1C
+              - renesas,r8a7790-wdt      # R-Car H2
+              - renesas,r8a7791-wdt      # R-Car M2-W
+              - renesas,r8a7792-wdt      # R-Car V2H
+              - renesas,r8a7793-wdt      # R-Car M2-N
+              - renesas,r8a7794-wdt      # R-Car E2
+          - const: renesas,rcar-gen2-wdt # R-Car Gen2 and RZ/G1
+
+      - items:
+          - enum:
+              - renesas,r8a774a1-wdt     # RZ/G2M
+              - renesas,r8a774b1-wdt     # RZ/G2N
+              - renesas,r8a774c0-wdt     # RZ/G2E
+              - renesas,r8a7795-wdt      # R-Car H3
+              - renesas,r8a7796-wdt      # R-Car M3-W
+              - renesas,r8a77961-wdt     # R-Car M3-W+
+              - renesas,r8a77965-wdt     # R-Car M3-N
+              - renesas,r8a77970-wdt     # R-Car V3M
+              - renesas,r8a77980-wdt     # R-Car V3H
+              - renesas,r8a77990-wdt     # R-Car E3
+              - renesas,r8a77995-wdt     # R-Car D3
+          - const: renesas,rcar-gen3-wdt # R-Car Gen3 and RZ/G2
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  timeout-sec: true
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+if:
+  not:
+    properties:
+      compatible:
+        contains:
+          enum:
+            - renesas,rza-wdt
+then:
+  required:
+    - power-domains
+    - resets
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
+    #include <dt-bindings/power/r8a7795-sysc.h>
+    wdt0: watchdog@e6020000 {
+            compatible = "renesas,r8a7795-wdt", "renesas,rcar-gen3-wdt";
+            reg = <0xe6020000 0x0c>;
+            clocks = <&cpg CPG_MOD 402>;
+            power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+            resets = <&cpg 402>;
+            timeout-sec = <60>;
+    };
-- 
2.17.1


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

* Re: [PATCH] dt-bindings: watchdog: renesas-wdt: Convert to json-schema
  2020-04-27 19:25 [PATCH] dt-bindings: watchdog: renesas-wdt: Convert to json-schema Geert Uytterhoeven
@ 2020-04-28 11:59 ` Niklas Söderlund
  2020-05-12  1:55 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2020-04-28 11:59 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Wolfram Sang,
	linux-watchdog, devicetree, linux-renesas-soc

Hi Geert,

Thanks for your work.

On 2020-04-27 21:25:22 +0200, Geert Uytterhoeven wrote:
> Convert the Renesas Watchdog Timer (WDT) Controller Device Tree binding
> documentation to json-schema.
> 
> Add missing "renesas,r8a77980-wdt" compatible value.
> Document missing properties.
> Update the example to match reality.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  .../bindings/watchdog/renesas,wdt.txt         |  50 ---------
>  .../bindings/watchdog/renesas,wdt.yaml        | 100 ++++++++++++++++++
>  2 files changed, 100 insertions(+), 50 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/renesas,wdt.txt
>  create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.txt b/Documentation/devicetree/bindings/watchdog/renesas,wdt.txt
> deleted file mode 100644
> index 79b3c62f183d26dc..0000000000000000
> --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.txt
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -Renesas Watchdog Timer (WDT) Controller
> -
> -Required properties:
> - - compatible : Must be "renesas,<soctype>-wdt", followed by a generic
> -		fallback compatible string when compatible with the generic
> -		version.
> -	       Examples with soctypes are:
> -		 - "renesas,r8a7743-wdt" (RZ/G1M)
> -		 - "renesas,r8a7744-wdt" (RZ/G1N)
> -		 - "renesas,r8a7745-wdt" (RZ/G1E)
> -		 - "renesas,r8a77470-wdt" (RZ/G1C)
> -		 - "renesas,r8a774a1-wdt" (RZ/G2M)
> -		 - "renesas,r8a774b1-wdt" (RZ/G2N)
> -		 - "renesas,r8a774c0-wdt" (RZ/G2E)
> -	         - "renesas,r8a7790-wdt" (R-Car H2)
> -	         - "renesas,r8a7791-wdt" (R-Car M2-W)
> -	         - "renesas,r8a7792-wdt" (R-Car V2H)
> -	         - "renesas,r8a7793-wdt" (R-Car M2-N)
> -	         - "renesas,r8a7794-wdt" (R-Car E2)
> -	         - "renesas,r8a7795-wdt" (R-Car H3)
> -	         - "renesas,r8a7796-wdt" (R-Car M3-W)
> -	         - "renesas,r8a77961-wdt" (R-Car M3-W+)
> -		 - "renesas,r8a77965-wdt" (R-Car M3-N)
> -	         - "renesas,r8a77970-wdt" (R-Car V3M)
> -	         - "renesas,r8a77990-wdt" (R-Car E3)
> -	         - "renesas,r8a77995-wdt" (R-Car D3)
> -	         - "renesas,r7s72100-wdt" (RZ/A1)
> -	         - "renesas,r7s9210-wdt"  (RZ/A2)
> -		The generic compatible string must be:
> -		 - "renesas,rza-wdt" for RZ/A
> -		 - "renesas,rcar-gen2-wdt" for R-Car Gen2 and RZ/G1
> -		 - "renesas,rcar-gen3-wdt" for R-Car Gen3 and RZ/G2
> -
> -- reg : Should contain WDT registers location and length
> -- clocks : the clock feeding the watchdog timer.
> -
> -Optional properties:
> -- timeout-sec : Contains the watchdog timeout in seconds
> -- power-domains : the power domain the WDT belongs to
> -- interrupts: Some WDTs have an interrupt when used in interval timer mode
> -
> -Examples:
> -
> -	wdt0: watchdog@e6020000 {
> -		compatible = "renesas,r8a7795-wdt", "renesas,rcar-gen3-wdt";
> -		reg = <0 0xe6020000 0 0x0c>;
> -		clocks = <&cpg CPG_MOD 402>;
> -		power-domains = <&cpg>;
> -		timeout-sec = <60>;
> -	};
> diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> new file mode 100644
> index 0000000000000000..27e8c4accd67bfff
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> @@ -0,0 +1,100 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/watchdog/renesas,wdt.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas Watchdog Timer (WDT) Controller
> +
> +maintainers:
> +  - Wolfram Sang <wsa+renesas@sang-engineering.com>
> +  - Geert Uytterhoeven <geert+renesas@glider.be>
> +
> +allOf:
> +  - $ref: "watchdog.yaml#"
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - renesas,r7s72100-wdt     # RZ/A1
> +              - renesas,r7s9210-wdt      # RZ/A2
> +          - const: renesas,rza-wdt       # RZ/A
> +
> +      - items:
> +          - enum:
> +              - renesas,r8a7743-wdt      # RZ/G1M
> +              - renesas,r8a7744-wdt      # RZ/G1N
> +              - renesas,r8a7745-wdt      # RZ/G1E
> +              - renesas,r8a77470-wdt     # RZ/G1C
> +              - renesas,r8a7790-wdt      # R-Car H2
> +              - renesas,r8a7791-wdt      # R-Car M2-W
> +              - renesas,r8a7792-wdt      # R-Car V2H
> +              - renesas,r8a7793-wdt      # R-Car M2-N
> +              - renesas,r8a7794-wdt      # R-Car E2
> +          - const: renesas,rcar-gen2-wdt # R-Car Gen2 and RZ/G1
> +
> +      - items:
> +          - enum:
> +              - renesas,r8a774a1-wdt     # RZ/G2M
> +              - renesas,r8a774b1-wdt     # RZ/G2N
> +              - renesas,r8a774c0-wdt     # RZ/G2E
> +              - renesas,r8a7795-wdt      # R-Car H3
> +              - renesas,r8a7796-wdt      # R-Car M3-W
> +              - renesas,r8a77961-wdt     # R-Car M3-W+
> +              - renesas,r8a77965-wdt     # R-Car M3-N
> +              - renesas,r8a77970-wdt     # R-Car V3M
> +              - renesas,r8a77980-wdt     # R-Car V3H
> +              - renesas,r8a77990-wdt     # R-Car E3
> +              - renesas,r8a77995-wdt     # R-Car D3
> +          - const: renesas,rcar-gen3-wdt # R-Car Gen3 and RZ/G2
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  resets:
> +    maxItems: 1
> +
> +  timeout-sec: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +
> +if:
> +  not:
> +    properties:
> +      compatible:
> +        contains:
> +          enum:
> +            - renesas,rza-wdt

:-)

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> +then:
> +  required:
> +    - power-domains
> +    - resets
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
> +    #include <dt-bindings/power/r8a7795-sysc.h>
> +    wdt0: watchdog@e6020000 {
> +            compatible = "renesas,r8a7795-wdt", "renesas,rcar-gen3-wdt";
> +            reg = <0xe6020000 0x0c>;
> +            clocks = <&cpg CPG_MOD 402>;
> +            power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
> +            resets = <&cpg 402>;
> +            timeout-sec = <60>;
> +    };
> -- 
> 2.17.1
> 

-- 
Regards,
Niklas Söderlund

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

* Re: [PATCH] dt-bindings: watchdog: renesas-wdt: Convert to json-schema
  2020-04-27 19:25 [PATCH] dt-bindings: watchdog: renesas-wdt: Convert to json-schema Geert Uytterhoeven
  2020-04-28 11:59 ` Niklas Söderlund
@ 2020-05-12  1:55 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2020-05-12  1:55 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-watchdog, Wim Van Sebroeck, Rob Herring, devicetree,
	Guenter Roeck, Wolfram Sang, linux-renesas-soc

On Mon, 27 Apr 2020 21:25:22 +0200, Geert Uytterhoeven wrote:
> Convert the Renesas Watchdog Timer (WDT) Controller Device Tree binding
> documentation to json-schema.
> 
> Add missing "renesas,r8a77980-wdt" compatible value.
> Document missing properties.
> Update the example to match reality.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  .../bindings/watchdog/renesas,wdt.txt         |  50 ---------
>  .../bindings/watchdog/renesas,wdt.yaml        | 100 ++++++++++++++++++
>  2 files changed, 100 insertions(+), 50 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/renesas,wdt.txt
>  create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> 

Applied, thanks!

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 19:25 [PATCH] dt-bindings: watchdog: renesas-wdt: Convert to json-schema Geert Uytterhoeven
2020-04-28 11:59 ` Niklas Söderlund
2020-05-12  1:55 ` Rob Herring

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git