xref: /linux/Documentation/devicetree/bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml (revision fba5618451d2b3af5e55f8af5ce9c5d3677ad9c4)
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:
116aec9751SNeil Armstrong  - Neil Armstrong <narmstrong@baylibre.com>
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
286aec9751SNeil Armstrongproperties:
296aec9751SNeil Armstrong  compatible:
306aec9751SNeil Armstrong    enum:
316aec9751SNeil Armstrong      - amlogic,meson-g12a-usb-ctrl
328dcb5a11SHanjie Lin      - amlogic,meson-a1-usb-ctrl
336aec9751SNeil Armstrong
346aec9751SNeil Armstrong  ranges: true
356aec9751SNeil Armstrong
366aec9751SNeil Armstrong  "#address-cells":
376aec9751SNeil Armstrong    enum: [ 1, 2 ]
386aec9751SNeil Armstrong
396aec9751SNeil Armstrong  "#size-cells":
406aec9751SNeil Armstrong    enum: [ 1, 2 ]
416aec9751SNeil Armstrong
426aec9751SNeil Armstrong  clocks:
436aec9751SNeil Armstrong    minItems: 1
446aec9751SNeil Armstrong
456aec9751SNeil Armstrong  resets:
466aec9751SNeil Armstrong    minItems: 1
476aec9751SNeil Armstrong
486aec9751SNeil Armstrong  reg:
496aec9751SNeil Armstrong    maxItems: 1
506aec9751SNeil Armstrong
516aec9751SNeil Armstrong  interrupts:
526aec9751SNeil Armstrong    maxItems: 1
536aec9751SNeil Armstrong
546aec9751SNeil Armstrong  phy-names:
556aec9751SNeil Armstrong    items:
566aec9751SNeil Armstrong      - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
576aec9751SNeil Armstrong      - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
586aec9751SNeil Armstrong      - const: usb3-phy0 # USB3 PHY if USB3_0 is used
596aec9751SNeil Armstrong
606aec9751SNeil Armstrong  phys:
616aec9751SNeil Armstrong    minItems: 1
626aec9751SNeil Armstrong    maxItems: 3
636aec9751SNeil Armstrong
646aec9751SNeil Armstrong  dr_mode: true
656aec9751SNeil Armstrong
666aec9751SNeil Armstrong  power-domains:
676aec9751SNeil Armstrong    maxItems: 1
686aec9751SNeil Armstrong
696aec9751SNeil Armstrong  vbus-supply:
706aec9751SNeil Armstrong    description: VBUS power supply when used in OTG switchable mode
716aec9751SNeil Armstrong
726aec9751SNeil ArmstrongpatternProperties:
736aec9751SNeil Armstrong  "^usb@[0-9a-f]+$":
746aec9751SNeil Armstrong    type: object
756aec9751SNeil Armstrong
766aec9751SNeil ArmstrongadditionalProperties: false
776aec9751SNeil Armstrong
786aec9751SNeil Armstrongrequired:
796aec9751SNeil Armstrong  - compatible
806aec9751SNeil Armstrong  - "#address-cells"
816aec9751SNeil Armstrong  - "#size-cells"
826aec9751SNeil Armstrong  - ranges
836aec9751SNeil Armstrong  - clocks
846aec9751SNeil Armstrong  - resets
856aec9751SNeil Armstrong  - reg
866aec9751SNeil Armstrong  - interrupts
876aec9751SNeil Armstrong  - phy-names
886aec9751SNeil Armstrong  - phys
896aec9751SNeil Armstrong  - dr_mode
906aec9751SNeil Armstrong
918dcb5a11SHanjie LinallOf:
928dcb5a11SHanjie Lin  - if:
938dcb5a11SHanjie Lin      properties:
948dcb5a11SHanjie Lin        compatible:
958dcb5a11SHanjie Lin          enum:
968dcb5a11SHanjie Lin            - amlogic,meson-a1-usb-ctrl
978dcb5a11SHanjie Lin
988dcb5a11SHanjie Lin    then:
998dcb5a11SHanjie Lin      properties:
1008dcb5a11SHanjie Lin        clocks:
1018dcb5a11SHanjie Lin          minItems: 3
1028dcb5a11SHanjie Lin        clock-names:
1038dcb5a11SHanjie Lin          items:
1048dcb5a11SHanjie Lin            - const: usb_ctrl
1058dcb5a11SHanjie Lin            - const: usb_bus
1068dcb5a11SHanjie Lin            - const: xtal_usb_ctrl
1078dcb5a11SHanjie Lin      required:
1088dcb5a11SHanjie Lin        - clock-names
1098dcb5a11SHanjie Lin
1106aec9751SNeil Armstrongexamples:
1116aec9751SNeil Armstrong  - |
1126aec9751SNeil Armstrong    usb: usb@ffe09000 {
1136aec9751SNeil Armstrong          compatible = "amlogic,meson-g12a-usb-ctrl";
114*fba56184SRob Herring          reg = <0xffe09000 0xa0>;
1156aec9751SNeil Armstrong          interrupts = <16>;
1166aec9751SNeil Armstrong          #address-cells = <1>;
1176aec9751SNeil Armstrong          #size-cells = <1>;
1186aec9751SNeil Armstrong          ranges;
1196aec9751SNeil Armstrong
1206aec9751SNeil Armstrong          clocks = <&clkc_usb>;
1216aec9751SNeil Armstrong          resets = <&reset_usb>;
1226aec9751SNeil Armstrong
1236aec9751SNeil Armstrong          dr_mode = "otg";
1246aec9751SNeil Armstrong
1256aec9751SNeil Armstrong          phys = <&usb2_phy0>, <&usb2_phy1>, <&usb3_phy0>;
1266aec9751SNeil Armstrong          phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0";
1276aec9751SNeil Armstrong
1286aec9751SNeil Armstrong          dwc2: usb@ff400000 {
1296aec9751SNeil Armstrong              compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
1306aec9751SNeil Armstrong              reg = <0xff400000 0x40000>;
1316aec9751SNeil Armstrong              interrupts = <31>;
1326aec9751SNeil Armstrong              clocks = <&clkc_usb1>;
133c5a05bd6SBenjamin Gaignard              clock-names = "otg";
1346aec9751SNeil Armstrong              phys = <&usb2_phy1>;
1356aec9751SNeil Armstrong              dr_mode = "peripheral";
1366aec9751SNeil Armstrong              g-rx-fifo-size = <192>;
1376aec9751SNeil Armstrong              g-np-tx-fifo-size = <128>;
1386aec9751SNeil Armstrong              g-tx-fifo-size = <128 128 16 16 16>;
1396aec9751SNeil Armstrong          };
1406aec9751SNeil Armstrong
1416aec9751SNeil Armstrong          dwc3: usb@ff500000 {
1426aec9751SNeil Armstrong              compatible = "snps,dwc3";
1436aec9751SNeil Armstrong              reg = <0xff500000 0x100000>;
1446aec9751SNeil Armstrong              interrupts = <30>;
1456aec9751SNeil Armstrong              dr_mode = "host";
1466aec9751SNeil Armstrong              snps,dis_u2_susphy_quirk;
1476aec9751SNeil Armstrong              snps,quirk-frame-length-adjustment;
1486aec9751SNeil Armstrong          };
1496aec9751SNeil Armstrong    };
150