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 85def4c47SEmmanuel Vadottitle: MediaTek USB3 DRD Controller Device Tree Bindings 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 27*b97ee269SEmmanuel Vadot - mediatek,mt8188-mtu3 282eb4d8dcSEmmanuel Vadot - mediatek,mt8192-mtu3 29d5b0e70fSEmmanuel Vadot - mediatek,mt8195-mtu3 305def4c47SEmmanuel Vadot - const: mediatek,mtu3 315def4c47SEmmanuel Vadot 325def4c47SEmmanuel Vadot reg: 335def4c47SEmmanuel Vadot items: 345def4c47SEmmanuel Vadot - description: the registers of device MAC 355def4c47SEmmanuel Vadot - description: the registers of IP Port Control 365def4c47SEmmanuel Vadot 375def4c47SEmmanuel Vadot reg-names: 385def4c47SEmmanuel Vadot items: 395def4c47SEmmanuel Vadot - const: mac 405def4c47SEmmanuel Vadot - const: ippc 415def4c47SEmmanuel Vadot 425def4c47SEmmanuel Vadot interrupts: 43354d7675SEmmanuel Vadot description: 44354d7675SEmmanuel Vadot use "interrupts-extended" when the interrupts are connected to the 45354d7675SEmmanuel Vadot separate interrupt controllers 46354d7675SEmmanuel Vadot minItems: 1 47354d7675SEmmanuel Vadot items: 48354d7675SEmmanuel Vadot - description: SSUSB device controller interrupt 49354d7675SEmmanuel Vadot - description: optional, wakeup interrupt used to support runtime PM 50354d7675SEmmanuel Vadot 51354d7675SEmmanuel Vadot interrupt-names: 52354d7675SEmmanuel Vadot items: 53354d7675SEmmanuel Vadot - const: device 54354d7675SEmmanuel Vadot - const: wakeup 555def4c47SEmmanuel Vadot 565def4c47SEmmanuel Vadot power-domains: 575def4c47SEmmanuel Vadot description: A phandle to USB power domain node to control USB's MTCMOS 585def4c47SEmmanuel Vadot maxItems: 1 595def4c47SEmmanuel Vadot 605def4c47SEmmanuel Vadot clocks: 615def4c47SEmmanuel Vadot minItems: 1 625def4c47SEmmanuel Vadot items: 635def4c47SEmmanuel Vadot - description: Controller clock used by normal mode 645def4c47SEmmanuel Vadot - description: Reference clock used by low power mode etc 655def4c47SEmmanuel Vadot - description: Mcu bus clock for register access 665def4c47SEmmanuel Vadot - description: DMA bus clock for data transfer 675def4c47SEmmanuel Vadot 685def4c47SEmmanuel Vadot clock-names: 695def4c47SEmmanuel Vadot minItems: 1 705def4c47SEmmanuel Vadot items: 715def4c47SEmmanuel Vadot - const: sys_ck # required, others are optional 725def4c47SEmmanuel Vadot - const: ref_ck 735def4c47SEmmanuel Vadot - const: mcu_ck 745def4c47SEmmanuel Vadot - const: dma_ck 755def4c47SEmmanuel Vadot 765def4c47SEmmanuel Vadot phys: 775def4c47SEmmanuel Vadot description: 785def4c47SEmmanuel Vadot List of all the USB PHYs used, it's better to keep the sequence 795def4c47SEmmanuel Vadot as the hardware layout. 805def4c47SEmmanuel Vadot minItems: 1 815def4c47SEmmanuel Vadot items: 825def4c47SEmmanuel Vadot - description: USB2/HS PHY # required, others are optional 835def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 845def4c47SEmmanuel Vadot - description: USB2/HS PHY # the following for backward compatible 855def4c47SEmmanuel Vadot - description: USB3/SS(P) PHY 865def4c47SEmmanuel Vadot - description: USB2/HS PHY 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 925def4c47SEmmanuel Vadot vusb33-supply: 935def4c47SEmmanuel Vadot description: Regulator of USB AVDD3.3v 945def4c47SEmmanuel Vadot 955def4c47SEmmanuel Vadot vbus-supply: 965def4c47SEmmanuel Vadot deprecated: true 975def4c47SEmmanuel Vadot description: | 985def4c47SEmmanuel Vadot Regulator of USB VBUS5v, needed when supports dual-role mode. 995def4c47SEmmanuel Vadot Particularly, if use an output GPIO to control a VBUS regulator, should 1005def4c47SEmmanuel Vadot model it as a regulator. See bindings/regulator/fixed-regulator.yaml 1015def4c47SEmmanuel Vadot It's considered valid for compatibility reasons, not allowed for 1025def4c47SEmmanuel Vadot new bindings, and put into a usb-connector node. 1035def4c47SEmmanuel Vadot 1045def4c47SEmmanuel Vadot dr_mode: 1055def4c47SEmmanuel Vadot enum: [host, peripheral, otg] 1065def4c47SEmmanuel Vadot default: otg 1075def4c47SEmmanuel Vadot 1085def4c47SEmmanuel Vadot maximum-speed: 1095def4c47SEmmanuel Vadot enum: [super-speed-plus, super-speed, high-speed, full-speed] 1105def4c47SEmmanuel Vadot 111*b97ee269SEmmanuel Vadot resets: 112*b97ee269SEmmanuel Vadot maxItems: 1 113*b97ee269SEmmanuel Vadot 1145def4c47SEmmanuel Vadot "#address-cells": 1155def4c47SEmmanuel Vadot enum: [1, 2] 1165def4c47SEmmanuel Vadot 1175def4c47SEmmanuel Vadot "#size-cells": 1185def4c47SEmmanuel Vadot enum: [1, 2] 1195def4c47SEmmanuel Vadot 1205def4c47SEmmanuel Vadot ranges: true 1215def4c47SEmmanuel Vadot 1225def4c47SEmmanuel Vadot extcon: 1235def4c47SEmmanuel Vadot deprecated: true 1245def4c47SEmmanuel Vadot description: | 125354d7675SEmmanuel Vadot Phandle to the extcon device detecting the IDDIG state, needed 1265def4c47SEmmanuel Vadot when supports dual-role mode. 1275def4c47SEmmanuel Vadot It's considered valid for compatibility reasons, not allowed for 1285def4c47SEmmanuel Vadot new bindings, and use "usb-role-switch" property instead. 1295def4c47SEmmanuel Vadot 1305def4c47SEmmanuel Vadot usb-role-switch: 1315def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 1325def4c47SEmmanuel Vadot description: Support role switch. 1335def4c47SEmmanuel Vadot type: boolean 1345def4c47SEmmanuel Vadot 135354d7675SEmmanuel Vadot role-switch-default-mode: 136354d7675SEmmanuel Vadot enum: [host, peripheral] 137354d7675SEmmanuel Vadot default: host 138354d7675SEmmanuel Vadot 1395def4c47SEmmanuel Vadot connector: 140c9ccf3a3SEmmanuel Vadot $ref: /schemas/connector/usb-connector.yaml# 1415def4c47SEmmanuel Vadot description: 1425def4c47SEmmanuel Vadot Connector for dual role switch, especially for "gpio-usb-b-connector" 1435def4c47SEmmanuel Vadot type: object 1445def4c47SEmmanuel Vadot 1455def4c47SEmmanuel Vadot port: 1465def4c47SEmmanuel Vadot description: 1475def4c47SEmmanuel Vadot Any connector to the data bus of this controller should be modelled 1485def4c47SEmmanuel Vadot using the OF graph bindings specified, if the "usb-role-switch" 1495def4c47SEmmanuel Vadot property is used. See graph.txt 1502eb4d8dcSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 1515def4c47SEmmanuel Vadot 1525def4c47SEmmanuel Vadot enable-manual-drd: 1535def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 1545def4c47SEmmanuel Vadot description: 1555def4c47SEmmanuel Vadot supports manual dual-role switch via debugfs; usually used when 1565def4c47SEmmanuel Vadot receptacle is TYPE-A and also wants to support dual-role mode. 1575def4c47SEmmanuel Vadot type: boolean 1585def4c47SEmmanuel Vadot 1595def4c47SEmmanuel Vadot wakeup-source: 1605def4c47SEmmanuel Vadot description: enable USB remote wakeup, see power/wakeup-source.txt 1615def4c47SEmmanuel Vadot type: boolean 1625def4c47SEmmanuel Vadot 1635def4c47SEmmanuel Vadot mediatek,syscon-wakeup: 1645def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle-array 1655def4c47SEmmanuel Vadot maxItems: 1 1665def4c47SEmmanuel Vadot description: 1675def4c47SEmmanuel Vadot A phandle to syscon used to access the register of the USB wakeup glue 1685def4c47SEmmanuel Vadot layer between xHCI and SPM, the field should always be 3 cells long. 1695def4c47SEmmanuel Vadot items: 1705def4c47SEmmanuel Vadot items: 1715def4c47SEmmanuel Vadot - description: 1725def4c47SEmmanuel Vadot The first cell represents a phandle to syscon 1735def4c47SEmmanuel Vadot - description: 1745def4c47SEmmanuel Vadot The second cell represents the register base address of the glue 1755def4c47SEmmanuel Vadot layer in syscon 1762eb4d8dcSEmmanuel Vadot - description: | 1775def4c47SEmmanuel Vadot The third cell represents the hardware version of the glue layer, 1782eb4d8dcSEmmanuel Vadot 1 - used by mt8173 etc, revision 1 without following IPM rule; 1792eb4d8dcSEmmanuel Vadot 2 - used by mt2712 etc, revision 2 with following IPM rule; 1802eb4d8dcSEmmanuel Vadot 101 - used by mt8183, specific 1.01; 1812eb4d8dcSEmmanuel Vadot 102 - used by mt8192, specific 1.02; 1822eb4d8dcSEmmanuel Vadot enum: [1, 2, 101, 102] 1835def4c47SEmmanuel Vadot 1845def4c47SEmmanuel Vadot mediatek,u3p-dis-msk: 1855def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1865def4c47SEmmanuel Vadot description: The mask to disable u3ports, bit0 for u3port0, 1875def4c47SEmmanuel Vadot bit1 for u3port1, ... etc 1885def4c47SEmmanuel Vadot 189354d7675SEmmanuel Vadot mediatek,u2p-dis-msk: 190354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 191354d7675SEmmanuel Vadot description: The mask to disable u2ports, bit0 for u2port0, 192354d7675SEmmanuel Vadot bit1 for u2port1, ... etc; but can't disable u2port0 if dual role mode 193354d7675SEmmanuel Vadot is enabled, so will be skipped in this case. 194354d7675SEmmanuel Vadot 1955def4c47SEmmanuel Vadot# Required child node when support dual-role 1965def4c47SEmmanuel VadotpatternProperties: 1975def4c47SEmmanuel Vadot "^usb@[0-9a-f]+$": 1985def4c47SEmmanuel Vadot type: object 199c9ccf3a3SEmmanuel Vadot $ref: /schemas/usb/mediatek,mtk-xhci.yaml# 2005def4c47SEmmanuel Vadot description: 2015def4c47SEmmanuel Vadot The xhci should be added as subnode to mtu3 as shown in the following 2025def4c47SEmmanuel Vadot example if the host mode is enabled. 2035def4c47SEmmanuel Vadot 2045def4c47SEmmanuel Vadotdependencies: 2055def4c47SEmmanuel Vadot connector: [ 'usb-role-switch' ] 2065def4c47SEmmanuel Vadot port: [ 'usb-role-switch' ] 207354d7675SEmmanuel Vadot role-switch-default-mode: [ 'usb-role-switch' ] 2085def4c47SEmmanuel Vadot wakeup-source: [ 'mediatek,syscon-wakeup' ] 2095def4c47SEmmanuel Vadot 2105def4c47SEmmanuel Vadotrequired: 2115def4c47SEmmanuel Vadot - compatible 2125def4c47SEmmanuel Vadot - reg 2135def4c47SEmmanuel Vadot - reg-names 2145def4c47SEmmanuel Vadot - interrupts 2155def4c47SEmmanuel Vadot - clocks 2165def4c47SEmmanuel Vadot - clock-names 2175def4c47SEmmanuel Vadot 2185def4c47SEmmanuel VadotadditionalProperties: false 2195def4c47SEmmanuel Vadot 2205def4c47SEmmanuel Vadotexamples: 2215def4c47SEmmanuel Vadot # Dual role switch by extcon 2225def4c47SEmmanuel Vadot - | 2235def4c47SEmmanuel Vadot #include <dt-bindings/clock/mt8173-clk.h> 2245def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 2255def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 2265def4c47SEmmanuel Vadot #include <dt-bindings/phy/phy.h> 2275def4c47SEmmanuel Vadot #include <dt-bindings/power/mt8173-power.h> 2285def4c47SEmmanuel Vadot 2295def4c47SEmmanuel Vadot usb@11271000 { 2305def4c47SEmmanuel Vadot compatible = "mediatek,mt8173-mtu3", "mediatek,mtu3"; 2315def4c47SEmmanuel Vadot reg = <0x11271000 0x3000>, <0x11280700 0x0100>; 2325def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 2335def4c47SEmmanuel Vadot interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_LOW>; 2345def4c47SEmmanuel Vadot phys = <&phy_port0 PHY_TYPE_USB3>, <&phy_port1 PHY_TYPE_USB2>; 2355def4c47SEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 2365def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>; 2375def4c47SEmmanuel Vadot clock-names = "sys_ck"; 2385def4c47SEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 2395def4c47SEmmanuel Vadot vbus-supply = <&usb_p0_vbus>; 2405def4c47SEmmanuel Vadot extcon = <&extcon_usb>; 2415def4c47SEmmanuel Vadot dr_mode = "otg"; 2425def4c47SEmmanuel Vadot wakeup-source; 2435def4c47SEmmanuel Vadot mediatek,syscon-wakeup = <&pericfg 0x400 1>; 2445def4c47SEmmanuel Vadot #address-cells = <1>; 2455def4c47SEmmanuel Vadot #size-cells = <1>; 2465def4c47SEmmanuel Vadot ranges; 2475def4c47SEmmanuel Vadot 2485def4c47SEmmanuel Vadot xhci: usb@11270000 { 2495def4c47SEmmanuel Vadot compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci"; 2505def4c47SEmmanuel Vadot reg = <0x11270000 0x1000>; 2515def4c47SEmmanuel Vadot reg-names = "mac"; 2525def4c47SEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 2535def4c47SEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 2545def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 2555def4c47SEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 2565def4c47SEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 2575def4c47SEmmanuel Vadot }; 2585def4c47SEmmanuel Vadot }; 2595def4c47SEmmanuel Vadot 260354d7675SEmmanuel Vadot # Dual role switch by gpio-usb-b-connector 2615def4c47SEmmanuel Vadot - | 2625def4c47SEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 2635def4c47SEmmanuel Vadot #include <dt-bindings/power/mt2712-power.h> 2645def4c47SEmmanuel Vadot 2655def4c47SEmmanuel Vadot usb@112c1000 { 2665def4c47SEmmanuel Vadot compatible = "mediatek,mt2712-mtu3", "mediatek,mtu3"; 2675def4c47SEmmanuel Vadot reg = <0x112c1000 0x3000>, <0x112d0700 0x0100>; 2685def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 2695def4c47SEmmanuel Vadot interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_LOW>; 2705def4c47SEmmanuel Vadot phys = <&u2port2 PHY_TYPE_USB2>; 2715def4c47SEmmanuel Vadot power-domains = <&scpsys MT2712_POWER_DOMAIN_USB2>; 2725def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>; 2735def4c47SEmmanuel Vadot clock-names = "sys_ck"; 274354d7675SEmmanuel Vadot dr_mode = "otg"; 2755def4c47SEmmanuel Vadot usb-role-switch; 276354d7675SEmmanuel Vadot #address-cells = <1>; 277354d7675SEmmanuel Vadot #size-cells = <1>; 278354d7675SEmmanuel Vadot ranges; 279354d7675SEmmanuel Vadot 280354d7675SEmmanuel Vadot host0: usb@11270000 { 281354d7675SEmmanuel Vadot compatible = "mediatek,mt2712-xhci", "mediatek,mtk-xhci"; 282354d7675SEmmanuel Vadot reg = <0x11270000 0x1000>; 283354d7675SEmmanuel Vadot reg-names = "mac"; 284354d7675SEmmanuel Vadot interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_LOW>; 285354d7675SEmmanuel Vadot power-domains = <&scpsys MT2712_POWER_DOMAIN_USB>; 286354d7675SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 287354d7675SEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 288354d7675SEmmanuel Vadot }; 2895def4c47SEmmanuel Vadot 2905def4c47SEmmanuel Vadot connector { 2915def4c47SEmmanuel Vadot compatible = "gpio-usb-b-connector", "usb-b-connector"; 2925def4c47SEmmanuel Vadot type = "micro"; 293354d7675SEmmanuel Vadot id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>; 294354d7675SEmmanuel Vadot vbus-supply = <&usb_p0_vbus>; 2955def4c47SEmmanuel Vadot }; 2965def4c47SEmmanuel Vadot }; 2975def4c47SEmmanuel Vadot 2985def4c47SEmmanuel Vadot # Dual role switch with type-c 2995def4c47SEmmanuel Vadot - | 3005def4c47SEmmanuel Vadot usb@11201000 { 3015def4c47SEmmanuel Vadot compatible ="mediatek,mt8183-mtu3", "mediatek,mtu3"; 3025def4c47SEmmanuel Vadot reg = <0x11201000 0x2e00>, <0x11203e00 0x0100>; 3035def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 3045def4c47SEmmanuel Vadot interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_LOW>; 3055def4c47SEmmanuel Vadot phys = <&u2port0 PHY_TYPE_USB2>; 3065def4c47SEmmanuel Vadot clocks = <&clk26m>; 3075def4c47SEmmanuel Vadot clock-names = "sys_ck"; 3085def4c47SEmmanuel Vadot mediatek,syscon-wakeup = <&pericfg 0x400 1>; 3095def4c47SEmmanuel Vadot wakeup-source; 3105def4c47SEmmanuel Vadot dr_mode = "otg"; 3115def4c47SEmmanuel Vadot usb-role-switch; 312354d7675SEmmanuel Vadot role-switch-default-mode = "host"; 3135def4c47SEmmanuel Vadot #address-cells = <1>; 3145def4c47SEmmanuel Vadot #size-cells = <1>; 3155def4c47SEmmanuel Vadot ranges; 3165def4c47SEmmanuel Vadot 3175def4c47SEmmanuel Vadot host: usb@11200000 { 3185def4c47SEmmanuel Vadot compatible = "mediatek,mt8183-xhci", "mediatek,mtk-xhci"; 3195def4c47SEmmanuel Vadot reg = <0x11200000 0x1000>; 3205def4c47SEmmanuel Vadot reg-names = "mac"; 3215def4c47SEmmanuel Vadot interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_LOW>; 3225def4c47SEmmanuel Vadot clocks = <&clk26m>; 3235def4c47SEmmanuel Vadot clock-names = "sys_ck"; 3245def4c47SEmmanuel Vadot }; 3255def4c47SEmmanuel Vadot 3265def4c47SEmmanuel Vadot port { 3275def4c47SEmmanuel Vadot usb_role_sw: endpoint { 3285def4c47SEmmanuel Vadot remote-endpoint = <&hs_ep>; 3295def4c47SEmmanuel Vadot }; 3305def4c47SEmmanuel Vadot }; 3315def4c47SEmmanuel Vadot }; 3325def4c47SEmmanuel Vadot 3335def4c47SEmmanuel Vadot... 334