Skip to contentSkip to conversation

dt-bindings: soc: ti: Convert OMAP DSP and IVA to DT schema

PATCH Superseded Eduard Bostina 3 participants 10 messages Jul 6 – Jul 8 Device tree bindings

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover dt-bindings: soc: ti: Convert OMAP DSP and IVA to DT schema

This series converts the Texas Instruments DSP and IVA Device Tree bindings from text format to DT schema.

These conversions are grouped together because the IVA schema explicitly depends on the DSP schema. The DSP is defined as a child node within the IVA subsystem.

Changes in v2:
- Expanded from a 2 patch to a 5 patch series.
- Moved both the DSP and IVA binding files from bindings/arm/omap/ to bindings/soc/ti/
- Patches 1 and 3: 1:1 conversions of the old txt files.
- Patches 2 and 4: Make 'ti,hwmods' optional to fix dtbs_check warnings. Reasoning described in the commit messages.
- Patch 5: Documents the DSP child node in the IVA schema to fix dtbs_check warnings. Reasoning described in the commit message.

Eduard Bostina (5):
dt-bindings: soc: ti: Convert DSP to DT schema
dt-bindings: soc: ti: omap-dsp: Make ti,hwmods optional
dt-bindings: soc: ti: Convert IVA to DT schema
dt-bindings: soc: ti: omap-iva: Make ti,hwmods optional
dt-bindings: soc: ti: omap-iva: Document DSP child node

 .../devicetree/bindings/arm/omap/dsp.txt      | 14 ------
 .../devicetree/bindings/arm/omap/iva.txt      | 19 --------
 .../devicetree/bindings/soc/ti/ti,iva.yaml    | 48 +++++++++++++++++++
 .../bindings/soc/ti/ti,omap3-c64.yaml         | 31 ++++++++++++
 4 files changed, 79 insertions(+), 33 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/omap/dsp.txt
 delete mode 100644 Documentation/devicetree/bindings/arm/omap/iva.txt
 create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,iva.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,omap3-c64.yaml
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/5 dt-bindings: soc: ti: Convert DSP to DT schema

Convert the Texas Instruments DSP bindings to DT schema.

During the conversion, the following updates were made:
- Moved the binding to bindings/soc/ti/

---
 .../devicetree/bindings/arm/omap/dsp.txt      | 14 --------
 .../bindings/soc/ti/ti,omap3-c64.yaml         | 32 +++++++++++++++++++
 2 files changed, 32 insertions(+), 14 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/omap/dsp.txt
 create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,omap3-c64.yaml
Documentation/devicetree/bindings/arm/omap/dsp.txt deleted +0 -14
deleted file mode 100644
index d3830a32ce08..000000000000
@@ -1,14 +0,0 @@
-* TI - DSP (Digital Signal Processor)
-
-TI DSP included in OMAP SoC
-
-Required properties:
-- compatible : Should be "ti,omap3-c64" for OMAP3 & 4
-- ti,hwmods: "dsp"
-
-Examples:
-
-dsp {
-    compatible = "ti,omap3-c64";
-    ti,hwmods = "dsp";
-};
Documentation/devicetree/bindings/soc/ti/ti,omap3-c64.yaml new file +32 -0
new file mode 100644
index 000000000000..a97e163c890a
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/ti/ti,omap3-c64.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments DSP (Digital Signal Processor)
+
+maintainers:
+  - Eduard Bostina <[email protected]>
+
+properties:
+  compatible:
+    const: ti,omap3-c64
+
+  ti,hwmods:
+    description: Name of the hwmod associated to the dsp
+    $ref: /schemas/types.yaml#/definitions/string
+    const: dsp
+
+required:
+  - compatible
+  - ti,hwmods
+
+additionalProperties: false
+
+examples:
+  - |
+    dsp {
+        compatible = "ti,omap3-c64";
+        ti,hwmods = "dsp";
+    };
Signature · 1 line
2.43.0
Reviewed-by on v2 1/5
#2 lore raw

Re: [PATCH v2 1/5] dt-bindings: soc: ti: Convert DSP to DT schema

Quoted 5 lines · Eduard Bostina

Convert the Texas Instruments DSP bindings to DT schema.

During the conversion, the following updates were made:
- Moved the binding to bindings/soc/ti/

Quoted 7 lines
---
 .../devicetree/bindings/arm/omap/dsp.txt      | 14 --------
 .../bindings/soc/ti/ti,omap3-c64.yaml         | 32 +++++++++++++++++++
 2 files changed, 32 insertions(+), 14 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/omap/dsp.txt
 create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,omap3-c64.yaml

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/5 dt-bindings: soc: ti: omap-dsp: Make ti,hwmods optional

In reply to Eduard Bostina

Make the 'ti,hwmods' property optional to resolve dtbs_check warnings, as several in-tree device trees currently omit it.

A review of the ti-sysc driver (drivers/bus/ti-sysc.c)
shows that the property is not strictly required for probing. The driver only reads it to populate the 'ddata->legacy_mode' flag. If the property is absent, the probe sequence continues normally without error.

---
 Documentation/devicetree/bindings/soc/ti/ti,omap3-c64.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/soc/ti/ti,omap3-c64.yaml +0 -1
index a97e163c890a..09d0ebf2cb13 100644
@@ -20,7 +20,6 @@ properties:
 
 required:
   - compatible
-  - ti,hwmods
 
 additionalProperties: false
 
Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH v2 2/5] dt-bindings: soc: ti: omap-dsp: Make ti,hwmods optional

Quoted 11 lines · Eduard Bostina

Make the 'ti,hwmods' property optional to resolve dtbs_check warnings, as several in-tree device trees currently omit it.

A review of the ti-sysc driver (drivers/bus/ti-sysc.c)
shows that the property is not strictly required for probing. The driver only reads it to populate the 'ddata->legacy_mode' flag. If the property is absent, the probe sequence continues normally without error.

---
 Documentation/devicetree/bindings/soc/ti/ti,omap3-c64.yaml | 1 -

Please squash the patch. If conversion leads to known warnings and original binding is not correct, then the conversion was supposed to do all necessary changes. See also my announcement/guideline for all mentosrhip-programs:

https://social.kernel.org/notice/B4DukxPLisztLVWuEi

Best regards,
Krzysztof

#5 lore raw

PATCH v2 3/5 dt-bindings: soc: ti: Convert IVA to DT schema

In reply to Eduard Bostina

Convert the Texas Instruments IVA bindings to DT schema.

During the conversion, the following updates were made:
- Moved the binding to bindings/soc/ti/
- Removed 'ti,iva' from the example as it is undocumented and unused.

---
 .../devicetree/bindings/arm/omap/iva.txt      | 19 ----------
 .../devicetree/bindings/soc/ti/ti,iva.yaml    | 36 +++++++++++++++++++
 2 files changed, 36 insertions(+), 19 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/omap/iva.txt
 create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,iva.yaml
Documentation/devicetree/bindings/arm/omap/iva.txt deleted +0 -19
deleted file mode 100644
index 6d6295171358..000000000000
@@ -1,19 +0,0 @@
-* TI - IVA (Imaging and Video Accelerator) subsystem
-
-The IVA contain various audio, video or imaging HW accelerator
-depending of the version.
-
-Required properties:
-- compatible : Should be:
-  - "ti,ivahd" for OMAP4
-  - "ti,iva2.2" for OMAP3
-  - "ti,iva2.1" for OMAP2430
-  - "ti,iva1" for OMAP2420
-- ti,hwmods: "iva"
-
-Examples:
-
-iva {
-    compatible = "ti,ivahd", "ti,iva";
-    ti,hwmods = "iva";
-};
Documentation/devicetree/bindings/soc/ti/ti,iva.yaml new file +36 -0
new file mode 100644
index 000000000000..5724b8367a15
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/ti/ti,iva.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments IVA (Imaging and Video Accelerator)
+
+maintainers:
+  - Eduard Bostina <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - ti,iva1
+      - ti,iva2.1
+      - ti,iva2.2
+      - ti,ivahd
+
+  ti,hwmods:
+    description: Name of the hwmod associated to the iva
+    $ref: /schemas/types.yaml#/definitions/string
+    const: iva
+
+required:
+  - compatible
+  - ti,hwmods
+
+additionalProperties: false
+
+examples:
+  - |
+    iva {
+        compatible = "ti,ivahd";
+        ti,hwmods = "iva";
+    };
Signature · 1 line
2.43.0
#6 lore raw

PATCH v2 4/5 dt-bindings: soc: ti: omap-iva: Make ti,hwmods optional

In reply to Eduard Bostina

Make the 'ti,hwmods' property optional to resolve dtbs_check warnings, as several in-tree device trees currently omit it.

A review of the ti-sysc driver (drivers/bus/ti-sysc.c) shows that the property is not strictly required for probing. The driver only reads it to populate the 'ddata->legacy_mode' flag. If the property is absent, the probe sequence continues normally without error.

---
 Documentation/devicetree/bindings/soc/ti/ti,iva.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/soc/ti/ti,iva.yaml +0 -1
index 5724b8367a15..799461a20b04 100644
@@ -24,7 +24,6 @@ properties:
 
 required:
   - compatible
-  - ti,hwmods
 
 additionalProperties: false
 
Signature · 1 line
2.43.0
#7 lore raw

Re: [PATCH v2 4/5] dt-bindings: soc: ti: omap-iva: Make ti,hwmods optional

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Globally removing 'ti,hwmods' from the 'required' list silently breaks schema validation for…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Globally removing 'ti,hwmods' from the 'required' list silently breaks schema validation for legacy OMAP generations, and the commit message justifies this using a fundamental misunderstanding of the driver architecture. --

commit b2b7440e95e8ab91078767b3f9e9a47ec5186538
Author: Eduard Bostina <[email protected]>

dt-bindings: soc: ti: omap-iva: Make ti,hwmods optional

This commit removes "ti,hwmods" from the required list in the ti,iva binding schema. The commit message indicates this is safe because the ti-sysc driver does not strictly require it for probing.

Quoted 4 lines

A review of the ti-sysc driver (drivers/bus/ti-sysc.c) shows that the property is not strictly required for probing. The driver only reads it to populate the 'ddata->legacy_mode' flag. If the property is absent, the probe sequence continues normally without error.

[Severity: Medium]
Is this justification accurate?

Looking at sysc_check_one_child() in drivers/bus/ti-sysc.c, the driver actually warns if it finds this property on a child node like ti,iva:

drivers/bus/ti-sysc.c:sysc_check_one_child() {
    ...
	name = of_get_property(np, "ti,hwmods", NULL);
	if (name && !of_device_is_compatible(np, "ti,sysc"))
		dev_warn(ddata->dev, "really a child ti,hwmods property?");
    ...
}

Documentation/devicetree/bindings/soc/ti/ti,iva.yaml properties: · line 27

Quoted 9 lines
Documentation/devicetree/bindings/soc/ti/ti,iva.yaml +0 -1
index 5724b8367a158..799461a20b049 100644
@@ -24,7 +24,6 @@ properties:
 
 required:
   - compatible
-  - ti,hwmods

[Severity: Medium]
Does removing this requirement globally break schema validation for older OMAP generations?

Legacy platforms (like OMAP2/OMAP3) rely on arch/arm/mach-omap2/omap_device.c, which strictly requires this property to initialize the device:

arch/arm/mach-omap2/omap_device.c:omap_device_build_from_dt() {
    ...
	oh_cnt = of_property_count_strings(node, "ti,hwmods");
	if (oh_cnt <= 0) {
		dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n");
		return -ENODEV;
	}
    ...
}

If "ti,hwmods" is globally optional, won't invalid device trees for these legacy platforms silently pass dtbs_check, only to fail at runtime with -ENODEV?

Quoted 1 line
Documentation/devicetree/bindings/soc/ti/ti,iva.yaml +0 -0
 additionalProperties: false
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#8 lore raw

PATCH v2 5/5 dt-bindings: soc: ti: omap-iva: Document DSP child node

In reply to Eduard Bostina

Document the DSP child node in the IVA schema to resolve dtbs_check warnings.

OMAP3 device tree (omap3.dtsi) models the DSP as a child of the IVA subsystem. This node was missing from the old iva.txt binding. Add it to align the schema with current ABI usage.

---
 .../devicetree/bindings/soc/ti/ti,iva.yaml          | 13 +++++++++++++
 1 file changed, 13 insertions(+)
Documentation/devicetree/bindings/soc/ti/ti,iva.yaml +13 -0
index 799461a20b04..d7168d76fdb0 100644
@@ -22,12 +22,25 @@ properties:
     $ref: /schemas/types.yaml#/definitions/string
     const: iva
 
+  dsp:
+    type: object
+    $ref: /schemas/soc/ti/ti,omap3-c64.yaml#
+    unevaluatedProperties: false
+
 required:
   - compatible
 
 additionalProperties: false
 
 examples:
+  - |
+    iva {
+        compatible = "ti,iva2.2";
+        ti,hwmods = "iva";
+        dsp {
+            compatible = "ti,omap3-c64";
+        };
+    };
   - |
     iva {
         compatible = "ti,ivahd";
Signature · 1 line
2.43.0
#9 lore raw

Re: [PATCH v2 5/5] dt-bindings: soc: ti: omap-iva: Document DSP child node

Quoted 17 lines · Eduard Bostina

Document the DSP child node in the IVA schema to resolve dtbs_check warnings.

OMAP3 device tree (omap3.dtsi) models the DSP as a child of the IVA subsystem. This node was missing from the old iva.txt binding. Add it to align the schema with current ABI usage.

---
 .../devicetree/bindings/soc/ti/ti,iva.yaml          | 13 +++++++++++++
 1 file changed, 13 insertions(+)
Documentation/devicetree/bindings/soc/ti/ti,iva.yaml +0 -0
index 799461a20b04..d7168d76fdb0 100644

Documentation/devicetree/bindings/soc/ti/ti,iva.yaml properties: · line 27

Quoted 6 lines
Documentation/devicetree/bindings/soc/ti/ti,iva.yaml +3 -0
@@ -22,12 +22,25 @@ properties:
     $ref: /schemas/types.yaml#/definitions/string
     const: iva
 
+  dsp:
+    type: object
+    $ref: /schemas/soc/ti/ti,omap3-c64.yaml#

This also should be squashed.

Best regards,
Krzysztof