15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 25def4c47SEmmanuel Vadot# Copyright (c) 2020 MediaTek 35def4c47SEmmanuel Vadot%YAML 1.2 45def4c47SEmmanuel Vadot--- 55def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/usb/mediatek,mtu3.yaml# 65def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 75def4c47SEmmanuel Vadot 87ef62cebSEmmanuel Vadottitle: MediaTek USB3 DRD Controller 95def4c47SEmmanuel Vadot 105def4c47SEmmanuel Vadotmaintainers: 115def4c47SEmmanuel Vadot - Chunfeng Yun <chunfeng.yun@mediatek.com> 125def4c47SEmmanuel Vadot 135def4c47SEmmanuel VadotallOf: 14*fac71e4eSEmmanuel Vadot - $ref: usb-drd.yaml 155def4c47SEmmanuel Vadot 165def4c47SEmmanuel Vadotdescription: | 175def4c47SEmmanuel Vadot The DRD controller has a glue layer IPPC (IP Port Control), and its host is 185def4c47SEmmanuel Vadot based on xHCI. 195def4c47SEmmanuel Vadot 205def4c47SEmmanuel Vadotproperties: 215def4c47SEmmanuel Vadot compatible: 225def4c47SEmmanuel Vadot items: 235def4c47SEmmanuel Vadot - enum: 245def4c47SEmmanuel Vadot - mediatek,mt2712-mtu3 255def4c47SEmmanuel Vadot - mediatek,mt8173-mtu3 265def4c47SEmmanuel Vadot - mediatek,mt8183-mtu3 278bab661aSEmmanuel Vadot - mediatek,mt8186-mtu3 28b97ee269SEmmanuel Vadot - mediatek,mt8188-mtu3 292eb4d8dcSEmmanuel Vadot - mediatek,mt8192-mtu3 30d5b0e70fSEmmanuel Vadot - mediatek,mt8195-mtu3 31cb7aa33aSEmmanuel Vadot - mediatek,mt8365-mtu3 325def4c47SEmmanuel Vadot - const: mediatek,mtu3 335def4c47SEmmanuel Vadot 345def4c47SEmmanuel Vadot reg: 355def4c47SEmmanuel Vadot items: 365def4c47SEmmanuel Vadot - description: the registers of device MAC 375def4c47SEmmanuel Vadot - description: the registers of IP Port Control 385def4c47SEmmanuel Vadot 395def4c47SEmmanuel Vadot reg-names: 405def4c47SEmmanuel Vadot items: 415def4c47SEmmanuel Vadot - const: mac 425def4c47SEmmanuel Vadot - const: ippc 435def4c47SEmmanuel Vadot 445def4c47SEmmanuel Vadot interrupts: 45354d7675SEmmanuel Vadot description: 46354d7675SEmmanuel Vadot use "interrupts-extended" when the interrupts are connected to the 47354d7675SEmmanuel Vadot separate interrupt controllers 48354d7675SEmmanuel Vadot minItems: 1 49354d7675SEmmanuel Vadot items: 50354d7675SEmmanuel Vadot - description: SSUSB device controller interrupt 51354d7675SEmmanuel Vadot - description: optional, wakeup interrupt used to support runtime PM 52354d7675SEmmanuel Vadot 53354d7675SEmmanuel Vadot interrupt-names: 54354d7675SEmmanuel Vadot items: 55354d7675SEmmanuel Vadot - const: device 56354d7675SEmmanuel Vadot - const: wakeup 575def4c47SEmmanuel Vadot 585def4c47SEmmanuel Vadot power-domains: 595def4c47SEmmanuel Vadot description: A phandle to USB power domain node to control USB's MTCMOS 605def4c47SEmmanuel Vadot maxItems: 1 615def4c47SEmmanuel Vadot 625def4c47SEmmanuel Vadot clocks: 635def4c47SEmmanuel Vadot minItems: 1 645def4c47SEmmanuel Vadot items: 655def4c47SEmmanuel Vadot - description: Controller clock used by normal mode 665def4c47SEmmanuel Vadot - description: Reference clock used by low power mode etc 675def4c47SEmmanuel Vadot - description: Mcu bus clock for register access 685def4c47SEmmanuel Vadot - description: DMA bus clock for data transfer 69*fac71e4eSEmmanuel Vadot - description: DRD controller clock 70*fac71e4eSEmmanuel Vadot - description: Frame count clock 715def4c47SEmmanuel Vadot 725def4c47SEmmanuel Vadot clock-names: 735def4c47SEmmanuel Vadot minItems: 1 745def4c47SEmmanuel Vadot items: 755def4c47SEmmanuel Vadot - const: sys_ck # required, others are optional 765def4c47SEmmanuel Vadot - const: ref_ck 775def4c47SEmmanuel Vadot - const: mcu_ck 785def4c47SEmmanuel Vadot - const: dma_ck 79*fac71e4eSEmmanuel Vadot - const: xhci_ck 80*fac71e4eSEmmanuel Vadot - const: frmcnt_ck 815def4c47SEmmanuel Vadot 825def4c47SEmmanuel Vadot phys: 835def4c47SEmmanuel Vadot description: 845def4c47SEmmanuel Vadot List of all the USB PHYs used, it's better to keep the sequence 855def4c47SEmmanuel Vadot as the hardware layout. 865def4c47SEmmanuel Vadot minItems: 1 875def4c47SEmmanuel Vadot items: 885def4c47SEmmanuel Vadot - description: USB2/HS PHY # required, others are optional 895def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 905def4c47SEmmanuel Vadot - description: USB2/HS PHY # the following for backward compatible 915def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 925def4c47SEmmanuel Vadot - description: USB2/HS PHY 935def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 945def4c47SEmmanuel Vadot - description: USB2/HS PHY 955def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 965def4c47SEmmanuel Vadot - description: USB2/HS PHY 975def4c47SEmmanuel Vadot 985def4c47SEmmanuel Vadot vusb33-supply: 995def4c47SEmmanuel Vadot description: Regulator of USB AVDD3.3v 1005def4c47SEmmanuel Vadot 1015def4c47SEmmanuel Vadot vbus-supply: 1025def4c47SEmmanuel Vadot deprecated: true 1035def4c47SEmmanuel Vadot description: | 1045def4c47SEmmanuel Vadot Regulator of USB VBUS5v, needed when supports dual-role mode. 1055def4c47SEmmanuel Vadot Particularly, if use an output GPIO to control a VBUS regulator, should 1065def4c47SEmmanuel Vadot model it as a regulator. See bindings/regulator/fixed-regulator.yaml 1075def4c47SEmmanuel Vadot It's considered valid for compatibility reasons, not allowed for 1085def4c47SEmmanuel Vadot new bindings, and put into a usb-connector node. 1095def4c47SEmmanuel Vadot 1105def4c47SEmmanuel Vadot dr_mode: 1115def4c47SEmmanuel Vadot enum: [host, peripheral, otg] 1125def4c47SEmmanuel Vadot default: otg 1135def4c47SEmmanuel Vadot 1145def4c47SEmmanuel Vadot maximum-speed: 1155def4c47SEmmanuel Vadot enum: [super-speed-plus, super-speed, high-speed, full-speed] 1165def4c47SEmmanuel Vadot 117b97ee269SEmmanuel Vadot resets: 118b97ee269SEmmanuel Vadot maxItems: 1 119b97ee269SEmmanuel Vadot 1205def4c47SEmmanuel Vadot "#address-cells": 1215def4c47SEmmanuel Vadot enum: [1, 2] 1225def4c47SEmmanuel Vadot 1235def4c47SEmmanuel Vadot "#size-cells": 1245def4c47SEmmanuel Vadot enum: [1, 2] 1255def4c47SEmmanuel Vadot 1265def4c47SEmmanuel Vadot ranges: true 1275def4c47SEmmanuel Vadot 1285def4c47SEmmanuel Vadot extcon: 1295def4c47SEmmanuel Vadot deprecated: true 1305def4c47SEmmanuel Vadot description: | 131354d7675SEmmanuel Vadot Phandle to the extcon device detecting the IDDIG state, needed 1325def4c47SEmmanuel Vadot when supports dual-role mode. 1335def4c47SEmmanuel Vadot It's considered valid for compatibility reasons, not allowed for 1345def4c47SEmmanuel Vadot new bindings, and use "usb-role-switch" property instead. 1355def4c47SEmmanuel Vadot 1365def4c47SEmmanuel Vadot usb-role-switch: 1375def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 1385def4c47SEmmanuel Vadot description: Support role switch. 1395def4c47SEmmanuel Vadot type: boolean 1405def4c47SEmmanuel Vadot 141354d7675SEmmanuel Vadot role-switch-default-mode: 142354d7675SEmmanuel Vadot enum: [host, peripheral] 143354d7675SEmmanuel Vadot default: host 144354d7675SEmmanuel Vadot 1455def4c47SEmmanuel Vadot connector: 146c9ccf3a3SEmmanuel Vadot $ref: /schemas/connector/usb-connector.yaml# 1475def4c47SEmmanuel Vadot description: 1485def4c47SEmmanuel Vadot Connector for dual role switch, especially for "gpio-usb-b-connector" 1495def4c47SEmmanuel Vadot type: object 1505def4c47SEmmanuel Vadot 1515def4c47SEmmanuel Vadot port: 1525def4c47SEmmanuel Vadot description: 1535def4c47SEmmanuel Vadot Any connector to the data bus of this controller should be modelled 1545def4c47SEmmanuel Vadot using the OF graph bindings specified, if the "usb-role-switch" 1555def4c47SEmmanuel Vadot property is used. See graph.txt 1562eb4d8dcSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 1575def4c47SEmmanuel Vadot 1585def4c47SEmmanuel Vadot enable-manual-drd: 1595def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 1605def4c47SEmmanuel Vadot description: 1615def4c47SEmmanuel Vadot supports manual dual-role switch via debugfs; usually used when 1625def4c47SEmmanuel Vadot receptacle is TYPE-A and also wants to support dual-role mode. 1635def4c47SEmmanuel Vadot type: boolean 1645def4c47SEmmanuel Vadot 1655def4c47SEmmanuel Vadot wakeup-source: 1665def4c47SEmmanuel Vadot description: enable USB remote wakeup, see power/wakeup-source.txt 1675def4c47SEmmanuel Vadot type: boolean 1685def4c47SEmmanuel Vadot 1695def4c47SEmmanuel Vadot mediatek,syscon-wakeup: 1705def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle-array 1715def4c47SEmmanuel Vadot maxItems: 1 1725def4c47SEmmanuel Vadot description: 1735def4c47SEmmanuel Vadot A phandle to syscon used to access the register of the USB wakeup glue 1745def4c47SEmmanuel Vadot layer between xHCI and SPM, the field should always be 3 cells long. 1755def4c47SEmmanuel Vadot items: 1765def4c47SEmmanuel Vadot items: 1775def4c47SEmmanuel Vadot - description: 1785def4c47SEmmanuel Vadot The first cell represents a phandle to syscon 1795def4c47SEmmanuel Vadot - description: 1805def4c47SEmmanuel Vadot The second cell represents the register base address of the glue 1815def4c47SEmmanuel Vadot layer in syscon 1822eb4d8dcSEmmanuel Vadot - description: | 1835def4c47SEmmanuel Vadot The third cell represents the hardware version of the glue layer, 1842eb4d8dcSEmmanuel Vadot 1 - used by mt8173 etc, revision 1 without following IPM rule; 1852eb4d8dcSEmmanuel Vadot 2 - used by mt2712 etc, revision 2 with following IPM rule; 1862eb4d8dcSEmmanuel Vadot 101 - used by mt8183, specific 1.01; 1872eb4d8dcSEmmanuel Vadot 102 - used by mt8192, specific 1.02; 1882eb4d8dcSEmmanuel Vadot enum: [1, 2, 101, 102] 1895def4c47SEmmanuel Vadot 1905def4c47SEmmanuel Vadot mediatek,u3p-dis-msk: 1915def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1925def4c47SEmmanuel Vadot description: The mask to disable u3ports, bit0 for u3port0, 1935def4c47SEmmanuel Vadot bit1 for u3port1, ... etc 1945def4c47SEmmanuel Vadot 195354d7675SEmmanuel Vadot mediatek,u2p-dis-msk: 196354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 197354d7675SEmmanuel Vadot description: The mask to disable u2ports, bit0 for u2port0, 198354d7675SEmmanuel Vadot bit1 for u2port1, ... etc; but can't disable u2port0 if dual role mode 199354d7675SEmmanuel Vadot is enabled, so will be skipped in this case. 200354d7675SEmmanuel Vadot 2015def4c47SEmmanuel Vadot# Required child node when support dual-role 2025def4c47SEmmanuel VadotpatternProperties: 2035def4c47SEmmanuel Vadot "^usb@[0-9a-f]+$": 2045def4c47SEmmanuel Vadot type: object 205c9ccf3a3SEmmanuel Vadot $ref: /schemas/usb/mediatek,mtk-xhci.yaml# 2065def4c47SEmmanuel Vadot description: 2075def4c47SEmmanuel Vadot The xhci should be added as subnode to mtu3 as shown in the following 2085def4c47SEmmanuel Vadot example if the host mode is enabled. 2095def4c47SEmmanuel Vadot 2105def4c47SEmmanuel Vadotdependencies: 211*fac71e4eSEmmanuel Vadot connector: [ usb-role-switch ] 212*fac71e4eSEmmanuel Vadot port: [ usb-role-switch ] 213*fac71e4eSEmmanuel Vadot role-switch-default-mode: [ usb-role-switch ] 2145def4c47SEmmanuel Vadot wakeup-source: [ 'mediatek,syscon-wakeup' ] 2155def4c47SEmmanuel Vadot 2165def4c47SEmmanuel Vadotrequired: 2175def4c47SEmmanuel Vadot - compatible 2185def4c47SEmmanuel Vadot - reg 2195def4c47SEmmanuel Vadot - reg-names 2205def4c47SEmmanuel Vadot - interrupts 2215def4c47SEmmanuel Vadot - clocks 2225def4c47SEmmanuel Vadot - clock-names 2235def4c47SEmmanuel Vadot 2245def4c47SEmmanuel VadotadditionalProperties: false 2255def4c47SEmmanuel Vadot 2265def4c47SEmmanuel Vadotexamples: 2275def4c47SEmmanuel Vadot # Dual role switch by extcon 2285def4c47SEmmanuel Vadot - | 2295def4c47SEmmanuel Vadot #include <dt-bindings/clock/mt8173-clk.h> 2305def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 2315def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 2325def4c47SEmmanuel Vadot #include <dt-bindings/phy/phy.h> 2335def4c47SEmmanuel Vadot #include <dt-bindings/power/mt8173-power.h> 2345def4c47SEmmanuel Vadot 2355def4c47SEmmanuel Vadot usb@11271000 { 2365def4c47SEmmanuel Vadot compatible = "mediatek,mt8173-mtu3", "mediatek,mtu3"; 2375def4c47SEmmanuel Vadot reg = <0x11271000 0x3000>, <0x11280700 0x0100>; 2385def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 2395def4c47SEmmanuel Vadot interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_LOW>; 2405def4c47SEmmanuel Vadot phys = <&phy_port0 PHY_TYPE_USB3>, <&phy_port1 PHY_TYPE_USB2>; 2415def4c47SEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 2425def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>; 2435def4c47SEmmanuel Vadot clock-names = "sys_ck"; 2445def4c47SEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 2455def4c47SEmmanuel Vadot vbus-supply = <&usb_p0_vbus>; 2465def4c47SEmmanuel Vadot extcon = <&extcon_usb>; 2475def4c47SEmmanuel Vadot dr_mode = "otg"; 2485def4c47SEmmanuel Vadot wakeup-source; 2495def4c47SEmmanuel Vadot mediatek,syscon-wakeup = <&pericfg 0x400 1>; 2505def4c47SEmmanuel Vadot #address-cells = <1>; 2515def4c47SEmmanuel Vadot #size-cells = <1>; 2525def4c47SEmmanuel Vadot ranges; 2535def4c47SEmmanuel Vadot 2545def4c47SEmmanuel Vadot xhci: usb@11270000 { 2555def4c47SEmmanuel Vadot compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci"; 2565def4c47SEmmanuel Vadot reg = <0x11270000 0x1000>; 2575def4c47SEmmanuel Vadot reg-names = "mac"; 2585def4c47SEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 2595def4c47SEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 2605def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 2615def4c47SEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 2625def4c47SEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 2635def4c47SEmmanuel Vadot }; 2645def4c47SEmmanuel Vadot }; 2655def4c47SEmmanuel Vadot 266354d7675SEmmanuel Vadot # Dual role switch by gpio-usb-b-connector 2675def4c47SEmmanuel Vadot - | 2685def4c47SEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 2695def4c47SEmmanuel Vadot #include <dt-bindings/power/mt2712-power.h> 2705def4c47SEmmanuel Vadot 2715def4c47SEmmanuel Vadot usb@112c1000 { 2725def4c47SEmmanuel Vadot compatible = "mediatek,mt2712-mtu3", "mediatek,mtu3"; 2735def4c47SEmmanuel Vadot reg = <0x112c1000 0x3000>, <0x112d0700 0x0100>; 2745def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 2755def4c47SEmmanuel Vadot interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_LOW>; 2765def4c47SEmmanuel Vadot phys = <&u2port2 PHY_TYPE_USB2>; 2775def4c47SEmmanuel Vadot power-domains = <&scpsys MT2712_POWER_DOMAIN_USB2>; 2785def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>; 2795def4c47SEmmanuel Vadot clock-names = "sys_ck"; 280354d7675SEmmanuel Vadot dr_mode = "otg"; 2815def4c47SEmmanuel Vadot usb-role-switch; 282354d7675SEmmanuel Vadot #address-cells = <1>; 283354d7675SEmmanuel Vadot #size-cells = <1>; 284354d7675SEmmanuel Vadot ranges; 285354d7675SEmmanuel Vadot 286354d7675SEmmanuel Vadot host0: usb@11270000 { 287354d7675SEmmanuel Vadot compatible = "mediatek,mt2712-xhci", "mediatek,mtk-xhci"; 288354d7675SEmmanuel Vadot reg = <0x11270000 0x1000>; 289354d7675SEmmanuel Vadot reg-names = "mac"; 290354d7675SEmmanuel Vadot interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_LOW>; 291354d7675SEmmanuel Vadot power-domains = <&scpsys MT2712_POWER_DOMAIN_USB>; 292354d7675SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 293354d7675SEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 294354d7675SEmmanuel Vadot }; 2955def4c47SEmmanuel Vadot 2965def4c47SEmmanuel Vadot connector { 2975def4c47SEmmanuel Vadot compatible = "gpio-usb-b-connector", "usb-b-connector"; 2985def4c47SEmmanuel Vadot type = "micro"; 299354d7675SEmmanuel Vadot id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>; 300354d7675SEmmanuel Vadot vbus-supply = <&usb_p0_vbus>; 3015def4c47SEmmanuel Vadot }; 3025def4c47SEmmanuel Vadot }; 3035def4c47SEmmanuel Vadot 3045def4c47SEmmanuel Vadot # Dual role switch with type-c 3055def4c47SEmmanuel Vadot - | 3065def4c47SEmmanuel Vadot usb@11201000 { 3075def4c47SEmmanuel Vadot compatible = "mediatek,mt8183-mtu3", "mediatek,mtu3"; 3085def4c47SEmmanuel Vadot reg = <0x11201000 0x2e00>, <0x11203e00 0x0100>; 3095def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 3105def4c47SEmmanuel Vadot interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_LOW>; 3115def4c47SEmmanuel Vadot phys = <&u2port0 PHY_TYPE_USB2>; 3125def4c47SEmmanuel Vadot clocks = <&clk26m>; 3135def4c47SEmmanuel Vadot clock-names = "sys_ck"; 3145def4c47SEmmanuel Vadot mediatek,syscon-wakeup = <&pericfg 0x400 1>; 3155def4c47SEmmanuel Vadot wakeup-source; 3165def4c47SEmmanuel Vadot dr_mode = "otg"; 3175def4c47SEmmanuel Vadot usb-role-switch; 318354d7675SEmmanuel Vadot role-switch-default-mode = "host"; 3195def4c47SEmmanuel Vadot #address-cells = <1>; 3205def4c47SEmmanuel Vadot #size-cells = <1>; 3215def4c47SEmmanuel Vadot ranges; 3225def4c47SEmmanuel Vadot 3235def4c47SEmmanuel Vadot host: usb@11200000 { 3245def4c47SEmmanuel Vadot compatible = "mediatek,mt8183-xhci", "mediatek,mtk-xhci"; 3255def4c47SEmmanuel Vadot reg = <0x11200000 0x1000>; 3265def4c47SEmmanuel Vadot reg-names = "mac"; 3275def4c47SEmmanuel Vadot interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_LOW>; 3285def4c47SEmmanuel Vadot clocks = <&clk26m>; 3295def4c47SEmmanuel Vadot clock-names = "sys_ck"; 3305def4c47SEmmanuel Vadot }; 3315def4c47SEmmanuel Vadot 3325def4c47SEmmanuel Vadot port { 3335def4c47SEmmanuel Vadot usb_role_sw: endpoint { 3345def4c47SEmmanuel Vadot remote-endpoint = <&hs_ep>; 3355def4c47SEmmanuel Vadot }; 3365def4c47SEmmanuel Vadot }; 3375def4c47SEmmanuel Vadot }; 3385def4c47SEmmanuel Vadot 3395def4c47SEmmanuel Vadot... 340