dt-bindings: phy: Convert Cygnus PCIe PHY to YAML
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 14 Dec 2021 03:58:19 +0000 (19:58 -0800)
committerRob Herring <robh@kernel.org>
Tue, 14 Dec 2021 20:27:57 +0000 (14:27 -0600)
Convert the Broadcom Cygnus PCIe PHY Device Tree binding t YAML to help
with validation.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20211214035820.2984289-6-f.fainelli@gmail.com
Signed-off-by: Rob Herring <robh@kernel.org>
Documentation/devicetree/bindings/phy/brcm,cygnus-pcie-phy.txt [deleted file]
Documentation/devicetree/bindings/phy/brcm,cygnus-pcie-phy.yaml [new file with mode: 0644]

diff --git a/Documentation/devicetree/bindings/phy/brcm,cygnus-pcie-phy.txt b/Documentation/devicetree/bindings/phy/brcm,cygnus-pcie-phy.txt
deleted file mode 100644 (file)
index 10efff2..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-Broadcom Cygnus PCIe PHY
-
-Required properties:
-- compatible: must be "brcm,cygnus-pcie-phy"
-- reg: base address and length of the PCIe PHY block
-- #address-cells: must be 1
-- #size-cells: must be 0
-
-Each PCIe PHY should be represented by a child node
-
-Required properties For the child node:
-- reg: the PHY ID
-0 - PCIe RC 0
-1 - PCIe RC 1
-- #phy-cells: must be 0
-
-Example:
-       pcie_phy: phy@301d0a0 {
-               compatible = "brcm,cygnus-pcie-phy";
-               reg = <0x0301d0a0 0x14>;
-
-               pcie0_phy: phy@0 {
-                       reg = <0>;
-                       #phy-cells = <0>;
-               };
-
-               pcie1_phy: phy@1 {
-                       reg = <1>;
-                       #phy-cells = <0>;
-               };
-       };
-
-       /* users of the PCIe phy */
-
-       pcie0: pcie@18012000 {
-               ...
-               ...
-               phys = <&pcie0_phy>;
-               phy-names = "pcie-phy";
-       };
-
-       pcie1: pcie@18013000 {
-               ...
-               ...
-               phys = <pcie1_phy>;
-               phy-names = "pcie-phy";
-       };
diff --git a/Documentation/devicetree/bindings/phy/brcm,cygnus-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/brcm,cygnus-pcie-phy.yaml
new file mode 100644 (file)
index 0000000..045699c
--- /dev/null
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/brcm,cygnus-pcie-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom Cygnus PCIe PHY
+
+maintainers:
+  - Ray Jui <ray.jui@broadcom.com>
+  - Scott Branden <scott.branden@broadcom.com>
+
+properties:
+  $nodename:
+    pattern: "^pcie[-|_]phy(@.*)?$"
+
+  compatible:
+    items:
+      - const: brcm,cygnus-pcie-phy
+
+  reg:
+    maxItems: 1
+    description: >
+      Base address and length of the PCIe PHY block
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^pcie-phy@[0-9]+$":
+    type: object
+    description: >
+      PCIe PHY child nodes
+
+    properties:
+      reg:
+        maxItems: 1
+        description: >
+          The PCIe PHY port number
+
+      "#phy-cells":
+        const: 0
+
+    required:
+      - reg
+      - "#phy-cells"
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    pcie_phy: pcie_phy@301d0a0 {
+      compatible = "brcm,cygnus-pcie-phy";
+      reg = <0x0301d0a0 0x14>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      pcie0_phy: pcie-phy@0 {
+          reg = <0>;
+          #phy-cells = <0>;
+      };
+
+      pcie1_phy: pcie-phy@1 {
+          reg = <1>;
+          #phy-cells = <0>;
+      };
+    };