xref: /freebsd/sys/contrib/device-tree/Bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
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---
5*fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/usb/amlogic,meson-g12a-usb-ctrl.yaml#
6*fac71e4eSEmmanuel 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:
11b97ee269SEmmanuel Vadot  - Neil Armstrong <neil.armstrong@linaro.org>
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
286be33864SEmmanuel 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
356be33864SEmmanuel 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]+$":
825def4c47SEmmanuel Vadot    oneOf:
835def4c47SEmmanuel Vadot      - $ref: dwc2.yaml#
845def4c47SEmmanuel Vadot      - $ref: snps,dwc3.yaml#
85c66ec88fSEmmanuel Vadot
86c66ec88fSEmmanuel VadotadditionalProperties: false
87c66ec88fSEmmanuel Vadot
88c66ec88fSEmmanuel Vadotrequired:
89c66ec88fSEmmanuel Vadot  - compatible
90c66ec88fSEmmanuel Vadot  - "#address-cells"
91c66ec88fSEmmanuel Vadot  - "#size-cells"
92c66ec88fSEmmanuel Vadot  - ranges
93c66ec88fSEmmanuel Vadot  - clocks
94c66ec88fSEmmanuel Vadot  - resets
95c66ec88fSEmmanuel Vadot  - reg
96c66ec88fSEmmanuel Vadot  - interrupts
97c66ec88fSEmmanuel Vadot  - phy-names
98c66ec88fSEmmanuel Vadot  - phys
99c66ec88fSEmmanuel Vadot  - dr_mode
100c66ec88fSEmmanuel Vadot
101c66ec88fSEmmanuel VadotallOf:
102c66ec88fSEmmanuel Vadot  - if:
103c66ec88fSEmmanuel Vadot      properties:
104c66ec88fSEmmanuel Vadot        compatible:
105c66ec88fSEmmanuel Vadot          enum:
106c66ec88fSEmmanuel Vadot            - amlogic,meson-g12a-usb-ctrl
107c66ec88fSEmmanuel Vadot
108c66ec88fSEmmanuel Vadot    then:
109c66ec88fSEmmanuel Vadot      properties:
110c66ec88fSEmmanuel Vadot        phy-names:
111cb7aa33aSEmmanuel Vadot          minItems: 2
112c66ec88fSEmmanuel Vadot          items:
113c66ec88fSEmmanuel Vadot            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
114c66ec88fSEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
115c66ec88fSEmmanuel Vadot            - const: usb3-phy0 # USB3 PHY if USB3_0 is used
116c66ec88fSEmmanuel Vadot  - if:
117c66ec88fSEmmanuel Vadot      properties:
118c66ec88fSEmmanuel Vadot        compatible:
119c66ec88fSEmmanuel Vadot          enum:
120c66ec88fSEmmanuel Vadot            - amlogic,meson-gxl-usb-ctrl
121c66ec88fSEmmanuel Vadot
122c66ec88fSEmmanuel Vadot    then:
123c66ec88fSEmmanuel Vadot      properties:
124c66ec88fSEmmanuel Vadot        clocks:
125c66ec88fSEmmanuel Vadot          minItems: 2
126c66ec88fSEmmanuel Vadot        clock-names:
127c66ec88fSEmmanuel Vadot          items:
128c66ec88fSEmmanuel Vadot            - const: usb_ctrl
129c66ec88fSEmmanuel Vadot            - const: ddr
130c66ec88fSEmmanuel Vadot        phy-names:
131c66ec88fSEmmanuel Vadot          items:
132c66ec88fSEmmanuel Vadot            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
133c66ec88fSEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
134c66ec88fSEmmanuel Vadot      required:
135c66ec88fSEmmanuel Vadot        - clock-names
136c66ec88fSEmmanuel Vadot  - if:
137c66ec88fSEmmanuel Vadot      properties:
138c66ec88fSEmmanuel Vadot        compatible:
139c66ec88fSEmmanuel Vadot          enum:
140c66ec88fSEmmanuel Vadot            - amlogic,meson-gxm-usb-ctrl
141c66ec88fSEmmanuel Vadot
142c66ec88fSEmmanuel Vadot    then:
143c66ec88fSEmmanuel Vadot      properties:
144c66ec88fSEmmanuel Vadot        clocks:
145c66ec88fSEmmanuel Vadot          minItems: 2
146c66ec88fSEmmanuel Vadot        clock-names:
147c66ec88fSEmmanuel Vadot          items:
148c66ec88fSEmmanuel Vadot            - const: usb_ctrl
149c66ec88fSEmmanuel Vadot            - const: ddr
150c66ec88fSEmmanuel Vadot        phy-names:
151c66ec88fSEmmanuel Vadot          items:
152c66ec88fSEmmanuel Vadot            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
153c66ec88fSEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
154c66ec88fSEmmanuel Vadot            - const: usb2-phy2 # USB2 PHY2 if USBOTG_C port is used
155c66ec88fSEmmanuel Vadot
156c66ec88fSEmmanuel Vadot      required:
157c66ec88fSEmmanuel Vadot        - clock-names
158c66ec88fSEmmanuel Vadot  - if:
159c66ec88fSEmmanuel Vadot      properties:
160c66ec88fSEmmanuel Vadot        compatible:
161c66ec88fSEmmanuel Vadot          enum:
1626be33864SEmmanuel Vadot            - amlogic,meson-axg-usb-ctrl
1636be33864SEmmanuel Vadot
1646be33864SEmmanuel Vadot    then:
1656be33864SEmmanuel Vadot      properties:
1666be33864SEmmanuel Vadot        phy-names:
1676be33864SEmmanuel Vadot          items:
1686be33864SEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
1696be33864SEmmanuel Vadot        clocks:
1706be33864SEmmanuel Vadot          minItems: 2
1716be33864SEmmanuel Vadot        clock-names:
1726be33864SEmmanuel Vadot          items:
1736be33864SEmmanuel Vadot            - const: usb_ctrl
1746be33864SEmmanuel Vadot            - const: ddr
1756be33864SEmmanuel Vadot      required:
1766be33864SEmmanuel Vadot        - clock-names
1776be33864SEmmanuel Vadot  - if:
1786be33864SEmmanuel Vadot      properties:
1796be33864SEmmanuel Vadot        compatible:
1806be33864SEmmanuel Vadot          enum:
181c66ec88fSEmmanuel Vadot            - amlogic,meson-a1-usb-ctrl
182c66ec88fSEmmanuel Vadot
183c66ec88fSEmmanuel Vadot    then:
184c66ec88fSEmmanuel Vadot      properties:
185c66ec88fSEmmanuel Vadot        phy-names:
186c66ec88fSEmmanuel Vadot          items:
187c66ec88fSEmmanuel Vadot            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
188c66ec88fSEmmanuel Vadot        clocks:
189c66ec88fSEmmanuel Vadot          minItems: 3
190c66ec88fSEmmanuel Vadot        clock-names:
191c66ec88fSEmmanuel Vadot          items:
192c66ec88fSEmmanuel Vadot            - const: usb_ctrl
193c66ec88fSEmmanuel Vadot            - const: usb_bus
194c66ec88fSEmmanuel Vadot            - const: xtal_usb_ctrl
195c66ec88fSEmmanuel Vadot      required:
196c66ec88fSEmmanuel Vadot        - clock-names
197c66ec88fSEmmanuel Vadot
198c66ec88fSEmmanuel Vadotexamples:
199c66ec88fSEmmanuel Vadot  - |
200c66ec88fSEmmanuel Vadot    usb: usb@ffe09000 {
201c66ec88fSEmmanuel Vadot          compatible = "amlogic,meson-g12a-usb-ctrl";
202c66ec88fSEmmanuel Vadot          reg = <0xffe09000 0xa0>;
203c66ec88fSEmmanuel Vadot          interrupts = <16>;
204c66ec88fSEmmanuel Vadot          #address-cells = <1>;
205c66ec88fSEmmanuel Vadot          #size-cells = <1>;
206c66ec88fSEmmanuel Vadot          ranges;
207c66ec88fSEmmanuel Vadot
208c66ec88fSEmmanuel Vadot          clocks = <&clkc_usb>;
209c66ec88fSEmmanuel Vadot          resets = <&reset_usb>;
210c66ec88fSEmmanuel Vadot
211c66ec88fSEmmanuel Vadot          dr_mode = "otg";
212c66ec88fSEmmanuel Vadot
213c66ec88fSEmmanuel Vadot          phys = <&usb2_phy0>, <&usb2_phy1>, <&usb3_phy0>;
214c66ec88fSEmmanuel Vadot          phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0";
215c66ec88fSEmmanuel Vadot
216c66ec88fSEmmanuel Vadot          dwc2: usb@ff400000 {
217c66ec88fSEmmanuel Vadot              compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
218c66ec88fSEmmanuel Vadot              reg = <0xff400000 0x40000>;
219c66ec88fSEmmanuel Vadot              interrupts = <31>;
220c66ec88fSEmmanuel Vadot              clocks = <&clkc_usb1>;
221c66ec88fSEmmanuel Vadot              clock-names = "otg";
222c66ec88fSEmmanuel Vadot              phys = <&usb2_phy1>;
223c66ec88fSEmmanuel Vadot              dr_mode = "peripheral";
224c66ec88fSEmmanuel Vadot              g-rx-fifo-size = <192>;
225c66ec88fSEmmanuel Vadot              g-np-tx-fifo-size = <128>;
226c66ec88fSEmmanuel Vadot              g-tx-fifo-size = <128 128 16 16 16>;
227c66ec88fSEmmanuel Vadot          };
228c66ec88fSEmmanuel Vadot
229c66ec88fSEmmanuel Vadot          dwc3: usb@ff500000 {
230c66ec88fSEmmanuel Vadot              compatible = "snps,dwc3";
231c66ec88fSEmmanuel Vadot              reg = <0xff500000 0x100000>;
232c66ec88fSEmmanuel Vadot              interrupts = <30>;
233c66ec88fSEmmanuel Vadot              dr_mode = "host";
234c66ec88fSEmmanuel Vadot              snps,dis_u2_susphy_quirk;
2355def4c47SEmmanuel Vadot              snps,quirk-frame-length-adjustment = <0x20>;
236c66ec88fSEmmanuel Vadot          };
237c66ec88fSEmmanuel Vadot    };
238