1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/phy/nvidia,tegra186-xusb-padctl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: NVIDIA Tegra186 XUSB pad controller
8
9maintainers:
10  - Thierry Reding <thierry.reding@gmail.com>
11  - Jon Hunter <jonathanh@nvidia.com>
12
13description: |
14  The Tegra XUSB pad controller manages a set of I/O lanes (with differential
15  signals) which connect directly to pins/pads on the SoC package. Each lane
16  is controlled by a HW block referred to as a "pad" in the Tegra hardware
17  documentation. Each such "pad" may control either one or multiple lanes,
18  and thus contains any logic common to all its lanes. Each lane can be
19  separately configured and powered up.
20
21  Some of the lanes are high-speed lanes, which can be used for PCIe, SATA or
22  super-speed USB. Other lanes are for various types of low-speed, full-speed
23  or high-speed USB (such as UTMI, ULPI and HSIC). The XUSB pad controller
24  contains a software-configurable mux that sits between the I/O controller
25  ports (e.g. PCIe) and the lanes.
26
27  In addition to per-lane configuration, USB 3.0 ports may require additional
28  settings on a per-board basis.
29
30  Pads will be represented as children of the top-level XUSB pad controller
31  device tree node. Each lane exposed by the pad will be represented by its
32  own subnode and can be referenced by users of the lane using the standard
33  PHY bindings, as described by the phy-bindings.txt file in this directory.
34
35  The Tegra hardware documentation refers to the connection between the XUSB
36  pad controller and the XUSB controller as "ports". This is confusing since
37  "port" is typically used to denote the physical USB receptacle. The device
38  tree binding in this document uses the term "port" to refer to the logical
39  abstraction of the signals that are routed to a USB receptacle (i.e. a PHY
40  for the USB signal, the VBUS power supply, the USB 2.0 companion port for
41  USB 3.0 receptacles, ...).
42
43properties:
44  compatible:
45    const: nvidia,tegra186-xusb-padctl
46
47  reg:
48    items:
49      - description: pad controller registers
50      - description: AO registers
51
52  interrupts:
53    items:
54      - description: XUSB pad controller interrupt
55
56  reg-names:
57    items:
58      - const: padctl
59      - const: ao
60
61  resets:
62    items:
63      - description: pad controller reset
64
65  reset-names:
66    items:
67      - const: padctl
68
69  avdd-pll-erefeut-supply:
70    description: UPHY brick and reference clock as well as UTMI PHY
71      power supply. Must supply 1.8 V.
72
73  avdd-usb-supply:
74    description: USB I/Os, VBUS, ID, REXT, D+/D- power supply. Must
75      supply 3.3 V.
76
77  vclamp-usb-supply:
78    description: Bias rail for USB pad. Must supply 1.8 V.
79
80  vddio-hsic-supply:
81    description: HSIC PHY power supply. Must supply 1.2 V.
82
83  pads:
84    description: A required child node named "pads" contains a list of
85      subnodes, one for each of the pads exposed by the XUSB pad controller.
86      Each pad may need additional resources that can be referenced in its
87      pad node.
88
89      The "status" property is used to enable or disable the use of a pad.
90      If set to "disabled", the pad will not be used on the given board. In
91      order to use the pad and any of its lanes, this property must be set
92      to "okay" or be absent.
93    type: object
94    additionalProperties: false
95    properties:
96      usb2:
97        type: object
98        additionalProperties: false
99        properties:
100          clocks:
101            items:
102              - description: USB2 tracking clock
103
104          clock-names:
105            items:
106              - const: trk
107
108          lanes:
109            type: object
110            additionalProperties: false
111            properties:
112              usb2-0:
113                type: object
114                additionalProperties: false
115                properties:
116                  "#phy-cells":
117                    const: 0
118
119                  nvidia,function:
120                    description: Function selection for this lane.
121                    $ref: /schemas/types.yaml#/definitions/string
122                    enum: [ xusb ]
123
124              usb2-1:
125                type: object
126                additionalProperties: false
127                properties:
128                  "#phy-cells":
129                    const: 0
130
131                  nvidia,function:
132                    description: Function selection for this lane.
133                    $ref: /schemas/types.yaml#/definitions/string
134                    enum: [ xusb ]
135
136              usb2-2:
137                type: object
138                additionalProperties: false
139                properties:
140                  "#phy-cells":
141                    const: 0
142
143                  nvidia,function:
144                    description: Function selection for this lane.
145                    $ref: /schemas/types.yaml#/definitions/string
146                    enum: [ xusb ]
147
148      hsic:
149        type: object
150        additionalProperties: false
151        properties:
152          clocks:
153            items:
154              - description: HSIC tracking clock
155
156          clock-names:
157            items:
158              - const: trk
159
160          lanes:
161            type: object
162            additionalProperties: false
163            properties:
164              hsic-0:
165                type: object
166                additionalProperties: false
167                properties:
168                  "#phy-cells":
169                    const: 0
170
171                  nvidia,function:
172                    description: Function selection for this lane.
173                    $ref: /schemas/types.yaml#/definitions/string
174                    enum: [ xusb ]
175
176      usb3:
177        type: object
178        additionalProperties: false
179        properties:
180          lanes:
181            type: object
182            additionalProperties: false
183            properties:
184              usb3-0:
185                type: object
186                additionalProperties: false
187                properties:
188                  "#phy-cells":
189                    const: 0
190
191                  nvidia,function:
192                    description: Function selection for this lane.
193                    $ref: /schemas/types.yaml#/definitions/string
194                    enum: [ xusb ]
195
196              usb3-1:
197                type: object
198                additionalProperties: false
199                properties:
200                  "#phy-cells":
201                    const: 0
202
203                  nvidia,function:
204                    description: Function selection for this lane.
205                    $ref: /schemas/types.yaml#/definitions/string
206                    enum: [ xusb ]
207
208              usb3-2:
209                type: object
210                additionalProperties: false
211                properties:
212                  "#phy-cells":
213                    const: 0
214
215                  nvidia,function:
216                    description: Function selection for this lane.
217                    $ref: /schemas/types.yaml#/definitions/string
218                    enum: [ xusb ]
219
220  ports:
221    description: A required child node named "ports" contains a list of
222      subnodes, one for each of the ports exposed by the XUSB pad controller.
223      Each port may need additional resources that can be referenced in its
224      port node.
225
226      The "status" property is used to enable or disable the use of a port.
227      If set to "disabled", the port will not be used on the given board. In
228      order to use the port, this property must be set to "okay".
229    type: object
230    additionalProperties: false
231    properties:
232      usb2-0:
233        type: object
234        additionalProperties: false
235        properties:
236          # no need to further describe this because the connector will
237          # match on gpio-usb-b-connector or usb-b-connector and cause
238          # that binding to be selected for the subnode
239          connector:
240            type: object
241
242          mode:
243            description: A string that determines the mode in which to
244              run the port.
245            $ref: /schemas/types.yaml#/definitions/string
246            enum: [ host, peripheral, otg ]
247
248          nvidia,internal:
249            description: A boolean property whose presence determines
250              that a port is internal. In the absence of this property
251              the port is considered to be external.
252            $ref: /schemas/types.yaml#/definitions/flag
253
254          usb-role-switch:
255            description: |
256              A boolean property whole presence indicates that the port
257              supports OTG or peripheral mode. If present, the port
258              supports switching between USB host and peripheral roles.
259              A connector must be added as a subnode in that case.
260
261              See ../connector/usb-connector.yaml.
262
263          vbus-supply:
264            description: A phandle to the regulator supplying the VBUS
265              voltage.
266
267        dependencies:
268          usb-role-switch: [ connector ]
269
270      usb2-1:
271        type: object
272        additionalProperties: false
273        properties:
274          # no need to further describe this because the connector will
275          # match on gpio-usb-b-connector or usb-b-connector and cause
276          # that binding to be selected for the subnode
277          connector:
278            type: object
279
280          mode:
281            description: A string that determines the mode in which to
282              run the port.
283            $ref: /schemas/types.yaml#/definitions/string
284            enum: [ host, peripheral, otg ]
285
286          nvidia,internal:
287            description: A boolean property whose presence determines
288              that a port is internal. In the absence of this property
289              the port is considered to be external.
290            $ref: /schemas/types.yaml#/definitions/flag
291
292          usb-role-switch:
293            description: |
294              A boolean property whole presence indicates that the port
295              supports OTG or peripheral mode. If present, the port
296              supports switching between USB host and peripheral roles.
297              A connector must be added as a subnode in that case.
298
299              See ../connector/usb-connector.yaml.
300
301          vbus-supply:
302            description: A phandle to the regulator supplying the VBUS
303              voltage.
304
305        dependencies:
306          usb-role-switch: [ connector ]
307
308      usb2-2:
309        type: object
310        additionalProperties: false
311        properties:
312          # no need to further describe this because the connector will
313          # match on gpio-usb-b-connector or usb-b-connector and cause
314          # that binding to be selected for the subnode
315          connector:
316            type: object
317
318          mode:
319            description: A string that determines the mode in which to
320              run the port.
321            $ref: /schemas/types.yaml#/definitions/string
322            enum: [ host, peripheral, otg ]
323
324          nvidia,internal:
325            description: A boolean property whose presence determines
326              that a port is internal. In the absence of this property
327              the port is considered to be external.
328            $ref: /schemas/types.yaml#/definitions/flag
329
330          usb-role-switch:
331            description: |
332              A boolean property whole presence indicates that the port
333              supports OTG or peripheral mode. If present, the port
334              supports switching between USB host and peripheral roles.
335              A connector must be added as a subnode in that case.
336
337              See ../connector/usb-connector.yaml.
338
339          vbus-supply:
340            description: A phandle to the regulator supplying the VBUS
341              voltage.
342
343        dependencies:
344          usb-role-switch: [ connector ]
345
346      hsic-0:
347        type: object
348        additionalProperties: false
349
350      usb3-0:
351        type: object
352        additionalProperties: false
353        properties:
354          nvidia,internal:
355            description: A boolean property whose presence determines
356              that a port is internal. In the absence of this property
357              the port is considered to be external.
358            $ref: /schemas/types.yaml#/definitions/flag
359
360          nvidia,usb2-companion:
361            description: A single cell that specifies the physical port
362              number to map this super-speed USB port to. The range of
363              valid port numbers varies with the SoC generation.
364            $ref: /schemas/types.yaml#/definitions/uint32
365            enum: [ 0, 1, 2, 3 ]
366
367          vbus-supply:
368            description: A phandle to the regulator supplying the VBUS
369              voltage.
370
371      usb3-1:
372        type: object
373        additionalProperties: false
374        properties:
375          nvidia,internal:
376            description: A boolean property whose presence determines
377              that a port is internal. In the absence of this property
378              the port is considered to be external.
379            $ref: /schemas/types.yaml#/definitions/flag
380
381          nvidia,usb2-companion:
382            description: A single cell that specifies the physical port
383              number to map this super-speed USB port to. The range of
384              valid port numbers varies with the SoC generation.
385            $ref: /schemas/types.yaml#/definitions/uint32
386            enum: [ 0, 1, 2, 3 ]
387
388          vbus-supply:
389            description: A phandle to the regulator supplying the VBUS
390              voltage.
391
392      usb3-2:
393        type: object
394        additionalProperties: false
395        properties:
396          nvidia,internal:
397            description: A boolean property whose presence determines
398              that a port is internal. In the absence of this property
399              the port is considered to be external.
400            $ref: /schemas/types.yaml#/definitions/flag
401
402          nvidia,usb2-companion:
403            description: A single cell that specifies the physical port
404              number to map this super-speed USB port to. The range of
405              valid port numbers varies with the SoC generation.
406            $ref: /schemas/types.yaml#/definitions/uint32
407            enum: [ 0, 1, 2, 3 ]
408
409          vbus-supply:
410            description: A phandle to the regulator supplying the VBUS
411              voltage.
412
413additionalProperties: false
414
415required:
416  - compatible
417  - reg
418  - resets
419  - reset-names
420  - avdd-pll-erefeut-supply
421  - avdd-usb-supply
422  - vclamp-usb-supply
423  - vddio-hsic-supply
424
425examples:
426  - |
427    #include <dt-bindings/clock/tegra186-clock.h>
428    #include <dt-bindings/gpio/tegra186-gpio.h>
429    #include <dt-bindings/interrupt-controller/arm-gic.h>
430    #include <dt-bindings/reset/tegra186-reset.h>
431
432    padctl@3520000 {
433        compatible = "nvidia,tegra186-xusb-padctl";
434        reg = <0x03520000 0x1000>,
435              <0x03540000 0x1000>;
436        reg-names = "padctl", "ao";
437        interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
438
439        resets = <&bpmp TEGRA186_RESET_XUSB_PADCTL>;
440        reset-names = "padctl";
441
442        avdd-pll-erefeut-supply = <&vdd_1v8_pll>;
443        avdd-usb-supply = <&vdd_3v3_sys>;
444        vclamp-usb-supply = <&vdd_1v8>;
445        vddio-hsic-supply = <&gnd>;
446
447        pads {
448            usb2 {
449                clocks = <&bpmp TEGRA186_CLK_USB2_TRK>;
450                clock-names = "trk";
451
452                lanes {
453                    usb2-0 {
454                        nvidia,function = "xusb";
455                        #phy-cells = <0>;
456                    };
457
458                    usb2-1 {
459                        nvidia,function = "xusb";
460                        #phy-cells = <0>;
461                    };
462
463                    usb2-2 {
464                        nvidia,function = "xusb";
465                        #phy-cells = <0>;
466                    };
467                };
468            };
469
470            hsic {
471                clocks = <&bpmp TEGRA186_CLK_HSIC_TRK>;
472                clock-names = "trk";
473                status = "disabled";
474
475                lanes {
476                    hsic-0 {
477                        status = "disabled";
478                        #phy-cells = <0>;
479                    };
480                };
481            };
482
483            usb3 {
484                lanes {
485                    usb3-0 {
486                        nvidia,function = "xusb";
487                        #phy-cells = <0>;
488                    };
489
490                    usb3-1 {
491                        nvidia,function = "xusb";
492                        #phy-cells = <0>;
493                    };
494
495                    usb3-2 {
496                        nvidia,function = "xusb";
497                        #phy-cells = <0>;
498                    };
499                };
500            };
501        };
502
503        ports {
504            usb2-0 {
505                mode = "otg";
506                vbus-supply = <&vdd_usb0>;
507                usb-role-switch;
508
509                connector {
510                    compatible = "gpio-usb-b-connector",
511                                 "usb-b-connector";
512                    label = "micro-USB";
513                    type = "micro";
514                    vbus-gpios = <&gpio TEGRA186_MAIN_GPIO(X, 7) GPIO_ACTIVE_LOW>;
515                    id-gpios = <&pmic 0 GPIO_ACTIVE_HIGH>;
516                };
517            };
518
519            usb2-1 {
520                vbus-supply = <&vdd_usb1>;
521                mode = "host";
522            };
523
524            usb2-2 {
525                status = "disabled";
526            };
527
528            hsic-0 {
529                status = "disabled";
530            };
531
532            usb3-0 {
533                nvidia,usb2-companion = <1>;
534            };
535
536            usb3-1 {
537                status = "disabled";
538            };
539
540            usb3-2 {
541                status = "disabled";
542            };
543        };
544    };
545