Skip to contentSkip to conversation

ti,keystone-devctrl: Convert to DT schema and DTS cleanups

PATCH Superseded Bhargav Joshi 4 participants 8 messages Aug 15 – Aug 18

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover ti,keystone-devctrl: Convert to DT schema and DTS cleanups

Series converts Texas Instruments Keystone Device State Control binding to DT schema and aligns the existing dt files with standard naming conventions.

Patch 1 aligns the legacy child node names with standard names. Patch 2 converts the ti,keystone-devctrl binding to YAML schema.

---
Changes in v2:
- Fix legacy node names containing underscores in existing .dtsi files.
- Dropped 'minItems: 2' and the conditional block. Made 'simple-mfd' and
bus properties strictly required, as all in-tree dts uses it.
- Updated patternProperties to strictly enforce standard node names
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Bhargav Joshi (2):
ARM: dts: ti: keystone: Align devctrl child node names with dtschema
dt-bindings: mfd: ti,keystone-devctrl: Convert to DT schema

 .../bindings/mfd/ti,keystone-devctrl.yaml          | 84 ++++++++++++++++++++++
 .../bindings/mfd/ti-keystone-devctrl.txt           | 19 -----
 arch/arm/boot/dts/ti/keystone/keystone-k2e.dtsi    |  2 +-
 arch/arm/boot/dts/ti/keystone/keystone-k2g.dtsi    |  4 +-
 arch/arm/boot/dts/ti/keystone/keystone-k2hk.dtsi   | 16 ++---
 arch/arm/boot/dts/ti/keystone/keystone-k2l.dtsi    |  8 +--
 arch/arm/boot/dts/ti/keystone/keystone.dtsi        |  2 +-
 7 files changed, 100 insertions(+), 35 deletions(-)

---
base-commit: 3d6d817622b0a9721e3cc404df3469171582be13
change-id: 20260813-ti-keystone-devctrl-6e49212fe35d

Best regards,

Signature · 1 line
Bhargav
#1 lore raw

PATCH v2 1/2 ARM: dts: ti: keystone: Align devctrl child node names with dtschema

Align TI Keystone device state control child node names with standard naming conventions.
- Change keystone_irq to interrupt-controller
- Change keystone_dsp_gpio to gpio

---
 arch/arm/boot/dts/ti/keystone/keystone-k2e.dtsi  |  2 +-
 arch/arm/boot/dts/ti/keystone/keystone-k2g.dtsi  |  4 ++--
 arch/arm/boot/dts/ti/keystone/keystone-k2hk.dtsi | 16 ++++++++--------
 arch/arm/boot/dts/ti/keystone/keystone-k2l.dtsi  |  8 ++++----
 arch/arm/boot/dts/ti/keystone/keystone.dtsi      |  2 +-
 5 files changed, 16 insertions(+), 16 deletions(-)
arch/arm/boot/dts/ti/keystone/keystone-k2e.dtsi +1 -1
index 662aa33cba11..083c94b62fc7 100644
@@ -110,7 +110,7 @@ pscrst: reset-controller {
 		};
 
 		devctrl: device-state-control@2620000 {
-			dspgpio0: keystone_dsp_gpio@240 {
+			dspgpio0: gpio@240 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x240 0x4>;
 				gpio-controller;
arch/arm/boot/dts/ti/keystone/keystone-k2g.dtsi +2 -2
index dafe485dfe19..11b27663503a 100644
@@ -121,7 +121,7 @@ devctrl: device-state-control@2620000 {
 			#size-cells = <1>;
 			ranges = <0x0 0x02620000 0x1000>;
 
-			kirq0: keystone_irq@2a0 {
+			kirq0: interrupt-controller@2a0 {
 				compatible = "ti,keystone-irq";
 				reg = <0x2a0 0x10>;
 				interrupts = <GIC_SPI 1 IRQ_TYPE_EDGE_RISING>;
@@ -130,7 +130,7 @@ kirq0: keystone_irq@2a0 {
 				ti,syscon-dev = <&devctrl 0x2a0>;
 			};
 
-			dspgpio0: keystone_dsp_gpio@240 {
+			dspgpio0: gpio@240 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x240 0x4>;
 				gpio-controller;
arch/arm/boot/dts/ti/keystone/keystone-k2hk.dtsi +8 -8
index 4fdf4b30384f..b7a9fbd6d59d 100644
@@ -88,7 +88,7 @@ pscrst: reset-controller {
 		};
 
 		devctrl: device-state-control@2620000 {
-			dspgpio0: keystone_dsp_gpio@240 {
+			dspgpio0: gpio@240 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x240 0x4>;
 				gpio-controller;
@@ -96,7 +96,7 @@ dspgpio0: keystone_dsp_gpio@240 {
 				gpio,syscon-dev = <&devctrl 0x240>;
 			};
 
-			dspgpio1: keystone_dsp_gpio@244 {
+			dspgpio1: gpio@244 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x244 0x4>;
 				gpio-controller;
@@ -104,7 +104,7 @@ dspgpio1: keystone_dsp_gpio@244 {
 				gpio,syscon-dev = <&devctrl 0x244>;
 			};
 
-			dspgpio2: keystone_dsp_gpio@248 {
+			dspgpio2: gpio@248 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x248 0x4>;
 				gpio-controller;
@@ -112,7 +112,7 @@ dspgpio2: keystone_dsp_gpio@248 {
 				gpio,syscon-dev = <&devctrl 0x248>;
 			};
 
-			dspgpio3: keystone_dsp_gpio@24c {
+			dspgpio3: gpio@24c {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x24c 0x4>;
 				gpio-controller;
@@ -120,7 +120,7 @@ dspgpio3: keystone_dsp_gpio@24c {
 				gpio,syscon-dev = <&devctrl 0x24c>;
 			};
 
-			dspgpio4: keystone_dsp_gpio@250 {
+			dspgpio4: gpio@250 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x250 0x4>;
 				gpio-controller;
@@ -128,7 +128,7 @@ dspgpio4: keystone_dsp_gpio@250 {
 				gpio,syscon-dev = <&devctrl 0x250>;
 			};
 
-			dspgpio5: keystone_dsp_gpio@254 {
+			dspgpio5: gpio@254 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x254 0x4>;
 				gpio-controller;
@@ -136,7 +136,7 @@ dspgpio5: keystone_dsp_gpio@254 {
 				gpio,syscon-dev = <&devctrl 0x254>;
 			};
 
-			dspgpio6: keystone_dsp_gpio@258 {
+			dspgpio6: gpio@258 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x258 0x4>;
 				gpio-controller;
@@ -144,7 +144,7 @@ dspgpio6: keystone_dsp_gpio@258 {
 				gpio,syscon-dev = <&devctrl 0x258>;
 			};
 
-			dspgpio7: keystone_dsp_gpio@25c {
+			dspgpio7: gpio@25c {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x25c 0x4>;
 				gpio-controller;
arch/arm/boot/dts/ti/keystone/keystone-k2l.dtsi +4 -4
index 330b437b667f..4678454c0eb3 100644
@@ -290,7 +290,7 @@ osr: sram@70000000 {
 		};
 
 		devctrl: device-state-control@2620000 {
-			dspgpio0: keystone_dsp_gpio@240 {
+			dspgpio0: gpio@240 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x240 0x4>;
 				gpio-controller;
@@ -298,7 +298,7 @@ dspgpio0: keystone_dsp_gpio@240 {
 				gpio,syscon-dev = <&devctrl 0x240>;
 			};
 
-			dspgpio1: keystone_dsp_gpio@244 {
+			dspgpio1: gpio@244 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x244 0x4>;
 				gpio-controller;
@@ -306,7 +306,7 @@ dspgpio1: keystone_dsp_gpio@244 {
 				gpio,syscon-dev = <&devctrl 0x244>;
 			};
 
-			dspgpio2: keystone_dsp_gpio@248 {
+			dspgpio2: gpio@248 {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x248 0x4>;
 				gpio-controller;
@@ -314,7 +314,7 @@ dspgpio2: keystone_dsp_gpio@248 {
 				gpio,syscon-dev = <&devctrl 0x248>;
 			};
 
-			dspgpio3: keystone_dsp_gpio@24c {
+			dspgpio3: gpio@24c {
 				compatible = "ti,keystone-dsp-gpio";
 				reg = <0x24c 0x4>;
 				gpio-controller;
arch/arm/boot/dts/ti/keystone/keystone.dtsi +1 -1
index ff16428860a9..20596fa446b9 100644
@@ -93,7 +93,7 @@ devctrl: device-state-control@2620000 {
 			#size-cells = <1>;
 			ranges = <0x0 0x02620000 0x1000>;
 
-			kirq0: keystone_irq@2a0 {
+			kirq0: interrupt-controller@2a0 {
 				compatible = "ti,keystone-irq";
 				reg = <0x2a0 0x4>;
 				interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.55.0
#2 lore raw

Re: [PATCH v2 1/2] ARM: dts: ti: keystone: Align devctrl child node names with dtschema

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 6 lines

Align TI Keystone device state control child node names with standard naming conventions.
- Change keystone_irq to interrupt-controller
- Change keystone_dsp_gpio to gpio

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

PATCH v2 2/2 dt-bindings: mfd: ti,keystone-devctrl: Convert to DT schema

In reply to Bhargav Joshi

Convert the Texas Instruments Keystone Device State Control binding from legacy text format to DT schema.

During the conversion, the following updates were made:
- Add "simple-mfd" to compatibles matching existing dts usage.
- Add required bus properties #address-cells, #size-cells, and ranges which were missing in text binding.
- Document child nodes gpio, interrupt-controller, and reset-controller.

---
Note: Running dt_binding_check on patch will yield a warning for 'ti,keystone-reset' in the example block. The YAML conversion patch for that child node is already in progress here:
https://lore.kernel.org/linux-devicetree/[email protected]/

---
 .../bindings/mfd/ti,keystone-devctrl.yaml          | 84 ++++++++++++++++++++++
 .../bindings/mfd/ti-keystone-devctrl.txt           | 19 -----
 2 files changed, 84 insertions(+), 19 deletions(-)
Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.yaml new file +84 -0
new file mode 100644
index 000000000000..dd73b62357ca
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/ti,keystone-devctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments Keystone Device State Control
+
+maintainers:
+  - Ivan Khoronzhuk <[email protected]>
+
+description:
+  The Keystone II devices have a set of registers that are used to control the
+  status of its peripherals. This node is intended to allow access to this
+  functionality.
+
+properties:
+  compatible:
+    items:
+      - const: ti,keystone-devctrl
+      - const: syscon
+      - const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+  ranges: true
+
+patternProperties:
+  "^gpio@[0-9a-f]+$":
+    type: object
+    description: Keystone DSP GPIO controller
+
+  "^interrupt-controller@[0-9a-f]+$":
+    type: object
+    description: Keystone DSP to ARM interrupt controller
+
+  "^reset-controller@[0-9a-f]+$":
+    type: object
+    description: Keystone reset controller
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    device-state-control@2620000 {
+        compatible = "ti,keystone-devctrl", "syscon", "simple-mfd";
+        reg = <0x02620000 0x1000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x02620000 0x1000>;
+
+        interrupt-controller@2a0 {
+            compatible = "ti,keystone-irq";
+            reg = <0x2a0 0x4>;
+            interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>;
+            interrupt-controller;
+            #interrupt-cells = <1>;
+            ti,syscon-dev = <&devctrl 0x2a0>;
+        };
+
+        reset-controller@328 {
+            compatible = "ti,keystone-reset";
+            reg = <0x328 0x10>;
+            ti,syscon-pll = <&pllctrl 0xe4>;
+            ti,syscon-dev = <&devctrl 0x328>;
+            ti,wdt-list = <0>;
+        };
+    };
Documentation/devicetree/bindings/mfd/ti-keystone-devctrl.txt deleted +0 -19
deleted file mode 100644
index 71a1f5963936..000000000000
@@ -1,19 +0,0 @@
-* Device tree bindings for Texas Instruments keystone device state control
-
-The Keystone II devices have a set of registers that are used to control
-the status of its peripherals. This node is intended to allow access to
-this functionality.
-
-Required properties:
-
-- compatible:		"ti,keystone-devctrl", "syscon"
-
-- reg:			contains offset/length value for device state control
-			registers space.
-
-Example:
-
-devctrl: device-state-control@02620000 {
-	compatible = "ti,keystone-devctrl", "syscon";
-	reg = <0x02620000 0x1000>;
-};
Signature · 1 line
2.55.0
#4 lore raw

Re: [PATCH v2 2/2] dt-bindings: mfd: ti,keystone-devctrl: Convert to DT schema

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Unresolved phandle references in the YAML example cause `dt_binding_check` failures. --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Unresolved phandle references in the YAML example cause dt_binding_check failures. --

--- Patch [2]: [PATCH v2 2/2] dt-bindings: mfd: ti,keystone-devctrl: Convert to DT schema --- commit 48184e73993f7287e1c95f939a5d488075736de6
Author: Bhargav Joshi <[email protected]>

dt-bindings: mfd: ti,keystone-devctrl: Convert to DT schema

This commit converts the Texas Instruments Keystone Device State Control binding from the legacy text format to a DT schema. It also adds simple-mfd and missing bus properties while documenting child nodes.

Quoted 4 lines
Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.yaml new file +0 -0
new file mode 100644

[ ... ]

Quoted 7 lines
Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.yaml new file +7 -0
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    device-state-control@2620000 {
+        compatible = "ti,keystone-devctrl", "syscon", "simple-mfd";
+        reg = <0x02620000 0x1000>;

[ ... ]

Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.yaml line 74

Quoted 7 lines
Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.yaml new file +7 -0
+        interrupt-controller@2a0 {
+            compatible = "ti,keystone-irq";
+            reg = <0x2a0 0x4>;
+            interrupts = <GIC_SPI 4 IRQ_TYPE_EDGE_RISING>;
+            interrupt-controller;
+            #interrupt-cells = <1>;
+            ti,syscon-dev = <&devctrl 0x2a0>;

[Severity: Low]
Will dtc fail to compile this example due to an unresolved phandle reference? The previous text binding defined a devctrl: label for the parent node, but it appears to have been dropped during the conversion.

Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.yaml line 80

Quoted 6 lines
Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.yaml new file +6 -0
+        };
+
+        reset-controller@328 {
+            compatible = "ti,keystone-reset";
+            reg = <0x328 0x10>;
+            ti,syscon-pll = <&pllctrl 0xe4>;

[Severity: Low]
Does the example need a dummy pllctrl node or label to avoid validation failures? It looks like &pllctrl is referenced here but not defined anywhere in the example block.

Quoted 4 lines
Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.yaml new file +4 -0
+            ti,syscon-dev = <&devctrl 0x328>;
+            ti,wdt-list = <0>;
+        };
+    };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#5 lore raw

Re: [PATCH v2 2/2] dt-bindings: mfd: ti,keystone-devctrl: Convert to DT schema

In reply to Bhargav Joshi
Quoted 15 lines · Bhargav Joshi

Convert the Texas Instruments Keystone Device State Control binding from legacy text format to DT schema.

During the conversion, the following updates were made:
- Add "simple-mfd" to compatibles matching existing dts usage.
- Add required bus properties #address-cells, #size-cells, and ranges which were missing in text binding.
- Document child nodes gpio, interrupt-controller, and reset-controller.

---
Note: Running dt_binding_check on patch will yield a warning for 'ti,keystone-reset' in the example block. The YAML conversion patch for that child node is already in progress here:
https://lore.kernel.org/linux-devicetree/[email protected]/

Quoted 5 lines
---
 .../bindings/mfd/ti,keystone-devctrl.yaml          | 84 ++++++++++++++++++++++
 .../bindings/mfd/ti-keystone-devctrl.txt           | 19 -----
 2 files changed, 84 insertions(+), 19 deletions(-)

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.example.dtb: /example-0/device-state-control@2620000/reset-controller@328: failed to match any schema with compatible: ['ti,keystone-reset'] Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.example.dtb: reset-controller@328 (ti,keystone-reset): ti,syscon-pll: b'\xff\xff\xff\xff\x00\x00\x00\xe4' is not of type 'object', 'integer', 'array', 'boolean', 'null'
from schema $id: http://devicetree.org/schemas/dt-core.yaml
Documentation/devicetree/bindings/mfd/ti,keystone-devctrl.example.dtb: reset-controller@328 (ti,keystone-reset): ti,wdt-list: b'\x00\x00\x00\x00' is not of type 'object', 'integer', 'array', 'boolean', 'null'
from schema $id: http://devicetree.org/schemas/dt-core.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#6 lore raw

Re: [PATCH v2 2/2] dt-bindings: mfd: ti,keystone-devctrl: Convert to DT schema

In reply to Bhargav Joshi
Quoted 9 lines · Bhargav Joshi

Convert the Texas Instruments Keystone Device State Control binding from legacy text format to DT schema.

During the conversion, the following updates were made:
- Add "simple-mfd" to compatibles matching existing dts usage.
- Add required bus properties #address-cells, #size-cells, and ranges which were missing in text binding.
- Document child nodes gpio, interrupt-controller, and reset-controller.

Quoted 7 lines

---
Note: Running dt_binding_check on patch will yield a warning for 'ti,keystone-reset' in the example block. The YAML conversion patch for that child node is already in progress here:
https://lore.kernel.org/linux-devicetree/[email protected]/
---

You need to send dependencies together, either in patchset or even one patch, depending on the case. If this has warnings then it cannot be applied.

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH v2 2/2] dt-bindings: mfd: ti,keystone-devctrl: Convert to DT schema

Hi,

Quoted 19 lines · Krzysztof Kozlowski
Quoted 9 lines · Bhargav Joshi

Convert the Texas Instruments Keystone Device State Control binding from legacy text format to DT schema.

During the conversion, the following updates were made:
- Add "simple-mfd" to compatibles matching existing dts usage.
- Add required bus properties #address-cells, #size-cells, and ranges which were missing in text binding.
- Document child nodes gpio, interrupt-controller, and reset-controller.

Quoted 7 lines

---
Note: Running dt_binding_check on patch will yield a warning for 'ti,keystone-reset' in the example block. The YAML conversion patch for that child node is already in progress here:
https://lore.kernel.org/linux-devicetree/[email protected]/
---

Quoted 3 lines

You need to send dependencies together, either in patchset or even one patch, depending on the case. If this has warnings then it cannot be applied.

Yes, but ti,keystone-reset is now already merged into linux-next, so i can wait until it is merged into mainline then resend the patch without warning.

Best regards,
Bhargav