xref: /linux/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml (revision c6a43fb3487f7e040170e60cdb9b030c669e9cf5)
16aec9751SNeil Armstrong# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
26aec9751SNeil Armstrong# Copyright 2019 BayLibre, SAS
36aec9751SNeil Armstrong%YAML 1.2
46aec9751SNeil Armstrong---
56aec9751SNeil Armstrong$id: "http://devicetree.org/schemas/usb/amlogic,meson-g12a-usb-ctrl.yaml#"
66aec9751SNeil Armstrong$schema: "http://devicetree.org/meta-schemas/core.yaml#"
76aec9751SNeil Armstrong
86aec9751SNeil Armstrongtitle: Amlogic Meson G12A DWC3 USB SoC Controller Glue
96aec9751SNeil Armstrong
106aec9751SNeil Armstrongmaintainers:
11*c6a43fb3SNeil Armstrong  - Neil Armstrong <neil.armstrong@linaro.org>
126aec9751SNeil Armstrong
136aec9751SNeil Armstrongdescription: |
146aec9751SNeil Armstrong  The Amlogic G12A embeds a DWC3 USB IP Core configured for USB2 and USB3
156aec9751SNeil Armstrong  in host-only mode, and a DWC2 IP Core configured for USB2 peripheral mode
166aec9751SNeil Armstrong  only.
176aec9751SNeil Armstrong
186aec9751SNeil Armstrong  A glue connects the DWC3 core to USB2 PHYs and optionally to an USB3 PHY.
196aec9751SNeil Armstrong
206aec9751SNeil Armstrong  One of the USB2 PHYs can be re-routed in peripheral mode to a DWC2 USB IP.
216aec9751SNeil Armstrong
226aec9751SNeil Armstrong  The DWC3 Glue controls the PHY routing and power, an interrupt line is
236aec9751SNeil Armstrong  connected to the Glue to serve as OTG ID change detection.
246aec9751SNeil Armstrong
258dcb5a11SHanjie Lin  The Amlogic A1 embeds a DWC3 USB IP Core configured for USB2 in
268dcb5a11SHanjie Lin  host-only mode.
278dcb5a11SHanjie Lin
28cdff2c94SNeil Armstrong  The Amlogic GXL, GXM & AXG SoCs doesn't embed an USB3 PHY.
298f385b67SNeil Armstrong
306aec9751SNeil Armstrongproperties:
316aec9751SNeil Armstrong  compatible:
326aec9751SNeil Armstrong    enum:
338f385b67SNeil Armstrong      - amlogic,meson-gxl-usb-ctrl
348f385b67SNeil Armstrong      - amlogic,meson-gxm-usb-ctrl
35cdff2c94SNeil Armstrong      - amlogic,meson-axg-usb-ctrl
366aec9751SNeil Armstrong      - amlogic,meson-g12a-usb-ctrl
378dcb5a11SHanjie Lin      - amlogic,meson-a1-usb-ctrl
386aec9751SNeil Armstrong
396aec9751SNeil Armstrong  ranges: true
406aec9751SNeil Armstrong
416aec9751SNeil Armstrong  "#address-cells":
426aec9751SNeil Armstrong    enum: [ 1, 2 ]
436aec9751SNeil Armstrong
446aec9751SNeil Armstrong  "#size-cells":
456aec9751SNeil Armstrong    enum: [ 1, 2 ]
466aec9751SNeil Armstrong
476aec9751SNeil Armstrong  clocks:
486aec9751SNeil Armstrong    minItems: 1
498f385b67SNeil Armstrong    maxItems: 3
508f385b67SNeil Armstrong
518f385b67SNeil Armstrong  clock-names:
528f385b67SNeil Armstrong    minItems: 1
538f385b67SNeil Armstrong    maxItems: 3
546aec9751SNeil Armstrong
556aec9751SNeil Armstrong  resets:
566aec9751SNeil Armstrong    minItems: 1
576aec9751SNeil Armstrong
586aec9751SNeil Armstrong  reg:
596aec9751SNeil Armstrong    maxItems: 1
606aec9751SNeil Armstrong
616aec9751SNeil Armstrong  interrupts:
626aec9751SNeil Armstrong    maxItems: 1
636aec9751SNeil Armstrong
646aec9751SNeil Armstrong  phy-names:
658f385b67SNeil Armstrong    minItems: 1
668f385b67SNeil Armstrong    maxItems: 3
676aec9751SNeil Armstrong
686aec9751SNeil Armstrong  phys:
696aec9751SNeil Armstrong    minItems: 1
706aec9751SNeil Armstrong    maxItems: 3
716aec9751SNeil Armstrong
726aec9751SNeil Armstrong  dr_mode: true
736aec9751SNeil Armstrong
746aec9751SNeil Armstrong  power-domains:
756aec9751SNeil Armstrong    maxItems: 1
766aec9751SNeil Armstrong
776aec9751SNeil Armstrong  vbus-supply:
786aec9751SNeil Armstrong    description: VBUS power supply when used in OTG switchable mode
796aec9751SNeil Armstrong
806aec9751SNeil ArmstrongpatternProperties:
816aec9751SNeil Armstrong  "^usb@[0-9a-f]+$":
823b34a589SSerge Semin    oneOf:
833b34a589SSerge Semin      - $ref: dwc2.yaml#
843b34a589SSerge Semin      - $ref: snps,dwc3.yaml#
856aec9751SNeil Armstrong
866aec9751SNeil ArmstrongadditionalProperties: false
876aec9751SNeil Armstrong
886aec9751SNeil Armstrongrequired:
896aec9751SNeil Armstrong  - compatible
906aec9751SNeil Armstrong  - "#address-cells"
916aec9751SNeil Armstrong  - "#size-cells"
926aec9751SNeil Armstrong  - ranges
936aec9751SNeil Armstrong  - clocks
946aec9751SNeil Armstrong  - resets
956aec9751SNeil Armstrong  - reg
966aec9751SNeil Armstrong  - interrupts
976aec9751SNeil Armstrong  - phy-names
986aec9751SNeil Armstrong  - phys
996aec9751SNeil Armstrong  - dr_mode
1006aec9751SNeil Armstrong
1018dcb5a11SHanjie LinallOf:
1028dcb5a11SHanjie Lin  - if:
1038dcb5a11SHanjie Lin      properties:
1048dcb5a11SHanjie Lin        compatible:
1058dcb5a11SHanjie Lin          enum:
1068f385b67SNeil Armstrong            - amlogic,meson-g12a-usb-ctrl
1078f385b67SNeil Armstrong
1088f385b67SNeil Armstrong    then:
1098f385b67SNeil Armstrong      properties:
1108f385b67SNeil Armstrong        phy-names:
1118f385b67SNeil Armstrong          items:
1128f385b67SNeil Armstrong            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
1138f385b67SNeil Armstrong            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
1148f385b67SNeil Armstrong            - const: usb3-phy0 # USB3 PHY if USB3_0 is used
1158f385b67SNeil Armstrong  - if:
1168f385b67SNeil Armstrong      properties:
1178f385b67SNeil Armstrong        compatible:
1188f385b67SNeil Armstrong          enum:
1198f385b67SNeil Armstrong            - amlogic,meson-gxl-usb-ctrl
1208f385b67SNeil Armstrong
1218f385b67SNeil Armstrong    then:
1228f385b67SNeil Armstrong      properties:
1238f385b67SNeil Armstrong        clocks:
1248f385b67SNeil Armstrong          minItems: 2
1258f385b67SNeil Armstrong        clock-names:
1268f385b67SNeil Armstrong          items:
1278f385b67SNeil Armstrong            - const: usb_ctrl
1288f385b67SNeil Armstrong            - const: ddr
1298f385b67SNeil Armstrong        phy-names:
1308f385b67SNeil Armstrong          items:
1318f385b67SNeil Armstrong            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
1328f385b67SNeil Armstrong            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
1338f385b67SNeil Armstrong      required:
1348f385b67SNeil Armstrong        - clock-names
1358f385b67SNeil Armstrong  - if:
1368f385b67SNeil Armstrong      properties:
1378f385b67SNeil Armstrong        compatible:
1388f385b67SNeil Armstrong          enum:
1398f385b67SNeil Armstrong            - amlogic,meson-gxm-usb-ctrl
1408f385b67SNeil Armstrong
1418f385b67SNeil Armstrong    then:
1428f385b67SNeil Armstrong      properties:
1438f385b67SNeil Armstrong        clocks:
1448f385b67SNeil Armstrong          minItems: 2
1458f385b67SNeil Armstrong        clock-names:
1468f385b67SNeil Armstrong          items:
1478f385b67SNeil Armstrong            - const: usb_ctrl
1488f385b67SNeil Armstrong            - const: ddr
1498f385b67SNeil Armstrong        phy-names:
1508f385b67SNeil Armstrong          items:
1518f385b67SNeil Armstrong            - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
1528f385b67SNeil Armstrong            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
1538f385b67SNeil Armstrong            - const: usb2-phy2 # USB2 PHY2 if USBOTG_C port is used
1548f385b67SNeil Armstrong
1558f385b67SNeil Armstrong      required:
1568f385b67SNeil Armstrong        - clock-names
1578f385b67SNeil Armstrong  - if:
1588f385b67SNeil Armstrong      properties:
1598f385b67SNeil Armstrong        compatible:
1608f385b67SNeil Armstrong          enum:
161cdff2c94SNeil Armstrong            - amlogic,meson-axg-usb-ctrl
162cdff2c94SNeil Armstrong
163cdff2c94SNeil Armstrong    then:
164cdff2c94SNeil Armstrong      properties:
165cdff2c94SNeil Armstrong        phy-names:
166cdff2c94SNeil Armstrong          items:
167cdff2c94SNeil Armstrong            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
168cdff2c94SNeil Armstrong        clocks:
169cdff2c94SNeil Armstrong          minItems: 2
170cdff2c94SNeil Armstrong        clock-names:
171cdff2c94SNeil Armstrong          items:
172cdff2c94SNeil Armstrong            - const: usb_ctrl
173cdff2c94SNeil Armstrong            - const: ddr
174cdff2c94SNeil Armstrong      required:
175cdff2c94SNeil Armstrong        - clock-names
176cdff2c94SNeil Armstrong  - if:
177cdff2c94SNeil Armstrong      properties:
178cdff2c94SNeil Armstrong        compatible:
179cdff2c94SNeil Armstrong          enum:
1808dcb5a11SHanjie Lin            - amlogic,meson-a1-usb-ctrl
1818dcb5a11SHanjie Lin
1828dcb5a11SHanjie Lin    then:
1838dcb5a11SHanjie Lin      properties:
1848f385b67SNeil Armstrong        phy-names:
1858f385b67SNeil Armstrong          items:
1868f385b67SNeil Armstrong            - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
1878dcb5a11SHanjie Lin        clocks:
1888dcb5a11SHanjie Lin          minItems: 3
1898dcb5a11SHanjie Lin        clock-names:
1908dcb5a11SHanjie Lin          items:
1918dcb5a11SHanjie Lin            - const: usb_ctrl
1928dcb5a11SHanjie Lin            - const: usb_bus
1938dcb5a11SHanjie Lin            - const: xtal_usb_ctrl
1948dcb5a11SHanjie Lin      required:
1958dcb5a11SHanjie Lin        - clock-names
1968dcb5a11SHanjie Lin
1976aec9751SNeil Armstrongexamples:
1986aec9751SNeil Armstrong  - |
1996aec9751SNeil Armstrong    usb: usb@ffe09000 {
2006aec9751SNeil Armstrong          compatible = "amlogic,meson-g12a-usb-ctrl";
201fba56184SRob Herring          reg = <0xffe09000 0xa0>;
2026aec9751SNeil Armstrong          interrupts = <16>;
2036aec9751SNeil Armstrong          #address-cells = <1>;
2046aec9751SNeil Armstrong          #size-cells = <1>;
2056aec9751SNeil Armstrong          ranges;
2066aec9751SNeil Armstrong
2076aec9751SNeil Armstrong          clocks = <&clkc_usb>;
2086aec9751SNeil Armstrong          resets = <&reset_usb>;
2096aec9751SNeil Armstrong
2106aec9751SNeil Armstrong          dr_mode = "otg";
2116aec9751SNeil Armstrong
2126aec9751SNeil Armstrong          phys = <&usb2_phy0>, <&usb2_phy1>, <&usb3_phy0>;
2136aec9751SNeil Armstrong          phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0";
2146aec9751SNeil Armstrong
2156aec9751SNeil Armstrong          dwc2: usb@ff400000 {
2166aec9751SNeil Armstrong              compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
2176aec9751SNeil Armstrong              reg = <0xff400000 0x40000>;
2186aec9751SNeil Armstrong              interrupts = <31>;
2196aec9751SNeil Armstrong              clocks = <&clkc_usb1>;
220c5a05bd6SBenjamin Gaignard              clock-names = "otg";
2216aec9751SNeil Armstrong              phys = <&usb2_phy1>;
2226aec9751SNeil Armstrong              dr_mode = "peripheral";
2236aec9751SNeil Armstrong              g-rx-fifo-size = <192>;
2246aec9751SNeil Armstrong              g-np-tx-fifo-size = <128>;
2256aec9751SNeil Armstrong              g-tx-fifo-size = <128 128 16 16 16>;
2266aec9751SNeil Armstrong          };
2276aec9751SNeil Armstrong
2286aec9751SNeil Armstrong          dwc3: usb@ff500000 {
2296aec9751SNeil Armstrong              compatible = "snps,dwc3";
2306aec9751SNeil Armstrong              reg = <0xff500000 0x100000>;
2316aec9751SNeil Armstrong              interrupts = <30>;
2326aec9751SNeil Armstrong              dr_mode = "host";
2336aec9751SNeil Armstrong              snps,dis_u2_susphy_quirk;
234042cdcd6SSerge Semin              snps,quirk-frame-length-adjustment = <0x20>;
2356aec9751SNeil Armstrong          };
2366aec9751SNeil Armstrong    };
237