Skip to contentSkip to conversation

dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema

PATCH Applied Shresth Prasad 3 participants 3 messages Jun 20, 2024 – Jul 2, 2024

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

PATCH v5 1/1 dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema

Convert txt bindings of Rockchip EMMC PHY to dtschema to allow for validation.

---
Request for an Ack from the PHY maintainers, so that the DT maintainer Heiko can merge it to grf.yaml in the order that he likes.

Changes in v5:
- remove myself from maintainers list
- put clocks before clock-names
- remove node lables
- remove grf node from example
- remove blank lines in grf.yaml
- add to example in grf.yaml

Tested against rockchip/rk3399-firefly.dtb, rockchip/rk3399-orangepi.dtb and rockchip/rk3399-pinebook-pro.dtb.

---
 .../phy/rockchip,rk3399-emmc-phy.yaml         | 64 +++++++++++++++++++
 .../bindings/phy/rockchip-emmc-phy.txt        | 43 -------------
 .../devicetree/bindings/soc/rockchip/grf.yaml | 16 ++++-
 3 files changed, 77 insertions(+), 46 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/rockchip,rk3399-emmc-phy.yaml
 delete mode 100644 Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
Documentation/devicetree/bindings/phy/rockchip,rk3399-emmc-phy.yaml new file +64 -0
new file mode 100644
index 000000000000..3e3729b1c799
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/rockchip,rk3399-emmc-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip EMMC PHY
+
+maintainers:
+  - Heiko Stuebner <[email protected]>
+
+properties:
+  compatible:
+    const: rockchip,rk3399-emmc-phy
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: emmcclk
+
+  drive-impedance-ohm:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Specifies the drive impedance in Ohm.
+    enum: [33, 40, 50, 66, 100]
+    default: 50
+
+  rockchip,enable-strobe-pulldown:
+    type: boolean
+    description: |
+      Enable internal pull-down for the strobe
+      line.  If not set, pull-down is not used.
+
+  rockchip,output-tapdelay-select:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Specifies the phyctrl_otapdlysec register.
+    default: 0x4
+    maximum: 0xf
+
+  "#phy-cells":
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - "#phy-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    phy@f780 {
+      compatible = "rockchip,rk3399-emmc-phy";
+      reg = <0xf780 0x20>;
+      clocks = <&sdhci>;
+      clock-names = "emmcclk";
+      drive-impedance-ohm = <50>;
+      #phy-cells = <0>;
+    };
Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt deleted +0 -43

43 lines not on this page · raw message

Documentation/devicetree/bindings/soc/rockchip/grf.yaml +13 -3
index 79798c747476..78c6d5b64138 100644
@@ -176,9 +176,10 @@ allOf:
             Documentation/devicetree/bindings/phy/rockchip-pcie-phy.txt
 
       patternProperties:
-        "phy@[0-9a-f]+$":
-          description:
-            Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
+        "^phy@[0-9a-f]+$":
+          type: object
+          $ref: /schemas/phy/rockchip,rk3399-emmc-phy.yaml#
+          unevaluatedProperties: false
 
   - if:
       properties:
@@ -292,6 +293,15 @@ examples:
         #phy-cells = <0>;
       };
 
+      phy@f780 {
+        compatible = "rockchip,rk3399-emmc-phy";
+        reg = <0xf780 0x20>;
+        clocks = <&sdhci>;
+        clock-names = "emmcclk";
+        drive-impedance-ohm = <50>;
+        #phy-cells = <0>;
+      };
+
       u2phy0: usb2phy@e450 {
         compatible = "rockchip,rk3399-usb2phy";
         reg = <0xe450 0x10>;
Signature · 1 line
2.45.2
maintainer Applied
#2 lore raw
In reply to Shresth Prasad
Quoted 4 lines · Shresth Prasad

Convert txt bindings of Rockchip EMMC PHY to dtschema to allow for validation.

Applied, thanks!

[1/1] dt-bindings: phy: rockchip-emmc-phy: Convert to dtschema

      commit: e245c725c72f8c94e5fe435fdefd6852851450b5

Best regards,

Signature · 1 line
Vinod Koul <[email protected]>