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