Skip to contentSkip to conversation

ti: davinci, keystone: txt to yaml

PATCH Superseded Kousik Sanagavarapu 2 participants 5 messages Jul 25, 2024 – Jul 26, 2024

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover ti: davinci, keystone: txt to yaml

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

v1: https://lore.kernel.org/linux-devicetree/[email protected]/

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
Signature · 1 line
2.45.2.827.g557ae147e6.dirty
#1 lore raw

PATCH v2 1/2 dt-bindings: timer: ti,davinci-timer: convert to dtschema

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.

---
 .../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
Documentation/devicetree/bindings/timer/ti,da830-timer.yaml new file +68 -0
new file mode 100644
index 000000000000..e9646f4e86cc
@@ -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 <[email protected]>
+
+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>;
+    };
+
+...
Documentation/devicetree/bindings/timer/ti,davinci-timer.txt deleted +0 -37
deleted file mode 100644
index 29bf91ccf5b7..000000000000
@@ -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>;
-	};
Signature · 1 line
2.45.2.827.g557ae147e6.dirty
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: timer: ti,davinci-timer: convert to dtschema

Quoted 5 lines · 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.

Quoted 7 lines
---
 .../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

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/2 dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema

In reply to 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.

---
 .../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
Documentation/devicetree/bindings/watchdog/davinci-wdt.txt deleted +0 -24
deleted file mode 100644
index aa10b8ec36e2..000000000000
@@ -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>;
-};
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.45.2.827.g557ae147e6.dirty
#4 lore raw

Re: [PATCH v2 2/2] dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema

Quoted 5 lines · 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.

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

Quoted 17 lines
---
 .../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
Documentation/devicetree/bindings/watchdog/davinci-wdt.txt deleted +0 -2
deleted file mode 100644
index aa10b8ec36e2..000000000000
@@ -1,24 +0,0 @@
-Texas Instruments DaVinci/Keystone Watchdog Timer (WDT) Controller
-

...

Quoted 8 lines
Documentation/devicetree/bindings/watchdog/davinci-wdt.txt deleted +8 -0
+  - Kousik Sanagavarapu <[email protected]>
+
+description: |
+  TI's Watchdog Timer Controller for DaVinci and Keystone Processors.
+
+  Datasheets
+
+    Davinci DM646x - https://www.ti.com/lit/ug/spruer5b/spruer5b.pdf

Documentation/devicetree/bindings/watchdog/davinci-wdt.txt

Quoted 10 lines
Documentation/devicetree/bindings/watchdog/davinci-wdt.txt deleted +10 -0
+    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