1# SPDX-License-Identifier: GPL-2.0-only
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/usb/renesas,usb3-peri.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Renesas USB 3.0 Peripheral controller
8
9maintainers:
10  - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
11
12properties:
13  compatible:
14    oneOf:
15      - items:
16          - enum:
17              - renesas,r8a774a1-usb3-peri # RZ/G2M
18              - renesas,r8a774b1-usb3-peri # RZ/G2N
19              - renesas,r8a774c0-usb3-peri # RZ/G2E
20              - renesas,r8a774e1-usb3-peri # RZ/G2H
21              - renesas,r8a7795-usb3-peri  # R-Car H3
22              - renesas,r8a7796-usb3-peri  # R-Car M3-W
23              - renesas,r8a77961-usb3-peri # R-Car M3-W+
24              - renesas,r8a77965-usb3-peri # R-Car M3-N
25              - renesas,r8a77990-usb3-peri # R-Car E3
26          - const: renesas,rcar-gen3-usb3-peri
27
28      - items:
29          - enum:
30              - renesas,r9a09g011-usb3-peri # RZ/V2M
31          - const: renesas,rzv2m-usb3-peri
32
33  reg:
34    maxItems: 1
35
36  interrupts:
37    minItems: 1
38    items:
39      - description: Combined interrupt for DMA, SYS and ERR
40      - description: Dual Role Device (DRD)
41      - description: Battery Charging
42      - description: Global Purpose Input
43
44  interrupt-names:
45    minItems: 1
46    items:
47      - const: all_p
48      - const: drd
49      - const: bc
50      - const: gpi
51
52  clocks:
53    minItems: 1
54    items:
55      - description: Main clock
56      - description: Register access clock
57
58  clock-names:
59    minItems: 1
60    items:
61      - const: aclk
62      - const: reg
63
64  phys:
65    maxItems: 1
66
67  phy-names:
68    const: usb
69
70  power-domains:
71    maxItems: 1
72
73  resets:
74    minItems: 1
75    items:
76      - description: Peripheral reset
77      - description: DRD reset
78
79  reset-names:
80    items:
81      - const: aresetn_p
82      - const: drd_reset
83
84  usb-role-switch:
85    $ref: /schemas/types.yaml#/definitions/flag
86    description: Support role switch.
87
88  companion:
89    $ref: /schemas/types.yaml#/definitions/phandle
90    description: phandle of a companion.
91
92  ports:
93    $ref: /schemas/graph.yaml#/properties/ports
94    description: |
95      any connector to the data bus of this controller should be modelled
96      using the OF graph bindings specified, if the "usb-role-switch"
97      property is used.
98
99    properties:
100      port@0:
101        $ref: /schemas/graph.yaml#/properties/port
102        description: High Speed (HS) data bus.
103
104      port@1:
105        $ref: /schemas/graph.yaml#/properties/port
106        description: Super Speed (SS) data bus.
107
108    required:
109      - port@0
110      - port@1
111
112required:
113  - compatible
114  - interrupts
115  - clocks
116
117allOf:
118  - if:
119      properties:
120        compatible:
121          contains:
122            enum:
123              - renesas,rzv2m-usb3-peri
124    then:
125      properties:
126        clocks:
127          minItems: 2
128        clock-names:
129          minItems: 2
130        interrupts:
131          minItems: 4
132        interrupt-names:
133          minItems: 4
134        resets:
135          minItems: 2
136      required:
137        - clock-names
138        - interrupt-names
139        - resets
140        - reset-names
141    else:
142      properties:
143        clocks:
144          maxItems: 1
145        interrupts:
146          maxItems: 1
147        resets:
148          maxItems: 1
149
150additionalProperties: false
151
152examples:
153  - |
154    #include <dt-bindings/clock/r8a774c0-cpg-mssr.h>
155    #include <dt-bindings/interrupt-controller/arm-gic.h>
156    #include <dt-bindings/power/r8a774c0-sysc.h>
157
158    usb3_peri0: usb@ee020000 {
159        compatible = "renesas,r8a774c0-usb3-peri", "renesas,rcar-gen3-usb3-peri";
160        reg = <0xee020000 0x400>;
161        interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
162        clocks = <&cpg CPG_MOD 328>;
163        companion = <&xhci0>;
164        usb-role-switch;
165
166        ports {
167                #address-cells = <1>;
168                #size-cells = <0>;
169                port@0 {
170                        reg = <0>;
171                        usb3_hs_ep: endpoint {
172                                remote-endpoint = <&hs_ep>;
173                        };
174                };
175                port@1 {
176                        reg = <1>;
177                        usb3_role_switch: endpoint {
178                                remote-endpoint = <&hd3ss3220_out_ep>;
179                        };
180                };
181        };
182    };
183