Skip to contentSkip to conversation

dt-bindings: net: ipq4019-mdio: document IPQ6018 compatible

PATCH Superseded Robert Marko 2 participants 10 messages Nov 13, 2022 – Nov 14, 2022

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 dt-bindings: net: ipq4019-mdio: document IPQ6018 compatible

Document IPQ6018 compatible that is already being used in the DTS along with the fallback IPQ4019 compatible as driver itself only gets probed on IPQ4019 and IPQ5018 compatibles.

This is also required in order to specify which platform require clock to be defined and validate it in schema.

---
 .../devicetree/bindings/net/qcom,ipq4019-mdio.yaml  | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +10 -3
index ad8b2b41c140..2463c0bad203 100644
@@ -14,9 +14,16 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - qcom,ipq4019-mdio
-      - qcom,ipq5018-mdio
+    oneOf:
+      - items:
+          - enum:
+              - qcom,ipq4019-mdio
+              - qcom,ipq5018-mdio
+
+      - items:
+          - enum:
+              - qcom,ipq6018-mdio
+          - const: qcom,ipq4019-mdio
 
   "#address-cells":
     const: 1
Signature · 1 line
2.38.1
#1 lore raw

PATCH 2/5 dt-bindings: net: ipq4019-mdio: add IPQ8074 compatible

Allow using IPQ8074 specific compatible along with the fallback IPQ4019 one in order to be able to specify which compatibles require clocks to be able to validate them via schema.

---
 Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +1 -0
index 2463c0bad203..2c85ae43d27d 100644
@@ -23,6 +23,7 @@ properties:
       - items:
           - enum:
               - qcom,ipq6018-mdio
+              - qcom,ipq8074-mdio
           - const: qcom,ipq4019-mdio
 
   "#address-cells":
Signature · 1 line
2.38.1
#3 lore raw

PATCH 3/5 dt-bindings: net: ipq4019-mdio: require and validate clocks

In reply to Robert Marko

Now that we can match the platforms requiring clocks by compatible start using those to allow clocks per compatible and make them required.

---
 .../bindings/net/qcom,ipq4019-mdio.yaml       | 28 +++++++++++++------
 1 file changed, 19 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +19 -9
index 2c85ae43d27d..b34955b0b827 100644
@@ -9,9 +9,6 @@ title: Qualcomm IPQ40xx MDIO Controller
 maintainers:
   - Robert Marko <[email protected]>
 
-allOf:
-  - $ref: "mdio.yaml#"
-
 properties:
   compatible:
     oneOf:
@@ -40,18 +37,31 @@ properties:
       the second Address and length of the register for ethernet LDO, this second
       address range is only required by the platform IPQ50xx.
 
-  clocks:
-    maxItems: 1
-    description: |
-      MDIO clock source frequency fixed to 100MHZ, this clock should be specified
-      by the platform IPQ807x, IPQ60xx and IPQ50xx.
-
 required:
   - compatible
   - reg
   - "#address-cells"
   - "#size-cells"
 
+allOf:
+  - $ref: "mdio.yaml#"
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,ipq5018-mdio
+              - qcom,ipq6018-mdio
+              - qcom,ipq8074-mdio
+    then:
+      properties:
+        clocks:
+          items:
+            - description: MDIO clock source frequency fixed to 100MHZ
+      required:
+        - clocks
+
 unevaluatedProperties: false
 
 examples:
Signature · 1 line
2.38.1
#5 lore raw

PATCH 4/5 dt-bindings: net: ipq4019-mdio: document required clock-names

In reply to Robert Marko

IPQ5018, IPQ6018 and IPQ8074 require clock-names to be set as driver is requesting the clock based on it and not index, so document that and make it required for the listed SoC-s.

---
 Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +4 -0
index b34955b0b827..d233009b0d49 100644
@@ -59,8 +59,12 @@ allOf:
         clocks:
           items:
             - description: MDIO clock source frequency fixed to 100MHZ
+        clock-names:
+          items:
+            - const: gcc_mdio_ahb_clk
       required:
         - clocks
+        - clock-names
 
 unevaluatedProperties: false
 
Signature · 1 line
2.38.1
#7 lore raw

PATCH 5/5 arm64: dts: qcom: ipq8074: add SoC specific compatible to MDIO

In reply to Robert Marko

Add the newly documented SoC compatible to MDIO in order to be able to validate clocks for it.

---
 arch/arm64/boot/dts/qcom/ipq8074.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/ipq8074.dtsi +1 -1
index a0481c671faf..583871c29586 100644
@@ -331,7 +331,7 @@ pcie_phy1: phy@8e200 {
 		};
 
 		mdio: mdio@90000 {
-			compatible = "qcom,ipq4019-mdio";
+			compatible = "qcom,ipq8074-mdio", "qcom,ipq4019-mdio";
 			reg = <0x00090000 0x64>;
 			#address-cells = <1>;
 			#size-cells = <0>;
Signature · 1 line
2.38.1
#9 lore raw
In reply to Robert Marko
Quoted 17 lines · Robert Marko

Document IPQ6018 compatible that is already being used in the DTS along with the fallback IPQ4019 compatible as driver itself only gets probed on IPQ4019 and IPQ5018 compatibles.

This is also required in order to specify which platform require clock to be defined and validate it in schema.

---
 .../devicetree/bindings/net/qcom,ipq4019-mdio.yaml  | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +0 -0
index ad8b2b41c140..2463c0bad203 100644

Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml allOf: · line 18

Quoted 8 lines
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +2 -3
@@ -14,9 +14,16 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - qcom,ipq4019-mdio
-      - qcom,ipq5018-mdio
+    oneOf:
+      - items:

These are just one item, so drop "items".

Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml allOf: · line 22

Quoted 4 lines
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +4 -0
+          - enum:
+              - qcom,ipq4019-mdio
+              - qcom,ipq5018-mdio
+

Best regards,
Krzysztof

Reviewed-by on v1 2/5
#2 lore raw

Re: [PATCH 2/5] dt-bindings: net: ipq4019-mdio: add IPQ8074 compatible

In reply to Robert Marko
Quoted 5 lines · Robert Marko

Allow using IPQ8074 specific compatible along with the fallback IPQ4019 one in order to be able to specify which compatibles require clocks to be able to validate them via schema.

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH 3/5] dt-bindings: net: ipq4019-mdio: require and validate clocks

In reply to Robert Marko
Quoted 23 lines · Robert Marko

Now that we can match the platforms requiring clocks by compatible start using those to allow clocks per compatible and make them required.

---
 .../bindings/net/qcom,ipq4019-mdio.yaml       | 28 +++++++++++++------
 1 file changed, 19 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +0 -3
index 2c85ae43d27d..b34955b0b827 100644
@@ -9,9 +9,6 @@ title: Qualcomm IPQ40xx MDIO Controller
 maintainers:
   - Robert Marko <[email protected]>
 
-allOf:
-  - $ref: "mdio.yaml#"
-
 properties:
   compatible:
     oneOf:

Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml properties: · line 44

Quoted 5 lines
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +0 -2
@@ -40,18 +37,31 @@ properties:
       the second Address and length of the register for ethernet LDO, this second
       address range is only required by the platform IPQ50xx.
 
-  clocks:
-    maxItems: 1

Keep it here.

Quoted 18 lines
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +8 -4
-    description: |
-      MDIO clock source frequency fixed to 100MHZ, this clock should be specified
-      by the platform IPQ807x, IPQ60xx and IPQ50xx.
-
 required:
   - compatible
   - reg
   - "#address-cells"
   - "#size-cells"
 
+allOf:
+  - $ref: "mdio.yaml#"
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:

Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml properties: · line 63

Quoted 10 lines
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +10 -0
+              - qcom,ipq5018-mdio
+              - qcom,ipq6018-mdio
+              - qcom,ipq8074-mdio
+    then:
+      properties:
+        clocks:
+          items:
+            - description: MDIO clock source frequency fixed to 100MHZ
+      required:
+        - clocks

else:
properties:
clocks: false

Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml properties: · line 67

Quoted 4 lines
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +1 -0
+
 unevaluatedProperties: false
 
 examples:

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH 4/5] dt-bindings: net: ipq4019-mdio: document required clock-names

In reply to Robert Marko
Quoted 14 lines · Robert Marko

IPQ5018, IPQ6018 and IPQ8074 require clock-names to be set as driver is requesting the clock based on it and not index, so document that and make it required for the listed SoC-s.

---
 Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +0 -0
index b34955b0b827..d233009b0d49 100644

Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml allOf: · line 61

Quoted 3 lines
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +0 -0
@@ -59,8 +59,12 @@ allOf:
         clocks:
           items:
             - description: MDIO clock source frequency fixed to 100MHZ

Similarly to clocks, define clock-names in top-level and disallow them for other variants. Do not define properties in allOf:if:then - it makes schema difficult to maintain and read.

Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml allOf: · line 70

Quoted 9 lines
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +4 -0
+        clock-names:
+          items:
+            - const: gcc_mdio_ahb_clk
       required:
         - clocks
+        - clock-names
 
 unevaluatedProperties: false
 

Best regards,
Krzysztof