1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2# Copyright (c) 2020 MediaTek 3%YAML 1.2 4--- 5$id: http://devicetree.org/schemas/usb/mediatek,mtu3.yaml# 6$schema: http://devicetree.org/meta-schemas/core.yaml# 7 8title: MediaTek USB3 DRD Controller 9 10maintainers: 11 - Chunfeng Yun <chunfeng.yun@mediatek.com> 12 13allOf: 14 - $ref: "usb-drd.yaml" 15 16description: | 17 The DRD controller has a glue layer IPPC (IP Port Control), and its host is 18 based on xHCI. 19 20properties: 21 compatible: 22 items: 23 - enum: 24 - mediatek,mt2712-mtu3 25 - mediatek,mt8173-mtu3 26 - mediatek,mt8183-mtu3 27 - mediatek,mt8186-mtu3 28 - mediatek,mt8188-mtu3 29 - mediatek,mt8192-mtu3 30 - mediatek,mt8195-mtu3 31 - const: mediatek,mtu3 32 33 reg: 34 items: 35 - description: the registers of device MAC 36 - description: the registers of IP Port Control 37 38 reg-names: 39 items: 40 - const: mac 41 - const: ippc 42 43 interrupts: 44 description: 45 use "interrupts-extended" when the interrupts are connected to the 46 separate interrupt controllers 47 minItems: 1 48 items: 49 - description: SSUSB device controller interrupt 50 - description: optional, wakeup interrupt used to support runtime PM 51 52 interrupt-names: 53 items: 54 - const: device 55 - const: wakeup 56 57 power-domains: 58 description: A phandle to USB power domain node to control USB's MTCMOS 59 maxItems: 1 60 61 clocks: 62 minItems: 1 63 items: 64 - description: Controller clock used by normal mode 65 - description: Reference clock used by low power mode etc 66 - description: Mcu bus clock for register access 67 - description: DMA bus clock for data transfer 68 69 clock-names: 70 minItems: 1 71 items: 72 - const: sys_ck # required, others are optional 73 - const: ref_ck 74 - const: mcu_ck 75 - const: dma_ck 76 77 phys: 78 description: 79 List of all the USB PHYs used, it's better to keep the sequence 80 as the hardware layout. 81 minItems: 1 82 items: 83 - description: USB2/HS PHY # required, others are optional 84 - description: USB3/SS(P) PHY 85 - description: USB2/HS PHY # the following for backward compatible 86 - description: USB3/SS(P) PHY 87 - description: USB2/HS PHY 88 - description: USB3/SS(P) PHY 89 - description: USB2/HS PHY 90 - description: USB3/SS(P) PHY 91 - description: USB2/HS PHY 92 93 vusb33-supply: 94 description: Regulator of USB AVDD3.3v 95 96 vbus-supply: 97 deprecated: true 98 description: | 99 Regulator of USB VBUS5v, needed when supports dual-role mode. 100 Particularly, if use an output GPIO to control a VBUS regulator, should 101 model it as a regulator. See bindings/regulator/fixed-regulator.yaml 102 It's considered valid for compatibility reasons, not allowed for 103 new bindings, and put into a usb-connector node. 104 105 dr_mode: 106 enum: [host, peripheral, otg] 107 default: otg 108 109 maximum-speed: 110 enum: [super-speed-plus, super-speed, high-speed, full-speed] 111 112 resets: 113 maxItems: 1 114 115 "#address-cells": 116 enum: [1, 2] 117 118 "#size-cells": 119 enum: [1, 2] 120 121 ranges: true 122 123 extcon: 124 deprecated: true 125 description: | 126 Phandle to the extcon device detecting the IDDIG state, needed 127 when supports dual-role mode. 128 It's considered valid for compatibility reasons, not allowed for 129 new bindings, and use "usb-role-switch" property instead. 130 131 usb-role-switch: 132 $ref: /schemas/types.yaml#/definitions/flag 133 description: Support role switch. 134 type: boolean 135 136 role-switch-default-mode: 137 enum: [host, peripheral] 138 default: host 139 140 connector: 141 $ref: /schemas/connector/usb-connector.yaml# 142 description: 143 Connector for dual role switch, especially for "gpio-usb-b-connector" 144 type: object 145 146 port: 147 description: 148 Any connector to the data bus of this controller should be modelled 149 using the OF graph bindings specified, if the "usb-role-switch" 150 property is used. See graph.txt 151 $ref: /schemas/graph.yaml#/properties/port 152 153 enable-manual-drd: 154 $ref: /schemas/types.yaml#/definitions/flag 155 description: 156 supports manual dual-role switch via debugfs; usually used when 157 receptacle is TYPE-A and also wants to support dual-role mode. 158 type: boolean 159 160 wakeup-source: 161 description: enable USB remote wakeup, see power/wakeup-source.txt 162 type: boolean 163 164 mediatek,syscon-wakeup: 165 $ref: /schemas/types.yaml#/definitions/phandle-array 166 maxItems: 1 167 description: 168 A phandle to syscon used to access the register of the USB wakeup glue 169 layer between xHCI and SPM, the field should always be 3 cells long. 170 items: 171 items: 172 - description: 173 The first cell represents a phandle to syscon 174 - description: 175 The second cell represents the register base address of the glue 176 layer in syscon 177 - description: | 178 The third cell represents the hardware version of the glue layer, 179 1 - used by mt8173 etc, revision 1 without following IPM rule; 180 2 - used by mt2712 etc, revision 2 with following IPM rule; 181 101 - used by mt8183, specific 1.01; 182 102 - used by mt8192, specific 1.02; 183 enum: [1, 2, 101, 102] 184 185 mediatek,u3p-dis-msk: 186 $ref: /schemas/types.yaml#/definitions/uint32 187 description: The mask to disable u3ports, bit0 for u3port0, 188 bit1 for u3port1, ... etc 189 190 mediatek,u2p-dis-msk: 191 $ref: /schemas/types.yaml#/definitions/uint32 192 description: The mask to disable u2ports, bit0 for u2port0, 193 bit1 for u2port1, ... etc; but can't disable u2port0 if dual role mode 194 is enabled, so will be skipped in this case. 195 196# Required child node when support dual-role 197patternProperties: 198 "^usb@[0-9a-f]+$": 199 type: object 200 $ref: /schemas/usb/mediatek,mtk-xhci.yaml# 201 description: 202 The xhci should be added as subnode to mtu3 as shown in the following 203 example if the host mode is enabled. 204 205dependencies: 206 connector: [ 'usb-role-switch' ] 207 port: [ 'usb-role-switch' ] 208 role-switch-default-mode: [ 'usb-role-switch' ] 209 wakeup-source: [ 'mediatek,syscon-wakeup' ] 210 211required: 212 - compatible 213 - reg 214 - reg-names 215 - interrupts 216 - clocks 217 - clock-names 218 219additionalProperties: false 220 221examples: 222 # Dual role switch by extcon 223 - | 224 #include <dt-bindings/clock/mt8173-clk.h> 225 #include <dt-bindings/interrupt-controller/arm-gic.h> 226 #include <dt-bindings/interrupt-controller/irq.h> 227 #include <dt-bindings/phy/phy.h> 228 #include <dt-bindings/power/mt8173-power.h> 229 230 usb@11271000 { 231 compatible = "mediatek,mt8173-mtu3", "mediatek,mtu3"; 232 reg = <0x11271000 0x3000>, <0x11280700 0x0100>; 233 reg-names = "mac", "ippc"; 234 interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_LOW>; 235 phys = <&phy_port0 PHY_TYPE_USB3>, <&phy_port1 PHY_TYPE_USB2>; 236 power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 237 clocks = <&topckgen CLK_TOP_USB30_SEL>; 238 clock-names = "sys_ck"; 239 vusb33-supply = <&mt6397_vusb_reg>; 240 vbus-supply = <&usb_p0_vbus>; 241 extcon = <&extcon_usb>; 242 dr_mode = "otg"; 243 wakeup-source; 244 mediatek,syscon-wakeup = <&pericfg 0x400 1>; 245 #address-cells = <1>; 246 #size-cells = <1>; 247 ranges; 248 249 xhci: usb@11270000 { 250 compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci"; 251 reg = <0x11270000 0x1000>; 252 reg-names = "mac"; 253 interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 254 power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 255 clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 256 clock-names = "sys_ck", "ref_ck"; 257 vusb33-supply = <&mt6397_vusb_reg>; 258 }; 259 }; 260 261 # Dual role switch by gpio-usb-b-connector 262 - | 263 #include <dt-bindings/gpio/gpio.h> 264 #include <dt-bindings/power/mt2712-power.h> 265 266 usb@112c1000 { 267 compatible = "mediatek,mt2712-mtu3", "mediatek,mtu3"; 268 reg = <0x112c1000 0x3000>, <0x112d0700 0x0100>; 269 reg-names = "mac", "ippc"; 270 interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_LOW>; 271 phys = <&u2port2 PHY_TYPE_USB2>; 272 power-domains = <&scpsys MT2712_POWER_DOMAIN_USB2>; 273 clocks = <&topckgen CLK_TOP_USB30_SEL>; 274 clock-names = "sys_ck"; 275 dr_mode = "otg"; 276 usb-role-switch; 277 #address-cells = <1>; 278 #size-cells = <1>; 279 ranges; 280 281 host0: usb@11270000 { 282 compatible = "mediatek,mt2712-xhci", "mediatek,mtk-xhci"; 283 reg = <0x11270000 0x1000>; 284 reg-names = "mac"; 285 interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_LOW>; 286 power-domains = <&scpsys MT2712_POWER_DOMAIN_USB>; 287 clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 288 clock-names = "sys_ck", "ref_ck"; 289 }; 290 291 connector { 292 compatible = "gpio-usb-b-connector", "usb-b-connector"; 293 type = "micro"; 294 id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>; 295 vbus-supply = <&usb_p0_vbus>; 296 }; 297 }; 298 299 # Dual role switch with type-c 300 - | 301 usb@11201000 { 302 compatible ="mediatek,mt8183-mtu3", "mediatek,mtu3"; 303 reg = <0x11201000 0x2e00>, <0x11203e00 0x0100>; 304 reg-names = "mac", "ippc"; 305 interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_LOW>; 306 phys = <&u2port0 PHY_TYPE_USB2>; 307 clocks = <&clk26m>; 308 clock-names = "sys_ck"; 309 mediatek,syscon-wakeup = <&pericfg 0x400 1>; 310 wakeup-source; 311 dr_mode = "otg"; 312 usb-role-switch; 313 role-switch-default-mode = "host"; 314 #address-cells = <1>; 315 #size-cells = <1>; 316 ranges; 317 318 host: usb@11200000 { 319 compatible = "mediatek,mt8183-xhci", "mediatek,mtk-xhci"; 320 reg = <0x11200000 0x1000>; 321 reg-names = "mac"; 322 interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_LOW>; 323 clocks = <&clk26m>; 324 clock-names = "sys_ck"; 325 }; 326 327 port { 328 usb_role_sw: endpoint { 329 remote-endpoint = <&hs_ep>; 330 }; 331 }; 332 }; 333 334... 335