0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 # Copyright 2019 BayLibre, SAS
0003 %YAML 1.2
0004 ---
0005 $id: "http://devicetree.org/schemas/usb/amlogic,meson-g12a-usb-ctrl.yaml#"
0006 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
0007
0008 title: Amlogic Meson G12A DWC3 USB SoC Controller Glue
0009
0010 maintainers:
0011 - Neil Armstrong <neil.armstrong@linaro.org>
0012
0013 description: |
0014 The Amlogic G12A embeds a DWC3 USB IP Core configured for USB2 and USB3
0015 in host-only mode, and a DWC2 IP Core configured for USB2 peripheral mode
0016 only.
0017
0018 A glue connects the DWC3 core to USB2 PHYs and optionally to an USB3 PHY.
0019
0020 One of the USB2 PHYs can be re-routed in peripheral mode to a DWC2 USB IP.
0021
0022 The DWC3 Glue controls the PHY routing and power, an interrupt line is
0023 connected to the Glue to serve as OTG ID change detection.
0024
0025 The Amlogic A1 embeds a DWC3 USB IP Core configured for USB2 in
0026 host-only mode.
0027
0028 The Amlogic GXL, GXM & AXG SoCs doesn't embed an USB3 PHY.
0029
0030 properties:
0031 compatible:
0032 enum:
0033 - amlogic,meson-gxl-usb-ctrl
0034 - amlogic,meson-gxm-usb-ctrl
0035 - amlogic,meson-axg-usb-ctrl
0036 - amlogic,meson-g12a-usb-ctrl
0037 - amlogic,meson-a1-usb-ctrl
0038
0039 ranges: true
0040
0041 "#address-cells":
0042 enum: [ 1, 2 ]
0043
0044 "#size-cells":
0045 enum: [ 1, 2 ]
0046
0047 clocks:
0048 minItems: 1
0049 maxItems: 3
0050
0051 clock-names:
0052 minItems: 1
0053 maxItems: 3
0054
0055 resets:
0056 minItems: 1
0057
0058 reg:
0059 maxItems: 1
0060
0061 interrupts:
0062 maxItems: 1
0063
0064 phy-names:
0065 minItems: 1
0066 maxItems: 3
0067
0068 phys:
0069 minItems: 1
0070 maxItems: 3
0071
0072 dr_mode: true
0073
0074 power-domains:
0075 maxItems: 1
0076
0077 vbus-supply:
0078 description: VBUS power supply when used in OTG switchable mode
0079
0080 patternProperties:
0081 "^usb@[0-9a-f]+$":
0082 oneOf:
0083 - $ref: dwc2.yaml#
0084 - $ref: snps,dwc3.yaml#
0085
0086 additionalProperties: false
0087
0088 required:
0089 - compatible
0090 - "#address-cells"
0091 - "#size-cells"
0092 - ranges
0093 - clocks
0094 - resets
0095 - reg
0096 - interrupts
0097 - phy-names
0098 - phys
0099 - dr_mode
0100
0101 allOf:
0102 - if:
0103 properties:
0104 compatible:
0105 enum:
0106 - amlogic,meson-g12a-usb-ctrl
0107
0108 then:
0109 properties:
0110 phy-names:
0111 items:
0112 - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
0113 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
0114 - const: usb3-phy0 # USB3 PHY if USB3_0 is used
0115 - if:
0116 properties:
0117 compatible:
0118 enum:
0119 - amlogic,meson-gxl-usb-ctrl
0120
0121 then:
0122 properties:
0123 clocks:
0124 minItems: 2
0125 clock-names:
0126 items:
0127 - const: usb_ctrl
0128 - const: ddr
0129 phy-names:
0130 items:
0131 - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
0132 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
0133 required:
0134 - clock-names
0135 - if:
0136 properties:
0137 compatible:
0138 enum:
0139 - amlogic,meson-gxm-usb-ctrl
0140
0141 then:
0142 properties:
0143 clocks:
0144 minItems: 2
0145 clock-names:
0146 items:
0147 - const: usb_ctrl
0148 - const: ddr
0149 phy-names:
0150 items:
0151 - const: usb2-phy0 # USB2 PHY0 if USBHOST_A port is used
0152 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
0153 - const: usb2-phy2 # USB2 PHY2 if USBOTG_C port is used
0154
0155 required:
0156 - clock-names
0157 - if:
0158 properties:
0159 compatible:
0160 enum:
0161 - amlogic,meson-axg-usb-ctrl
0162
0163 then:
0164 properties:
0165 phy-names:
0166 items:
0167 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
0168 clocks:
0169 minItems: 2
0170 clock-names:
0171 items:
0172 - const: usb_ctrl
0173 - const: ddr
0174 required:
0175 - clock-names
0176 - if:
0177 properties:
0178 compatible:
0179 enum:
0180 - amlogic,meson-a1-usb-ctrl
0181
0182 then:
0183 properties:
0184 phy-names:
0185 items:
0186 - const: usb2-phy1 # USB2 PHY1 if USBOTG_B port is used
0187 clocks:
0188 minItems: 3
0189 clock-names:
0190 items:
0191 - const: usb_ctrl
0192 - const: usb_bus
0193 - const: xtal_usb_ctrl
0194 required:
0195 - clock-names
0196
0197 examples:
0198 - |
0199 usb: usb@ffe09000 {
0200 compatible = "amlogic,meson-g12a-usb-ctrl";
0201 reg = <0xffe09000 0xa0>;
0202 interrupts = <16>;
0203 #address-cells = <1>;
0204 #size-cells = <1>;
0205 ranges;
0206
0207 clocks = <&clkc_usb>;
0208 resets = <&reset_usb>;
0209
0210 dr_mode = "otg";
0211
0212 phys = <&usb2_phy0>, <&usb2_phy1>, <&usb3_phy0>;
0213 phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0";
0214
0215 dwc2: usb@ff400000 {
0216 compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
0217 reg = <0xff400000 0x40000>;
0218 interrupts = <31>;
0219 clocks = <&clkc_usb1>;
0220 clock-names = "otg";
0221 phys = <&usb2_phy1>;
0222 dr_mode = "peripheral";
0223 g-rx-fifo-size = <192>;
0224 g-np-tx-fifo-size = <128>;
0225 g-tx-fifo-size = <128 128 16 16 16>;
0226 };
0227
0228 dwc3: usb@ff500000 {
0229 compatible = "snps,dwc3";
0230 reg = <0xff500000 0x100000>;
0231 interrupts = <30>;
0232 dr_mode = "host";
0233 snps,dis_u2_susphy_quirk;
0234 snps,quirk-frame-length-adjustment = <0x20>;
0235 };
0236 };