Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] dt-bindings: usb: renesas: usb3-peri: convert bindings to json-schema
@ 2019-11-06 10:34 Yoshihiro Shimoda
  2019-11-07  0:59 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Yoshihiro Shimoda @ 2019-11-06 10:34 UTC (permalink / raw)
  To: gregkh, robh+dt, mark.rutland
  Cc: devicetree, linux-usb, linux-renesas-soc, Yoshihiro Shimoda

Convert Renesas USB 3.0 Peripheral controller bindings documentation
to json-schema.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 Changes from v1:
 - Remove oneOf from compatible.
 - Remove comments from reg, interrupts and clocks.
 - Add maxItems on phys.
 - Remove generic.txt and graph.txt references.
 https://patchwork.kernel.org/patch/11205923/

 .../devicetree/bindings/usb/renesas,usb3-peri.txt  | 65 ----------------
 .../devicetree/bindings/usb/renesas,usb3-peri.yaml | 86 ++++++++++++++++++++++
 2 files changed, 86 insertions(+), 65 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/usb/renesas,usb3-peri.txt
 create mode 100644 Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml

diff --git a/Documentation/devicetree/bindings/usb/renesas,usb3-peri.txt b/Documentation/devicetree/bindings/usb/renesas,usb3-peri.txt
deleted file mode 100644
index 1343dfc..00000000
--- a/Documentation/devicetree/bindings/usb/renesas,usb3-peri.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-Renesas Electronics USB3.0 Peripheral driver
-
-Required properties:
-  - compatible: Must contain one of the following:
-	- "renesas,r8a774a1-usb3-peri"
-	- "renesas,r8a774b1-usb3-peri"
-	- "renesas,r8a774c0-usb3-peri"
-	- "renesas,r8a7795-usb3-peri"
-	- "renesas,r8a7796-usb3-peri"
-	- "renesas,r8a77965-usb3-peri"
-	- "renesas,r8a77990-usb3-peri"
-	- "renesas,rcar-gen3-usb3-peri" for a generic R-Car Gen3 or RZ/G2
-	  compatible device
-
-    When compatible with the generic version, nodes must list the
-    SoC-specific version corresponding to the platform first
-    followed by the generic version.
-
-  - reg: Base address and length of the register for the USB3.0 Peripheral
-  - interrupts: Interrupt specifier for the USB3.0 Peripheral
-  - clocks: clock phandle and specifier pair
-
-Optional properties:
-  - phys: phandle + phy specifier pair
-  - phy-names: must be "usb"
-  - usb-role-switch: support role switch. see usb/generic.txt
-
-Sub-nodes:
-- any connector to the data bus of this controller should be modelled using the
-  OF graph bindings specified in bindings/graph.txt, if the "usb-role-switch"
-  property is used.
-
-Example of R-Car H3 ES1.x:
-	usb3_peri0: usb@ee020000 {
-		compatible = "renesas,r8a7795-usb3-peri",
-			     "renesas,rcar-gen3-usb3-peri";
-		reg = <0 0xee020000 0 0x400>;
-		interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
-		clocks = <&cpg CPG_MOD 328>;
-	};
-
-	usb3_peri1: usb@ee060000 {
-		compatible = "renesas,r8a7795-usb3-peri",
-			     "renesas,rcar-gen3-usb3-peri";
-		reg = <0 0xee060000 0 0x400>;
-		interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
-		clocks = <&cpg CPG_MOD 327>;
-	};
-
-Example of RZ/G2E:
-	usb3_peri0: usb@ee020000 {
-		compatible = "renesas,r8a774c0-usb3-peri",
-			     "renesas,rcar-gen3-usb3-peri";
-		reg = <0 0xee020000 0 0x400>;
-		interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
-		clocks = <&cpg CPG_MOD 328>;
-		companion = <&xhci0>;
-		usb-role-switch;
-
-		port {
-			usb3_role_switch: endpoint {
-				remote-endpoint = <&hd3ss3220_ep>;
-			};
-		};
-	};
diff --git a/Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml b/Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml
new file mode 100644
index 00000000..92d8631
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/renesas,usb3-peri.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas USB 3.0 Peripheral controller
+
+maintainers:
+  - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,r8a774a1-usb3-peri # RZ/G2M
+          - renesas,r8a774b1-usb3-peri # RZ/G2N
+          - renesas,r8a774c0-usb3-peri # RZ/G2E
+          - renesas,r8a7795-usb3-peri  # R-Car H3
+          - renesas,r8a7796-usb3-peri  # R-Car M3-W
+          - renesas,r8a77965-usb3-peri # R-Car M3-N
+          - renesas,r8a77990-usb3-peri # R-Car E3
+      - const: renesas,rcar-gen3-usb3-peri
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  phys:
+    maxItems: 1
+
+  phy-names:
+    const: usb
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  usb-role-switch:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Support role switch.
+
+  companion:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle of a companion.
+
+  port:
+    description: |
+      any connector to the data bus of this controller should be modelled
+      using the OF graph bindings specified, if the "usb-role-switch"
+      property is used.
+
+required:
+  - compatible
+  - interrupts
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a774c0-cpg-mssr.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/r8a774c0-sysc.h>
+
+    usb3_peri0: usb@ee020000 {
+        compatible = "renesas,r8a774c0-usb3-peri", "renesas,rcar-gen3-usb3-peri";
+        reg = <0 0xee020000 0 0x400>;
+        interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&cpg CPG_MOD 328>;
+        companion = <&xhci0>;
+        usb-role-switch;
+
+        port {
+            usb3_role_switch: endpoint {
+                remote-endpoint = <&hd3ss3220_ep>;
+            };
+        };
+    };
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] dt-bindings: usb: renesas: usb3-peri: convert bindings to json-schema
  2019-11-06 10:34 [PATCH v2] dt-bindings: usb: renesas: usb3-peri: convert bindings to json-schema Yoshihiro Shimoda
@ 2019-11-07  0:59 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2019-11-07  0:59 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: gregkh, robh+dt, mark.rutland, devicetree, linux-usb,
	linux-renesas-soc, Yoshihiro Shimoda

On Wed,  6 Nov 2019 19:34:53 +0900, Yoshihiro Shimoda wrote:
> Convert Renesas USB 3.0 Peripheral controller bindings documentation
> to json-schema.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  Changes from v1:
>  - Remove oneOf from compatible.
>  - Remove comments from reg, interrupts and clocks.
>  - Add maxItems on phys.
>  - Remove generic.txt and graph.txt references.
>  https://patchwork.kernel.org/patch/11205923/
> 
>  .../devicetree/bindings/usb/renesas,usb3-peri.txt  | 65 ----------------
>  .../devicetree/bindings/usb/renesas,usb3-peri.yaml | 86 ++++++++++++++++++++++
>  2 files changed, 86 insertions(+), 65 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/usb/renesas,usb3-peri.txt
>  create mode 100644 Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 10:34 [PATCH v2] dt-bindings: usb: renesas: usb3-peri: convert bindings to json-schema Yoshihiro Shimoda
2019-11-07  0:59 ` Rob Herring

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git