Skip to contentSkip to conversation

dt-bindings: pwm: Convert TI PWM Subsystem to DT schema

PATCH Superseded Eduard Bostina 3 participants 5 messages Aug 12

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: pwm: Convert TI PWM Subsystem to DT schema

Convert the Texas Instruments SoC PWM Subsystem bindings to DT schema.

During the conversion, the following updates were made:
- 'counter' node was added to the allowed child nodes list to resolve dtbs_check warnings. Some eqep nodes use 'counter' instead of 'eqep'.

---
Changes in v2:
- Renamed the file to ti,am33xx-pwmss.yaml to match the base compatible.
- Required a 'compatible' property in the child nodes.
- Reduced the binding to a single example and included the PWM child nodes (ECAP, EQEP, EHRPWM) in it.

Link to v1: https://lore.kernel.org/all/[email protected]/

 .../devicetree/bindings/pwm/pwm-tipwmss.txt   | 58 --------------
 .../bindings/pwm/ti,am33xx-pwmss.yaml         | 76 +++++++++++++++++++
 2 files changed, 76 insertions(+), 58 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-tipwmss.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml
Documentation/devicetree/bindings/pwm/pwm-tipwmss.txt deleted +0 -58
deleted file mode 100644
index 4633697fbda1..000000000000
@@ -1,58 +0,0 @@
-TI SOC based PWM Subsystem
-
-Required properties:
-- compatible: Must be "ti,<soc>-pwmss".
-  for am33xx  - compatible = "ti,am33xx-pwmss";
-  for am4372  - compatible = "ti,am4372-pwmss","ti,am33xx-pwmss";
-  for dra746 - compatible = "ti,dra746-pwmss", "ti,am33xx-pwmss"
-
-- reg: physical base address and size of the registers map.
-- address-cells: Specify the number of u32 entries needed in child nodes.
-		  Should set to 1.
-- size-cells: specify number of u32 entries needed to specify child nodes size
-		in reg property. Should set to 1.
-- ranges: describes the address mapping of a memory-mapped bus. Should set to
-	   physical address map of child's base address, physical address within
-	   parent's address  space and length of the address map. For am33xx,
-	   3 set of child register maps present, ECAP register space, EQEP
-	   register space, EHRPWM register space.
-
-Also child nodes should also populated under PWMSS DT node.
-
-Example:
-epwmss0: epwmss@48300000 { /* PWMSS for am33xx */
-	compatible = "ti,am33xx-pwmss";
-	reg = <0x48300000 0x10>;
-	ti,hwmods = "epwmss0";
-	#address-cells = <1>;
-	#size-cells = <1>;
-	ranges = <0x48300100 0x48300100 0x80   /* ECAP */
-		  0x48300180 0x48300180 0x80   /* EQEP */
-		  0x48300200 0x48300200 0x80>; /* EHRPWM */
-
-	/* child nodes go here */
-};
-
-epwmss0: epwmss@48300000 { /* PWMSS for am4372 */
-	compatible = "ti,am4372-pwmss","ti,am33xx-pwmss"
-	reg = <0x48300000 0x10>;
-	ti,hwmods = "epwmss0";
-	#address-cells = <1>;
-	#size-cells = <1>;
-	ranges = <0x48300100 0x48300100 0x80   /* ECAP */
-		  0x48300180 0x48300180 0x80   /* EQEP */
-		  0x48300200 0x48300200 0x80>; /* EHRPWM */
-
-	/* child nodes go here */
-};
-
-epwmss0: epwmss@4843e000 { /* PWMSS for DRA7xx */
-	compatible = "ti,dra746-pwmss", "ti,am33xx-pwmss";
-	reg = <0x4843e000 0x30>;
-	ti,hwmods = "epwmss0";
-	#address-cells = <1>;
-	#size-cells = <1>;
-	ranges;
-
-	/* child nodes go here */
-};
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml new file +76 -0

76 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The newly added YAML binding example contains child nodes (ECAP, EQEP, and EHRPWM) that omit…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly added YAML binding example contains child nodes (ECAP, EQEP, and EHRPWM) that omit mandatory properties required by their respective device tree schemas, which will cause make dt_binding_check to fail. --

--- Patch [1]: [PATCH v2] dt-bindings: pwm: Convert TI PWM Subsystem to DT schema --- commit 6e7740860be9339a28d4f050268b9aad56636a0b
Author: Eduard Bostina <[email protected]>

dt-bindings: pwm: Convert TI PWM Subsystem to DT schema

Convert the Texas Instruments SoC PWM Subsystem bindings to DT schema. During the conversion, a 'counter' node was added to the allowed child nodes list to resolve dtbs_check warnings.

Quoted 5 lines
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml new file +0 -0
new file mode 100644
index 0000000000000..e2b6ae326cb58

[ ... ]

Quoted 17 lines
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml new file +17 -0
+examples:
+  - |
+    pwm@48300000 {
+        compatible = "ti,am33xx-pwmss";
+        reg = <0x48300000 0x10>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x48300100 0x48300100 0x80>,   /* ECAP */
+                 <0x48300180 0x48300180 0x80>,   /* EQEP */
+                 <0x48300200 0x48300200 0x80>;   /* EHRPWM */
+
+        pwm@48300100 {
+            compatible = "ti,am3352-ecap";
+            #pwm-cells = <3>;
+            reg = <0x48300100 0x80>;
+        };
+

Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml line 75

Quoted 10 lines
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml new file +10 -0
+        counter@48300180 {
+            compatible = "ti,am3352-eqep";
+            reg = <0x48300180 0x80>;
+        };
+
+        pwm@48300200 {
+            compatible = "ti,am3352-ehrpwm";
+            #pwm-cells = <3>;
+            reg = <0x48300200 0x80>;
+        };

[Severity: Low]
Will this example fail dt_binding_check validation?

These child nodes omit properties that are mandatory in their respective device tree schemas. For instance, the ECAP and EHRPWM nodes are missing clocks and clock-names, and the EQEP node is missing clocks and interrupts.

Since dt_binding_check cross-validates examples against all existing schemas, omitting these required properties will likely trigger validation errors.

Quoted 1 line

+ };

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Eduard Bostina
Quoted 16 lines · Eduard Bostina

Convert the Texas Instruments SoC PWM Subsystem bindings to DT schema.

During the conversion, the following updates were made:
- 'counter' node was added to the allowed child nodes list to resolve dtbs_check warnings. Some eqep nodes use 'counter' instead of 'eqep'.

---
Changes in v2:
- Renamed the file to ti,am33xx-pwmss.yaml to match the base compatible.
- Required a 'compatible' property in the child nodes.
- Reduced the binding to a single example and included the PWM child nodes (ECAP, EQEP, EHRPWM) in it.

Quoted 8 lines

Link to v1: https://lore.kernel.org/all/[email protected]/

 .../devicetree/bindings/pwm/pwm-tipwmss.txt   | 58 --------------
 .../bindings/pwm/ti,am33xx-pwmss.yaml         | 76 +++++++++++++++++++
 2 files changed, 76 insertions(+), 58 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-tipwmss.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.example.dtb: pwm@48300100 (ti,am3352-ecap): 'clocks' is a required property
from schema $id: http://devicetree.org/schemas/pwm/pwm-tiecap.yaml
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.example.dtb: pwm@48300100 (ti,am3352-ecap): 'clock-names' is a required property
from schema $id: http://devicetree.org/schemas/pwm/pwm-tiecap.yaml
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.example.dtb: counter@48300180 (ti,am3352-eqep): 'oneOf' conditional failed, one must be fixed:
'interrupts' is a required property
'interrupts-extended' is a required property
from schema $id: http://devicetree.org/schemas/counter/ti-eqep.yaml
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.example.dtb: counter@48300180 (ti,am3352-eqep): 'clocks' is a required property
from schema $id: http://devicetree.org/schemas/counter/ti-eqep.yaml
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.example.dtb: pwm@48300200 (ti,am3352-ehrpwm): 'clocks' is a required property
from schema $id: http://devicetree.org/schemas/pwm/pwm-tiehrpwm.yaml
Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.example.dtb: pwm@48300200 (ti,am3352-ehrpwm): 'clock-names' is a required property
from schema $id: http://devicetree.org/schemas/pwm/pwm-tiehrpwm.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.

maintainer Reviewed-by on v2 1/1
#3 lore raw
In reply to Eduard Bostina
Quoted 16 lines · Eduard Bostina

Convert the Texas Instruments SoC PWM Subsystem bindings to DT schema.

During the conversion, the following updates were made:
- 'counter' node was added to the allowed child nodes list to resolve dtbs_check warnings. Some eqep nodes use 'counter' instead of 'eqep'.

---
Changes in v2:
- Renamed the file to ti,am33xx-pwmss.yaml to match the base compatible.
- Required a 'compatible' property in the child nodes.
- Reduced the binding to a single example and included the PWM child nodes (ECAP, EQEP, EHRPWM) in it.

Quoted 8 lines

Link to v1: https://lore.kernel.org/all/[email protected]/

 .../devicetree/bindings/pwm/pwm-tipwmss.txt   | 58 --------------
 .../bindings/pwm/ti,am33xx-pwmss.yaml         | 76 +++++++++++++++++++
 2 files changed, 76 insertions(+), 58 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-tipwmss.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml
maintainer
#4 lore raw
Quoted 20 lines · Rob Herring (Arm)
Quoted 18 lines · Eduard Bostina

Convert the Texas Instruments SoC PWM Subsystem bindings to DT schema.

During the conversion, the following updates were made:
- 'counter' node was added to the allowed child nodes list to resolve dtbs_check warnings. Some eqep nodes use 'counter' instead of 'eqep'.

---
Changes in v2:
- Renamed the file to ti,am33xx-pwmss.yaml to match the base compatible.
- Required a 'compatible' property in the child nodes.
- Reduced the binding to a single example and included the PWM child nodes (ECAP, EQEP, EHRPWM) in it.

Link to v1: https://lore.kernel.org/all/[email protected]/

Quoted 8 lines
Quoted 6 lines
 .../devicetree/bindings/pwm/pwm-tipwmss.txt   | 58 --------------
 .../bindings/pwm/ti,am33xx-pwmss.yaml         | 76 +++++++++++++++++++
 2 files changed, 76 insertions(+), 58 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-tipwmss.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/ti,am33xx-pwmss.yaml

Withdrawn. Your example is incomplete.

Do not use DT_SCHEMA_FILES to test. You can do
'make pwm/ti,am33xx-pwmss.yaml' which is a bit more complete of a test.

Rob