Skip to contentSkip to conversation

phy: qcom,qmp: fix dt-bindings and deprecate lane suffix

PATCH Superseded Johan Hovold 5 participants 89 messages Jul 5, 2022 – Jul 6, 2022

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/43 dt-bindings: phy: qcom,qmp: fix bogus clock-cells property

In reply to Johan Hovold

The QMP PHY wrapper node is not a clock provider so drop the bogus '#clock-cells' property that was added when converting to DT schema.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml | 5 -----
 1 file changed, 5 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +0 -5
index 8b850c5ab116..f74b3bf34a23 100644
@@ -66,9 +66,6 @@ properties:
       - description: Address and length of PHY's common serdes block.
       - description: Address and length of PHY's DP_COM control block.
 
-  "#clock-cells":
-    enum: [ 1, 2 ]
-
   "#address-cells":
     enum: [ 1, 2 ]
 
@@ -116,7 +113,6 @@ patternProperties:
 required:
   - compatible
   - reg
-  - "#clock-cells"
   - "#address-cells"
   - "#size-cells"
   - ranges
@@ -468,7 +464,6 @@ examples:
     usb_2_qmpphy: phy-wrapper@88eb000 {
         compatible = "qcom,sdm845-qmp-usb3-uni-phy";
         reg = <0x088eb000 0x18c>;
-        #clock-cells = <1>;
         #address-cells = <1>;
         #size-cells = <1>;
         ranges = <0x0 0x088eb000 0x2000>;
Signature · 1 line
2.35.1
#0 lore raw

cover phy: qcom,qmp: fix dt-bindings and deprecate lane suffix

When adding support for SC8280XP to the QMP PHY driver I noticed that the PHY provider child node was not described by the current DT schema.

The SC8280XP PHYs also need a second fixed-divider PIPE clock ("pipediv2") and I didn't want to have to add a bogus "lane" suffix to the clock name just to match the current "pipe0" name so I decided to deprecate the unnecessary suffix in the current binding instead.

To be able to add the missing child-node schema and handle device specifics like additional PIPE clocks, it quickly became obvious that the binding needs to be split up.

This series fixes some issue with the current schema before splitting it up in separate schemas for PCIe, UFS and USB, which are then cleaned up further before adding missing parts like the child PHY provider nodes and examples.

The MSM8996 PCIe PHY gets its own schema as this is the only non-combo PHY that actually provides more than one PHY per IP block. Note that the "lane" suffix is still unnecessary and misleading.

The final patches adds support for the new resource names to the (recently split up) PHY drivers. Included is also a related combo PHY cleanup.

I'll post a separate series with related DTS fixes caught while developing this series.

Johan

Johan Hovold (43):
dt-bindings: phy: qcom,qmp: fix bogus clock-cells property
dt-bindings: phy: qcom,qmp: sort compatible strings
dt-bindings: phy: qcom,qmp: clean up descriptions
dt-bindings: phy: qcom,qmp: clean up example
dt-bindings: phy: qcom,qmp: drop child-node comment
dt-bindings: phy: qcom,qmp: split out msm8996-qmp-pcie-phy
dt-bindings: phy: qcom,msm8996-qmp-pcie: clean up constraints
dt-bindings: phy: qcom,msm8996-qmp-pcie: add missing child node schema
dt-bindings: phy: qcom,msm8996-qmp-pcie: add example node
dt-bindings: phy: qcom,msm8996-qmp-pcie: deprecate PIPE clock names
dt-bindings: phy: qcom,msm8996-qmp-pcie: deprecate reset names
dt-bindings: phy: qcom,qmp: split out PCIe PHY binding
dt-bindings: phy: qcom,qmp-pcie: clean up register constraints
dt-bindings: phy: qcom,qmp-pcie: clean up clock constraints
dt-bindings: phy: qcom,qmp-pcie: clean up reset constraints
dt-bindings: phy: qcom,qmp-pcie: drop unused vddp-ref-clk supply
dt-bindings: phy: qcom,qmp-pcie: add missing child node schema
dt-bindings: phy: qcom,qmp-pcie: add example node
dt-bindings: phy: qcom,qmp-pcie: deprecate PIPE clock name
dt-bindings: phy: qcom,qmp: split out UFS PHY binding
dt-bindings: phy: qcom,qmp-ufs: clean up supplies
dt-bindings: phy: qcom,qmp-ufs: clean up reset providers
dt-bindings: phy: qcom,qmp-ufs: clean up clock constraints
dt-bindings: phy: qcom,qmp-ufs: clean up register constraints
dt-bindings: phy: qcom,qmp-ufs: add missing SM8450 clock
dt-bindings: phy: qcom,qmp-ufs: add missing SM8150 power domain
dt-bindings: phy: qcom,qmp-ufs: add missing child node schema
dt-bindings: phy: qcom,qmp-ufs: add example node
dt-bindings: phy: qcom,qmp: split out USB binding
dt-bindings: phy: qcom,qmp-usb: clean up clock constraints
dt-bindings: phy: qcom,qmp-usb: clean up supplies
dt-bindings: phy: qcom,qmp-usb: drop unused vddp-ref-clk supply
dt-bindings: phy: qcom,qmp-usb: clean up reset providers
dt-bindings: phy: qcom,qmp-usb: add missing child node schema
dt-bindings: phy: qcom,qmp-usb: deprecate PIPE clock name
dt-bindings: phy: qcom,qmp-usb3-dp: fix bogus clock-cells property
dt-bindings: phy: qcom,qmp-usb3-dp: deprecate USB PIPE clock name
phy: qcom-qmp-pcie: drop pipe clock lane suffix
phy: qcom-qmp-combo: drop unused lane reset
phy: qcom-qmp-combo: drop pipe clock lane suffix
phy: qcom-qmp-pcie-msm8996: drop pipe clock lane suffix
phy: qcom-qmp-pcie-msm8996: drop reset lane suffix
phy: qcom-qmp-usb: drop pipe clock lane suffix

 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 212 ++++++++
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 309 +++++++++++
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml | 500 ------------------
 .../bindings/phy/qcom,qmp-ufs-phy.yaml        | 249 +++++++++
 .../bindings/phy/qcom,qmp-usb-phy.yaml        | 417 +++++++++++++++
 .../bindings/phy/qcom,qmp-usb3-dp-phy.yaml    |  15 +-
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c     |  10 +-
 .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c  |  17 +-
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c      |   8 +-
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c       |   8 +-
 10 files changed, 1224 insertions(+), 521 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml
 delete mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml
Signature · 1 line
2.35.1
#15 lore raw

PATCH 7/43 dt-bindings: phy: qcom,msm8996-qmp-pcie: clean up constraints

Drop the compatible conditional and tighten the property constraints.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 65 +++++--------------
 1 file changed, 18 insertions(+), 47 deletions(-)
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +18 -47
index 14fd86fd91ec..b73bf5c06358 100644
@@ -19,10 +19,8 @@ properties:
     const: qcom,msm8996-qmp-pcie-phy
 
   reg:
-    minItems: 1
     items:
       - description: Address and length of PHY's common serdes block.
-      - description: Address and length of PHY's DP_COM control block.
 
   "#address-cells":
     enum: [ 1, 2 ]
@@ -33,20 +31,28 @@ properties:
   ranges: true
 
   clocks:
-    minItems: 1
-    maxItems: 4
+    items:
+      - description: PHY aux clock.
+      - description: PHY config clock.
+      - description: 19.2 MHz ref clock.
 
   clock-names:
-    minItems: 1
-    maxItems: 4
+    items:
+      - const: aux
+      - const: cfg_ahb
+      - const: ref
 
   resets:
-    minItems: 1
-    maxItems: 3
+    items:
+      - description: Reset of PHY block.
+      - description: PHY common block reset.
+      - description: PHY's ahb cfg block reset.
 
   reset-names:
-    minItems: 1
-    maxItems: 3
+    items:
+      - const: phy
+      - const: common
+      - const: cfg
 
   vdda-phy-supply:
     description:
@@ -56,10 +62,6 @@ properties:
     description:
       Phandle to 1.8V regulator supply to PHY refclk pll block.
 
-  vddp-ref-clk-supply:
-    description:
-      Phandle to a regulator supply to any specific refclk pll block.
-
 patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
@@ -77,38 +79,7 @@ required:
   - clock-names
   - resets
   - reset-names
+  - vdda-phy-supply
+  - vdda-pll-supply
 
 additionalProperties: false
-
-allOf:
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,msm8996-qmp-pcie-phy
-    then:
-      properties:
-        clocks:
-          items:
-            - description: PHY aux clock.
-            - description: PHY config clock.
-            - description: 19.2 MHz ref clock.
-        clock-names:
-          items:
-            - const: aux
-            - const: cfg_ahb
-            - const: ref
-        resets:
-          items:
-            - description: Reset of PHY block.
-            - description: PHY common block reset.
-            - description: PHY's ahb cfg block reset.
-        reset-names:
-          items:
-            - const: phy
-            - const: common
-            - const: cfg
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
Signature · 1 line
2.35.1
#26 lore raw

PATCH 10/43 dt-bindings: phy: qcom,msm8996-qmp-pcie: deprecate PIPE clock names

In reply to Johan Hovold

Drop the unnecessary "lane" suffix from the PHY PIPE clock names and mark the old names as deprecated.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +12 -8
index 45f7bb7a632a..7931b1fd1476 100644
@@ -79,11 +79,15 @@ patternProperties:
           - description: PIPE clock
 
       clock-names:
-        items:
-          - enum:
-              - pipe0
-              - pipe1
-              - pipe2
+        oneOf:
+          - items:
+              - const: pipe
+          - items:
+              - enum:
+                  - pipe0
+                  - pipe1
+                  - pipe2
+            deprecated: true
 
       resets:
         items:
@@ -160,7 +164,7 @@ examples:
                   <0x1400 0x1dc>;
 
             clocks = <&gcc GCC_PCIE_0_PIPE_CLK>;
-            clock-names = "pipe0";
+            clock-names = "pipe";
             resets = <&gcc GCC_PCIE_0_PHY_BCR>;
             reset-names = "lane0";
 
@@ -176,7 +180,7 @@ examples:
                   <0x2400 0x1dc>;
 
             clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
-            clock-names = "pipe1";
+            clock-names = "pipe";
             resets = <&gcc GCC_PCIE_1_PHY_BCR>;
             reset-names = "lane1";
 
@@ -192,7 +196,7 @@ examples:
                   <0x3400 0x1dc>;
 
             clocks = <&gcc GCC_PCIE_2_PIPE_CLK>;
-            clock-names = "pipe2";
+            clock-names = "pipe";
             resets = <&gcc GCC_PCIE_2_PHY_BCR>;
             reset-names = "lane2";
 
Signature · 1 line
2.35.1
#46 lore raw

PATCH 17/43 dt-bindings: phy: qcom,qmp-pcie: add missing child node schema

In reply to Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 88 ++++++++++++++++++-
 1 file changed, 85 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +85 -3
index ff1577f68a00..5a1ebf874559 100644
@@ -69,9 +69,37 @@ properties:
 patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
-    description:
-      Each device node of QMP PHY is required to have as many child nodes as
-      the number of lanes the PHY has.
+    description: Single PHY-provider child node.
+    properties:
+      reg:
+        minItems: 3
+        maxItems: 6
+
+      clocks:
+        items:
+          - description: PIPE clock
+
+      clock-names:
+        items:
+          - const: pipe0
+
+      "#clock-cells":
+        const: 0
+
+      clock-output-names: true
+
+      "#phy-cells":
+        const: 0
+
+    required:
+      - reg
+      - clocks
+      - clock-names
+      - "#clock-cells"
+      - clock-output-names
+      - "#phy-cells"
+
+    additionalProperties: false
 
 required:
   - compatible
@@ -180,3 +208,57 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sm8250-qmp-gen3x2-pcie-phy
+              - qcom,sm8250-qmp-modem-pcie-phy
+              - qcom,sm8450-qmp-gen4x2-pcie-phy
+    then:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              items:
+                - description: TX lane 1
+                - description: RX lane 1
+                - description: PCS
+                - description: TX lane 2
+                - description: RX lane 2
+                - description: PCS_MISC
+    else:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              minItems: 3
+              maxItems: 4
+              items:
+                - description: TX
+                - description: RX
+                - description: PCS
+                - description: PCS_MISC
+      if:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - qcom,ipq6018-qmp-pcie-phy
+                - qcom,ipq8074-qmp-pcie-phy
+                - qcom,msm8998-qmp-pcie-phy
+                - qcom,sdm845-qhp-pcie-phy
+      then:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                maxItems: 3
+      else:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                minItems: 4
Signature · 1 line
2.35.1
#31 lore raw

PATCH 12/43 dt-bindings: phy: qcom,qmp: split out PCIe PHY binding

In reply to Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the PCIe PHY binding in a separate file.

---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 188 ++++++++++++++++++
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml |  75 -------
 2 files changed, 188 insertions(+), 75 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml new file +188 -0
new file mode 100644
index 000000000000..d1d4a468acc3
@@ -0,0 +1,188 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/phy/qcom,qmp-pcie-phy.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Qualcomm QMP PHY controller (PCIe)
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description:
+  QMP PHY controller supports physical layer functionality for a number of
+  controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.
+
+properties:
+  compatible:
+    enum:
+      - qcom,ipq6018-qmp-pcie-phy
+      - qcom,ipq8074-qmp-pcie-phy
+      - qcom,msm8998-qmp-pcie-phy
+      - qcom,sc8180x-qmp-pcie-phy
+      - qcom,sdm845-qhp-pcie-phy
+      - qcom,sdm845-qmp-pcie-phy
+      - qcom,sdx55-qmp-pcie-phy
+      - qcom,sm8250-qmp-gen3x1-pcie-phy
+      - qcom,sm8250-qmp-gen3x2-pcie-phy
+      - qcom,sm8250-qmp-modem-pcie-phy
+      - qcom,sm8450-qmp-gen3x1-pcie-phy
+      - qcom,sm8450-qmp-gen4x2-pcie-phy
+
+  reg:
+    minItems: 1
+    items:
+      - description: Address and length of PHY's common serdes block.
+      - description: Address and length of PHY's DP_COM control block.
+
+  "#address-cells":
+    enum: [ 1, 2 ]
+
+  "#size-cells":
+    enum: [ 1, 2 ]
+
+  ranges: true
+
+  clocks:
+    minItems: 1
+    maxItems: 4
+
+  clock-names:
+    minItems: 1
+    maxItems: 4
+
+  resets:
+    minItems: 1
+    maxItems: 3
+
+  reset-names:
+    minItems: 1
+    maxItems: 3
+
+  vdda-phy-supply:
+    description:
+      Phandle to a regulator supply to PHY core block.
+
+  vdda-pll-supply:
+    description:
+      Phandle to 1.8V regulator supply to PHY refclk pll block.
+
+  vddp-ref-clk-supply:
+    description:
+      Phandle to a regulator supply to any specific refclk pll block.
+
+patternProperties:
+  "^phy@[0-9a-f]+$":
+    type: object
+    description:
+      Each device node of QMP PHY is required to have as many child nodes as
+      the number of lanes the PHY has.
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,msm8998-qmp-pcie-phy
+    then:
+      properties:
+        clocks:
+          items:
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
+        clock-names:
+          items:
+            - const: aux
+            - const: cfg_ahb
+            - const: ref
+        resets:
+          items:
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
+        reset-names:
+          items:
+            - const: phy
+            - const: common
+      required:
+        - vdda-phy-supply
+        - vdda-pll-supply
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,ipq6018-qmp-pcie-phy
+              - qcom,ipq8074-qmp-pcie-phy
+    then:
+      properties:
+        clocks:
+          items:
+            - description: PHY aux clock.
+            - description: PHY config clock.
+        clock-names:
+          items:
+            - const: aux
+            - const: cfg_ahb
+        resets:
+          items:
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
+        reset-names:
+          items:
+            - const: phy
+            - const: common
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sc8180x-qmp-pcie-phy
+              - qcom,sdm845-qhp-pcie-phy
+              - qcom,sdm845-qmp-pcie-phy
+              - qcom,sdx55-qmp-pcie-phy
+              - qcom,sm8250-qmp-gen3x1-pcie-phy
+              - qcom,sm8250-qmp-gen3x2-pcie-phy
+              - qcom,sm8250-qmp-modem-pcie-phy
+              - qcom,sm8450-qmp-gen3x1-pcie-phy
+              - qcom,sm8450-qmp-gen4x2-pcie-phy
+    then:
+      properties:
+        clocks:
+          items:
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
+            - description: PHY refgen clock.
+        clock-names:
+          items:
+            - const: aux
+            - const: cfg_ahb
+            - const: ref
+            - const: refgen
+        resets:
+          items:
+            - description: Reset of PHY block.
+        reset-names:
+          items:
+            - const: phy
+      required:
+        - vdda-phy-supply
+        - vdda-pll-supply
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +0 -75

119 lines not on this page · raw message

Signature · 1 line
2.35.1
#37 lore raw

PATCH 15/43 dt-bindings: phy: qcom,qmp-pcie: clean up reset constraints

In reply to Johan Hovold

The PCIe PHY binding requires one or two resets.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +2 -2
index 0486b2b48d72..557cccc8f4dd 100644
@@ -52,11 +52,11 @@ properties:
 
   resets:
     minItems: 1
-    maxItems: 3
+    maxItems: 2
 
   reset-names:
     minItems: 1
-    maxItems: 3
+    maxItems: 2
 
   vdda-phy-supply:
     description:
Signature · 1 line
2.35.1
#39 lore raw

PATCH 16/43 dt-bindings: phy: qcom,qmp-pcie: drop unused vddp-ref-clk supply

In reply to Johan Hovold

Only UFS PHY nodes in mainline have a vddp-ref-clk supply. Drop it from the PCIe PHY binding.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml | 4 ----
 1 file changed, 4 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +0 -4
index 557cccc8f4dd..ff1577f68a00 100644
@@ -66,10 +66,6 @@ properties:
     description:
       Phandle to 1.8V regulator supply to PHY refclk pll block.
 
-  vddp-ref-clk-supply:
-    description:
-      Phandle to a regulator supply to any specific refclk pll block.
-
 patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
Signature · 1 line
2.35.1
#63 lore raw

PATCH 25/43 dt-bindings: phy: qcom,qmp-ufs: add missing SM8450 clock

In reply to Johan Hovold

Add the missing "qref" clock used by the SM8450 UFS QMP PHY to the binding.

Fixes e04121ba1b08 ("dt-bindings: phy: qcom,qmp: Add SM8450 UFS phy compatible")
Fixes 07fa917a335e ("arm64: dts: qcom: sm8450: add ufs nodes")
---
 .../bindings/phy/qcom,qmp-ufs-phy.yaml        | 23 +++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml +21 -2
index af3ed5601d21..d04cdb85f005 100644
@@ -43,11 +43,11 @@ properties:
 
   clocks:
     minItems: 1
-    maxItems: 2
+    maxItems: 3
 
   clock-names:
     minItems: 1
-    maxItems: 2
+    maxItems: 3
 
   resets:
     items:
@@ -129,3 +129,22 @@ allOf:
           items:
             - const: ref
             - const: ref_aux
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sm8450-qmp-ufs-phy
+    then:
+      properties:
+        clocks:
+          items:
+            - description: 19.2 MHz ref clock.
+            - description: PHY reference aux clock.
+            - description: qref clock.
+        clock-names:
+          items:
+            - const: ref
+            - const: ref_aux
+            - const: qref
Signature · 1 line
2.35.1
#62 lore raw

PATCH 24/43 dt-bindings: phy: qcom,qmp-ufs: clean up register constraints

In reply to Johan Hovold

Only some USB and combo PHYs have a second dp_com control block.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml | 2 --
 1 file changed, 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml +0 -2
index 732518d0427c..af3ed5601d21 100644
@@ -30,10 +30,8 @@ properties:
       - qcom,sm8450-qmp-ufs-phy
 
   reg:
-    minItems: 1
     items:
       - description: Address and length of PHY's common serdes block.
-      - description: Address and length of PHY's DP_COM control block.
 
   "#address-cells":
     enum: [ 1, 2 ]
Signature · 1 line
2.35.1
#59 lore raw

PATCH 21/43 dt-bindings: phy: qcom,qmp-ufs: clean up supplies

In reply to Johan Hovold

The UFS PHY binding requires the vdda-phy and vdd-pll supplies.

---
 .../devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml         | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml +2 -6
index 4471f1b4fb7a..c4458d90d8b7 100644
@@ -88,6 +88,8 @@ required:
   - clock-names
   - resets
   - reset-names
+  - vdda-phy-supply
+  - vdda-pll-supply
 
 additionalProperties: false
 
@@ -112,9 +114,6 @@ allOf:
         reset-names:
           items:
             - const: ufsphy
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
 
   - if:
       properties:
@@ -144,6 +143,3 @@ allOf:
         reset-names:
           items:
             - const: ufsphy
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
Signature · 1 line
2.35.1
#67 lore raw

PATCH 29/43 dt-bindings: phy: qcom,qmp: split out USB binding

In reply to Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the USB PHY binding in a separate file.

---
 .../phy/{qcom,qmp-phy.yaml => qcom,qmp-usb-phy.yaml}     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
 rename Documentation/devicetree/bindings/phy/{qcom,qmp-phy.yaml => qcom,qmp-usb-phy.yaml} (98%)
Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml renamed from Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +7 -2
similarity index 98%
rename from Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
rename to Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml
index 04c24f8e4526..8343e24b669a 100644
@@ -2,10 +2,10 @@
 
 %YAML 1.2
 ---
-$id: "http://devicetree.org/schemas/phy/qcom,qmp-phy.yaml#"
+$id: "http://devicetree.org/schemas/phy/qcom,qmp-usb-phy.yaml#"
 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
 
-title: Qualcomm QMP PHY controller
+title: Qualcomm QMP PHY controller (USB)
 
 maintainers:
   - Vinod Koul <[email protected]>
@@ -130,6 +130,7 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
+
   - if:
       properties:
         compatible:
@@ -160,6 +161,7 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
+
   - if:
       properties:
         compatible:
@@ -191,6 +193,7 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
+
   - if:
       properties:
         compatible:
@@ -225,6 +228,7 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
+
   - if:
       properties:
         compatible:
@@ -255,6 +259,7 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
+
   - if:
       properties:
         compatible:
Signature · 1 line
2.35.1
#11 lore raw

PATCH 6/43 dt-bindings: phy: qcom,qmp: split out msm8996-qmp-pcie-phy

In reply to Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the odd-bird msm8996-qmp-pcie-phy which is the only QMP PHY that uses separate "per-lane" nodes.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 114 ++++++++++++++++++
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml |  32 -----
 2 files changed, 114 insertions(+), 32 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +114 -0
new file mode 100644
index 000000000000..14fd86fd91ec
@@ -0,0 +1,114 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/phy/qcom,msm8996-qmp-pcie-phy.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Qualcomm QMP PHY controller (MSM8996 PCIe)
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description:
+  QMP PHY controller supports physical layer functionality for a number of
+  controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.
+
+properties:
+  compatible:
+    const: qcom,msm8996-qmp-pcie-phy
+
+  reg:
+    minItems: 1
+    items:
+      - description: Address and length of PHY's common serdes block.
+      - description: Address and length of PHY's DP_COM control block.
+
+  "#address-cells":
+    enum: [ 1, 2 ]
+
+  "#size-cells":
+    enum: [ 1, 2 ]
+
+  ranges: true
+
+  clocks:
+    minItems: 1
+    maxItems: 4
+
+  clock-names:
+    minItems: 1
+    maxItems: 4
+
+  resets:
+    minItems: 1
+    maxItems: 3
+
+  reset-names:
+    minItems: 1
+    maxItems: 3
+
+  vdda-phy-supply:
+    description:
+      Phandle to a regulator supply to PHY core block.
+
+  vdda-pll-supply:
+    description:
+      Phandle to 1.8V regulator supply to PHY refclk pll block.
+
+  vddp-ref-clk-supply:
+    description:
+      Phandle to a regulator supply to any specific refclk pll block.
+
+patternProperties:
+  "^phy@[0-9a-f]+$":
+    type: object
+    description:
+      Each device node of QMP PHY is required to have as many child nodes as
+      the number of lanes the PHY has.
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,msm8996-qmp-pcie-phy
+    then:
+      properties:
+        clocks:
+          items:
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
+        clock-names:
+          items:
+            - const: aux
+            - const: cfg_ahb
+            - const: ref
+        resets:
+          items:
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
+            - description: PHY's ahb cfg block reset.
+        reset-names:
+          items:
+            - const: phy
+            - const: common
+            - const: cfg
+      required:
+        - vdda-phy-supply
+        - vdda-pll-supply
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +0 -32
index bca006e41821..7a76fd286cee 100644
@@ -21,7 +21,6 @@ properties:
       - qcom,ipq6018-qmp-usb3-phy
       - qcom,ipq8074-qmp-pcie-phy
       - qcom,ipq8074-qmp-usb3-phy
-      - qcom,msm8996-qmp-pcie-phy
       - qcom,msm8996-qmp-ufs-phy
       - qcom,msm8996-qmp-usb3-phy
       - qcom,msm8998-qmp-pcie-phy
@@ -184,37 +183,6 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,msm8996-qmp-pcie-phy
-    then:
-      properties:
-        clocks:
-          items:
-            - description: PHY aux clock.
-            - description: PHY config clock.
-            - description: 19.2 MHz ref clock.
-        clock-names:
-          items:
-            - const: aux
-            - const: cfg_ahb
-            - const: ref
-        resets:
-          items:
-            - description: Reset of PHY block.
-            - description: PHY common block reset.
-            - description: PHY's ahb cfg block reset.
-        reset-names:
-          items:
-            - const: phy
-            - const: common
-            - const: cfg
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
   - if:
       properties:
         compatible:
Signature · 1 line
2.35.1
#65 lore raw

PATCH 27/43 dt-bindings: phy: qcom,qmp-ufs: add missing child node schema

In reply to Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-ufs-phy.yaml        | 72 ++++++++++++++++++-
 1 file changed, 69 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml +69 -3
index f1e3d70eb73d..9124b60eb9a7 100644
@@ -75,9 +75,20 @@ properties:
 patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
-    description:
-      Each device node of QMP PHY is required to have as many child nodes as
-      the number of lanes the PHY has.
+    description: Single PHY-provider child node.
+    properties:
+      reg:
+        minItems: 3
+        maxItems: 6
+
+      "#phy-cells":
+        const: 0
+
+    required:
+      - reg
+      - "#phy-cells"
+
+    additionalProperties: false
 
 required:
   - compatible
@@ -151,3 +162,58 @@ allOf:
             - const: ref
             - const: ref_aux
             - const: qref
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,msm8998-qmp-ufs-phy
+              - qcom,sc8280xp-qmp-ufs-phy
+              - qcom,sdm845-qmp-ufs-phy
+              - qcom,sm6350-qmp-ufs-phy
+              - qcom,sm8150-qmp-ufs-phy
+              - qcom,sm8250-qmp-ufs-phy
+              - qcom,sm8350-qmp-ufs-phy
+              - qcom,sm8450-qmp-ufs-phy
+    then:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              items:
+                - description: TX lane 1
+                - description: RX lane 1
+                - description: PCS
+                - description: TX lane 2
+                - description: RX lane 2
+    else:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              minItems: 3
+              maxItems: 4
+              items:
+                - description: TX
+                - description: RX
+                - description: PCS
+                - description: PCS_MISC
+      if:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - qcom,msm8996-qmp-ufs-phy
+      then:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                maxItems: 3
+      else:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                minItems: 4
Signature · 1 line
2.35.1
#71 lore raw

PATCH 33/43 dt-bindings: phy: qcom,qmp-usb: clean up reset providers

In reply to Johan Hovold

The USB PHY binding requires two resets.

---
 .../devicetree/bindings/phy/qcom,qmp-usb-phy.yaml         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml +4 -4
index 76979aff086f..21744bbe1764 100644
@@ -59,12 +59,12 @@ properties:
     maxItems: 4
 
   resets:
-    minItems: 1
-    maxItems: 3
+    minItems: 2
+    maxItems: 2
 
   reset-names:
-    minItems: 1
-    maxItems: 3
+    minItems: 2
+    maxItems: 2
 
   vdda-phy-supply:
     description:
Signature · 1 line
2.35.1
#7 lore raw

PATCH 4/43 dt-bindings: phy: qcom,qmp: clean up example

In reply to Johan Hovold

Clean up the example node somewhat by grouping consumer and provider properties in the child node.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +5 -2
index 83f777b4636f..e678d7d5f675 100644
@@ -486,10 +486,13 @@ examples:
                       <0x400 0x1fc>,
                       <0x800 0x218>,
                       <0x600 0x70>;
-                #clock-cells = <0>;
-                #phy-cells = <0>;
+
                 clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
                 clock-names = "pipe0";
+
+                #clock-cells = <0>;
                 clock-output-names = "usb3_uni_phy_pipe_clk_src";
+
+                #phy-cells = <0>;
             };
         };
Signature · 1 line
2.35.1
#9 lore raw

PATCH 5/43 dt-bindings: phy: qcom,qmp: drop child-node comment

In reply to Johan Hovold

Drop the redundant comment about child nodes being required that was copied from the old binding documentation.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +0 -1
index e678d7d5f675..bca006e41821 100644
@@ -102,7 +102,6 @@ properties:
     description:
       Phandle to a regulator supply to any specific refclk pll block.
 
-#Required nodes:
 patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
Signature · 1 line
2.35.1
#75 lore raw

PATCH 37/43 dt-bindings: phy: qcom,qmp-usb3-dp: deprecate USB PIPE clock name

In reply to Johan Hovold

Drop the bogus "lane" suffix from the USB PHY PIPE clock name and mark the old name as deprecated.

---
 .../devicetree/bindings/phy/qcom,qmp-usb3-dp-phy.yaml  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-usb3-dp-phy.yaml +7 -3
index 86d64c61bca3..09d7708158bb 100644
@@ -96,8 +96,12 @@ patternProperties:
           - description: pipe clock
 
       clock-names:
-        items:
-          - const: pipe0
+        oneOf:
+          - items:
+              - const: pipe
+          - items:
+              - const: pipe0
+            deprecated: true
 
       clock-output-names:
         items:
@@ -192,7 +196,7 @@ examples:
             #clock-cells = <0>;
             #phy-cells = <0>;
             clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
-            clock-names = "pipe0";
+            clock-names = "pipe";
             clock-output-names = "usb3_phy_pipe_clk_src";
         };
 
Signature · 1 line
2.35.1
#5 lore raw

PATCH 3/43 dt-bindings: phy: qcom,qmp: clean up descriptions

In reply to Johan Hovold

Clean up the descriptions somewhat by using uppercase "PHY" consistently and spelling out "clock".

---
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml | 102 +++++++++---------
 1 file changed, 51 insertions(+), 51 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +51 -51
index 38e0ade01687..83f777b4636f 100644
@@ -11,7 +11,7 @@ maintainers:
   - Vinod Koul <[email protected]>
 
 description:
-  QMP phy controller supports physical layer functionality for a number of
+  QMP PHY controller supports physical layer functionality for a number of
   controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.
 
 properties:
@@ -107,7 +107,7 @@ patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
     description:
-      Each device node of QMP phy is required to have as many child nodes as
+      Each device node of QMP PHY is required to have as many child nodes as
       the number of lanes the PHY has.
 
 required:
@@ -134,10 +134,10 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy aux clock.
-            - description: Phy config clock.
-            - description: 19.2 MHz ref clk.
-            - description: Phy common block aux clock.
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
+            - description: PHY common block aux clock.
         clock-names:
           items:
             - const: aux
@@ -146,8 +146,8 @@ allOf:
             - const: com_aux
         resets:
           items:
-            - description: reset of phy block.
-            - description: phy common block reset.
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
         reset-names:
           items:
             - const: phy
@@ -166,9 +166,9 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy aux clock.
-            - description: Phy config clock.
-            - description: 19.2 MHz ref clk.
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
         clock-names:
           items:
             - const: aux
@@ -176,8 +176,8 @@ allOf:
             - const: ref
         resets:
           items:
-            - description: reset of phy block.
-            - description: phy common block reset.
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
         reset-names:
           items:
             - const: phy
@@ -195,9 +195,9 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy aux clock.
-            - description: Phy config clock.
-            - description: 19.2 MHz ref clk.
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
         clock-names:
           items:
             - const: aux
@@ -205,9 +205,9 @@ allOf:
             - const: ref
         resets:
           items:
-            - description: reset of phy block.
-            - description: phy common block reset.
-            - description: phy's ahb cfg block reset.
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
+            - description: PHY's ahb cfg block reset.
         reset-names:
           items:
             - const: phy
@@ -229,9 +229,9 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy aux clock.
-            - description: Phy config clock.
-            - description: 19.2 MHz ref clk.
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
         clock-names:
           items:
             - const: aux
@@ -239,8 +239,8 @@ allOf:
             - const: ref
         resets:
           items:
-            - description: reset of phy block.
-            - description: phy common block reset.
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
         reset-names:
           items:
             - const: phy
@@ -258,7 +258,7 @@ allOf:
       properties:
         clocks:
           items:
-            - description: 19.2 MHz ref clk.
+            - description: 19.2 MHz ref clock.
         clock-names:
           items:
             - const: ref
@@ -287,8 +287,8 @@ allOf:
       properties:
         clocks:
           items:
-            - description: 19.2 MHz ref clk.
-            - description: Phy reference aux clock.
+            - description: 19.2 MHz ref clock.
+            - description: PHY reference aux clock.
         clock-names:
           items:
             - const: ref
@@ -313,16 +313,16 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy aux clock.
-            - description: Phy config clock.
+            - description: PHY aux clock.
+            - description: PHY config clock.
         clock-names:
           items:
             - const: aux
             - const: cfg_ahb
         resets:
           items:
-            - description: reset of phy block.
-            - description: phy common block reset.
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
         reset-names:
           items:
             - const: phy
@@ -345,10 +345,10 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy aux clock.
-            - description: Phy config clock.
-            - description: 19.2 MHz ref clk.
-            - description: Phy refgen clk.
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
+            - description: PHY refgen clock.
         clock-names:
           items:
             - const: aux
@@ -357,7 +357,7 @@ allOf:
             - const: refgen
         resets:
           items:
-            - description: reset of phy block.
+            - description: Reset of PHY block.
         reset-names:
           items:
             - const: phy
@@ -377,10 +377,10 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy aux clock.
-            - description: 19.2 MHz ref clk source.
-            - description: 19.2 MHz ref clk.
-            - description: Phy common block aux clock.
+            - description: PHY aux clock.
+            - description: 19.2 MHz ref clock source.
+            - description: 19.2 MHz ref clock.
+            - description: PHY common block aux clock.
         clock-names:
           items:
             - const: aux
@@ -389,8 +389,8 @@ allOf:
             - const: com_aux
         resets:
           items:
-            - description: reset of phy block.
-            - description: phy common block reset.
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
         reset-names:
           items:
             - const: phy
@@ -409,9 +409,9 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy aux clock.
-            - description: 19.2 MHz ref clk.
-            - description: Phy common block aux clock.
+            - description: PHY aux clock.
+            - description: 19.2 MHz ref clock.
+            - description: PHY common block aux clock.
         clock-names:
           items:
             - const: aux
@@ -419,8 +419,8 @@ allOf:
             - const: com_aux
         resets:
           items:
-            - description: reset of phy block.
-            - description: phy common block reset.
+            - description: Reset of PHY block.
+            - description: PHY common block reset.
         reset-names:
           items:
             - const: phy
@@ -438,9 +438,9 @@ allOf:
       properties:
         clocks:
           items:
-            - description: Phy config clock.
-            - description: 19.2 MHz ref clk.
-            - description: Phy common block aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
+            - description: PHY common block aux clock.
         clock-names:
           items:
             - const: cfg_ahb
@@ -449,7 +449,7 @@ allOf:
         resets:
           items:
             - description: phy_phy reset.
-            - description: reset of phy block.
+            - description: reset of PHY block.
         reset-names:
           items:
             - const: phy_phy
Signature · 1 line
2.35.1
#60 lore raw

PATCH 22/43 dt-bindings: phy: qcom,qmp-ufs: clean up reset providers

In reply to Johan Hovold

The UFS binding requires a single PHY reset.

---
 .../bindings/phy/qcom,qmp-ufs-phy.yaml        | 20 ++++---------------
 1 file changed, 4 insertions(+), 16 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml +4 -16
index c4458d90d8b7..b84511f02221 100644
@@ -52,12 +52,12 @@ properties:
     maxItems: 4
 
   resets:
-    minItems: 1
-    maxItems: 3
+    items:
+      - description: PHY reset in the UFS controller.
 
   reset-names:
-    minItems: 1
-    maxItems: 3
+    items:
+      - const: ufsphy
 
   vdda-phy-supply:
     description:
@@ -108,12 +108,6 @@ allOf:
         clock-names:
           items:
             - const: ref
-        resets:
-          items:
-            - description: PHY reset in the UFS controller.
-        reset-names:
-          items:
-            - const: ufsphy
 
   - if:
       properties:
@@ -137,9 +131,3 @@ allOf:
           items:
             - const: ref
             - const: ref_aux
-        resets:
-          items:
-            - description: PHY reset in the UFS controller.
-        reset-names:
-          items:
-            - const: ufsphy
Signature · 1 line
2.35.1
#73 lore raw

PATCH 35/43 dt-bindings: phy: qcom,qmp-usb: deprecate PIPE clock name

In reply to Johan Hovold

Drop the bogus "lane" suffix from the PHY PIPE clock name and mark the old name as deprecated.

---
 .../devicetree/bindings/phy/qcom,qmp-usb-phy.yaml      | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml +7 -3
index c9a6765708cc..279b8823bc17 100644
@@ -88,8 +88,12 @@ patternProperties:
           - description: PIPE clock
 
       clock-names:
-        items:
-          - const: pipe0
+        oneOf:
+          - items:
+              - const: pipe
+          - items:
+              - const: pipe0
+            deprecated: true
 
       "#clock-cells":
         const: 0
@@ -403,7 +407,7 @@ examples:
                       <0x600 0x70>;
 
                 clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
-                clock-names = "pipe0";
+                clock-names = "pipe";
 
                 #clock-cells = <0>;
                 clock-output-names = "usb3_uni_phy_pipe_clk_src";
Signature · 1 line
2.35.1
#61 lore raw

PATCH 23/43 dt-bindings: phy: qcom,qmp-ufs: clean up clock constraints

In reply to Johan Hovold

The UFS PHY binding requires one or two clocks.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml +2 -2
index b84511f02221..732518d0427c 100644
@@ -45,11 +45,11 @@ properties:
 
   clocks:
     minItems: 1
-    maxItems: 4
+    maxItems: 2
 
   clock-names:
     minItems: 1
-    maxItems: 4
+    maxItems: 2
 
   resets:
     items:
Signature · 1 line
2.35.1
#72 lore raw

PATCH 34/43 dt-bindings: phy: qcom,qmp-usb: add missing child node schema

In reply to Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-usb-phy.yaml        | 109 +++++++++++++++++-
 1 file changed, 106 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml +106 -3
index 21744bbe1764..c9a6765708cc 100644
@@ -77,9 +77,37 @@ properties:
 patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
-    description:
-      Each device node of QMP PHY is required to have as many child nodes as
-      the number of lanes the PHY has.
+    description: Single PHY-provider child node.
+    properties:
+      reg:
+        minItems: 3
+        maxItems: 6
+
+      clocks:
+        items:
+          - description: PIPE clock
+
+      clock-names:
+        items:
+          - const: pipe0
+
+      "#clock-cells":
+        const: 0
+
+      clock-output-names: true
+
+      "#phy-cells":
+        const: 0
+
+    required:
+      - reg
+      - clocks
+      - clock-names
+      - "#clock-cells"
+      - clock-output-names
+      - "#phy-cells"
+
+    additionalProperties: false
 
 required:
   - compatible
@@ -270,6 +298,81 @@ allOf:
             - const: phy_phy
             - const: phy
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,msm8998-qmp-usb3-phy
+              - qcom,sdm845-qmp-usb3-phy
+              - qcom,sm8150-qmp-usb3-phy
+              - qcom,sm8350-qmp-usb3-phy
+              - qcom,sm8450-qmp-usb3-phy
+    then:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              minItems: 5
+              maxItems: 6
+              items:
+                - description: TX lane 1
+                - description: RX lane 1
+                - description: PCS
+                - description: TX lane 2
+                - description: RX lane 2
+                - description: PCS_MISC
+      if:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - qcom,msm8998-qmp-usb3-phy
+      then:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                maxItems: 5
+      else:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                minItems: 6
+    else:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              minItems: 3
+              maxItems: 4
+              items:
+                - description: TX
+                - description: RX
+                - description: PCS
+                - description: PCS_MISC
+      if:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - qcom,msm8996-qmp-usb3-phy
+                - qcom,sm8250-qmp-usb3-uni-phy
+                - qcom,sm8350-qmp-usb3-uni-phy
+      then:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                maxItems: 3
+      else:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                minItems: 4
+
 examples:
   - |
     #include <dt-bindings/clock/qcom,gcc-sdm845.h>
Signature · 1 line
2.35.1
#19 lore raw

PATCH 8/43 dt-bindings: phy: qcom,msm8996-qmp-pcie: add missing child node schema

In reply to Johan Hovold

Add the missing the description of the PHY-provider child nodes which were ignored when converting to DT schema.

Also fix up the description that claimed that one child node per lane (rather than PHY) was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 51 ++++++++++++++++++-
 1 file changed, 49 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +49 -2
index b73bf5c06358..8aadb25686b2 100644
@@ -66,8 +66,55 @@ patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
     description:
-      Each device node of QMP PHY is required to have as many child nodes as
-      the number of lanes the PHY has.
+      One child node per PHY provided by this block.
+    properties:
+      reg:
+        items:
+          - description: TX
+          - description: RX
+          - description: PCS
+
+      clocks:
+        items:
+          - description: PIPE clock
+
+      clock-names:
+        items:
+          - enum:
+              - pipe0
+              - pipe1
+              - pipe2
+
+      resets:
+        items:
+          - description: PHY (lane) reset
+
+      reset-names:
+        items:
+          - enum:
+              - lane0
+              - lane1
+              - lane2
+
+      "#clock-cells":
+        const: 0
+
+      clock-output-names: true
+
+      "#phy-cells":
+        const: 0
+
+    required:
+      - reg
+      - clocks
+      - clock-names
+      - resets
+      - reset-names
+      - "#clock-cells"
+      - clock-output-names
+      - "#phy-cells"
+
+    additionalProperties: false
 
 required:
   - compatible
Signature · 1 line
2.35.1
#57 lore raw

PATCH 20/43 dt-bindings: phy: qcom,qmp: split out UFS PHY binding

In reply to Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the UFS PHY binding in a separate file.

---
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml |  65 --------
 .../bindings/phy/qcom,qmp-ufs-phy.yaml        | 149 ++++++++++++++++++
 2 files changed, 149 insertions(+), 65 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +0 -65
index f416a1a53a3f..04c24f8e4526 100644
@@ -19,32 +19,21 @@ properties:
     enum:
       - qcom,ipq6018-qmp-usb3-phy
       - qcom,ipq8074-qmp-usb3-phy
-      - qcom,msm8996-qmp-ufs-phy
       - qcom,msm8996-qmp-usb3-phy
-      - qcom,msm8998-qmp-ufs-phy
       - qcom,msm8998-qmp-usb3-phy
       - qcom,qcm2290-qmp-usb3-phy
       - qcom,sc7180-qmp-usb3-phy
-      - qcom,sc8180x-qmp-ufs-phy
       - qcom,sc8180x-qmp-usb3-phy
-      - qcom,sc8280xp-qmp-ufs-phy
-      - qcom,sdm845-qmp-ufs-phy
       - qcom,sdm845-qmp-usb3-phy
       - qcom,sdm845-qmp-usb3-uni-phy
       - qcom,sdx55-qmp-usb3-uni-phy
       - qcom,sdx65-qmp-usb3-uni-phy
-      - qcom,sm6115-qmp-ufs-phy
-      - qcom,sm6350-qmp-ufs-phy
-      - qcom,sm8150-qmp-ufs-phy
       - qcom,sm8150-qmp-usb3-phy
       - qcom,sm8150-qmp-usb3-uni-phy
-      - qcom,sm8250-qmp-ufs-phy
       - qcom,sm8250-qmp-usb3-phy
       - qcom,sm8250-qmp-usb3-uni-phy
-      - qcom,sm8350-qmp-ufs-phy
       - qcom,sm8350-qmp-usb3-phy
       - qcom,sm8350-qmp-usb3-uni-phy
-      - qcom,sm8450-qmp-ufs-phy
       - qcom,sm8450-qmp-usb3-phy
 
   reg:
@@ -202,60 +191,6 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,msm8996-qmp-ufs-phy
-    then:
-      properties:
-        clocks:
-          items:
-            - description: 19.2 MHz ref clock.
-        clock-names:
-          items:
-            - const: ref
-        resets:
-          items:
-            - description: PHY reset in the UFS controller.
-        reset-names:
-          items:
-            - const: ufsphy
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,msm8998-qmp-ufs-phy
-              - qcom,sc8180x-qmp-ufs-phy
-              - qcom,sc8280xp-qmp-ufs-phy
-              - qcom,sdm845-qmp-ufs-phy
-              - qcom,sm6350-qmp-ufs-phy
-              - qcom,sm8150-qmp-ufs-phy
-              - qcom,sm8250-qmp-ufs-phy
-    then:
-      properties:
-        clocks:
-          items:
-            - description: 19.2 MHz ref clock.
-            - description: PHY reference aux clock.
-        clock-names:
-          items:
-            - const: ref
-            - const: ref_aux
-        resets:
-          items:
-            - description: PHY reset in the UFS controller.
-        reset-names:
-          items:
-            - const: ufsphy
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
   - if:
       properties:
         compatible:
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml new file +149 -0

149 lines not on this page · raw message

Signature · 1 line
2.35.1
#68 lore raw

PATCH 30/43 dt-bindings: phy: qcom,qmp-usb: clean up clock constraints

In reply to Johan Hovold

The USB PHY binding uses three or four clocks.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml +2 -2
index 8343e24b669a..2f7043503ca0 100644
@@ -51,11 +51,11 @@ properties:
   ranges: true
 
   clocks:
-    minItems: 1
+    minItems: 3
     maxItems: 4
 
   clock-names:
-    minItems: 1
+    minItems: 3
     maxItems: 4
 
   resets:
Signature · 1 line
2.35.1
#83 lore raw

PATCH 40/43 phy: qcom-qmp-combo: drop pipe clock lane suffix

In reply to Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +6 -2
index b266514ae9ee..7b2eb234cfc2 100644
@@ -2558,8 +2558,12 @@ int qcom_qmp_phy_combo_create(struct device *dev, struct device_node *np, int id
 	 * Otherwise, we initialize pipe clock to NULL for
 	 * all phys that don't need this.
 	 */
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");
+	if (IS_ERR(qphy->pipe_clk) && PTR_ERR(qphy->pipe_clk) != -EPROBE_DEFER) {
+		/* Fall back to the legacy pipe clock name. */
+		snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
+		qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	}
 	if (IS_ERR(qphy->pipe_clk)) {
 		if (cfg->type == PHY_TYPE_USB3) {
 			ret = PTR_ERR(qphy->pipe_clk);
Signature · 1 line
2.35.1
#86 lore raw

PATCH 42/43 phy: qcom-qmp-pcie-msm8996: drop reset lane suffix

In reply to Johan Hovold

The lane reset is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the reset name.

Drop the lane-number suffix from the lane reset name, but continue supporting the legacy name as a fall back.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +6 -3
index b8481dab54db..9ddb42fa5f7a 100644
@@ -915,9 +915,12 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,
 				     "failed to get lane%d pipe clock\n", id);
 	}
 
-	/* Get lane reset, if any */
-	snprintf(prop_name, sizeof(prop_name), "lane%d", id);
-	qphy->lane_rst = of_reset_control_get_exclusive(np, prop_name);
+	qphy->lane_rst = of_reset_control_get_exclusive(np, "lane");
+	if (IS_ERR(qphy->lane_rst) && PTR_ERR(qphy->lane_rst) != -EPROBE_DEFER) {
+		/* Fall back to the legacy lane reset name. */
+		snprintf(prop_name, sizeof(prop_name), "lane%d", id);
+		qphy->lane_rst = of_reset_control_get_exclusive(np, prop_name);
+	}
 	if (IS_ERR(qphy->lane_rst)) {
 		dev_err(dev, "failed to get lane%d reset\n", id);
 		return PTR_ERR(qphy->lane_rst);
Signature · 1 line
2.35.1
#33 lore raw

PATCH 13/43 dt-bindings: phy: qcom,qmp-pcie: clean up register constraints

In reply to Johan Hovold

Only some USB and combo PHYs have a second dp_com control block.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml | 2 --
 1 file changed, 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +0 -2
index d1d4a468acc3..7cdc1cce06cf 100644
@@ -31,10 +31,8 @@ properties:
       - qcom,sm8450-qmp-gen4x2-pcie-phy
 
   reg:
-    minItems: 1
     items:
       - description: Address and length of PHY's common serdes block.
-      - description: Address and length of PHY's DP_COM control block.
 
   "#address-cells":
     enum: [ 1, 2 ]
Signature · 1 line
2.35.1
#3 lore raw

PATCH 2/43 dt-bindings: phy: qcom,qmp: sort compatible strings

In reply to Johan Hovold

Sort the compatible strings alphabetically to make it easier to look up entries and add new ones.

---
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml        | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +6 -6
index f74b3bf34a23..38e0ade01687 100644
@@ -38,15 +38,18 @@ properties:
       - qcom,sdm845-qmp-ufs-phy
       - qcom,sdm845-qmp-usb3-phy
       - qcom,sdm845-qmp-usb3-uni-phy
+      - qcom,sdx55-qmp-pcie-phy
+      - qcom,sdx55-qmp-usb3-uni-phy
+      - qcom,sdx65-qmp-usb3-uni-phy
       - qcom,sm6115-qmp-ufs-phy
       - qcom,sm6350-qmp-ufs-phy
       - qcom,sm8150-qmp-ufs-phy
       - qcom,sm8150-qmp-usb3-phy
       - qcom,sm8150-qmp-usb3-uni-phy
-      - qcom,sm8250-qmp-ufs-phy
       - qcom,sm8250-qmp-gen3x1-pcie-phy
       - qcom,sm8250-qmp-gen3x2-pcie-phy
       - qcom,sm8250-qmp-modem-pcie-phy
+      - qcom,sm8250-qmp-ufs-phy
       - qcom,sm8250-qmp-usb3-phy
       - qcom,sm8250-qmp-usb3-uni-phy
       - qcom,sm8350-qmp-ufs-phy
@@ -56,9 +59,6 @@ properties:
       - qcom,sm8450-qmp-gen4x2-pcie-phy
       - qcom,sm8450-qmp-ufs-phy
       - qcom,sm8450-qmp-usb3-phy
-      - qcom,sdx55-qmp-pcie-phy
-      - qcom,sdx55-qmp-usb3-uni-phy
-      - qcom,sdx65-qmp-usb3-uni-phy
 
   reg:
     minItems: 1
@@ -277,12 +277,12 @@ allOf:
           contains:
             enum:
               - qcom,msm8998-qmp-ufs-phy
+              - qcom,sc8180x-qmp-ufs-phy
+              - qcom,sc8280xp-qmp-ufs-phy
               - qcom,sdm845-qmp-ufs-phy
               - qcom,sm6350-qmp-ufs-phy
               - qcom,sm8150-qmp-ufs-phy
               - qcom,sm8250-qmp-ufs-phy
-              - qcom,sc8180x-qmp-ufs-phy
-              - qcom,sc8280xp-qmp-ufs-phy
     then:
       properties:
         clocks:
Signature · 1 line
2.35.1
#21 lore raw

PATCH 9/43 dt-bindings: phy: qcom,msm8996-qmp-pcie: add example node

In reply to Johan Hovold

Add an example node based on a cleaned up version of msm8996.dtsi.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +72 -0
index 8aadb25686b2..45f7bb7a632a 100644
@@ -130,3 +130,75 @@ required:
   - vdda-pll-supply
 
 additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-msm8996.h>
+    pcie_phy: phy-wrapper@34000 {
+        compatible = "qcom,msm8996-qmp-pcie-phy";
+        reg = <0x34000 0x488>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x34000 0x4000>;
+
+        clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
+                 <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>,
+                 <&gcc GCC_PCIE_CLKREF_CLK>;
+        clock-names = "aux", "cfg_ahb", "ref";
+
+        resets = <&gcc GCC_PCIE_PHY_BCR>,
+                 <&gcc GCC_PCIE_PHY_COM_BCR>,
+                 <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>;
+        reset-names = "phy", "common", "cfg";
+
+        vdda-phy-supply = <&vreg_l28a_0p925>;
+        vdda-pll-supply = <&vreg_l12a_1p8>;
+
+        pciephy_0: phy@1000 {
+            reg = <0x1000 0x130>,
+                  <0x1200 0x200>,
+                  <0x1400 0x1dc>;
+
+            clocks = <&gcc GCC_PCIE_0_PIPE_CLK>;
+            clock-names = "pipe0";
+            resets = <&gcc GCC_PCIE_0_PHY_BCR>;
+            reset-names = "lane0";
+
+            #clock-cells = <0>;
+            clock-output-names = "pcie_0_pipe_clk_src";
+
+            #phy-cells = <0>;
+        };
+
+        pciephy_1: phy@2000 {
+            reg = <0x2000 0x130>,
+                  <0x2200 0x200>,
+                  <0x2400 0x1dc>;
+
+            clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
+            clock-names = "pipe1";
+            resets = <&gcc GCC_PCIE_1_PHY_BCR>;
+            reset-names = "lane1";
+
+            #clock-cells = <0>;
+            clock-output-names = "pcie_1_pipe_clk_src";
+
+            #phy-cells = <0>;
+        };
+
+        pciephy_2: phy@3000 {
+            reg = <0x3000 0x130>,
+                  <0x3200 0x200>,
+                  <0x3400 0x1dc>;
+
+            clocks = <&gcc GCC_PCIE_2_PIPE_CLK>;
+            clock-names = "pipe2";
+            resets = <&gcc GCC_PCIE_2_PHY_BCR>;
+            reset-names = "lane2";
+
+            #clock-cells = <0>;
+            clock-output-names = "pcie_2_pipe_clk_src";
+
+            #phy-cells = <0>;
+        };
+    };
Signature · 1 line
2.35.1
#85 lore raw

PATCH 41/43 phy: qcom-qmp-pcie-msm8996: drop pipe clock lane suffix

In reply to Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +6 -2
index 812d14afb5ec..b8481dab54db 100644
@@ -904,8 +904,12 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,
 	if (!qphy->pcs_misc)
 		dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
 
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");
+	if (IS_ERR(qphy->pipe_clk) && PTR_ERR(qphy->pipe_clk) != -EPROBE_DEFER) {
+		/* Fall back to the legacy pipe clock name. */
+		snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
+		qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	}
 	if (IS_ERR(qphy->pipe_clk)) {
 		return dev_err_probe(dev, PTR_ERR(qphy->pipe_clk),
 				     "failed to get lane%d pipe clock\n", id);
Signature · 1 line
2.35.1
#81 lore raw

PATCH 39/43 phy: qcom-qmp-combo: drop unused lane reset

In reply to Johan Hovold

Drop the unused lane reset pointer which isn't used by any combo PHY.

---
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 2 --
 1 file changed, 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +0 -2
index c18cd3b93c30..b266514ae9ee 100644
@@ -818,7 +818,6 @@ struct qmp_phy_combo_cfg {
  * @pipe_clk: pipe clock
  * @index: lane index
  * @qmp: QMP phy to which this lane belongs
- * @lane_rst: lane's reset controller
  * @mode: current PHY mode
  * @dp_aux_cfg: Display port aux config
  * @dp_opts: Display port optional config
@@ -837,7 +836,6 @@ struct qmp_phy {
 	struct clk *pipe_clk;
 	unsigned int index;
 	struct qcom_qmp *qmp;
-	struct reset_control *lane_rst;
 	enum phy_mode mode;
 	unsigned int dp_aux_cfg;
 	struct phy_configure_opts_dp dp_opts;
Signature · 1 line
2.35.1
#74 lore raw

PATCH 36/43 dt-bindings: phy: qcom,qmp-usb3-dp: fix bogus clock-cells property

In reply to Johan Hovold

The QMP PHY wrapper node is not a clock provider so drop the bogus '#clock-cells' property that was added when converting to DT schema.

Fixes 59351049ad15 ("dt-bindings: phy: qcom,qmp-usb3-dp: Add dt bindings for USB3 DP PHY")
---
 .../devicetree/bindings/phy/qcom,qmp-usb3-dp-phy.yaml        | 5 -----
 1 file changed, 5 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-usb3-dp-phy.yaml +0 -5
index 60dc27834e1d..86d64c61bca3 100644
@@ -30,9 +30,6 @@ properties:
       - const: dp_com
       - const: dp
 
-  "#clock-cells":
-    enum: [ 1, 2 ]
-
   "#address-cells":
     enum: [ 1, 2 ]
 
@@ -147,7 +144,6 @@ patternProperties:
 required:
   - compatible
   - reg
-  - "#clock-cells"
   - "#address-cells"
   - "#size-cells"
   - ranges
@@ -169,7 +165,6 @@ examples:
               <0x088e8000 0x10>,
               <0x088ea000 0x40>;
         reg-names = "usb", "dp_com", "dp";
-        #clock-cells = <1>;
         #address-cells = <1>;
         #size-cells = <1>;
         ranges = <0x0 0x088e9000 0x2000>;
Signature · 1 line
2.35.1
#28 lore raw

PATCH 11/43 dt-bindings: phy: qcom,msm8996-qmp-pcie: deprecate reset names

In reply to Johan Hovold

Drop the unnecessary "lane" suffix from the PHY reset names and mark the old names as deprecated.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +12 -8
index 7931b1fd1476..0bea8270b37e 100644
@@ -94,11 +94,15 @@ patternProperties:
           - description: PHY (lane) reset
 
       reset-names:
-        items:
-          - enum:
-              - lane0
-              - lane1
-              - lane2
+        oneOf:
+          - items:
+              - const: lane
+          - items:
+              - enum:
+                  - lane0
+                  - lane1
+                  - lane2
+            deprecated: true
 
       "#clock-cells":
         const: 0
@@ -166,7 +170,7 @@ examples:
             clocks = <&gcc GCC_PCIE_0_PIPE_CLK>;
             clock-names = "pipe";
             resets = <&gcc GCC_PCIE_0_PHY_BCR>;
-            reset-names = "lane0";
+            reset-names = "lane";
 
             #clock-cells = <0>;
             clock-output-names = "pcie_0_pipe_clk_src";
@@ -182,7 +186,7 @@ examples:
             clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
             clock-names = "pipe";
             resets = <&gcc GCC_PCIE_1_PHY_BCR>;
-            reset-names = "lane1";
+            reset-names = "lane";
 
             #clock-cells = <0>;
             clock-output-names = "pcie_1_pipe_clk_src";
@@ -198,7 +202,7 @@ examples:
             clocks = <&gcc GCC_PCIE_2_PIPE_CLK>;
             clock-names = "pipe";
             resets = <&gcc GCC_PCIE_2_PHY_BCR>;
-            reset-names = "lane2";
+            reset-names = "lane";
 
             #clock-cells = <0>;
             clock-output-names = "pcie_2_pipe_clk_src";
Signature · 1 line
2.35.1
#35 lore raw

PATCH 14/43 dt-bindings: phy: qcom,qmp-pcie: clean up clock constraints

In reply to Johan Hovold

The PCIe PHY binding requires two, three or four clocks.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +2 -2
index 7cdc1cce06cf..0486b2b48d72 100644
@@ -43,11 +43,11 @@ properties:
   ranges: true
 
   clocks:
-    minItems: 1
+    minItems: 2
     maxItems: 4
 
   clock-names:
-    minItems: 1
+    minItems: 2
     maxItems: 4
 
   resets:
Signature · 1 line
2.35.1
#56 lore raw

PATCH 19/43 dt-bindings: phy: qcom,qmp-pcie: deprecate PIPE clock name

In reply to Johan Hovold

Drop the bogus "lane" suffix from the PHY PIPE clock name and mark the old name as deprecated.

---
 .../devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml     | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +7 -3
index 3fc08af41144..32f872de8f4b 100644
@@ -80,8 +80,12 @@ patternProperties:
           - description: PIPE clock
 
       clock-names:
-        items:
-          - const: pipe0
+        oneOf:
+          - items:
+              - const: pipe
+          - items:
+              - const: pipe0
+            deprecated: true
 
       "#clock-cells":
         const: 0
@@ -295,7 +299,7 @@ examples:
                   <0xe00 0xf4>;
 
             clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
-            clock-names = "pipe0";
+            clock-names = "pipe";
 
             #clock-cells = <0>;
             clock-output-names = "pcie_1_pipe_clk";
Signature · 1 line
2.35.1
#88 lore raw

PATCH 43/43 phy: qcom-qmp-usb: drop pipe clock lane suffix

In reply to Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +6 -2
index 994a8232be7b..dfe7294a589f 100644
@@ -2665,8 +2665,12 @@ int qcom_qmp_phy_usb_create(struct device *dev, struct device_node *np, int id,
 	if (!qphy->pcs_misc)
 		dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
 
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");
+	if (IS_ERR(qphy->pipe_clk) && PTR_ERR(qphy->pipe_clk) != -EPROBE_DEFER) {
+		/* Fall back to the legacy pipe clock name. */
+		snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
+		qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	}
 	if (IS_ERR(qphy->pipe_clk)) {
 		return dev_err_probe(dev, PTR_ERR(qphy->pipe_clk),
 				     "failed to get lane%d pipe clock\n", id);
Signature · 1 line
2.35.1
#66 lore raw

PATCH 28/43 dt-bindings: phy: qcom,qmp-ufs: add example node

In reply to Johan Hovold

Add an example node based on a cleaned up version of sc8280xp.dtsi.

---
 .../bindings/phy/qcom,qmp-ufs-phy.yaml        | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml +30 -0
index 9124b60eb9a7..24272cdde9a1 100644
@@ -217,3 +217,33 @@ allOf:
             properties:
               reg:
                 minItems: 4
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-sc8280xp.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    phy-wrapper@1d87000 {
+        compatible = "qcom,sc8280xp-qmp-ufs-phy";
+        reg = <0x01d87000 0xe10>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x01d87000 0x1000>;
+
+        clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GCC_UFS_PHY_PHY_AUX_CLK>;
+        clock-names = "ref", "ref_aux";
+
+        resets = <&ufs_mem_hc 0>;
+        reset-names = "ufsphy";
+
+        vdda-phy-supply = <&vreg_l6b>;
+        vdda-pll-supply = <&vreg_l3b>;
+
+        phy@400 {
+            reg = <0x400 0x108>,
+                  <0x600 0x1e0>,
+                  <0xc00 0x1dc>,
+                  <0x800 0x108>,
+                  <0xa00 0x1e0>;
+            #phy-cells = <0>;
+        };
+    };
Signature · 1 line
2.35.1
#69 lore raw

PATCH 31/43 dt-bindings: phy: qcom,qmp-usb: clean up supplies

In reply to Johan Hovold

The USB PHY binding requires the vdda-phy and vdd-pll supplies.

---
 .../bindings/phy/qcom,qmp-usb-phy.yaml        | 20 ++-----------------
 1 file changed, 2 insertions(+), 18 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml +2 -18
index 2f7043503ca0..3404ad7fc6db 100644
@@ -95,6 +95,8 @@ required:
   - clock-names
   - resets
   - reset-names
+  - vdda-phy-supply
+  - vdda-pll-supply
 
 additionalProperties: false
 
@@ -127,9 +129,6 @@ allOf:
           items:
             - const: phy
             - const: common
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
 
   - if:
       properties:
@@ -158,9 +157,6 @@ allOf:
           items:
             - const: phy
             - const: common
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
 
   - if:
       properties:
@@ -190,9 +186,6 @@ allOf:
           items:
             - const: phy
             - const: common
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
 
   - if:
       properties:
@@ -225,9 +218,6 @@ allOf:
           items:
             - const: phy
             - const: common
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
 
   - if:
       properties:
@@ -256,9 +246,6 @@ allOf:
           items:
             - const: phy
             - const: common
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
 
   - if:
       properties:
@@ -286,9 +273,6 @@ allOf:
           items:
             - const: phy_phy
             - const: phy
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
 
 examples:
   - |
Signature · 1 line
2.35.1
#76 lore raw

PATCH 38/43 phy: qcom-qmp-pcie: drop pipe clock lane suffix

In reply to Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +6 -2
index 385ea3d8de08..254ad25591b9 100644
@@ -2210,8 +2210,12 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
 	if (!qphy->pcs_misc)
 		dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
 
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");
+	if (IS_ERR(qphy->pipe_clk) && PTR_ERR(qphy->pipe_clk) != -EPROBE_DEFER) {
+		/* Fall back to the legacy pipe clock name. */
+		snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
+		qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	}
 	if (IS_ERR(qphy->pipe_clk)) {
 		return dev_err_probe(dev, PTR_ERR(qphy->pipe_clk),
 				     "failed to get lane%d pipe clock\n", id);
Signature · 1 line
2.35.1
#54 lore raw

PATCH 18/43 dt-bindings: phy: qcom,qmp-pcie: add example node

In reply to Johan Hovold

Add an example node based on a cleaned up version of sm8250.dtsi.

---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +41 -0
index 5a1ebf874559..3fc08af41144 100644
@@ -262,3 +262,44 @@ allOf:
             properties:
               reg:
                 minItems: 4
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-sm8250.h>
+    phy-wrapper@1c0e000 {
+        compatible = "qcom,sm8250-qmp-gen3x2-pcie-phy";
+        reg = <0x01c0e000 0x1c0>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x01c0e000 0x1000>;
+
+        clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
+                 <&gcc GCC_PCIE_1_CFG_AHB_CLK>,
+                 <&gcc GCC_PCIE_WIGIG_CLKREF_EN>,
+                 <&gcc GCC_PCIE1_PHY_REFGEN_CLK>;
+
+        clock-names = "aux", "cfg_ahb", "ref", "refgen";
+
+        resets = <&gcc GCC_PCIE_1_PHY_BCR>;
+        reset-names = "phy";
+
+        vdda-phy-supply = <&vreg_l10c_0p88>;
+        vdda-pll-supply = <&vreg_l6b_1p2>;
+
+        phy@200 {
+            reg = <0x200 0x170>,
+                  <0x400 0x200>,
+                  <0xa00 0x1f0>,
+                  <0x600 0x170>,
+                  <0x800 0x200>,
+                  <0xe00 0xf4>;
+
+            clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
+            clock-names = "pipe0";
+
+            #clock-cells = <0>;
+            clock-output-names = "pcie_1_pipe_clk";
+
+            #phy-cells = <0>;
+        };
+    };
Signature · 1 line
2.35.1
#64 lore raw

PATCH 26/43 dt-bindings: phy: qcom,qmp-ufs: add missing SM8150 power domain

In reply to Johan Hovold

Add the missing optional power-domains property used by the SM8150 UFS QMP PHY to the binding.

Fixes fe75b0c4a691 ("arm64: dts: qcom: sm8150: Add ufs power-domain entries")
---
 Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml +3 -0
index d04cdb85f005..f1e3d70eb73d 100644
@@ -49,6 +49,9 @@ properties:
     minItems: 1
     maxItems: 3
 
+  power-domains:
+    maxItems: 1
+
   resets:
     items:
       - description: PHY reset in the UFS controller.
Signature · 1 line
2.35.1
#70 lore raw

PATCH 32/43 dt-bindings: phy: qcom,qmp-usb: drop unused vddp-ref-clk supply

In reply to Johan Hovold

Only UFS PHY nodes in mainline have a vddp-ref-clk supply. Drop it from the USB PHY binding.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml | 4 ----
 1 file changed, 4 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-usb-phy.yaml +0 -4
index 3404ad7fc6db..76979aff086f 100644
@@ -74,10 +74,6 @@ properties:
     description:
       Phandle to 1.8V regulator supply to PHY refclk pll block.
 
-  vddp-ref-clk-supply:
-    description:
-      Phandle to a regulator supply to any specific refclk pll block.
-
 patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
Signature · 1 line
2.35.1
Reviewed-by on v1 1/43
#2 lore raw

Re: [PATCH 01/43] dt-bindings: phy: qcom,qmp: fix bogus clock-cells property

In reply to Johan Hovold
Quoted 8 lines · Johan Hovold

The QMP PHY wrapper node is not a clock provider so drop the bogus '#clock-cells' property that was added when converting to DT schema.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml | 5 -----
 1 file changed, 5 deletions(-)

Best regards,
Krzysztof

#12 lore raw

Re: [PATCH 06/43] dt-bindings: phy: qcom,qmp: split out msm8996-qmp-pcie-phy

In reply to Johan Hovold
Quoted 17 lines · Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the odd-bird msm8996-qmp-pcie-phy which is the only QMP PHY that uses separate "per-lane" nodes.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 114 ++++++++++++++++++
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml |  32 -----
 2 files changed, 114 insertions(+), 32 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +0 -0
new file mode 100644
index 000000000000..14fd86fd91ec

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 2

Quoted 2 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +2 -0
@@ -0,0 +1,114 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+

No line break

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 6

Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +4 -0
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/phy/qcom,msm8996-qmp-pcie-phy.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"

Drop the quotes from two above.

Quoted 9 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +9 -0
+
+title: Qualcomm QMP PHY controller (MSM8996 PCIe)
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description:
+  QMP PHY controller supports physical layer functionality for a number of
+  controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 25

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +10 -0
+
+properties:
+  compatible:
+    const: qcom,msm8996-qmp-pcie-phy
+
+  reg:
+    minItems: 1
+    items:
+      - description: Address and length of PHY's common serdes block.
+      - description: Address and length of PHY's DP_COM control block.

Are two reg items applicable here?

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 37

Quoted 12 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +12 -0
+
+  "#address-cells":
+    enum: [ 1, 2 ]
+
+  "#size-cells":
+    enum: [ 1, 2 ]
+
+  ranges: true
+
+  clocks:
+    minItems: 1
+    maxItems: 4

Define clocks here, not in allOf:if:then.

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 41

Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +4 -0
+
+  clock-names:
+    minItems: 1
+    maxItems: 4

Ditto

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 45

Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +4 -0
+
+  resets:
+    minItems: 1
+    maxItems: 3

Ditto

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 49

Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +4 -0
+
+  reset-names:
+    minItems: 1
+    maxItems: 3

Ditto

Quoted 55 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +55 -0
+
+  vdda-phy-supply:
+    description:
+      Phandle to a regulator supply to PHY core block.
+
+  vdda-pll-supply:
+    description:
+      Phandle to 1.8V regulator supply to PHY refclk pll block.
+
+  vddp-ref-clk-supply:
+    description:
+      Phandle to a regulator supply to any specific refclk pll block.
+
+patternProperties:
+  "^phy@[0-9a-f]+$":
+    type: object
+    description:
+      Each device node of QMP PHY is required to have as many child nodes as
+      the number of lanes the PHY has.
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,msm8996-qmp-pcie-phy
+    then:
+      properties:
+        clocks:
+          items:
+            - description: PHY aux clock.
+            - description: PHY config clock.
+            - description: 19.2 MHz ref clock.
+        clock-names:
+          items:
+            - const: aux
+            - const: cfg_ahb
+            - const: ref
+        resets:
+          items:
+            - description: Reset of PHY block.

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 114

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +10 -0
+            - description: PHY common block reset.
+            - description: PHY's ahb cfg block reset.
+        reset-names:
+          items:
+            - const: phy
+            - const: common
+            - const: cfg
+      required:
+        - vdda-phy-supply
+        - vdda-pll-supply

How about an example?

Best regards,
Krzysztof

Reviewed-by on v1 8/43
#20 lore raw

Re: [PATCH 08/43] dt-bindings: phy: qcom,msm8996-qmp-pcie: add missing child node schema

In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

Add the missing the description of the PHY-provider child nodes which were ignored when converting to DT schema.

Also fix up the description that claimed that one child node per lane (rather than PHY) was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")

---

Best regards,
Krzysztof

#29 lore raw

Re: [PATCH 11/43] dt-bindings: phy: qcom,msm8996-qmp-pcie: deprecate reset names

In reply to Johan Hovold
Quoted 21 lines · Johan Hovold

Drop the unnecessary "lane" suffix from the PHY reset names and mark the old names as deprecated.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +0 -5
index 7931b1fd1476..0bea8270b37e 100644
@@ -94,11 +94,15 @@ patternProperties:
           - description: PHY (lane) reset
 
       reset-names:
-        items:
-          - enum:
-              - lane0
-              - lane1
-              - lane2

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml patternProperties: · line 106

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +9 -0
+        oneOf:
+          - items:
+              - const: lane
+          - items:
+              - enum:
+                  - lane0
+                  - lane1
+                  - lane2
+            deprecated: true
 

How about just dropping reset-names entirely? Marking entire field deprecated and removing from DTS? The same in the previous patch.

Usually one-item xxx-names do not bring any useful information.

Best regards,
Krzysztof

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#32 lore raw

Re: [PATCH 12/43] dt-bindings: phy: qcom,qmp: split out PCIe PHY binding

In reply to Johan Hovold
Quoted 16 lines · Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the PCIe PHY binding in a separate file.

---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 188 ++++++++++++++++++
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml |  75 -------
 2 files changed, 188 insertions(+), 75 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml new file +0 -0
new file mode 100644
index 000000000000..d1d4a468acc3

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml line 2

Quoted 2 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml new file +2 -0
@@ -0,0 +1,188 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+

No new line.

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml line 6

Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml new file +4 -0
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/phy/qcom,qmp-pcie-phy.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"

Drop quotes.

Quoted 21 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml new file +21 -0
+
+title: Qualcomm QMP PHY controller (PCIe)
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description:
+  QMP PHY controller supports physical layer functionality for a number of
+  controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.
+
+properties:
+  compatible:
+    enum:
+      - qcom,ipq6018-qmp-pcie-phy
+      - qcom,ipq8074-qmp-pcie-phy
+      - qcom,msm8998-qmp-pcie-phy
+      - qcom,sc8180x-qmp-pcie-phy
+      - qcom,sdm845-qhp-pcie-phy
+      - qcom,sdm845-qmp-pcie-phy
+      - qcom,sdx55-qmp-pcie-phy
+      - qcom,sm8250-qmp-gen3x1-pcie-phy

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml line 37

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml new file +10 -0
+      - qcom,sm8250-qmp-gen3x2-pcie-phy
+      - qcom,sm8250-qmp-modem-pcie-phy
+      - qcom,sm8450-qmp-gen3x1-pcie-phy
+      - qcom,sm8450-qmp-gen4x2-pcie-phy
+
+  reg:
+    minItems: 1
+    items:
+      - description: Address and length of PHY's common serdes block.
+      - description: Address and length of PHY's DP_COM control block.

All my msm8996-qmp-pcie comments apply.

Best regards,
Krzysztof

#34 lore raw

Re: [PATCH 13/43] dt-bindings: phy: qcom,qmp-pcie: clean up register constraints

In reply to Johan Hovold
Quoted 6 lines · Johan Hovold

Only some USB and combo PHYs have a second dp_com control block.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml | 2 --
 1 file changed, 2 deletions(-)

Squash it. This patch does not make any sense on its own.

Best regards,
Krzysztof

#36 lore raw

Re: [PATCH 14/43] dt-bindings: phy: qcom,qmp-pcie: clean up clock constraints

In reply to Johan Hovold
Quoted 7 lines · Johan Hovold

The PCIe PHY binding requires two, three or four clocks.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Squash it.

Best regards,
Krzysztof

#38 lore raw

Re: [PATCH 15/43] dt-bindings: phy: qcom,qmp-pcie: clean up reset constraints

In reply to Johan Hovold
Quoted 12 lines · Johan Hovold

The PCIe PHY binding requires one or two resets.

---
 Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +0 -0
index 0486b2b48d72..557cccc8f4dd 100644

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml properties: · line 55

Quoted 5 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +1 -1
@@ -52,11 +52,11 @@ properties:
 
   resets:
     minItems: 1
-    maxItems: 3
+    maxItems: 2

Squash it.

Best regards,
Krzysztof

#40 lore raw

Re: [PATCH 16/43] dt-bindings: phy: qcom,qmp-pcie: drop unused vddp-ref-clk supply

In reply to Johan Hovold
Quoted 3 lines · Johan Hovold

Only UFS PHY nodes in mainline have a vddp-ref-clk supply. Drop it from the PCIe PHY binding.

That's not really good reason. Either the hardware uses ref-clk supply or not. Now it looks like you copied everything from common schema and clean things up. That's not how it should be organize.

It's okay to copy existing bindings which are applicable and then in separate patch deprecate things or remove pieces which are not correct. But all this in assumption that the first copy already selected only applicable parts.

Best regards,
Krzysztof

#47 lore raw

Re: [PATCH 17/43] dt-bindings: phy: qcom,qmp-pcie: add missing child node schema

In reply to Johan Hovold
Quoted 85 lines · Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 88 ++++++++++++++++++-
 1 file changed, 85 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +55 -3
index ff1577f68a00..5a1ebf874559 100644
@@ -69,9 +69,37 @@ properties:
 patternProperties:
   "^phy@[0-9a-f]+$":
     type: object
-    description:
-      Each device node of QMP PHY is required to have as many child nodes as
-      the number of lanes the PHY has.
+    description: Single PHY-provider child node.
+    properties:
+      reg:
+        minItems: 3
+        maxItems: 6
+
+      clocks:
+        items:
+          - description: PIPE clock
+
+      clock-names:
+        items:
+          - const: pipe0
+
+      "#clock-cells":
+        const: 0
+
+      clock-output-names: true
+
+      "#phy-cells":
+        const: 0
+
+    required:
+      - reg
+      - clocks
+      - clock-names
+      - "#clock-cells"
+      - clock-output-names
+      - "#phy-cells"
+
+    additionalProperties: false
 
 required:
   - compatible
@@ -180,3 +208,57 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sm8250-qmp-gen3x2-pcie-phy
+              - qcom,sm8250-qmp-modem-pcie-phy
+              - qcom,sm8450-qmp-gen4x2-pcie-phy
+    then:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              items:
+                - description: TX lane 1
+                - description: RX lane 1
+                - description: PCS
+                - description: TX lane 2
+                - description: RX lane 2
+                - description: PCS_MISC
+    else:
+      patternProperties:
+        "^phy@[0-9a-f]+$":

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml allOf: · line 244

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +10 -0
+          properties:
+            reg:
+              minItems: 3
+              maxItems: 4
+              items:
+                - description: TX
+                - description: RX
+                - description: PCS
+                - description: PCS_MISC
+      if:

Do not include if within other if. Just split the entire section to its own if:.

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +10 -0
+        properties:
+          compatible:
+            contains:
+              enum:
+                - qcom,ipq6018-qmp-pcie-phy
+                - qcom,ipq8074-qmp-pcie-phy
+                - qcom,msm8998-qmp-pcie-phy
+                - qcom,sdm845-qhp-pcie-phy
+      then:
+        patternProperties:

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml allOf: · line 264

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +10 -0
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                maxItems: 3
+      else:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                minItems: 4

Best regards,
Krzysztof

#55 lore raw

Re: [PATCH 18/43] dt-bindings: phy: qcom,qmp-pcie: add example node

In reply to Johan Hovold
Quoted 7 lines · Johan Hovold

Add an example node based on a cleaned up version of sm8250.dtsi.

---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)

Should be squashed.

Best regards,
Krzysztof

#58 lore raw

Re: [PATCH 20/43] dt-bindings: phy: qcom,qmp: split out UFS PHY binding

In reply to Johan Hovold
Quoted 114 lines · Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the UFS PHY binding in a separate file.

---
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml |  65 --------
 .../bindings/phy/qcom,qmp-ufs-phy.yaml        | 149 ++++++++++++++++++
 2 files changed, 149 insertions(+), 65 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml +0 -65
index f416a1a53a3f..04c24f8e4526 100644
@@ -19,32 +19,21 @@ properties:
     enum:
       - qcom,ipq6018-qmp-usb3-phy
       - qcom,ipq8074-qmp-usb3-phy
-      - qcom,msm8996-qmp-ufs-phy
       - qcom,msm8996-qmp-usb3-phy
-      - qcom,msm8998-qmp-ufs-phy
       - qcom,msm8998-qmp-usb3-phy
       - qcom,qcm2290-qmp-usb3-phy
       - qcom,sc7180-qmp-usb3-phy
-      - qcom,sc8180x-qmp-ufs-phy
       - qcom,sc8180x-qmp-usb3-phy
-      - qcom,sc8280xp-qmp-ufs-phy
-      - qcom,sdm845-qmp-ufs-phy
       - qcom,sdm845-qmp-usb3-phy
       - qcom,sdm845-qmp-usb3-uni-phy
       - qcom,sdx55-qmp-usb3-uni-phy
       - qcom,sdx65-qmp-usb3-uni-phy
-      - qcom,sm6115-qmp-ufs-phy
-      - qcom,sm6350-qmp-ufs-phy
-      - qcom,sm8150-qmp-ufs-phy
       - qcom,sm8150-qmp-usb3-phy
       - qcom,sm8150-qmp-usb3-uni-phy
-      - qcom,sm8250-qmp-ufs-phy
       - qcom,sm8250-qmp-usb3-phy
       - qcom,sm8250-qmp-usb3-uni-phy
-      - qcom,sm8350-qmp-ufs-phy
       - qcom,sm8350-qmp-usb3-phy
       - qcom,sm8350-qmp-usb3-uni-phy
-      - qcom,sm8450-qmp-ufs-phy
       - qcom,sm8450-qmp-usb3-phy
 
   reg:
@@ -202,60 +191,6 @@ allOf:
       required:
         - vdda-phy-supply
         - vdda-pll-supply
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,msm8996-qmp-ufs-phy
-    then:
-      properties:
-        clocks:
-          items:
-            - description: 19.2 MHz ref clock.
-        clock-names:
-          items:
-            - const: ref
-        resets:
-          items:
-            - description: PHY reset in the UFS controller.
-        reset-names:
-          items:
-            - const: ufsphy
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,msm8998-qmp-ufs-phy
-              - qcom,sc8180x-qmp-ufs-phy
-              - qcom,sc8280xp-qmp-ufs-phy
-              - qcom,sdm845-qmp-ufs-phy
-              - qcom,sm6350-qmp-ufs-phy
-              - qcom,sm8150-qmp-ufs-phy
-              - qcom,sm8250-qmp-ufs-phy
-    then:
-      properties:
-        clocks:
-          items:
-            - description: 19.2 MHz ref clock.
-            - description: PHY reference aux clock.
-        clock-names:
-          items:
-            - const: ref
-            - const: ref_aux
-        resets:
-          items:
-            - description: PHY reset in the UFS controller.
-        reset-names:
-          items:
-            - const: ufsphy
-      required:
-        - vdda-phy-supply
-        - vdda-pll-supply
   - if:
       properties:
         compatible:
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml new file +0 -0
new file mode 100644
index 000000000000..4471f1b4fb7a

Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/phy/qcom,qmp-ufs-phy.yaml new file +7 -0
@@ -0,0 +1,149 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/phy/qcom,qmp-ufs-phy.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+

All previous comments apply.

Best regards,
Krzysztof

#77 lore raw

Re: [PATCH 38/43] phy: qcom-qmp-pcie: drop pipe clock lane suffix

In reply to Johan Hovold
Quoted 16 lines · Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -0
index 385ea3d8de08..254ad25591b9 100644

drivers/phy/qualcomm/phy-qcom-qmp-pcie.c int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id, · line 2213

Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -2
@@ -2210,8 +2210,12 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
 	if (!qphy->pcs_misc)
 		dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
 
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");

Just get first clock and no need for handling any deprecation.

Best regards,
Krzysztof

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#13 lore raw

Re: [PATCH 06/43] dt-bindings: phy: qcom,qmp: split out msm8996-qmp-pcie-phy

In reply to Krzysztof Kozlowski
Quoted 23 lines · Krzysztof Kozlowski
Quoted 17 lines · Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the odd-bird msm8996-qmp-pcie-phy which is the only QMP PHY that uses separate "per-lane" nodes.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 114 ++++++++++++++++++
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml |  32 -----
 2 files changed, 114 insertions(+), 32 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +0 -0
new file mode 100644
index 000000000000..14fd86fd91ec

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 2

Quoted 2 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +2 -0
@@ -0,0 +1,114 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+

No line break

Quoted 6 lines

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 6

Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +4 -0
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/phy/qcom,msm8996-qmp-pcie-phy.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"

Drop the quotes from two above.

This comes from the current binding. I can clean that one up first.

Quoted 13 lines
Quoted 13 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +13 -0
+
+title: Qualcomm QMP PHY controller (MSM8996 PCIe)
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description:
+  QMP PHY controller supports physical layer functionality for a number of
+  controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.
+
+properties:
+  compatible:
+    const: qcom,msm8996-qmp-pcie-phy
Quoted 8 lines

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 25

Quoted 6 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +6 -0
+
+  reg:
+    minItems: 1
+    items:
+      - description: Address and length of PHY's common serdes block.
+      - description: Address and length of PHY's DP_COM control block.

Are two reg items applicable here?

No, but see below.

Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +6 -0
+
+  "#address-cells":
+    enum: [ 1, 2 ]
+
+  "#size-cells":
+    enum: [ 1, 2 ]
Quoted 8 lines

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 37

Quoted 6 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +6 -0
+
+  ranges: true
+
+  clocks:
+    minItems: 1
+    maxItems: 4

Define clocks here, not in allOf:if:then.

To remain sane, and to help reviewers, I decided not to do changes to the binding while splitting it up which would only make them harder to review.

Hence the split followed by cleanup/tightening of constraints.

Quoted 1 line

How about an example?

That's also a new addition to the binding and goes in a later separate patch.

Johan

#84 lore raw

Re: [PATCH 40/43] phy: qcom-qmp-combo: drop pipe clock lane suffix

In reply to Johan Hovold
Quoted 16 lines · Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +0 -0
index b266514ae9ee..7b2eb234cfc2 100644

drivers/phy/qualcomm/phy-qcom-qmp-combo.c int qcom_qmp_phy_combo_create(struct device *dev, struct device_node *np, int id · line 2561

Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +1 -2
@@ -2558,8 +2558,12 @@ int qcom_qmp_phy_combo_create(struct device *dev, struct device_node *np, int id
 	 * Otherwise, we initialize pipe clock to NULL for
 	 * all phys that don't need this.
 	 */
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");

Just grab first clock.

Best regards,
Krzysztof

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#17 lore raw

Re: [PATCH 07/43] dt-bindings: phy: qcom,msm8996-qmp-pcie: clean up constraints

In reply to Krzysztof Kozlowski
Quoted 7 lines · Krzysztof Kozlowski
Quoted 3 lines · Johan Hovold

Drop the compatible conditional and tighten the property constraints.

Squash it with previous patch. Does not make sense to add new file and a patch later change it.

I beg to differ, for the reasons I just spelled out in my previous reply.

Johan

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#87 lore raw

Re: [PATCH 42/43] phy: qcom-qmp-pcie-msm8996: drop reset lane suffix

In reply to Johan Hovold
Quoted 16 lines · Johan Hovold

The lane reset is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the reset name.

Drop the lane-number suffix from the lane reset name, but continue supporting the legacy name as a fall back.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0 -0
index b8481dab54db..9ddb42fa5f7a 100644

drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np, · line 918

Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +1 -3
@@ -915,9 +915,12 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,
 				     "failed to get lane%d pipe clock\n", id);
 	}
 
-	/* Get lane reset, if any */
-	snprintf(prop_name, sizeof(prop_name), "lane%d", id);
-	qphy->lane_rst = of_reset_control_get_exclusive(np, prop_name);
+	qphy->lane_rst = of_reset_control_get_exclusive(np, "lane");

As well, just grab first entry and ABI is kept stable.

Best regards,
Krzysztof

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#23 lore raw

Re: [PATCH 09/43] dt-bindings: phy: qcom,msm8996-qmp-pcie: add example node

In reply to Krzysztof Kozlowski
Quoted 6 lines · Krzysztof Kozlowski
Quoted 3 lines · Johan Hovold

Add an example node based on a cleaned up version of msm8996.dtsi.

Squash it, please.

Why? It's a new addition to the schema.

Johan

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#14 lore raw

Re: [PATCH 06/43] dt-bindings: phy: qcom,qmp: split out msm8996-qmp-pcie-phy

In reply to Johan Hovold
Quoted 24 lines · Johan Hovold
Quoted 23 lines · Krzysztof Kozlowski
Quoted 17 lines · Johan Hovold

The QMP PHY DT schema is getting unwieldy. Break out the odd-bird msm8996-qmp-pcie-phy which is the only QMP PHY that uses separate "per-lane" nodes.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 114 ++++++++++++++++++
 .../devicetree/bindings/phy/qcom,qmp-phy.yaml |  32 -----
 2 files changed, 114 insertions(+), 32 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +0 -0
new file mode 100644
index 000000000000..14fd86fd91ec

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 2

Quoted 2 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +2 -0
@@ -0,0 +1,114 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+

No line break

Quoted 8 lines
Quoted 6 lines

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 6

Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +4 -0
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/phy/qcom,msm8996-qmp-pcie-phy.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"

Drop the quotes from two above.

This comes from the current binding. I can clean that one up first.

You now selectively copy pieces from old binding into new one. Copy while correcting obvious issues.

Quoted 40 lines
Quoted 14 lines
Quoted 14 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +13 -0
+
+title: Qualcomm QMP PHY controller (MSM8996 PCIe)
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description:
+  QMP PHY controller supports physical layer functionality for a number of
+  controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.
+
+properties:
+  compatible:
+    const: qcom,msm8996-qmp-pcie-phy
Quoted 8 lines

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 25

Quoted 6 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +6 -0
+
+  reg:
+    minItems: 1
+    items:
+      - description: Address and length of PHY's common serdes block.
+      - description: Address and length of PHY's DP_COM control block.

Are two reg items applicable here?

No, but see below.

Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +6 -0
+
+  "#address-cells":
+    enum: [ 1, 2 ]
+
+  "#size-cells":
+    enum: [ 1, 2 ]
Quoted 8 lines

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml line 37

Quoted 6 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml new file +6 -0
+
+  ranges: true
+
+  clocks:
+    minItems: 1
+    maxItems: 4

Define clocks here, not in allOf:if:then.

Quoted 5 lines

To remain sane, and to help reviewers, I decided not to do changes to the binding while splitting it up which would only make them harder to review.

Hence the split followed by cleanup/tightening of constraints.

It's confusing. I look at this commit and it is not correct. How do I know that next commits will correct it? I responded in further patches that most of them they should be squashed with this copy.

Quoted 6 lines
Quoted 2 lines

How about an example?

That's also a new addition to the binding and goes in a later separate patch.

Best regards,
Krzysztof

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#18 lore raw

Re: [PATCH 07/43] dt-bindings: phy: qcom,msm8996-qmp-pcie: clean up constraints

In reply to Johan Hovold
Quoted 11 lines · Johan Hovold
Quoted 7 lines · Krzysztof Kozlowski
Quoted 3 lines · Johan Hovold

Drop the compatible conditional and tighten the property constraints.

Squash it with previous patch. Does not make sense to add new file and a patch later change it.

I beg to differ, for the reasons I just spelled out in my previous reply.

So let's keep the discussion there.

Best regards,
Krzysztof

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on v1 39/43
#82 lore raw

Re: [PATCH 39/43] phy: qcom-qmp-combo: drop unused lane reset

In reply to Johan Hovold
Quoted 3 lines · Johan Hovold

Drop the unused lane reset pointer which isn't used by any combo PHY.

Quoted 3 lines
---
  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 2 --
  1 file changed, 2 deletions(-)
Signature · 7 lines
With best wishes
Dmitry

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#78 lore raw

Re: [PATCH 38/43] phy: qcom-qmp-pcie: drop pipe clock lane suffix

In reply to Krzysztof Kozlowski
Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
  drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -0
index 385ea3d8de08..254ad25591b9 100644
@@ -2210,8 +2210,12 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
  	if (!qphy->pcs_misc)
  		dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
 
Quoted 5 lines

drivers/phy/qualcomm/phy-qcom-qmp-pcie.c int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id, · line 2213

Quoted 3 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -2
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");

Just get first clock and no need for handling any deprecation.

If I got it correctly, passing NULL instead of the name would do the trick.

Signature · 2 lines
With best wishes
Dmitry
#24 lore raw

Re: [PATCH 09/43] dt-bindings: phy: qcom,msm8996-qmp-pcie: add example node

In reply to Johan Hovold
Quoted 9 lines · Johan Hovold
Quoted 6 lines · Krzysztof Kozlowski
Quoted 3 lines · Johan Hovold

Add an example node based on a cleaned up version of msm8996.dtsi.

Squash it, please.

Why? It's a new addition to the schema.

Because it is not really new. When you add new bindings or convert existing ones (without example), it is expected that example is within that commit. You do here the same - add entirely new file. Old file had example and the bindings. You now split some pieces, convert it, so new file is also expected to come with the bindings.

The same as there is no point to make half-TXT-YAML conversion, there is no point in half-split of existing bindings. Either this split is correct and complete, or it's not a finished commit and we do not commit half-commits.

Best regards,
Krzysztof

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#41 lore raw

Re: [PATCH 16/43] dt-bindings: phy: qcom,qmp-pcie: drop unused vddp-ref-clk supply

In reply to Krzysztof Kozlowski
Quoted 8 lines · Krzysztof Kozlowski
Quoted 3 lines · Johan Hovold

Only UFS PHY nodes in mainline have a vddp-ref-clk supply. Drop it from the PCIe PHY binding.

That's not really good reason. Either the hardware uses ref-clk supply or not. Now it looks like you copied everything from common schema and clean things up. That's not how it should be organize.

Yes, and I've been pretty clear that that's how I'm going about to disentangle the current binding.

Quoted 4 lines

It's okay to copy existing bindings which are applicable and then in separate patch deprecate things or remove pieces which are not correct. But all this in assumption that the first copy already selected only applicable parts.

But how would you be able to tell what parts I left out from the original copy unless I first do the split and then explicitly remove things that were presumably *never* applicable and just happened to be added because all bindings where combined in one large mess of a schema?

Johan

#48 lore raw

Re: [PATCH 17/43] dt-bindings: phy: qcom,qmp-pcie: add missing child node schema

In reply to Krzysztof Kozlowski
Quoted 53 lines · Krzysztof Kozlowski
Quoted 41 lines · Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 88 ++++++++++++++++++-
 1 file changed, 85 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +23 -0
index ff1577f68a00..5a1ebf874559 100644
@@ -69,9 +69,37 @@ properties:
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sm8250-qmp-gen3x2-pcie-phy
+              - qcom,sm8250-qmp-modem-pcie-phy
+              - qcom,sm8450-qmp-gen4x2-pcie-phy
+    then:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              items:
+                - description: TX lane 1
+                - description: RX lane 1
+                - description: PCS
+                - description: TX lane 2
+                - description: RX lane 2
+                - description: PCS_MISC
+    else:
+      patternProperties:
+        "^phy@[0-9a-f]+$":

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml properties: · line 102

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +10 -0
+          properties:
+            reg:
+              minItems: 3
+              maxItems: 4
+              items:
+                - description: TX
+                - description: RX
+                - description: PCS
+                - description: PCS_MISC
+      if:
Quoted 2 lines

Do not include if within other if. Just split the entire section to its own if:.

That sounds like it would just obfuscate the logic. The else clause specified 3-4 registers and the nested if determines which compatibles use which by further narrowing the range.

If you move it out to the else: this would be really hard understand and verify.

Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +12 -0
+        properties:
+          compatible:
+            contains:
+              enum:
+                - qcom,ipq6018-qmp-pcie-phy
+                - qcom,ipq8074-qmp-pcie-phy
+                - qcom,msm8998-qmp-pcie-phy
+                - qcom,sdm845-qhp-pcie-phy
+      then:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
Quoted 8 lines

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml allOf: · line 264

Quoted 8 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +8 -0
+              reg:
+                maxItems: 3
+      else:
+        patternProperties:
+          "^phy@[0-9a-f]+$":
+            properties:
+              reg:
+                minItems: 4

Johan

#49 lore raw

Re: [PATCH 17/43] dt-bindings: phy: qcom,qmp-pcie: add missing child node schema

Quoted 57 lines · Johan Hovold
Quoted 53 lines · Krzysztof Kozlowski
Quoted 41 lines · Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 88 ++++++++++++++++++-
 1 file changed, 85 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +23 -0
index ff1577f68a00..5a1ebf874559 100644
@@ -69,9 +69,37 @@ properties:
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sm8250-qmp-gen3x2-pcie-phy
+              - qcom,sm8250-qmp-modem-pcie-phy
+              - qcom,sm8450-qmp-gen4x2-pcie-phy
+    then:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              items:
+                - description: TX lane 1
+                - description: RX lane 1
+                - description: PCS
+                - description: TX lane 2
+                - description: RX lane 2
+                - description: PCS_MISC
+    else:
+      patternProperties:
+        "^phy@[0-9a-f]+$":

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml properties: · line 102

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +10 -0
+          properties:
+            reg:
+              minItems: 3
+              maxItems: 4
+              items:
+                - description: TX
+                - description: RX
+                - description: PCS
+                - description: PCS_MISC
+      if:
Quoted 2 lines

Do not include if within other if. Just split the entire section to its own if:.

Quoted 6 lines

That sounds like it would just obfuscate the logic. The else clause specified 3-4 registers and the nested if determines which compatibles use which by further narrowing the range.

If you move it out to the else: this would be really hard understand and verify.

Every bindings are expected to do that way and most of them are doing
it: define broad constraints in properties:, then define strict constraints per each variant. Easy to follow code. This binding is not particularly special to make it different than other ones. Doing semi-strict constraints in if: and then additional constrain in nested
if: is not easy to understand and verify.

Best regards,
Krzysztof

#79 lore raw

Re: [PATCH 38/43] phy: qcom-qmp-pcie: drop pipe clock lane suffix

In reply to Dmitry Baryshkov
Quoted 21 lines · Dmitry Baryshkov
Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
  drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -0
index 385ea3d8de08..254ad25591b9 100644
@@ -2210,8 +2210,12 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
  	if (!qphy->pcs_misc)
  		dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
 
Quoted 5 lines
Quoted 5 lines

drivers/phy/qualcomm/phy-qcom-qmp-pcie.c int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id, · line 2213

Quoted 3 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -2
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");

Just get first clock and no need for handling any deprecation.

I still want to deprecate the current name as it makes no sense and risks introducing inconsistencies when adding new resources (e.g. should they also get a bogus suffix).

Quoted 1 line

If I got it correctly, passing NULL instead of the name would do the trick.

Ah, thanks for spotting that. I feared this would require adding a host of new devres wrappers otherwise.

Would still be needed for the upcoming second pipediv2 clock though...

Johan

#42 lore raw

Re: [PATCH 16/43] dt-bindings: phy: qcom,qmp-pcie: drop unused vddp-ref-clk supply

In reply to Johan Hovold
Quoted 7 lines · Johan Hovold
Quoted 4 lines

It's okay to copy existing bindings which are applicable and then in separate patch deprecate things or remove pieces which are not correct. But all this in assumption that the first copy already selected only applicable parts.

But how would you be able to tell what parts I left out from the original copy

They are obvious and immediately visible. I see old bindings and new bindings - no troubles to compare. I review new bindings - everything in place.

I don't want to review old code, inapplicable code. The patch I am reviewing (the one doing the split) must bring correct bindings, except these few differences like deprecated stuff.

Quoted 3 lines

unless I first do the split and then explicitly remove things that were presumably *never* applicable and just happened to be added because all bindings where combined in one large mess of a schema?

Best regards,
Krzysztof

#25 lore raw

Re: [PATCH 09/43] dt-bindings: phy: qcom,msm8996-qmp-pcie: add example node

In reply to Krzysztof Kozlowski
Quoted 17 lines · Krzysztof Kozlowski
Quoted 9 lines · Johan Hovold
Quoted 6 lines · Krzysztof Kozlowski
Quoted 3 lines · Johan Hovold

Add an example node based on a cleaned up version of msm8996.dtsi.

Squash it, please.

Why? It's a new addition to the schema.

Because it is not really new. When you add new bindings or convert existing ones (without example), it is expected that example is within that commit. You do here the same - add entirely new file. Old file had example and the bindings. You now split some pieces, convert it, so new file is also expected to come with the bindings.

Quoted 4 lines

The same as there is no point to make half-TXT-YAML conversion, there is no point in half-split of existing bindings. Either this split is correct and complete, or it's not a finished commit and we do not commit half-commits.

Fair enough, I'll squash the examples in.

Thanks for the quick review.

Johan

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#80 lore raw

Re: [PATCH 38/43] phy: qcom-qmp-pcie: drop pipe clock lane suffix

In reply to Johan Hovold
Quoted 28 lines · Johan Hovold
Quoted 21 lines · Dmitry Baryshkov
Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Johan Hovold

The pipe clock is defined in the "lane" node so there's no need to keep adding a redundant lane-number suffix to the clock name.

Drop the lane suffix from the pipe clock name, but continue supporting the legacy name as a fall back.

---
  drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -0
index 385ea3d8de08..254ad25591b9 100644
@@ -2210,8 +2210,12 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
  	if (!qphy->pcs_misc)
  		dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
 
Quoted 5 lines
Quoted 5 lines

drivers/phy/qualcomm/phy-qcom-qmp-pcie.c int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id, · line 2213

Quoted 3 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -2
-	snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
-	qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
+	qphy->pipe_clk = devm_get_clk_from_child(dev, np, "pipe");

Just get first clock and no need for handling any deprecation.

Quoted 3 lines

I still want to deprecate the current name as it makes no sense and risks introducing inconsistencies when adding new resources (e.g. should they also get a bogus suffix).

And it was suggested to you to deprecate entire property... There is no need to handle anything in the driver.

Quoted 7 lines
Quoted 2 lines

If I got it correctly, passing NULL instead of the name would do the trick.

Ah, thanks for spotting that. I feared this would require adding a host of new devres wrappers otherwise.

Would still be needed for the upcoming second pipediv2 clock though...

Best regards,
Krzysztof

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#50 lore raw

Re: [PATCH 17/43] dt-bindings: phy: qcom,qmp-pcie: add missing child node schema

In reply to Krzysztof Kozlowski
Quoted 65 lines · Krzysztof Kozlowski
Quoted 57 lines · Johan Hovold
Quoted 53 lines · Krzysztof Kozlowski
Quoted 41 lines · Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 88 ++++++++++++++++++-
 1 file changed, 85 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +23 -0
index ff1577f68a00..5a1ebf874559 100644
@@ -69,9 +69,37 @@ properties:
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sm8250-qmp-gen3x2-pcie-phy
+              - qcom,sm8250-qmp-modem-pcie-phy
+              - qcom,sm8450-qmp-gen4x2-pcie-phy
+    then:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              items:
+                - description: TX lane 1
+                - description: RX lane 1
+                - description: PCS
+                - description: TX lane 2
+                - description: RX lane 2
+                - description: PCS_MISC
+    else:
+      patternProperties:
+        "^phy@[0-9a-f]+$":

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml properties: · line 102

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +10 -0
+          properties:
+            reg:
+              minItems: 3
+              maxItems: 4
+              items:
+                - description: TX
+                - description: RX
+                - description: PCS
+                - description: PCS_MISC
+      if:
Quoted 2 lines

Do not include if within other if. Just split the entire section to its own if:.

Quoted 6 lines

That sounds like it would just obfuscate the logic. The else clause specified 3-4 registers and the nested if determines which compatibles use which by further narrowing the range.

If you move it out to the else: this would be really hard understand and verify.

Quoted 6 lines

Every bindings are expected to do that way and most of them are doing
it: define broad constraints in properties:, then define strict constraints per each variant. Easy to follow code. This binding is not particularly special to make it different than other ones. Doing semi-strict constraints in if: and then additional constrain in nested
if: is not easy to understand and verify.

Ok, so you want to flatten this by repeating also the register descriptions?

That wouldn't hurt readability as much, but doing so would be more error prone as it's easy to miss adding a new compatible in every group of conditionals and there's no else clause to catch the mistake.

Right know the logic is

if dual-lane
items = 6
else
items = 3 or 4
if single-lane-exception
items = 3
else
items = 4

Flattening this gives

if dual-lane
items = 6
if single-lane-normal
items = 4
if single-lane-exception
items = 3

Which means that every compatible must now be listed in one of the conditionals.

Fine with me, but please confirm that I understood you correctly.

Johan

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#30 lore raw

Re: [PATCH 11/43] dt-bindings: phy: qcom,msm8996-qmp-pcie: deprecate reset names

In reply to Krzysztof Kozlowski
Quoted 36 lines · Krzysztof Kozlowski
Quoted 21 lines · Johan Hovold

Drop the unnecessary "lane" suffix from the PHY reset names and mark the old names as deprecated.

---
 .../phy/qcom,msm8996-qmp-pcie-phy.yaml        | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +0 -5
index 7931b1fd1476..0bea8270b37e 100644
@@ -94,11 +94,15 @@ patternProperties:
           - description: PHY (lane) reset
 
       reset-names:
-        items:
-          - enum:
-              - lane0
-              - lane1
-              - lane2

Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml patternProperties: · line 106

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-pcie-phy.yaml +9 -0
+        oneOf:
+          - items:
+              - const: lane
+          - items:
+              - enum:
+                  - lane0
+                  - lane1
+                  - lane2
+            deprecated: true
 

How about just dropping reset-names entirely? Marking entire field deprecated and removing from DTS? The same in the previous patch.

Quoted 1 line

Usually one-item xxx-names do not bring any useful information.

Yeah, I agree, that's better.

Johan

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#43 lore raw

Re: [PATCH 16/43] dt-bindings: phy: qcom,qmp-pcie: drop unused vddp-ref-clk supply

In reply to Krzysztof Kozlowski
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Johan Hovold
Quoted 4 lines

It's okay to copy existing bindings which are applicable and then in separate patch deprecate things or remove pieces which are not correct. But all this in assumption that the first copy already selected only applicable parts.

Quoted 6 lines
Quoted 2 lines

But how would you be able to tell what parts I left out from the original copy

They are obvious and immediately visible. I see old bindings and new bindings - no troubles to compare. I review new bindings - everything in place.

Heh, with all these conditionals in place that may be harder than it sounds.

Quoted 3 lines

I don't want to review old code, inapplicable code. The patch I am reviewing (the one doing the split) must bring correct bindings, except these few differences like deprecated stuff.

Sure, I get that. But this very patch is an example of why I tried to remove things explicitly instead folding this into the original patch and risking it not being noticed.

It's not always obvious what is applicable and what is not, especially when the old schema is in the state it is.

Quoted 3 lines
Quoted 3 lines

unless I first do the split and then explicitly remove things that were presumably *never* applicable and just happened to be added because all bindings where combined in one large mess of a schema?

So you suggest we keep this regulator for all PHY variants even though it was probably only needed for UFS on some older SoCs?

Johan

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
maintainer
#53 lore raw

Re: [PATCH 17/43] dt-bindings: phy: qcom,qmp-pcie: add missing child node schema

In reply to Johan Hovold
Quoted 12 lines · Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 88 ++++++++++++++++++-
 1 file changed, 85 insertions(+), 3 deletions(-)

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/phy/qcom,qmp-pcie-phy.yaml: allOf:3:else:patternProperties:^phy@[0-9a-f]+$:properties:reg: {'minItems': 3, 'maxItems': 4, 'items': [{'description': 'TX'}, {'description': 'RX'}, {'description': 'PCS'}, {'description': 'PCS_MISC'}]} should not be valid under {'required': ['maxItems']}
hint: "maxItems" is not needed with an "items" list
from schema $id: http://devicetree.org/meta-schemas/items.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml: ignoring, error in schema: allOf: 3: else: patternProperties: ^phy@[0-9a-f]+$: properties: reg

doc reference errors (make refcheckdocs):

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

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.

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#44 lore raw

Re: [PATCH 16/43] dt-bindings: phy: qcom,qmp-pcie: drop unused vddp-ref-clk supply

In reply to Johan Hovold
Quoted 10 lines · Johan Hovold
Quoted 9 lines · Krzysztof Kozlowski
Quoted 7 lines · Johan Hovold
Quoted 4 lines

It's okay to copy existing bindings which are applicable and then in separate patch deprecate things or remove pieces which are not correct. But all this in assumption that the first copy already selected only applicable parts.

But how would you be able to tell what parts I left out from the original copy

Quoted 6 lines
Quoted 3 lines

They are obvious and immediately visible. I see old bindings and new bindings - no troubles to compare. I review new bindings - everything in place.

Heh, with all these conditionals in place that may be harder than it sounds.

True and your patchset split does not make it easier.

Quoted 11 lines
Quoted 4 lines

I don't want to review old code, inapplicable code. The patch I am reviewing (the one doing the split) must bring correct bindings, except these few differences like deprecated stuff.

Sure, I get that. But this very patch is an example of why I tried to remove things explicitly instead folding this into the original patch and risking it not being noticed.

It's not always obvious what is applicable and what is not, especially when the old schema is in the state it is.

Unless bindings are very precise, usually it's not visible what is applicable or not, so there is just no benefit in multi-step approach in split from old bindings. The same as with conversion of bindings, the assumption is that original file was not correct, so we review the final file.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

unless I first do the split and then explicitly remove things that were presumably *never* applicable and just happened to be added because all bindings where combined in one large mess of a schema?

So you suggest we keep this regulator for all PHY variants even though it was probably only needed for UFS on some older SoCs?

No. I commented only that reason is not a good one. The proper reason could be: there is or there is no such pin in the device or the history tells that adding it for all variants was a mistake.

Best regards,
Krzysztof

#51 lore raw

Re: [PATCH 17/43] dt-bindings: phy: qcom,qmp-pcie: add missing child node schema

In reply to Johan Hovold
Quoted 100 lines · Johan Hovold
Quoted 65 lines · Krzysztof Kozlowski
Quoted 57 lines · Johan Hovold
Quoted 53 lines · Krzysztof Kozlowski
Quoted 41 lines · Johan Hovold

Add the missing the description of the PHY-provider child node which was ignored when converting to DT schema.

Also fix up the incorrect description that claimed that one child node per lane was required.

Fixes ccf51c1cedfd ("dt-bindings: phy: qcom,qmp: Convert QMP PHY bindings to yaml")
---
 .../bindings/phy/qcom,qmp-pcie-phy.yaml       | 88 ++++++++++++++++++-
 1 file changed, 85 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +23 -0
index ff1577f68a00..5a1ebf874559 100644
@@ -69,9 +69,37 @@ properties:
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sm8250-qmp-gen3x2-pcie-phy
+              - qcom,sm8250-qmp-modem-pcie-phy
+              - qcom,sm8450-qmp-gen4x2-pcie-phy
+    then:
+      patternProperties:
+        "^phy@[0-9a-f]+$":
+          properties:
+            reg:
+              items:
+                - description: TX lane 1
+                - description: RX lane 1
+                - description: PCS
+                - description: TX lane 2
+                - description: RX lane 2
+                - description: PCS_MISC
+    else:
+      patternProperties:
+        "^phy@[0-9a-f]+$":

Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml properties: · line 102

Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-pcie-phy.yaml +10 -0
+          properties:
+            reg:
+              minItems: 3
+              maxItems: 4
+              items:
+                - description: TX
+                - description: RX
+                - description: PCS
+                - description: PCS_MISC
+      if:
Quoted 2 lines

Do not include if within other if. Just split the entire section to its own if:.

Quoted 6 lines

That sounds like it would just obfuscate the logic. The else clause specified 3-4 registers and the nested if determines which compatibles use which by further narrowing the range.

If you move it out to the else: this would be really hard understand and verify.

Quoted 6 lines

Every bindings are expected to do that way and most of them are doing
it: define broad constraints in properties:, then define strict constraints per each variant. Easy to follow code. This binding is not particularly special to make it different than other ones. Doing semi-strict constraints in if: and then additional constrain in nested
if: is not easy to understand and verify.

Ok, so you want to flatten this by repeating also the register descriptions?

That wouldn't hurt readability as much, but doing so would be more error prone as it's easy to miss adding a new compatible in every group of conditionals and there's no else clause to catch the mistake.

Right know the logic is

if dual-lane
items = 6
else
items = 3 or 4
if single-lane-exception
items = 3
else
items = 4

Flattening this gives

if dual-lane
items = 6
if single-lane-normal
items = 4
if single-lane-exception
items = 3

Quoted 2 lines

Which means that every compatible must now be listed in one of the conditionals.

Yes, because it's explicit and easy to read. Handling compatibles in 'else' makes it opposite - one cannot use grep and cannot easily find what is actually covered by maxItems:4 (you need to check all 7 compatibles to find what is not covered here).

Quoted 2 lines

Fine with me, but please confirm that I understood you correctly.

You have already flattened if-if-if for clocks and resets, so this should follow similar approach. I don't think it could be squashed with that previous if-if-if, though.

Best regards,
Krzysztof

#45 lore raw

Re: [PATCH 16/43] dt-bindings: phy: qcom,qmp-pcie: drop unused vddp-ref-clk supply

In reply to Krzysztof Kozlowski
Quoted 8 lines · Krzysztof Kozlowski
Quoted 2 lines · Johan Hovold

So you suggest we keep this regulator for all PHY variants even though it was probably only needed for UFS on some older SoCs?

No. I commented only that reason is not a good one. The proper reason could be: there is or there is no such pin in the device or the history tells that adding it for all variants was a mistake.

Ok, I'll include it since it was there as an optional regulator from the start and hence implicitly made part of the binding for later PHYs even though it likely only applies to the older MSM8996/98.

If anyone has access to the documentation they can drop it later.

Johan

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#52 lore raw

Re: [PATCH 17/43] dt-bindings: phy: qcom,qmp-pcie: add missing child node schema

In reply to Krzysztof Kozlowski
Quoted 29 lines · Krzysztof Kozlowski
Quoted 27 lines · Johan Hovold

Ok, so you want to flatten this by repeating also the register descriptions?

That wouldn't hurt readability as much, but doing so would be more error prone as it's easy to miss adding a new compatible in every group of conditionals and there's no else clause to catch the mistake.

Right know the logic is

if dual-lane
items = 6
else
items = 3 or 4
if single-lane-exception
items = 3
else
items = 4

Flattening this gives

if dual-lane
items = 6
if single-lane-normal
items = 4
if single-lane-exception
items = 3

Quoted 7 lines
Quoted 2 lines

Which means that every compatible must now be listed in one of the conditionals.

Yes, because it's explicit and easy to read. Handling compatibles in 'else' makes it opposite - one cannot use grep and cannot easily find what is actually covered by maxItems:4 (you need to check all 7 compatibles to find what is not covered here).

I'll go with that then.

Johan