xref: /freebsd/sys/contrib/device-tree/Bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot# Copyright 2019 BayLibre, SAS
3c66ec88fSEmmanuel Vadot%YAML 1.2
4c66ec88fSEmmanuel Vadot---
5c66ec88fSEmmanuel Vadot$id: "http://devicetree.org/schemas/usb/amlogic,meson-g12a-usb-ctrl.yaml#"
6c66ec88fSEmmanuel Vadot$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7c66ec88fSEmmanuel Vadot
8c66ec88fSEmmanuel Vadottitle: Amlogic Meson G12A DWC3 USB SoC Controller Glue
9c66ec88fSEmmanuel Vadot
10c66ec88fSEmmanuel Vadotmaintainers:
11c66ec88fSEmmanuel Vadot  - Neil Armstrong <narmstrong@baylibre.com>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription: |
14c66ec88fSEmmanuel Vadot  The Amlogic G12A embeds a DWC3 USB IP Core configured for USB2 and USB3
15c66ec88fSEmmanuel Vadot  in host-only mode, and a DWC2 IP Core configured for USB2 peripheral mode
16c66ec88fSEmmanuel Vadot  only.
17c66ec88fSEmmanuel Vadot
18c66ec88fSEmmanuel Vadot  A glue connects the DWC3 core to USB2 PHYs and optionally to an USB3 PHY.
19c66ec88fSEmmanuel Vadot
20c66ec88fSEmmanuel Vadot  One of the USB2 PHYs can be re-routed in peripheral mode to a DWC2 USB IP.
21c66ec88fSEmmanuel Vadot
22c66ec88fSEmmanuel Vadot  The DWC3 Glue controls the PHY routing and power, an interrupt line is
23c66ec88fSEmmanuel Vadot  connected to the Glue to serve as OTG ID change detection.
24c66ec88fSEmmanuel Vadot
25c66ec88fSEmmanuel Vadot  The Amlogic A1 embeds a DWC3 USB IP Core configured for USB2 in
26c66ec88fSEmmanuel Vadot  host-only mode.
27c66ec88fSEmmanuel Vadot
28*6be33864SEmmanuel Vadot  The Amlogic GXL, GXM & AXG SoCs doesn't embed an USB3 PHY.
29c66ec88fSEmmanuel Vadot
30c66ec88fSEmmanuel Vadotproperties:
31c66ec88fSEmmanuel Vadot  compatible:
32c66ec88fSEmmanuel Vadot    enum:
33c66ec88fSEmmanuel Vadot      - amlogic,meson-gxl-usb-ctrl
34c66ec88fSEmmanuel Vadot      - amlogic,meson-gxm-usb-ctrl
35*6be33864SEmmanuel Vadot      - amlogic,meson-axg-usb-ctrl
36c66ec88fSEmmanuel Vadot      - amlogic,meson-g12a-usb-ctrl
37c66ec88fSEmmanuel Vadot      - amlogic,meson-a1-usb-ctrl
38c66ec88fSEmmanuel Vadot
39c66ec88fSEmmanuel Vadot  ranges: true
40c66ec88fSEmmanuel Vadot
41c66ec88fSEmmanuel Vadot  "#address-cells":
42c66ec88fSEmmanuel Vadot    enum: [ 1, 2 ]
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel Vadot  "#size-cells":
45c66ec88fSEmmanuel Vadot    enum: [ 1, 2 ]
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  clocks:
48c66ec88fSEmmanuel Vadot    minItems: 1
49c66ec88fSEmmanuel Vadot    maxItems: 3
50c66ec88fSEmmanuel Vadot
51c66ec88fSEmmanuel Vadot  clock-names:
52c66ec88fSEmmanuel Vadot    minItems: 1
53c66ec88fSEmmanuel Vadot    maxItems: 3
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot  resets:
56c66ec88fSEmmanuel Vadot    minItems: 1
57c66ec88fSEmmanuel Vadot
58c66ec88fSEmmanuel Vadot  reg:
59c66ec88fSEmmanuel Vadot    maxItems: 1
60c66ec88fSEmmanuel Vadot
61c66ec88fSEmmanuel Vadot  interrupts:
62c66ec88fSEmmanuel Vadot    maxItems: 1
63c66ec88fSEmmanuel Vadot
64c66ec88fSEmmanuel Vadot  phy-names:
65c66ec88fSEmmanuel Vadot    minItems: 1
66c66ec88fSEmmanuel Vadot    maxItems: 3
67c66ec88fSEmmanuel Vadot
68c66ec88fSEmmanuel Vadot  phys:
69c66ec88fSEmmanuel Vadot    minItems: 1
70c66ec88fSEmmanuel Vadot    maxItems: 3
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  dr_mode: true
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot  power-domains:
75c66ec88fSEmmanuel Vadot    maxItems: 1
76c66ec88fSEmmanuel Vadot
77c66ec88fSEmmanuel Vadot  vbus-supply:
78c66ec88fSEmmanuel Vadot    description: VBUS power supply when used in OTG switchable mode
79c66ec88fSEmmanuel Vadot
80c66ec88fSEmmanuel VadotpatternProperties:
81c66ec88fSEmmanuel Vadot  "^usb@[0-9a-f]+$":
82c66ec88fSEmmanuel Vadot    type: object
83c66ec88fSEmmanuel Vadot
84c66ec88fSEmmanuel VadotadditionalProperties: false
85c66ec88fSEmmanuel Vadot
86c66ec88fSEmmanuel Vadotrequired:
87c66ec88fSEmmanuel Vadot  - compatible
88c66ec88fSEmmanuel Vadot  - "#address-cells"
89c66ec88fSEmmanuel Vadot  - "#size-cells"
90c66ec88fSEmmanuel Vadot  - ranges
91c66ec88fSEmmanuel Vadot  - clocks
92c66ec88fSEmmanuel Vadot  - resets
93c66ec88fSEmmanuel Vadot  - reg
94c66ec88fSEmmanuel Vadot  - interrupts
95c66ec88fSEmmanuel Vadot  - phy-names
96c66ec88fSEmmanuel Vadot  - phys
97c66ec88fSEmmanuel Vadot  - dr_mode
98c66ec88fSEmmanuel Vadot
99c66ec88fSEmmanuel VadotallOf:
100c66ec88fSEmmanuel Vadot  - if:
101c66ec88fSEmmanuel Vadot      properties:
102c66ec88fSEmmanuel Vadot        compatible:
103c66ec88fSEmmanuel Vadot          enum:
104c66ec88fSEmmanuel Vadot            - amlogic,meson-g12a-usb-ctrl
105c66ec88fSEmmanuel Vadot
106c66ec88fSEmmanuel Vadot    then:
107c66ec88fSEmmanuel Vadot      properties:
108c66ec88fSEmmanuel Vadot        phy-names:
109c66ec88fSEmmanuel Vadot          items:
110c66ec88fSEmmanuel Vadot            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
111c66ec88fSEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
112c66ec88fSEmmanuel Vadot            - const: usb3-phy0 # USB3 PHY if USB3_0 is used
113c66ec88fSEmmanuel Vadot  - if:
114c66ec88fSEmmanuel Vadot      properties:
115c66ec88fSEmmanuel Vadot        compatible:
116c66ec88fSEmmanuel Vadot          enum:
117c66ec88fSEmmanuel Vadot            - amlogic,meson-gxl-usb-ctrl
118c66ec88fSEmmanuel Vadot
119c66ec88fSEmmanuel Vadot    then:
120c66ec88fSEmmanuel Vadot      properties:
121c66ec88fSEmmanuel Vadot        clocks:
122c66ec88fSEmmanuel Vadot          minItems: 2
123c66ec88fSEmmanuel Vadot        clock-names:
124c66ec88fSEmmanuel Vadot          items:
125c66ec88fSEmmanuel Vadot            - const: usb_ctrl
126c66ec88fSEmmanuel Vadot            - const: ddr
127c66ec88fSEmmanuel Vadot        phy-names:
128c66ec88fSEmmanuel Vadot          items:
129c66ec88fSEmmanuel Vadot            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
130c66ec88fSEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
131c66ec88fSEmmanuel Vadot      required:
132c66ec88fSEmmanuel Vadot        - clock-names
133c66ec88fSEmmanuel Vadot  - if:
134c66ec88fSEmmanuel Vadot      properties:
135c66ec88fSEmmanuel Vadot        compatible:
136c66ec88fSEmmanuel Vadot          enum:
137c66ec88fSEmmanuel Vadot            - amlogic,meson-gxm-usb-ctrl
138c66ec88fSEmmanuel Vadot
139c66ec88fSEmmanuel Vadot    then:
140c66ec88fSEmmanuel Vadot      properties:
141c66ec88fSEmmanuel Vadot        clocks:
142c66ec88fSEmmanuel Vadot          minItems: 2
143c66ec88fSEmmanuel Vadot        clock-names:
144c66ec88fSEmmanuel Vadot          items:
145c66ec88fSEmmanuel Vadot            - const: usb_ctrl
146c66ec88fSEmmanuel Vadot            - const: ddr
147c66ec88fSEmmanuel Vadot        phy-names:
148c66ec88fSEmmanuel Vadot          items:
149c66ec88fSEmmanuel Vadot            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
150c66ec88fSEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
151c66ec88fSEmmanuel Vadot            - const: usb2-phy2 # USB2 PHY2 if USBOTG_C port is used
152c66ec88fSEmmanuel Vadot
153c66ec88fSEmmanuel Vadot      required:
154c66ec88fSEmmanuel Vadot        - clock-names
155c66ec88fSEmmanuel Vadot  - if:
156c66ec88fSEmmanuel Vadot      properties:
157c66ec88fSEmmanuel Vadot        compatible:
158c66ec88fSEmmanuel Vadot          enum:
159*6be33864SEmmanuel Vadot            - amlogic,meson-axg-usb-ctrl
160*6be33864SEmmanuel Vadot
161*6be33864SEmmanuel Vadot    then:
162*6be33864SEmmanuel Vadot      properties:
163*6be33864SEmmanuel Vadot        phy-names:
164*6be33864SEmmanuel Vadot          items:
165*6be33864SEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
166*6be33864SEmmanuel Vadot        clocks:
167*6be33864SEmmanuel Vadot          minItems: 2
168*6be33864SEmmanuel Vadot        clock-names:
169*6be33864SEmmanuel Vadot          items:
170*6be33864SEmmanuel Vadot            - const: usb_ctrl
171*6be33864SEmmanuel Vadot            - const: ddr
172*6be33864SEmmanuel Vadot      required:
173*6be33864SEmmanuel Vadot        - clock-names
174*6be33864SEmmanuel Vadot  - if:
175*6be33864SEmmanuel Vadot      properties:
176*6be33864SEmmanuel Vadot        compatible:
177*6be33864SEmmanuel Vadot          enum:
178c66ec88fSEmmanuel Vadot            - amlogic,meson-a1-usb-ctrl
179c66ec88fSEmmanuel Vadot
180c66ec88fSEmmanuel Vadot    then:
181c66ec88fSEmmanuel Vadot      properties:
182c66ec88fSEmmanuel Vadot        phy-names:
183c66ec88fSEmmanuel Vadot          items:
184c66ec88fSEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
185c66ec88fSEmmanuel Vadot        clocks:
186c66ec88fSEmmanuel Vadot          minItems: 3
187c66ec88fSEmmanuel Vadot        clock-names:
188c66ec88fSEmmanuel Vadot          items:
189c66ec88fSEmmanuel Vadot            - const: usb_ctrl
190c66ec88fSEmmanuel Vadot            - const: usb_bus
191c66ec88fSEmmanuel Vadot            - const: xtal_usb_ctrl
192c66ec88fSEmmanuel Vadot      required:
193c66ec88fSEmmanuel Vadot        - clock-names
194c66ec88fSEmmanuel Vadot
195c66ec88fSEmmanuel Vadotexamples:
196c66ec88fSEmmanuel Vadot  - |
197c66ec88fSEmmanuel Vadot    usb: usb@ffe09000 {
198c66ec88fSEmmanuel Vadot          compatible = "amlogic,meson-g12a-usb-ctrl";
199c66ec88fSEmmanuel Vadot          reg = <0xffe09000 0xa0>;
200c66ec88fSEmmanuel Vadot          interrupts = <16>;
201c66ec88fSEmmanuel Vadot          #address-cells = <1>;
202c66ec88fSEmmanuel Vadot          #size-cells = <1>;
203c66ec88fSEmmanuel Vadot          ranges;
204c66ec88fSEmmanuel Vadot
205c66ec88fSEmmanuel Vadot          clocks = <&clkc_usb>;
206c66ec88fSEmmanuel Vadot          resets = <&reset_usb>;
207c66ec88fSEmmanuel Vadot
208c66ec88fSEmmanuel Vadot          dr_mode = "otg";
209c66ec88fSEmmanuel Vadot
210c66ec88fSEmmanuel Vadot          phys = <&usb2_phy0>, <&usb2_phy1>, <&usb3_phy0>;
211c66ec88fSEmmanuel Vadot          phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0";
212c66ec88fSEmmanuel Vadot
213c66ec88fSEmmanuel Vadot          dwc2: usb@ff400000 {
214c66ec88fSEmmanuel Vadot              compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
215c66ec88fSEmmanuel Vadot              reg = <0xff400000 0x40000>;
216c66ec88fSEmmanuel Vadot              interrupts = <31>;
217c66ec88fSEmmanuel Vadot              clocks = <&clkc_usb1>;
218c66ec88fSEmmanuel Vadot              clock-names = "otg";
219c66ec88fSEmmanuel Vadot              phys = <&usb2_phy1>;
220c66ec88fSEmmanuel Vadot              dr_mode = "peripheral";
221c66ec88fSEmmanuel Vadot              g-rx-fifo-size = <192>;
222c66ec88fSEmmanuel Vadot              g-np-tx-fifo-size = <128>;
223c66ec88fSEmmanuel Vadot              g-tx-fifo-size = <128 128 16 16 16>;
224c66ec88fSEmmanuel Vadot          };
225c66ec88fSEmmanuel Vadot
226c66ec88fSEmmanuel Vadot          dwc3: usb@ff500000 {
227c66ec88fSEmmanuel Vadot              compatible = "snps,dwc3";
228c66ec88fSEmmanuel Vadot              reg = <0xff500000 0x100000>;
229c66ec88fSEmmanuel Vadot              interrupts = <30>;
230c66ec88fSEmmanuel Vadot              dr_mode = "host";
231c66ec88fSEmmanuel Vadot              snps,dis_u2_susphy_quirk;
232c66ec88fSEmmanuel Vadot              snps,quirk-frame-length-adjustment;
233c66ec88fSEmmanuel Vadot          };
234c66ec88fSEmmanuel Vadot    };
235