Commit 92086b88 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Vinod Koul
Browse files

dt-bindings: phy: renesas,rcar-gen2-usb-phy: Convert to json-schema



Convert the Renesas R-Car Gen2 USB PHY Device Tree binding documentation
to json-schema.

Add missing properties.
Rename the device node from "usb-phy" to "usb-phy-controller", as it
does not represent a USB PHY itself, and thus does not have a
"#phy-cells" property.
Rename the child nodes from "usb-channel" to "usb-phy", as these do
represent USB PHYs.
Drop the second example, as it doesn't add any value.

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/dbdcffd009302734fe2fb895ce04b72fa1ea4355.1663165000.git.geert+renesas@glider.be


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent f5d6b5d6
Loading
Loading
Loading
Loading
+0 −112
Original line number Diff line number Diff line
* Renesas R-Car generation 2 USB PHY

This file provides information on what the device node for the R-Car generation
2 USB PHY contains.

Required properties:
- compatible: "renesas,usb-phy-r8a7742" if the device is a part of R8A7742 SoC.
	      "renesas,usb-phy-r8a7743" if the device is a part of R8A7743 SoC.
	      "renesas,usb-phy-r8a7744" if the device is a part of R8A7744 SoC.
	      "renesas,usb-phy-r8a7745" if the device is a part of R8A7745 SoC.
	      "renesas,usb-phy-r8a77470" if the device is a part of R8A77470 SoC.
	      "renesas,usb-phy-r8a7790" if the device is a part of R8A7790 SoC.
	      "renesas,usb-phy-r8a7791" if the device is a part of R8A7791 SoC.
	      "renesas,usb-phy-r8a7794" if the device is a part of R8A7794 SoC.
	      "renesas,rcar-gen2-usb-phy" for a generic R-Car Gen2 or
					  RZ/G1 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: offset and length of the register block.
- #address-cells: number of address cells for the USB channel subnodes, must
		  be <1>.
- #size-cells: number of size cells for the USB channel subnodes, must be <0>.
- clocks: clock phandle and specifier pair.
- clock-names: string, clock input name, must be "usbhs".

The USB PHY device tree node should have the subnodes corresponding to the USB
channels. These subnodes must contain the following properties:
- reg: the USB controller selector; see the table below for the values.
- #phy-cells: see phy-bindings.txt in the same directory, must be <1>.

The phandle's argument in the PHY specifier is the USB controller selector for
the USB channel other than r8a77470 SoC; see the selector meanings below:

+-----------+---------------+---------------+
|\ Selector |               |               |
+ --------- +       0       |       1       |
| Channel  \|               |               |
+-----------+---------------+---------------+
| 0         | PCI EHCI/OHCI | HS-USB        |
| 2         | PCI EHCI/OHCI | xHCI          |
+-----------+---------------+---------------+

For r8a77470 SoC;see the selector meaning below:

+-----------+---------------+---------------+
|\ Selector |               |               |
+ --------- +       0       |       1       |
| Channel  \|               |               |
+-----------+---------------+---------------+
| 0         | EHCI/OHCI     | HS-USB        |
+-----------+---------------+---------------+

Example (Lager board):

	usb-phy@e6590100 {
		compatible = "renesas,usb-phy-r8a7790", "renesas,rcar-gen2-usb-phy";
		reg = <0 0xe6590100 0 0x100>;
		#address-cells = <1>;
		#size-cells = <0>;
		clocks = <&cpg CPG_MOD 704>;
		clock-names = "usbhs";
		power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
		resets = <&cpg 704>;

		usb0: usb-channel@0 {
			reg = <0>;
			#phy-cells = <1>;
		};
		usb2: usb-channel@2 {
			reg = <2>;
			#phy-cells = <1>;
		};
	};

Example (iWave RZ/G1C sbc):

	usbphy0: usb-phy0@e6590100 {
		compatible = "renesas,usb-phy-r8a77470",
			     "renesas,rcar-gen2-usb-phy";
		reg = <0 0xe6590100 0 0x100>;
		#address-cells = <1>;
		#size-cells = <0>;
		clocks = <&cpg CPG_MOD 704>;
		clock-names = "usbhs";
		power-domains = <&sysc R8A77470_PD_ALWAYS_ON>;
		resets = <&cpg 704>;

		usb0: usb-channel@0 {
			reg = <0>;
			#phy-cells = <1>;
		};
	};

	usbphy1: usb-phy@e6598100 {
		compatible = "renesas,usb-phy-r8a77470",
			     "renesas,rcar-gen2-usb-phy";
		reg = <0 0xe6598100 0 0x100>;
		#address-cells = <1>;
		#size-cells = <0>;
		clocks = <&cpg CPG_MOD 706>;
		clock-names = "usbhs";
		power-domains = <&sysc R8A77470_PD_ALWAYS_ON>;
		resets = <&cpg 706>;

		usb1: usb-channel@0 {
			reg = <0>;
			#phy-cells = <1>;
		};
	};
+123 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/phy/renesas,rcar-gen2-usb-phy.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Renesas R-Car Gen2 USB PHY

maintainers:
  - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

properties:
  compatible:
    items:
      - enum:
          - renesas,usb-phy-r8a7742      # RZ/G1H
          - renesas,usb-phy-r8a7743      # RZ/G1M
          - renesas,usb-phy-r8a7744      # RZ/G1N
          - renesas,usb-phy-r8a7745      # RZ/G1E
          - renesas,usb-phy-r8a77470     # RZ/G1C
          - renesas,usb-phy-r8a7790      # R-Car H2
          - renesas,usb-phy-r8a7791      # R-Car M2-W
          - renesas,usb-phy-r8a7794      # R-Car E2
      - const: renesas,rcar-gen2-usb-phy # R-Car Gen2 or RZ/G1

  reg:
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: usbhs

  power-domains:
    maxItems: 1

  resets:
    maxItems: 1

patternProperties:
  "^usb-phy@[02]$":
    type: object
    description: Subnode corresponding to a USB channel.

    properties:
      reg:
        description: FIXME RZ/G1C supports channel 0 only
        enum: [0, 2]

      '#phy-cells':
        description: |
          The phandle's argument in the PHY specifier is the USB controller
          selector for the USB channel.
          For RZ/G1C:
            - 0 for EHCI/OHCI
            - 1 for HS-USB
          For all other SoCS:
            - 0 for PCI EHCI/OHCI
            - 1 for HS-USB (channel 0) or xHCI (channel 2)
        const: 1

    required:
      - reg
      - '#phy-cells'

    additionalProperties: false

required:
  - compatible
  - reg
  - '#address-cells'
  - '#size-cells'
  - clocks
  - clock-names
  - resets
  - power-domains
  - usb-phy@0

if:
  properties:
    compatible:
      contains:
        const: renesas,usb-phy-r8a77470
then:
  properties:
    usb-phy@2: false
else:
  required:
    - usb-phy@2

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/r8a7790-cpg-mssr.h>
    #include <dt-bindings/power/r8a7790-sysc.h>
    usb-phy-controller@e6590100 {
        compatible = "renesas,usb-phy-r8a7790", "renesas,rcar-gen2-usb-phy";
        reg = <0xe6590100 0x100>;
        #address-cells = <1>;
        #size-cells = <0>;
        clocks = <&cpg CPG_MOD 704>;
        clock-names = "usbhs";
        power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
        resets = <&cpg 704>;

        usb0: usb-phy@0 {
            reg = <0>;
            #phy-cells = <1>;
        };
        usb2: usb-phy@2 {
            reg = <2>;
            #phy-cells = <1>;
        };
    };