1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: "http://devicetree.org/schemas/usb/nvidia,tegra-xudc.yaml#"
5$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6
7title: Device tree binding for NVIDIA Tegra XUSB device mode controller (XUDC)
8
9description:
10  The Tegra XUDC controller supports both USB 2.0 HighSpeed/FullSpeed and
11  USB 3.0 SuperSpeed protocols.
12
13maintainers:
14  - Nagarjuna Kristam <nkristam@nvidia.com>
15  - JC Kuo <jckuo@nvidia.com>
16  - Thierry Reding <treding@nvidia.com>
17
18properties:
19  compatible:
20    items:
21      - enum:
22          - nvidia,tegra210-xudc # For Tegra210
23          - nvidia,tegra186-xudc # For Tegra186
24
25  reg:
26    minItems: 2
27    maxItems: 3
28    items:
29      - description: XUSB device controller registers
30      - description: XUSB device PCI Config registers
31      - description: XUSB device registers.
32
33  reg-names:
34    minItems: 2
35    maxItems: 3
36    items:
37      - const: base
38      - const: fpci
39      - const: ipfs
40
41  interrupts:
42    maxItems: 1
43    description: Must contain the XUSB device interrupt.
44
45  clocks:
46    minItems: 4
47    maxItems: 5
48    items:
49      - description: Clock to enable core XUSB dev clock.
50      - description: Clock to enable XUSB super speed clock.
51      - description: Clock to enable XUSB super speed dev clock.
52      - description: Clock to enable XUSB high speed dev clock.
53      - description: Clock to enable XUSB full speed dev clock.
54
55  clock-names:
56    minItems: 4
57    maxItems: 5
58    items:
59     - const: dev
60     - const: ss
61     - const: ss_src
62     - const: fs_src
63     - const: hs_src
64
65  power-domains:
66    maxItems: 2
67    items:
68      - description: XUSBB(device) power-domain
69      - description: XUSBA(superspeed) power-domain
70
71  power-domain-names:
72    maxItems: 2
73    items:
74      - const: dev
75      - const: ss
76
77  nvidia,xusb-padctl:
78    $ref: /schemas/types.yaml#/definitions/phandle-array
79    description:
80      phandle to the XUSB pad controller that is used to configure the USB pads
81      used by the XUDC controller.
82
83  phys:
84    minItems: 1
85    description:
86      Must contain an entry for each entry in phy-names.
87      See ../phy/phy-bindings.txt for details.
88
89  phy-names:
90    minItems: 1
91    items:
92      - const: usb2-0
93      - const: usb2-1
94      - const: usb2-2
95      - const: usb2-3
96      - const: usb3-0
97      - const: usb3-1
98      - const: usb3-2
99      - const: usb3-3
100
101  avddio-usb-supply:
102    description: PCIe/USB3 analog logic power supply. Must supply 1.05 V.
103
104  hvdd-usb-supply:
105    description: USB controller power supply. Must supply 3.3 V.
106
107required:
108  - compatible
109  - reg
110  - reg-names
111  - interrupts
112  - clocks
113  - clock-names
114  - power-domains
115  - power-domain-names
116  - nvidia,xusb-padctl
117  - phys
118  - phy-names
119
120allOf:
121  - if:
122      properties:
123        compatible:
124          contains:
125            enum:
126              - nvidia,tegra210-xudc
127    then:
128      properties:
129        reg:
130          minItems: 3
131        reg-names:
132          minItems: 3
133        clocks:
134          minItems: 5
135        clock-names:
136          minItems: 5
137      required:
138        - avddio-usb-supply
139        - hvdd-usb-supply
140
141  - if:
142      properties:
143        compatible:
144          contains:
145            enum:
146              - nvidia,tegra186-xudc
147    then:
148      properties:
149        reg:
150          maxItems: 2
151        reg-names:
152          maxItems: 2
153        clocks:
154          maxItems: 4
155        clock-names:
156          maxItems: 4
157
158examples:
159  - |
160    #include <dt-bindings/clock/tegra210-car.h>
161    #include <dt-bindings/gpio/tegra-gpio.h>
162    #include <dt-bindings/interrupt-controller/arm-gic.h>
163
164    usb@700d0000 {
165        compatible = "nvidia,tegra210-xudc";
166        reg = <0x0 0x700d0000 0x0 0x8000>,
167              <0x0 0x700d8000 0x0 0x1000>,
168              <0x0 0x700d9000 0x0 0x1000>;
169        reg-names = "base", "fpci", "ipfs";
170
171        interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
172
173        clocks = <&tegra_car TEGRA210_CLK_XUSB_DEV>,
174                 <&tegra_car TEGRA210_CLK_XUSB_SS>,
175                 <&tegra_car TEGRA210_CLK_XUSB_SSP_SRC>,
176                 <&tegra_car TEGRA210_CLK_XUSB_FS_SRC>,
177                 <&tegra_car TEGRA210_CLK_XUSB_HS_SRC>;
178        clock-names = "dev", "ss", "ss_src", "fs_src", "hs_src";
179
180        power-domains = <&pd_xusbdev>, <&pd_xusbss>;
181        power-domain-names = "dev", "ss";
182
183        nvidia,xusb-padctl = <&padctl>;
184
185        phys = <&micro_b>;
186        phy-names = "usb2-0";
187
188        avddio-usb-supply = <&vdd_pex_1v05>;
189        hvdd-usb-supply = <&vdd_3v3_sys>;
190    };
191