Skip to contentSkip to conversation

dt-bindings: ufs: amd,versal2-ufs: Add ref_clk clock property

PATCH In review Ajay Neeli 3 participants 5 messages Nov 11 – Nov 18

Subsystems (4)
lore
Share & tools
lore

Ajay Neeli

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: ufs: amd,versal2-ufs: Add ref_clk clock property

Add ref_clk clock property to specify the reference clock frequency supplied to the UFS device.

The AMD Versal2 UFS controller operates with a 26 MHz reference clock. UFS 3.x devices default their bRefClkFreq attribute to 26 MHz, matching the controller, so no explicit configuration is needed. However, UFS 4.0 and later devices default bRefClkFreq to 52 MHz, expecting a 52 MHz reference clock. This mismatch causes timing violations and link instability.

Adding the ref_clk property allows the UFS driver to read the actual reference clock frequency from the devicetree and program the device bRefClkFreq attribute accordingly during initialization.

---
 .../devicetree/bindings/ufs/amd,versal2-ufs.yaml         | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +5 -4
index c00ec342d574..e294c0f1b0ce 100644
@@ -20,11 +20,12 @@ properties:
     maxItems: 1
 
   clocks:
-    maxItems: 1
+    maxItems: 2
 
   clock-names:
     items:
       - const: core
+      - const: ref_clk
 
   power-domains:
     maxItems: 1
@@ -52,10 +53,10 @@ examples:
     ufs@f10b0000 {
         compatible = "amd,versal2-ufs";
         reg = <0xf10b0000 0x1000>;
-        clocks = <&ufs_core_clk>;
-        clock-names = "core";
+        clocks = <&ufs_core_clk>, <&ufs_ref_clk>;
+        clock-names = "core", "ref_clk";
         resets = <&scmi_reset 4>, <&scmi_reset 35>;
         reset-names = "host", "phy";
         interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>;
-        freq-table-hz = <0 0>;
+        freq-table-hz = <0 0>, <26000000 26000000>;
     };
Signature · 1 line
2.43.7
#1 lore raw
Quoted 24 lines · Ajay Neeli

Add ref_clk clock property to specify the reference clock frequency supplied to the UFS device.

The AMD Versal2 UFS controller operates with a 26 MHz reference clock. UFS 3.x devices default their bRefClkFreq attribute to 26 MHz, matching the controller, so no explicit configuration is needed. However, UFS 4.0 and later devices default bRefClkFreq to 52 MHz, expecting a 52 MHz reference clock. This mismatch causes timing violations and link instability.

Adding the ref_clk property allows the UFS driver to read the actual reference clock frequency from the devicetree and program the device bRefClkFreq attribute accordingly during initialization.

---
 .../devicetree/bindings/ufs/amd,versal2-ufs.yaml         | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +0 -0
index c00ec342d574..e294c0f1b0ce 100644

Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml properties: · line 23

Quoted 5 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +1 -1
@@ -20,11 +20,12 @@ properties:
     maxItems: 1
 
   clocks:
-    maxItems: 1
+    maxItems: 2

Please add an items list here.

Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml properties: · line 28

Quoted 5 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +1 -0
   clock-names:
     items:
       - const: core
+      - const: ref_clk

its a clock by nature, don't restate that in the name.
pw-bot: changes-requested

Thanks,
Conor.

Quoted 21 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +3 -3
   power-domains:
     maxItems: 1
@@ -52,10 +53,10 @@ examples:
     ufs@f10b0000 {
         compatible = "amd,versal2-ufs";
         reg = <0xf10b0000 0x1000>;
-        clocks = <&ufs_core_clk>;
-        clock-names = "core";
+        clocks = <&ufs_core_clk>, <&ufs_ref_clk>;
+        clock-names = "core", "ref_clk";
         resets = <&scmi_reset 4>, <&scmi_reset 35>;
         reset-names = "host", "phy";
         interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>;
-        freq-table-hz = <0 0>;
+        freq-table-hz = <0 0>, <26000000 26000000>;
     };
Signature · 1 line
2.43.7
#2 lore raw
Quoted 27 lines · Conor Dooley
Quoted 26 lines · Ajay Neeli

Add ref_clk clock property to specify the reference clock frequency supplied to the UFS device.

The AMD Versal2 UFS controller operates with a 26 MHz reference clock. UFS 3.x devices default their bRefClkFreq attribute to 26 MHz, matching the controller, so no explicit configuration is needed. However, UFS 4.0 and later devices default bRefClkFreq to 52 MHz, expecting a 52 MHz reference clock. This mismatch causes timing violations and link instability.

Adding the ref_clk property allows the UFS driver to read the actual reference clock frequency from the devicetree and program the device bRefClkFreq attribute accordingly during initialization.

---
  .../devicetree/bindings/ufs/amd,versal2-ufs.yaml         | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +0 -0
index c00ec342d574..e294c0f1b0ce 100644
@@ -20,11 +20,12 @@ properties:
      maxItems: 1
 
Quoted 6 lines

Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml properties: · line 23

Quoted 3 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +1 -1
    clocks:
-    maxItems: 1
+    maxItems: 2

Please add an items list here.

Sure, will add it in v2.

Quoted 8 lines

Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml properties: · line 28

Quoted 5 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +1 -0
    clock-names:
      items:
        - const: core
+      - const: ref_clk

its a clock by nature, don't restate that in the name.
pw-bot: changes-requested

The generic UFS platform code currently identifies the reference clock by the "ref_clk" clock name in ufshcd_parse_clock_info().

Would you prefer that the common UFS code be changed to use "ref" as well, or should this binding retain "ref_clk" for consistency with the existing UFS core convention?

Quoted 25 lines

Thanks,
Conor.

Quoted 21 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +3 -3
    power-domains:
      maxItems: 1
@@ -52,10 +53,10 @@ examples:
      ufs@f10b0000 {
          compatible = "amd,versal2-ufs";
          reg = <0xf10b0000 0x1000>;
-        clocks = <&ufs_core_clk>;
-        clock-names = "core";
+        clocks = <&ufs_core_clk>, <&ufs_ref_clk>;
+        clock-names = "core", "ref_clk";
          resets = <&scmi_reset 4>, <&scmi_reset 35>;
          reset-names = "host", "phy";
          interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>;
-        freq-table-hz = <0 0>;
+        freq-table-hz = <0 0>, <26000000 26000000>;
      };
Signature · 1 line
2.43.7
#3 lore raw
Quoted 46 lines · Ajay Neeli
Quoted 20 lines · Conor Dooley
Quoted 19 lines · Ajay Neeli

Add ref_clk clock property to specify the reference clock frequency supplied to the UFS device.

The AMD Versal2 UFS controller operates with a 26 MHz reference clock. UFS 3.x devices default their bRefClkFreq attribute to 26 MHz, matching the controller, so no explicit configuration is needed. However, UFS 4.0 and later devices default bRefClkFreq to 52 MHz, expecting a 52 MHz reference clock. This mismatch causes timing violations and link instability.

Adding the ref_clk property allows the UFS driver to read the actual reference clock frequency from the devicetree and program the device bRefClkFreq attribute accordingly during initialization.

---
  .../devicetree/bindings/ufs/amd,versal2-ufs.yaml         | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)
Quoted 12 lines

Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml properties: · line 22

Quoted 9 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +1 -1
index c00ec342d574..e294c0f1b0ce 100644
@@ -20,11 +20,12 @@ properties:
      maxItems: 1
    clocks:
-    maxItems: 1
+    maxItems: 2

Please add an items list here.

Sure, will add it in v2.

Quoted 7 lines

Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml properties: · line 28

Quoted 4 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +1 -0
    clock-names:
      items:
        - const: core
+      - const: ref_clk

its a clock by nature, don't restate that in the name.
pw-bot: changes-requested

Quoted 6 lines

The generic UFS platform code currently identifies the reference clock by the "ref_clk" clock name in ufshcd_parse_clock_info().

Would you prefer that the common UFS code be changed to use "ref" as well, or should this binding retain "ref_clk" for consistency with the existing UFS core convention?

I'd like the core to be changed so that every new ufs device is not forced to propagate the pattern.

#4 lore raw
Quoted 50 lines · Conor Dooley
Quoted 49 lines · Ajay Neeli
Quoted 20 lines · Conor Dooley
Quoted 19 lines · Ajay Neeli

Add ref_clk clock property to specify the reference clock frequency supplied to the UFS device.

The AMD Versal2 UFS controller operates with a 26 MHz reference clock. UFS 3.x devices default their bRefClkFreq attribute to 26 MHz, matching the controller, so no explicit configuration is needed. However, UFS 4.0 and later devices default bRefClkFreq to 52 MHz, expecting a 52 MHz reference clock. This mismatch causes timing violations and link instability.

Adding the ref_clk property allows the UFS driver to read the actual reference clock frequency from the devicetree and program the device bRefClkFreq attribute accordingly during initialization.

---
   .../devicetree/bindings/ufs/amd,versal2-ufs.yaml         | 9 +++++----
   1 file changed, 5 insertions(+), 4 deletions(-)
Quoted 12 lines

Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml properties: · line 22

Quoted 9 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +1 -1
index c00ec342d574..e294c0f1b0ce 100644
@@ -20,11 +20,12 @@ properties:
       maxItems: 1
     clocks:
-    maxItems: 1
+    maxItems: 2

Please add an items list here.

Sure, will add it in v2.

Quoted 7 lines

Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml properties: · line 28

Quoted 4 lines
Documentation/devicetree/bindings/ufs/amd,versal2-ufs.yaml +1 -0
     clock-names:
       items:
         - const: core
+      - const: ref_clk

its a clock by nature, don't restate that in the name.
pw-bot: changes-requested

The generic UFS platform code currently identifies the reference clock by the "ref_clk" clock name in ufshcd_parse_clock_info().

Quoted 6 lines
Quoted 3 lines

Would you prefer that the common UFS code be changed to use "ref" as well, or should this binding retain "ref_clk" for consistency with the existing UFS core convention?

I'd like the core to be changed so that every new ufs device is not forced to propagate the pattern.

Sure, I will update the common UFS code to support "ref" while retaining support for existing "ref_clk" users, and use "ref" in this binding.

Thanks,
Ajay