devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ti: davinci, keystone: txt to yaml
@ 2024-07-25 15:03 Kousik Sanagavarapu
  2024-07-25 15:03 ` [PATCH v2 1/2] dt-bindings: timer: ti,davinci-timer: convert to dtschema Kousik Sanagavarapu
  2024-07-25 15:03 ` [PATCH v2 2/2] dt-bindings: watchdog: ti,davinci-wdt: " Kousik Sanagavarapu
  0 siblings, 2 replies; 5+ messages in thread
From: Kousik Sanagavarapu @ 2024-07-25 15:03 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wim Van Sebroeck, Guenter Roeck
  Cc: devicetree, linux-watchdog, linux-kernel, Kousik Sanagavarapu

Convert txt bindings of DaVinci Timer and DaVinci/Keystone WDT
Controller to dtschema.

v1: https://lore.kernel.org/linux-devicetree/20240721170840.15569-1-five231003@gmail.com/

Changes vs v1:
- Change davinci timer binding's file name to match with the compatible.
  Also add "maxItems" for interrupts.

- Change the order of compatibles in wdt controller bindings touched in
  order to match DTS.

- Drop 3/3 from v1 which might effect users and should not have been
  included in this series in the first place.

Kousik Sanagavarapu (2):
  dt-bindings: timer: ti,davinci-timer: convert to dtschema
  dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema

 .../bindings/timer/ti,da830-timer.yaml        | 68 +++++++++++++++++++
 .../bindings/timer/ti,davinci-timer.txt       | 37 ----------
 .../bindings/watchdog/davinci-wdt.txt         | 24 -------
 .../bindings/watchdog/ti,davinci-wdt.yaml     | 52 ++++++++++++++
 4 files changed, 120 insertions(+), 61 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/timer/ti,da830-timer.yaml
 delete mode 100644 Documentation/devicetree/bindings/timer/ti,davinci-timer.txt
 delete mode 100644 Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml

-- 
2.45.2.827.g557ae147e6.dirty


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

* [PATCH v2 1/2] dt-bindings: timer: ti,davinci-timer: convert to dtschema
  2024-07-25 15:03 [PATCH v2 0/2] ti: davinci, keystone: txt to yaml Kousik Sanagavarapu
@ 2024-07-25 15:03 ` Kousik Sanagavarapu
  2024-07-26  9:15   ` Krzysztof Kozlowski
  2024-07-25 15:03 ` [PATCH v2 2/2] dt-bindings: watchdog: ti,davinci-wdt: " Kousik Sanagavarapu
  1 sibling, 1 reply; 5+ messages in thread
From: Kousik Sanagavarapu @ 2024-07-25 15:03 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wim Van Sebroeck, Guenter Roeck
  Cc: devicetree, linux-watchdog, linux-kernel, Kousik Sanagavarapu

Convert txt binding of TI's DaVinci timer to dtschema to allow for
validation.

While at it, change the file name to match the compatible.

Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
---
 .../bindings/timer/ti,da830-timer.yaml        | 68 +++++++++++++++++++
 .../bindings/timer/ti,davinci-timer.txt       | 37 ----------
 2 files changed, 68 insertions(+), 37 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/timer/ti,da830-timer.yaml
 delete mode 100644 Documentation/devicetree/bindings/timer/ti,davinci-timer.txt

diff --git a/Documentation/devicetree/bindings/timer/ti,da830-timer.yaml b/Documentation/devicetree/bindings/timer/ti,da830-timer.yaml
new file mode 100644
index 000000000000..e9646f4e86cc
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/ti,da830-timer.yaml
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/ti,da830-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI DaVinci Timer
+
+maintainers:
+  - Kousik Sanagavarapu <five231003@gmail.com>
+
+description: |
+  This is a 64-bit timer found on TI's DaVinci architecture devices. The timer
+  can be configured as a general-purpose 64-bit timer, dual general-purpose
+  32-bit timers. When configured as dual 32-bit timers, each half can operate
+  in conjunction (chain mode) or independently (unchained mode) of each other.
+
+  The timer is a free running up-counter and can generate interrupts when the
+  counter reaches preset counter values.
+
+properties:
+  compatible:
+    const: ti,da830-timer
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 2
+    maxItems: 10
+
+  interrupt-names:
+    minItems: 2
+    items:
+      - const: tint12
+      - const: tint34
+      - const: cmpint0
+      - const: cmpint1
+      - const: cmpint2
+      - const: cmpint3
+      - const: cmpint4
+      - const: cmpint5
+      - const: cmpint6
+      - const: cmpint7
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    timer@20000 {
+        compatible = "ti,da830-timer";
+        reg = <0x20000 0x1000>;
+        interrupts = <21>, <22>;
+        interrupt-names = "tint12", "tint34";
+        clocks = <&pll0_auxclk>;
+    };
+
+...
diff --git a/Documentation/devicetree/bindings/timer/ti,davinci-timer.txt b/Documentation/devicetree/bindings/timer/ti,davinci-timer.txt
deleted file mode 100644
index 29bf91ccf5b7..000000000000
--- a/Documentation/devicetree/bindings/timer/ti,davinci-timer.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-* Device tree bindings for Texas Instruments DaVinci timer
-
-This document provides bindings for the 64-bit timer in the DaVinci
-architecture devices. The timer can be configured as a general-purpose 64-bit
-timer, dual general-purpose 32-bit timers. When configured as dual 32-bit
-timers, each half can operate in conjunction (chain mode) or independently
-(unchained mode) of each other.
-
-The timer is a free running up-counter and can generate interrupts when the
-counter reaches preset counter values.
-
-Also see ../watchdog/davinci-wdt.txt for timers that are configurable as
-watchdog timers.
-
-Required properties:
-
-- compatible : should be "ti,da830-timer".
-- reg : specifies base physical address and count of the registers.
-- interrupts : interrupts generated by the timer.
-- interrupt-names: should be "tint12", "tint34", "cmpint0", "cmpint1",
-		   "cmpint2", "cmpint3", "cmpint4", "cmpint5", "cmpint6",
-		   "cmpint7" ("cmpintX" may be omitted if not present in the
-		   hardware).
-- clocks : the clock feeding the timer clock.
-
-Example:
-
-	clocksource: timer@20000 {
-		compatible = "ti,da830-timer";
-		reg = <0x20000 0x1000>;
-		interrupts = <21>, <22>, <74>, <75>, <76>, <77>, <78>, <79>,
-			     <80>, <81>;
-		interrupt-names = "tint12", "tint34", "cmpint0", "cmpint1",
-				  "cmpint2", "cmpint3", "cmpint4", "cmpint5",
-				  "cmpint6", "cmpint7";
-		clocks = <&pll0_auxclk>;
-	};
-- 
2.45.2.827.g557ae147e6.dirty


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

* [PATCH v2 2/2] dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
  2024-07-25 15:03 [PATCH v2 0/2] ti: davinci, keystone: txt to yaml Kousik Sanagavarapu
  2024-07-25 15:03 ` [PATCH v2 1/2] dt-bindings: timer: ti,davinci-timer: convert to dtschema Kousik Sanagavarapu
@ 2024-07-25 15:03 ` Kousik Sanagavarapu
  2024-07-26  9:17   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Kousik Sanagavarapu @ 2024-07-25 15:03 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wim Van Sebroeck, Guenter Roeck
  Cc: devicetree, linux-watchdog, linux-kernel, Kousik Sanagavarapu

Convert txt bindings of TI's DaVinci/Keystone Watchdog Timer Controller
to dtschema to allow for validation.

While at it, change the order of the compatibles w.r.t. the txt binding
to stay in sync with the existing DTS.

Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
---
 .../bindings/watchdog/davinci-wdt.txt         | 24 ---------
 .../bindings/watchdog/ti,davinci-wdt.yaml     | 52 +++++++++++++++++++
 2 files changed, 52 insertions(+), 24 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt b/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
deleted file mode 100644
index aa10b8ec36e2..000000000000
--- a/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Texas Instruments DaVinci/Keystone Watchdog Timer (WDT) Controller
-
-Required properties:
-- compatible : Should be "ti,davinci-wdt", "ti,keystone-wdt"
-- reg : Should contain WDT registers location and length
-
-Optional properties:
-- timeout-sec : Contains the watchdog timeout in seconds
-- clocks : the clock feeding the watchdog timer.
-	   Needed if platform uses clocks.
-	   See clock-bindings.txt
-
-Documentation:
-Davinci DM646x - https://www.ti.com/lit/ug/spruer5b/spruer5b.pdf
-Keystone - https://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf
-
-Examples:
-
-wdt: wdt@2320000 {
-	compatible = "ti,davinci-wdt";
-	reg = <0x02320000 0x80>;
-	timeout-sec = <30>;
-	clocks = <&clkwdtimer0>;
-};
diff --git a/Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml b/Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml
new file mode 100644
index 000000000000..f1413e7370a1
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/ti,davinci-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI DaVinci/Keystone Watchdog Timer Controller
+
+maintainers:
+  - Kousik Sanagavarapu <five231003@gmail.com>
+
+description: |
+  TI's Watchdog Timer Controller for DaVinci and Keystone Processors.
+
+  Datasheets
+
+    Davinci DM646x - https://www.ti.com/lit/ug/spruer5b/spruer5b.pdf
+    Keystone - https://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf
+
+allOf:
+  - $ref: watchdog.yaml#
+
+properties:
+  compatible:
+    items:
+      - const: ti,keystone-wdt
+      - const: ti,davinci-wdt
+
+  reg:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    wdt: watchdog@22f0080 {
+        compatible = "ti,keystone-wdt", "ti,davinci-wdt";
+        reg = <0x022f0080 0x80>;
+        clocks = <&clkwdtimer0>;
+    };
+
+...
-- 
2.45.2.827.g557ae147e6.dirty


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

* Re: [PATCH v2 1/2] dt-bindings: timer: ti,davinci-timer: convert to dtschema
  2024-07-25 15:03 ` [PATCH v2 1/2] dt-bindings: timer: ti,davinci-timer: convert to dtschema Kousik Sanagavarapu
@ 2024-07-26  9:15   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-26  9:15 UTC (permalink / raw)
  To: Kousik Sanagavarapu, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Wim Van Sebroeck,
	Guenter Roeck
  Cc: devicetree, linux-watchdog, linux-kernel

On 25/07/2024 17:03, Kousik Sanagavarapu wrote:
> Convert txt binding of TI's DaVinci timer to dtschema to allow for
> validation.
> 
> While at it, change the file name to match the compatible.
> 
> Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
> ---
>  .../bindings/timer/ti,da830-timer.yaml        | 68 +++++++++++++++++++
>  .../bindings/timer/ti,davinci-timer.txt       | 37 ----------
>  2 files changed, 68 insertions(+), 37 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/timer/ti,da830-timer.yaml
>  delete mode 100644 Documentation/devicetree/bindings/timer/ti,davinci-timer.txt

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH v2 2/2] dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
  2024-07-25 15:03 ` [PATCH v2 2/2] dt-bindings: watchdog: ti,davinci-wdt: " Kousik Sanagavarapu
@ 2024-07-26  9:17   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-26  9:17 UTC (permalink / raw)
  To: Kousik Sanagavarapu, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Wim Van Sebroeck,
	Guenter Roeck
  Cc: devicetree, linux-watchdog, linux-kernel

On 25/07/2024 17:03, Kousik Sanagavarapu wrote:
> Convert txt bindings of TI's DaVinci/Keystone Watchdog Timer Controller
> to dtschema to allow for validation.
> 
> While at it, change the order of the compatibles w.r.t. the txt binding
> to stay in sync with the existing DTS.

... and add power-domains property, because it is used somwhere?

> 
> Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
> ---
>  .../bindings/watchdog/davinci-wdt.txt         | 24 ---------
>  .../bindings/watchdog/ti,davinci-wdt.yaml     | 52 +++++++++++++++++++
>  2 files changed, 52 insertions(+), 24 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
>  create mode 100644 Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt b/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
> deleted file mode 100644
> index aa10b8ec36e2..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/davinci-wdt.txt
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -Texas Instruments DaVinci/Keystone Watchdog Timer (WDT) Controller
> -

...

> +  - Kousik Sanagavarapu <five231003@gmail.com>
> +
> +description: |
> +  TI's Watchdog Timer Controller for DaVinci and Keystone Processors.
> +
> +  Datasheets
> +
> +    Davinci DM646x - https://www.ti.com/lit/ug/spruer5b/spruer5b.pdf
> +    Keystone - https://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf
> +
> +allOf:
> +  - $ref: watchdog.yaml#
> +
> +properties:
> +  compatible:
> +    items:
> +      - const: ti,keystone-wdt
> +      - const: ti,davinci-wdt

Validate the DTS - you will see this is wrong. You miss davinci standing
alone (so oneOf).

Best regards,
Krzysztof


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

end of thread, other threads:[~2024-07-26  9:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 15:03 [PATCH v2 0/2] ti: davinci, keystone: txt to yaml Kousik Sanagavarapu
2024-07-25 15:03 ` [PATCH v2 1/2] dt-bindings: timer: ti,davinci-timer: convert to dtschema Kousik Sanagavarapu
2024-07-26  9:15   ` Krzysztof Kozlowski
2024-07-25 15:03 ` [PATCH v2 2/2] dt-bindings: watchdog: ti,davinci-wdt: " Kousik Sanagavarapu
2024-07-26  9:17   ` Krzysztof Kozlowski

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