Skip to contentSkip to conversation

dt-bindings for Cadence UFS host controller

PATCH New Dhananjay Kangude 2 participants 8 messages Aug 26, 2021 – Oct 11, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings for Cadence UFS host controller

This patch series converted the previous dt-binging text to yaml for Cadence UFS host

Dhananjay Kangude (1):
dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host
controller

 .../devicetree/bindings/ufs/cdns,ufshc.txt         |   32 --------
 .../devicetree/bindings/ufs/cdns,ufshc.yaml        |   80 ++++++++++++++++++++
 2 files changed, 80 insertions(+), 32 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml
#1 lore raw

PATCH 1/1 dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host controller

Converted bindings into yaml format for Cadence UFS host controller

---
 .../devicetree/bindings/ufs/cdns,ufshc.txt         |   32 --------
 .../devicetree/bindings/ufs/cdns,ufshc.yaml        |   80 ++++++++++++++++++++
 2 files changed, 80 insertions(+), 32 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -32
deleted file mode 100644
index 02347b0..0000000
@@ -1,32 +0,0 @@
-* Cadence Universal Flash Storage (UFS) Controller
-
-UFS nodes are defined to describe on-chip UFS host controllers.
-Each UFS controller instance should have its own node.
-Please see the ufshcd-pltfrm.txt for a list of all available properties.
-
-Required properties:
-- compatible	: Compatible list, contains one of the following controllers:
-			"cdns,ufshc" - Generic CDNS HCI,
-			"cdns,ufshc-m31-16nm" - CDNS UFS HC + M31 16nm PHY
-		  complemented with the JEDEC version:
-			"jedec,ufs-2.0"
-
-- reg		: Address and length of the UFS register set.
-- interrupts	: One interrupt mapping.
-- freq-table-hz	: Clock frequency table.
-		  See the ufshcd-pltfrm.txt for details.
-- clocks	: List of phandle and clock specifier pairs.
-- clock-names	: List of clock input name strings sorted in the same
-		  order as the clocks property. "core_clk" is mandatory.
-		  Depending on a type of a PHY,
-		  the "phy_clk" clock can also be added, if needed.
-
-Example:
-	ufs@fd030000 {
-		compatible = "cdns,ufshc", "jedec,ufs-2.0";
-		reg = <0xfd030000 0x10000>;
-		interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
-		freq-table-hz = <0 0>, <0 0>;
-		clocks = <&ufs_core_clk>, <&ufs_phy_clk>;
-		clock-names = "core_clk", "phy_clk";
-	};
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +80 -0

80 lines not on this page · raw message

Signature · 1 line
1.7.1
maintainer
#2 lore raw

Re: [PATCH v1] dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host controller

Quoted 10 lines · Dhananjay Kangude

Converted bindings into yaml format for Cadence UFS host controller

---
 .../devicetree/bindings/ufs/cdns,ufshc.txt         |   32 --------
 .../devicetree/bindings/ufs/cdns,ufshc.yaml        |   80 ++++++++++++++++++++
 2 files changed, 80 insertions(+), 32 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/ufs/ti,j721e-ufs.example.dt.yaml: ufs@4000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml

doc reference errors (make refcheckdocs):
Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml: Documentation/devicetree/bindings/ufs/cdns,ufshc.txt

See https://patchwork.ozlabs.org/patch/1521296

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

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.

#3 lore raw

PATCH v2 1/1 dt-bindings for Cadence UFS host controller

In reply to Dhananjay Kangude

This patch series converted the previous dt-binging text to yaml for Cadence UFS host.

Changes since v1:
1. Corrected reference to cdns,ufshc.yaml in ti,j721e-ufs.yaml
2. Removed power-doamin property from ufs node

Dhananjay Kangude (1):
dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host
controller

 .../devicetree/bindings/ufs/cdns,ufshc.txt         |   32 --------
 .../devicetree/bindings/ufs/cdns,ufshc.yaml        |   80 ++++++++++++++++++++
 .../devicetree/bindings/ufs/ti,j721e-ufs.yaml      |    3 +-
 3 files changed, 81 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml
#4 lore raw

PATCH v2 1/1 dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host controller

1.Converted bindings into yaml format for Cadence UFS host controller 2.Modified reference to cdns,ufshc.txt tp cdns,ufshc.yaml 3.Removed power,domain property from ti,j721e-ufs.yaml as it is not required

---
 .../devicetree/bindings/ufs/cdns,ufshc.txt         |   32 --------
 .../devicetree/bindings/ufs/cdns,ufshc.yaml        |   80 ++++++++++++++++++++
 .../devicetree/bindings/ufs/ti,j721e-ufs.yaml      |    3 +-
 3 files changed, 81 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -32
deleted file mode 100644
index 02347b0..0000000
@@ -1,32 +0,0 @@
-* Cadence Universal Flash Storage (UFS) Controller
-
-UFS nodes are defined to describe on-chip UFS host controllers.
-Each UFS controller instance should have its own node.
-Please see the ufshcd-pltfrm.txt for a list of all available properties.
-
-Required properties:
-- compatible	: Compatible list, contains one of the following controllers:
-			"cdns,ufshc" - Generic CDNS HCI,
-			"cdns,ufshc-m31-16nm" - CDNS UFS HC + M31 16nm PHY
-		  complemented with the JEDEC version:
-			"jedec,ufs-2.0"
-
-- reg		: Address and length of the UFS register set.
-- interrupts	: One interrupt mapping.
-- freq-table-hz	: Clock frequency table.
-		  See the ufshcd-pltfrm.txt for details.
-- clocks	: List of phandle and clock specifier pairs.
-- clock-names	: List of clock input name strings sorted in the same
-		  order as the clocks property. "core_clk" is mandatory.
-		  Depending on a type of a PHY,
-		  the "phy_clk" clock can also be added, if needed.
-
-Example:
-	ufs@fd030000 {
-		compatible = "cdns,ufshc", "jedec,ufs-2.0";
-		reg = <0xfd030000 0x10000>;
-		interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
-		freq-table-hz = <0 0>, <0 0>;
-		clocks = <&ufs_core_clk>, <&ufs_phy_clk>;
-		clock-names = "core_clk", "phy_clk";
-	};
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +80 -0

80 lines not on this page · raw message

Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml +1 -2
index 4d13e6b..b8f73dd 100644
@@ -50,7 +50,7 @@ patternProperties:
     type: object
     description: |
       Cadence UFS controller node must be the child node. Refer
-      Documentation/devicetree/bindings/ufs/cdns,ufshc.txt for binding
+      Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml for binding
       documentation of child node
 
 additionalProperties: false
@@ -81,7 +81,6 @@ examples:
                 reg = <0x0 0x4000 0x0 0x10000>;
                 interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                 freq-table-hz = <19200000 19200000>;
-                power-domains = <&k3_pds 277>;
                 clocks = <&k3_clks 277 1>;
                 assigned-clocks = <&k3_clks 277 1>;
                 assigned-clock-parents = <&k3_clks 277 4>;
Signature · 1 line
1.7.1
maintainer
#5 lore raw

Re: [PATCH v2] dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host controller

Quoted 3 lines · Dhananjay Kangude

1.Converted bindings into yaml format for Cadence UFS host controller 2.Modified reference to cdns,ufshc.txt tp cdns,ufshc.yaml 3.Removed power,domain property from ti,j721e-ufs.yaml as it is not required

Maybe not required, but should be allowed which is still not the case.

Quoted 73 lines
---
 .../devicetree/bindings/ufs/cdns,ufshc.txt         |   32 --------
 .../devicetree/bindings/ufs/cdns,ufshc.yaml        |   80 ++++++++++++++++++++
 .../devicetree/bindings/ufs/ti,j721e-ufs.yaml      |    3 +-
 3 files changed, 81 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -32
deleted file mode 100644
index 02347b0..0000000
@@ -1,32 +0,0 @@
-* Cadence Universal Flash Storage (UFS) Controller
-
-UFS nodes are defined to describe on-chip UFS host controllers.
-Each UFS controller instance should have its own node.
-Please see the ufshcd-pltfrm.txt for a list of all available properties.
-
-Required properties:
-- compatible	: Compatible list, contains one of the following controllers:
-			"cdns,ufshc" - Generic CDNS HCI,
-			"cdns,ufshc-m31-16nm" - CDNS UFS HC + M31 16nm PHY
-		  complemented with the JEDEC version:
-			"jedec,ufs-2.0"
-
-- reg		: Address and length of the UFS register set.
-- interrupts	: One interrupt mapping.
-- freq-table-hz	: Clock frequency table.
-		  See the ufshcd-pltfrm.txt for details.
-- clocks	: List of phandle and clock specifier pairs.
-- clock-names	: List of clock input name strings sorted in the same
-		  order as the clocks property. "core_clk" is mandatory.
-		  Depending on a type of a PHY,
-		  the "phy_clk" clock can also be added, if needed.
-
-Example:
-	ufs@fd030000 {
-		compatible = "cdns,ufshc", "jedec,ufs-2.0";
-		reg = <0xfd030000 0x10000>;
-		interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
-		freq-table-hz = <0 0>, <0 0>;
-		clocks = <&ufs_core_clk>, <&ufs_phy_clk>;
-		clock-names = "core_clk", "phy_clk";
-	};
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +19 -0
new file mode 100644
index 0000000..4509ae0
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/ufs/cdns,ufshc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cadence Universal Flash Storage (UFS) Controller
+
+maintainers:
+  - Dhananjay Kangude <[email protected]>
+
+description:
+  UFS nodes are defined to describe on-chip Cadence UFS host controllers.
+  Each UFS controller instance should have its own node.
+
+properties:
+  compatible:
+    oneOf:
+      - items:

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+          - enum:
+              - cdns,ufshc
+              - cdns,ufshc-m31-16nm
+          - const: jedec,ufs-2.0
+      - items:
+          - const: jedec,ufs-2.0
+
+  reg:
+    items:
+      - description: UFS controller register set

Not a useful description. Just 'maxItems: 1'.

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 39

Quoted 10 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    items:
+      - description: Description of core_clk
+      - description: Description of phy_clk
+      - description: Description of ref_clk

'Description of core_clk'?

ref_clk was not documented. Okay to add, but mention why in the commit msg.

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 49

Quoted 10 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+
+  clock-names:
+    minItems: 1
+    items:
+      - const: core_clk
+      - const: phy_clk
+      - const: ref_clk
+
+  freq-table-hz:
+    $ref: /schemas/types.yaml#/definitions/uint64-matrix

Not the right type.

Quoted 6 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +6 -0
+    description:
+      Clock frequency table.
+      See the ufshcd-pltfrm.txt for details.
+
+  dma-coherent: true
+

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 65

Quoted 10 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+required:
+  - compatible
+  - reg
+  - interrupts
+  - freq-table-hz
+  - clocks
+  - clock-names
+
+additionalProperties: false
+unevaluatedProperties: false

Don't need both. Just additionalProperties.

Quoted 40 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +15 -0
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    ufs: ufs@fd030000 {
+         compatible = "cdns,ufshc", "jedec,ufs-2.0";
+         reg = <0xfd030000 0x10000>;
+         interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
+         freq-table-hz = <0 0>;
+         clocks = <&ufs_core_clk>;
+         clock-names = "core_clk";
+    };
+
Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml +1 -2
index 4d13e6b..b8f73dd 100644
@@ -50,7 +50,7 @@ patternProperties:
     type: object
     description: |
       Cadence UFS controller node must be the child node. Refer
-      Documentation/devicetree/bindings/ufs/cdns,ufshc.txt for binding
+      Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml for binding
       documentation of child node
 
 additionalProperties: false
@@ -81,7 +81,6 @@ examples:
                 reg = <0x0 0x4000 0x0 0x10000>;
                 interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                 freq-table-hz = <19200000 19200000>;
-                power-domains = <&k3_pds 277>;
                 clocks = <&k3_clks 277 1>;
                 assigned-clocks = <&k3_clks 277 1>;
                 assigned-clock-parents = <&k3_clks 277 4>;
Signature · 1 line
1.7.1
#6 lore raw

RE: [PATCH v2] dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host controller

Quoted 7 lines · Dhananjay Kangude
Quoted 3 lines

1.Converted bindings into yaml format for Cadence UFS host controller 2.Modified reference to cdns,ufshc.txt tp cdns,ufshc.yaml 3.Removed power,domain property from ti,j721e-ufs.yaml as it is not required

Maybe not required, but should be allowed which is still not the case.

I got it. I will add the power,domain property as an optional in ufs and retain ti,j721-ufs.yaml in original form.

Quoted 91 lines
Quoted 5 lines
---
 .../devicetree/bindings/ufs/cdns,ufshc.txt         |   32 --------
 .../devicetree/bindings/ufs/cdns,ufshc.yaml        |   80

++++++++++++++++++++

Quoted 13 lines
 .../devicetree/bindings/ufs/ti,j721e-ufs.yaml      |    3 +-
 3 files changed, 81 insertions(+), 34 deletions(-)  delete mode
100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml

Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -0
deleted file mode 100644
index 02347b0..0000000

Documentation/devicetree/bindings/ufs/cdns,ufshc.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -10
@@ -1,32 +0,0 @@
-* Cadence Universal Flash Storage (UFS) Controller
-
-UFS nodes are defined to describe on-chip UFS host controllers.
-Each UFS controller instance should have its own node.
-Please see the ufshcd-pltfrm.txt for a list of all available properties.
-
-Required properties:
-- compatible	: Compatible list, contains one of the following controllers:
-			"cdns,ufshc" - Generic CDNS HCI,
-			"cdns,ufshc-m31-16nm" - CDNS UFS HC + M31 16nm

PHY

Quoted 30 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -22
-		  complemented with the JEDEC version:
-			"jedec,ufs-2.0"
-
-- reg		: Address and length of the UFS register set.
-- interrupts	: One interrupt mapping.
-- freq-table-hz	: Clock frequency table.
-		  See the ufshcd-pltfrm.txt for details.
-- clocks	: List of phandle and clock specifier pairs.
-- clock-names	: List of clock input name strings sorted in the same
-		  order as the clocks property. "core_clk" is mandatory.
-		  Depending on a type of a PHY,
-		  the "phy_clk" clock can also be added, if needed.
-
-Example:
-	ufs@fd030000 {
-		compatible = "cdns,ufshc", "jedec,ufs-2.0";
-		reg = <0xfd030000 0x10000>;
-		interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
-		freq-table-hz = <0 0>, <0 0>;
-		clocks = <&ufs_core_clk>, <&ufs_phy_clk>;
-		clock-names = "core_clk", "phy_clk";
-	};
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +0 -0
new file mode 100644
index 0000000..4509ae0

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 4

Quoted 4 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +4 -0
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2
+---
+$id:
+https://urldefense.com/v3/__http://devicetree.org/schemas/ufs/cdns,uf

+shc.yaml*__;Iw!!EHscmS1ygiU1lA!VP17yEajmecovQs1IfNiRJklavtRgx16eZXg0 b

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 7

Quoted 4 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +3 -0
+G5re3EAQrSfmirkkVpagqs5mE$
+$schema:
+https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.y

+aml*__;Iw!!EHscmS1ygiU1lA!VP17yEajmecovQs1IfNiRJklavtRgx16eZXg0bG5r e3

Quoted 19 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +19 -0
+EAQrSfmirkkVpEHrPgh4$
+
+title: Cadence Universal Flash Storage (UFS) Controller
+
+maintainers:
+  - Dhananjay Kangude <[email protected]>
+
+description:
+  UFS nodes are defined to describe on-chip Cadence UFS host controllers.
+  Each UFS controller instance should have its own node.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - cdns,ufshc
+              - cdns,ufshc-m31-16nm
+          - const: jedec,ufs-2.0
Quoted 8 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 29

Quoted 6 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +6 -0
+      - items:
+          - const: jedec,ufs-2.0
+
+  reg:
+    items:
+      - description: UFS controller register set

Not a useful description. Just 'maxItems: 1'.

I agree. I will change the property details.

Quoted 13 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 39

Quoted 11 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    items:
+      - description: Description of core_clk
+      - description: Description of phy_clk
+      - description: Description of ref_clk

'Description of core_clk'?

OK. I will change it.

Quoted 2 lines

ref_clk was not documented. Okay to add, but mention why in the commit msg.

The ref_clk is used by ufs spec to decide ufs device reference clock and it is part of ufs framework. Usually SoC vendors fix this value by using this property used by core framework.
The details are already mentioned in Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt

Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +4 -0
+
+  clock-names:
+    minItems: 1
+    items:
Quoted 8 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 49

Quoted 6 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +6 -0
+      - const: core_clk
+      - const: phy_clk
+      - const: ref_clk
+
+  freq-table-hz:
+    $ref: /schemas/types.yaml#/definitions/uint64-matrix

Not the right type.

I have tried with different ref as single array but it seems not compatible. The freq-table-hz property need the values in 2D array format.
for example:
freq-table-hz = <250000000 250000000>, <19200000 19200000>, <19200000 19200000>;

Could you suggest what type suits the requirement. Thanks.

Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+    description:
+      Clock frequency table.
+      See the ufshcd-pltfrm.txt for details.
+
+  dma-coherent: true
+
+required:
+  - compatible
+  - reg
+  - interrupts
Quoted 8 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 65

Quoted 6 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +6 -0
+  - freq-table-hz
+  - clocks
+  - clock-names
+
+additionalProperties: false
+unevaluatedProperties: false

Don't need both. Just additionalProperties.

I got it. I will change in next version.

Quoted 43 lines
Quoted 43 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +15 -0
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    ufs: ufs@fd030000 {
+         compatible = "cdns,ufshc", "jedec,ufs-2.0";
+         reg = <0xfd030000 0x10000>;
+         interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
+         freq-table-hz = <0 0>;
+         clocks = <&ufs_core_clk>;
+         clock-names = "core_clk";
+    };
+
Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml +2 -3
index 4d13e6b..b8f73dd 100644
@@ -50,7 +50,7 @@ patternProperties:
     type: object
     description: |
       Cadence UFS controller node must be the child node. Refer
-      Documentation/devicetree/bindings/ufs/cdns,ufshc.txt for binding
+      Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml for
+ binding
       documentation of child node
 
 additionalProperties: false
@@ -81,7 +81,6 @@ examples:
                 reg = <0x0 0x4000 0x0 0x10000>;
                 interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                 freq-table-hz = <19200000 19200000>;
-                power-domains = <&k3_pds 277>;
                 clocks = <&k3_clks 277 1>;
                 assigned-clocks = <&k3_clks 277 1>;
                 assigned-clock-parents = <&k3_clks 277 4>;
--

1.7.1

#7 lore raw

RE: [PATCH v2] dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host controller

Hi Rob,
This is with respect to your comment on the right type for property freq-table-hz.
I have tried different combinations but it seems not compatible with property. The param freq-table-hz have multiple pair of frequencies in <Min Max> format which needed to decide operating frequencies in the same order of clocks property.

I would appreciate if you provide some suggestion for correct type.

Thanks
Dhananjay

Quoted 233 lines

-----Original Message-----
From: Dhananjay Vilasrao Kangude
Sent: Thursday, September 9, 2021 5:38 PM
To: Rob Herring <[email protected]>
Cc: [email protected]; [email protected]; Milind Parab <[email protected]>; [email protected]; [email protected]
Subject: RE: [PATCH v2] dt-bindings: ufshc: cdns: convert bindings for Cadence UFS host controller

Quoted 7 lines · Dhananjay Kangude
Quoted 4 lines

1.Converted bindings into yaml format for Cadence UFS host controller 2.Modified reference to cdns,ufshc.txt tp cdns,ufshc.yaml 3.Removed power,domain property from ti,j721e-ufs.yaml as it is not required

Maybe not required, but should be allowed which is still not the case.

I got it. I will add the power,domain property as an optional in ufs and retain ti,j721-ufs.yaml in original form.

Quoted 12 lines
Quoted 5 lines
---
 .../devicetree/bindings/ufs/cdns,ufshc.txt         |   32 --------
 .../devicetree/bindings/ufs/cdns,ufshc.yaml        |   80

++++++++++++++++++++

Quoted 6 lines
 .../devicetree/bindings/ufs/ti,j721e-ufs.yaml      |    3 +-
 3 files changed, 81 insertions(+), 34 deletions(-)  delete mode
100644 Documentation/devicetree/bindings/ufs/cdns,ufshc.txt
 create mode 100644

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml

Quoted 15 lines
Quoted 7 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -0
deleted file mode 100644
index 02347b0..0000000

Documentation/devicetree/bindings/ufs/cdns,ufshc.txt line 8

Quoted 8 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -8
@@ -1,32 +0,0 @@
-* Cadence Universal Flash Storage (UFS) Controller
-
-UFS nodes are defined to describe on-chip UFS host controllers.
-Each UFS controller instance should have its own node.
-Please see the ufshcd-pltfrm.txt for a list of all available properties.
-
-Required properties:
-- compatible	: Compatible list, contains one of the following

controllers:

Quoted 30 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.txt line 10

Quoted 2 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -2
-			"cdns,ufshc" - Generic CDNS HCI,
-			"cdns,ufshc-m31-16nm" - CDNS UFS HC + M31 16nm

PHY

Quoted 27 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.txt deleted +0 -22
-		  complemented with the JEDEC version:
-			"jedec,ufs-2.0"
-
-- reg		: Address and length of the UFS register set.
-- interrupts	: One interrupt mapping.
-- freq-table-hz	: Clock frequency table.
-		  See the ufshcd-pltfrm.txt for details.
-- clocks	: List of phandle and clock specifier pairs.
-- clock-names	: List of clock input name strings sorted in the same
-		  order as the clocks property. "core_clk" is mandatory.
-		  Depending on a type of a PHY,
-		  the "phy_clk" clock can also be added, if needed.
-
-Example:
-	ufs@fd030000 {
-		compatible = "cdns,ufshc", "jedec,ufs-2.0";
-		reg = <0xfd030000 0x10000>;
-		interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
-		freq-table-hz = <0 0>, <0 0>;
-		clocks = <&ufs_core_clk>, <&ufs_phy_clk>;
-		clock-names = "core_clk", "phy_clk";
-	};
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +0 -1
new file mode 100644
index 0000000..4509ae0
--- /dev/null
Quoted 9 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 5

Quoted 8 lines

+++ b/Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +5 -0
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2
+---
+$id:
+https://urldefense.com/v3/__http://devicetree.org/schemas/ufs/cdns,
+uf

+shc.yaml*__;Iw!!EHscmS1ygiU1lA!VP17yEajmecovQs1IfNiRJklavtRgx16eZXg0

Quoted 7 lines

b

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 9

Quoted 5 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +4 -0
+G5re3EAQrSfmirkkVpagqs5mE$
+$schema:
+https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core
+.y

+aml*__;Iw!!EHscmS1ygiU1lA!VP17yEajmecovQs1IfNiRJklavtRgx16eZXg0bG5r

Quoted 10 lines

e3

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml

Quoted 9 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +9 -0
+EAQrSfmirkkVpEHrPgh4$
+
+title: Cadence Universal Flash Storage (UFS) Controller
+
+maintainers:
+  - Dhananjay Kangude <[email protected]>
+
+description:
+  UFS nodes are defined to describe on-chip Cadence UFS host

controllers.

Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+  Each UFS controller instance should have its own node.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - cdns,ufshc
+              - cdns,ufshc-m31-16nm
+          - const: jedec,ufs-2.0
Quoted 8 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 29

Quoted 6 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +6 -0
+      - items:
+          - const: jedec,ufs-2.0
+
+  reg:
+    items:
+      - description: UFS controller register set

Not a useful description. Just 'maxItems: 1'.

I agree. I will change the property details.

Quoted 13 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 39

Quoted 11 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    items:
+      - description: Description of core_clk
+      - description: Description of phy_clk
+      - description: Description of ref_clk

'Description of core_clk'?

OK. I will change it.

Quoted 2 lines

ref_clk was not documented. Okay to add, but mention why in the commit msg.

The ref_clk is used by ufs spec to decide ufs device reference clock and it is part of ufs framework.
Usually SoC vendors fix this value by using this property used by core framework.
The details are already mentioned in Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt

Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +4 -0
+
+  clock-names:
+    minItems: 1
+    items:
Quoted 8 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 49

Quoted 6 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +6 -0
+      - const: core_clk
+      - const: phy_clk
+      - const: ref_clk
+
+  freq-table-hz:
+    $ref: /schemas/types.yaml#/definitions/uint64-matrix

Not the right type.

I have tried with different ref as single array but it seems not compatible. The freq-table-hz property need the values in 2D array format. for example:
freq-table-hz = <250000000 250000000>, <19200000 19200000>, <19200000 19200000>;

Could you suggest what type suits the requirement. Thanks.

Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +10 -0
+    description:
+      Clock frequency table.
+      See the ufshcd-pltfrm.txt for details.
+
+  dma-coherent: true
+
+required:
+  - compatible
+  - reg
+  - interrupts
Quoted 8 lines

Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml line 65

Quoted 6 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +6 -0
+  - freq-table-hz
+  - clocks
+  - clock-names
+
+additionalProperties: false
+unevaluatedProperties: false

Don't need both. Just additionalProperties.

I got it. I will change in next version.

Quoted 43 lines
Quoted 43 lines
Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml new file +15 -0
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    ufs: ufs@fd030000 {
+         compatible = "cdns,ufshc", "jedec,ufs-2.0";
+         reg = <0xfd030000 0x10000>;
+         interrupts = <0 1 IRQ_TYPE_LEVEL_HIGH>;
+         freq-table-hz = <0 0>;
+         clocks = <&ufs_core_clk>;
+         clock-names = "core_clk";
+    };
+
Documentation/devicetree/bindings/ufs/ti,j721e-ufs.yaml +2 -3
index 4d13e6b..b8f73dd 100644
@@ -50,7 +50,7 @@ patternProperties:
     type: object
     description: |
       Cadence UFS controller node must be the child node. Refer
-      Documentation/devicetree/bindings/ufs/cdns,ufshc.txt for binding
+      Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml for
+ binding
       documentation of child node
 
 additionalProperties: false
@@ -81,7 +81,6 @@ examples:
                 reg = <0x0 0x4000 0x0 0x10000>;
                 interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                 freq-table-hz = <19200000 19200000>;
-                power-domains = <&k3_pds 277>;
                 clocks = <&k3_clks 277 1>;
                 assigned-clocks = <&k3_clks 277 1>;
                 assigned-clock-parents = <&k3_clks 277 4>;
--

1.7.1