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: 145def4c47SEmmanuel 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 31*cb7aa33aSEmmanuel 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 695def4c47SEmmanuel Vadot 705def4c47SEmmanuel Vadot clock-names: 715def4c47SEmmanuel Vadot minItems: 1 725def4c47SEmmanuel Vadot items: 735def4c47SEmmanuel Vadot - const: sys_ck # required, others are optional 745def4c47SEmmanuel Vadot - const: ref_ck 755def4c47SEmmanuel Vadot - const: mcu_ck 765def4c47SEmmanuel Vadot - const: dma_ck 775def4c47SEmmanuel Vadot 785def4c47SEmmanuel Vadot phys: 795def4c47SEmmanuel Vadot description: 805def4c47SEmmanuel Vadot List of all the USB PHYs used, it's better to keep the sequence 815def4c47SEmmanuel Vadot as the hardware layout. 825def4c47SEmmanuel Vadot minItems: 1 835def4c47SEmmanuel Vadot items: 845def4c47SEmmanuel Vadot - description: USB2/HS PHY # required, others are optional 855def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 865def4c47SEmmanuel Vadot - description: USB2/HS PHY # the following for backward compatible 875def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 885def4c47SEmmanuel Vadot - description: USB2/HS PHY 895def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 905def4c47SEmmanuel Vadot - description: USB2/HS PHY 915def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 925def4c47SEmmanuel Vadot - description: USB2/HS PHY 935def4c47SEmmanuel Vadot 945def4c47SEmmanuel Vadot vusb33-supply: 955def4c47SEmmanuel Vadot description: Regulator of USB AVDD3.3v 965def4c47SEmmanuel Vadot 975def4c47SEmmanuel Vadot vbus-supply: 985def4c47SEmmanuel Vadot deprecated: true 995def4c47SEmmanuel Vadot description: | 1005def4c47SEmmanuel Vadot Regulator of USB VBUS5v, needed when supports dual-role mode. 1015def4c47SEmmanuel Vadot Particularly, if use an output GPIO to control a VBUS regulator, should 1025def4c47SEmmanuel Vadot model it as a regulator. See bindings/regulator/fixed-regulator.yaml 1035def4c47SEmmanuel Vadot It's considered valid for compatibility reasons, not allowed for 1045def4c47SEmmanuel Vadot new bindings, and put into a usb-connector node. 1055def4c47SEmmanuel Vadot 1065def4c47SEmmanuel Vadot dr_mode: 1075def4c47SEmmanuel Vadot enum: [host, peripheral, otg] 1085def4c47SEmmanuel Vadot default: otg 1095def4c47SEmmanuel Vadot 1105def4c47SEmmanuel Vadot maximum-speed: 1115def4c47SEmmanuel Vadot enum: [super-speed-plus, super-speed, high-speed, full-speed] 1125def4c47SEmmanuel Vadot 113b97ee269SEmmanuel Vadot resets: 114b97ee269SEmmanuel Vadot maxItems: 1 115b97ee269SEmmanuel Vadot 1165def4c47SEmmanuel Vadot "#address-cells": 1175def4c47SEmmanuel Vadot enum: [1, 2] 1185def4c47SEmmanuel Vadot 1195def4c47SEmmanuel Vadot "#size-cells": 1205def4c47SEmmanuel Vadot enum: [1, 2] 1215def4c47SEmmanuel Vadot 1225def4c47SEmmanuel Vadot ranges: true 1235def4c47SEmmanuel Vadot 1245def4c47SEmmanuel Vadot extcon: 1255def4c47SEmmanuel Vadot deprecated: true 1265def4c47SEmmanuel Vadot description: | 127354d7675SEmmanuel Vadot Phandle to the extcon device detecting the IDDIG state, needed 1285def4c47SEmmanuel Vadot when supports dual-role mode. 1295def4c47SEmmanuel Vadot It's considered valid for compatibility reasons, not allowed for 1305def4c47SEmmanuel Vadot new bindings, and use "usb-role-switch" property instead. 1315def4c47SEmmanuel Vadot 1325def4c47SEmmanuel Vadot usb-role-switch: 1335def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 1345def4c47SEmmanuel Vadot description: Support role switch. 1355def4c47SEmmanuel Vadot type: boolean 1365def4c47SEmmanuel Vadot 137354d7675SEmmanuel Vadot role-switch-default-mode: 138354d7675SEmmanuel Vadot enum: [host, peripheral] 139354d7675SEmmanuel Vadot default: host 140354d7675SEmmanuel Vadot 1415def4c47SEmmanuel Vadot connector: 142c9ccf3a3SEmmanuel Vadot $ref: /schemas/connector/usb-connector.yaml# 1435def4c47SEmmanuel Vadot description: 1445def4c47SEmmanuel Vadot Connector for dual role switch, especially for "gpio-usb-b-connector" 1455def4c47SEmmanuel Vadot type: object 1465def4c47SEmmanuel Vadot 1475def4c47SEmmanuel Vadot port: 1485def4c47SEmmanuel Vadot description: 1495def4c47SEmmanuel Vadot Any connector to the data bus of this controller should be modelled 1505def4c47SEmmanuel Vadot using the OF graph bindings specified, if the "usb-role-switch" 1515def4c47SEmmanuel Vadot property is used. See graph.txt 1522eb4d8dcSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 1535def4c47SEmmanuel Vadot 1545def4c47SEmmanuel Vadot enable-manual-drd: 1555def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 1565def4c47SEmmanuel Vadot description: 1575def4c47SEmmanuel Vadot supports manual dual-role switch via debugfs; usually used when 1585def4c47SEmmanuel Vadot receptacle is TYPE-A and also wants to support dual-role mode. 1595def4c47SEmmanuel Vadot type: boolean 1605def4c47SEmmanuel Vadot 1615def4c47SEmmanuel Vadot wakeup-source: 1625def4c47SEmmanuel Vadot description: enable USB remote wakeup, see power/wakeup-source.txt 1635def4c47SEmmanuel Vadot type: boolean 1645def4c47SEmmanuel Vadot 1655def4c47SEmmanuel Vadot mediatek,syscon-wakeup: 1665def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle-array 1675def4c47SEmmanuel Vadot maxItems: 1 1685def4c47SEmmanuel Vadot description: 1695def4c47SEmmanuel Vadot A phandle to syscon used to access the register of the USB wakeup glue 1705def4c47SEmmanuel Vadot layer between xHCI and SPM, the field should always be 3 cells long. 1715def4c47SEmmanuel Vadot items: 1725def4c47SEmmanuel Vadot items: 1735def4c47SEmmanuel Vadot - description: 1745def4c47SEmmanuel Vadot The first cell represents a phandle to syscon 1755def4c47SEmmanuel Vadot - description: 1765def4c47SEmmanuel Vadot The second cell represents the register base address of the glue 1775def4c47SEmmanuel Vadot layer in syscon 1782eb4d8dcSEmmanuel Vadot - description: | 1795def4c47SEmmanuel Vadot The third cell represents the hardware version of the glue layer, 1802eb4d8dcSEmmanuel Vadot 1 - used by mt8173 etc, revision 1 without following IPM rule; 1812eb4d8dcSEmmanuel Vadot 2 - used by mt2712 etc, revision 2 with following IPM rule; 1822eb4d8dcSEmmanuel Vadot 101 - used by mt8183, specific 1.01; 1832eb4d8dcSEmmanuel Vadot 102 - used by mt8192, specific 1.02; 1842eb4d8dcSEmmanuel Vadot enum: [1, 2, 101, 102] 1855def4c47SEmmanuel Vadot 1865def4c47SEmmanuel Vadot mediatek,u3p-dis-msk: 1875def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1885def4c47SEmmanuel Vadot description: The mask to disable u3ports, bit0 for u3port0, 1895def4c47SEmmanuel Vadot bit1 for u3port1, ... etc 1905def4c47SEmmanuel Vadot 191354d7675SEmmanuel Vadot mediatek,u2p-dis-msk: 192354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 193354d7675SEmmanuel Vadot description: The mask to disable u2ports, bit0 for u2port0, 194354d7675SEmmanuel Vadot bit1 for u2port1, ... etc; but can't disable u2port0 if dual role mode 195354d7675SEmmanuel Vadot is enabled, so will be skipped in this case. 196354d7675SEmmanuel Vadot 1975def4c47SEmmanuel Vadot# Required child node when support dual-role 1985def4c47SEmmanuel VadotpatternProperties: 1995def4c47SEmmanuel Vadot "^usb@[0-9a-f]+$": 2005def4c47SEmmanuel Vadot type: object 201c9ccf3a3SEmmanuel Vadot $ref: /schemas/usb/mediatek,mtk-xhci.yaml# 2025def4c47SEmmanuel Vadot description: 2035def4c47SEmmanuel Vadot The xhci should be added as subnode to mtu3 as shown in the following 2045def4c47SEmmanuel Vadot example if the host mode is enabled. 2055def4c47SEmmanuel Vadot 2065def4c47SEmmanuel Vadotdependencies: 2075def4c47SEmmanuel Vadot connector: [ 'usb-role-switch' ] 2085def4c47SEmmanuel Vadot port: [ 'usb-role-switch' ] 209354d7675SEmmanuel Vadot role-switch-default-mode: [ 'usb-role-switch' ] 2105def4c47SEmmanuel Vadot wakeup-source: [ 'mediatek,syscon-wakeup' ] 2115def4c47SEmmanuel Vadot 2125def4c47SEmmanuel Vadotrequired: 2135def4c47SEmmanuel Vadot - compatible 2145def4c47SEmmanuel Vadot - reg 2155def4c47SEmmanuel Vadot - reg-names 2165def4c47SEmmanuel Vadot - interrupts 2175def4c47SEmmanuel Vadot - clocks 2185def4c47SEmmanuel Vadot - clock-names 2195def4c47SEmmanuel Vadot 2205def4c47SEmmanuel VadotadditionalProperties: false 2215def4c47SEmmanuel Vadot 2225def4c47SEmmanuel Vadotexamples: 2235def4c47SEmmanuel Vadot # Dual role switch by extcon 2245def4c47SEmmanuel Vadot - | 2255def4c47SEmmanuel Vadot #include <dt-bindings/clock/mt8173-clk.h> 2265def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 2275def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 2285def4c47SEmmanuel Vadot #include <dt-bindings/phy/phy.h> 2295def4c47SEmmanuel Vadot #include <dt-bindings/power/mt8173-power.h> 2305def4c47SEmmanuel Vadot 2315def4c47SEmmanuel Vadot usb@11271000 { 2325def4c47SEmmanuel Vadot compatible = "mediatek,mt8173-mtu3", "mediatek,mtu3"; 2335def4c47SEmmanuel Vadot reg = <0x11271000 0x3000>, <0x11280700 0x0100>; 2345def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 2355def4c47SEmmanuel Vadot interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_LOW>; 2365def4c47SEmmanuel Vadot phys = <&phy_port0 PHY_TYPE_USB3>, <&phy_port1 PHY_TYPE_USB2>; 2375def4c47SEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 2385def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>; 2395def4c47SEmmanuel Vadot clock-names = "sys_ck"; 2405def4c47SEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 2415def4c47SEmmanuel Vadot vbus-supply = <&usb_p0_vbus>; 2425def4c47SEmmanuel Vadot extcon = <&extcon_usb>; 2435def4c47SEmmanuel Vadot dr_mode = "otg"; 2445def4c47SEmmanuel Vadot wakeup-source; 2455def4c47SEmmanuel Vadot mediatek,syscon-wakeup = <&pericfg 0x400 1>; 2465def4c47SEmmanuel Vadot #address-cells = <1>; 2475def4c47SEmmanuel Vadot #size-cells = <1>; 2485def4c47SEmmanuel Vadot ranges; 2495def4c47SEmmanuel Vadot 2505def4c47SEmmanuel Vadot xhci: usb@11270000 { 2515def4c47SEmmanuel Vadot compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci"; 2525def4c47SEmmanuel Vadot reg = <0x11270000 0x1000>; 2535def4c47SEmmanuel Vadot reg-names = "mac"; 2545def4c47SEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 2555def4c47SEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 2565def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 2575def4c47SEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 2585def4c47SEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 2595def4c47SEmmanuel Vadot }; 2605def4c47SEmmanuel Vadot }; 2615def4c47SEmmanuel Vadot 262354d7675SEmmanuel Vadot # Dual role switch by gpio-usb-b-connector 2635def4c47SEmmanuel Vadot - | 2645def4c47SEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 2655def4c47SEmmanuel Vadot #include <dt-bindings/power/mt2712-power.h> 2665def4c47SEmmanuel Vadot 2675def4c47SEmmanuel Vadot usb@112c1000 { 2685def4c47SEmmanuel Vadot compatible = "mediatek,mt2712-mtu3", "mediatek,mtu3"; 2695def4c47SEmmanuel Vadot reg = <0x112c1000 0x3000>, <0x112d0700 0x0100>; 2705def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 2715def4c47SEmmanuel Vadot interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_LOW>; 2725def4c47SEmmanuel Vadot phys = <&u2port2 PHY_TYPE_USB2>; 2735def4c47SEmmanuel Vadot power-domains = <&scpsys MT2712_POWER_DOMAIN_USB2>; 2745def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>; 2755def4c47SEmmanuel Vadot clock-names = "sys_ck"; 276354d7675SEmmanuel Vadot dr_mode = "otg"; 2775def4c47SEmmanuel Vadot usb-role-switch; 278354d7675SEmmanuel Vadot #address-cells = <1>; 279354d7675SEmmanuel Vadot #size-cells = <1>; 280354d7675SEmmanuel Vadot ranges; 281354d7675SEmmanuel Vadot 282354d7675SEmmanuel Vadot host0: usb@11270000 { 283354d7675SEmmanuel Vadot compatible = "mediatek,mt2712-xhci", "mediatek,mtk-xhci"; 284354d7675SEmmanuel Vadot reg = <0x11270000 0x1000>; 285354d7675SEmmanuel Vadot reg-names = "mac"; 286354d7675SEmmanuel Vadot interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_LOW>; 287354d7675SEmmanuel Vadot power-domains = <&scpsys MT2712_POWER_DOMAIN_USB>; 288354d7675SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 289354d7675SEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 290354d7675SEmmanuel Vadot }; 2915def4c47SEmmanuel Vadot 2925def4c47SEmmanuel Vadot connector { 2935def4c47SEmmanuel Vadot compatible = "gpio-usb-b-connector", "usb-b-connector"; 2945def4c47SEmmanuel Vadot type = "micro"; 295354d7675SEmmanuel Vadot id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>; 296354d7675SEmmanuel Vadot vbus-supply = <&usb_p0_vbus>; 2975def4c47SEmmanuel Vadot }; 2985def4c47SEmmanuel Vadot }; 2995def4c47SEmmanuel Vadot 3005def4c47SEmmanuel Vadot # Dual role switch with type-c 3015def4c47SEmmanuel Vadot - | 3025def4c47SEmmanuel Vadot usb@11201000 { 3035def4c47SEmmanuel Vadot compatible ="mediatek,mt8183-mtu3", "mediatek,mtu3"; 3045def4c47SEmmanuel Vadot reg = <0x11201000 0x2e00>, <0x11203e00 0x0100>; 3055def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 3065def4c47SEmmanuel Vadot interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_LOW>; 3075def4c47SEmmanuel Vadot phys = <&u2port0 PHY_TYPE_USB2>; 3085def4c47SEmmanuel Vadot clocks = <&clk26m>; 3095def4c47SEmmanuel Vadot clock-names = "sys_ck"; 3105def4c47SEmmanuel Vadot mediatek,syscon-wakeup = <&pericfg 0x400 1>; 3115def4c47SEmmanuel Vadot wakeup-source; 3125def4c47SEmmanuel Vadot dr_mode = "otg"; 3135def4c47SEmmanuel Vadot usb-role-switch; 314354d7675SEmmanuel Vadot role-switch-default-mode = "host"; 3155def4c47SEmmanuel Vadot #address-cells = <1>; 3165def4c47SEmmanuel Vadot #size-cells = <1>; 3175def4c47SEmmanuel Vadot ranges; 3185def4c47SEmmanuel Vadot 3195def4c47SEmmanuel Vadot host: usb@11200000 { 3205def4c47SEmmanuel Vadot compatible = "mediatek,mt8183-xhci", "mediatek,mtk-xhci"; 3215def4c47SEmmanuel Vadot reg = <0x11200000 0x1000>; 3225def4c47SEmmanuel Vadot reg-names = "mac"; 3235def4c47SEmmanuel Vadot interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_LOW>; 3245def4c47SEmmanuel Vadot clocks = <&clk26m>; 3255def4c47SEmmanuel Vadot clock-names = "sys_ck"; 3265def4c47SEmmanuel Vadot }; 3275def4c47SEmmanuel Vadot 3285def4c47SEmmanuel Vadot port { 3295def4c47SEmmanuel Vadot usb_role_sw: endpoint { 3305def4c47SEmmanuel Vadot remote-endpoint = <&hs_ep>; 3315def4c47SEmmanuel Vadot }; 3325def4c47SEmmanuel Vadot }; 3335def4c47SEmmanuel Vadot }; 3345def4c47SEmmanuel Vadot 3355def4c47SEmmanuel Vadot... 336