1*c66ec88fSEmmanuel VadotThe device node for Mediatek USB3.0 DRD controller 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotRequired properties: 4*c66ec88fSEmmanuel Vadot - compatible : should be "mediatek,<soc-model>-mtu3", "mediatek,mtu3", 5*c66ec88fSEmmanuel Vadot soc-model is the name of SoC, such as mt8173, mt2712 etc, 6*c66ec88fSEmmanuel Vadot when using "mediatek,mtu3" compatible string, you need SoC specific 7*c66ec88fSEmmanuel Vadot ones in addition, one of: 8*c66ec88fSEmmanuel Vadot - "mediatek,mt8173-mtu3" 9*c66ec88fSEmmanuel Vadot - reg : specifies physical base address and size of the registers 10*c66ec88fSEmmanuel Vadot - reg-names: should be "mac" for device IP and "ippc" for IP port control 11*c66ec88fSEmmanuel Vadot - interrupts : interrupt used by the device IP 12*c66ec88fSEmmanuel Vadot - power-domains : a phandle to USB power domain node to control USB's 13*c66ec88fSEmmanuel Vadot mtcmos 14*c66ec88fSEmmanuel Vadot - vusb33-supply : regulator of USB avdd3.3v 15*c66ec88fSEmmanuel Vadot - clocks : a list of phandle + clock-specifier pairs, one for each 16*c66ec88fSEmmanuel Vadot entry in clock-names 17*c66ec88fSEmmanuel Vadot - clock-names : must contain "sys_ck" for clock of controller, 18*c66ec88fSEmmanuel Vadot the following clocks are optional: 19*c66ec88fSEmmanuel Vadot "ref_ck", "mcu_ck" and "dma_ck"; 20*c66ec88fSEmmanuel Vadot - phys : see usb-hcd.yaml in the current directory 21*c66ec88fSEmmanuel Vadot - dr_mode : should be one of "host", "peripheral" or "otg", 22*c66ec88fSEmmanuel Vadot refer to usb/generic.txt 23*c66ec88fSEmmanuel Vadot 24*c66ec88fSEmmanuel VadotOptional properties: 25*c66ec88fSEmmanuel Vadot - #address-cells, #size-cells : should be '2' if the device has sub-nodes 26*c66ec88fSEmmanuel Vadot with 'reg' property 27*c66ec88fSEmmanuel Vadot - ranges : allows valid 1:1 translation between child's address space and 28*c66ec88fSEmmanuel Vadot parent's address space 29*c66ec88fSEmmanuel Vadot - extcon : external connector for vbus and idpin changes detection, needed 30*c66ec88fSEmmanuel Vadot when supports dual-role mode. 31*c66ec88fSEmmanuel Vadot it's considered valid for compatibility reasons, not allowed for 32*c66ec88fSEmmanuel Vadot new bindings, and use "usb-role-switch" property instead. 33*c66ec88fSEmmanuel Vadot - vbus-supply : reference to the VBUS regulator, needed when supports 34*c66ec88fSEmmanuel Vadot dual-role mode. 35*c66ec88fSEmmanuel Vadot it's considered valid for compatibility reasons, not allowed for 36*c66ec88fSEmmanuel Vadot new bindings, and put into a usb-connector node. 37*c66ec88fSEmmanuel Vadot see connector/usb-connector.yaml. 38*c66ec88fSEmmanuel Vadot - pinctrl-names : a pinctrl state named "default" is optional, and need be 39*c66ec88fSEmmanuel Vadot defined if auto drd switch is enabled, that means the property dr_mode 40*c66ec88fSEmmanuel Vadot is set as "otg", and meanwhile the property "mediatek,enable-manual-drd" 41*c66ec88fSEmmanuel Vadot is not set. 42*c66ec88fSEmmanuel Vadot - pinctrl-0 : pin control group 43*c66ec88fSEmmanuel Vadot See: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt 44*c66ec88fSEmmanuel Vadot 45*c66ec88fSEmmanuel Vadot - maximum-speed : valid arguments are "super-speed", "high-speed" and 46*c66ec88fSEmmanuel Vadot "full-speed"; refer to usb/generic.txt 47*c66ec88fSEmmanuel Vadot - usb-role-switch : use USB Role Switch to support dual-role switch, but 48*c66ec88fSEmmanuel Vadot not extcon; see usb/generic.txt. 49*c66ec88fSEmmanuel Vadot - enable-manual-drd : supports manual dual-role switch via debugfs; usually 50*c66ec88fSEmmanuel Vadot used when receptacle is TYPE-A and also wants to support dual-role 51*c66ec88fSEmmanuel Vadot mode. 52*c66ec88fSEmmanuel Vadot - wakeup-source: enable USB remote wakeup of host mode. 53*c66ec88fSEmmanuel Vadot - mediatek,syscon-wakeup : phandle to syscon used to access the register 54*c66ec88fSEmmanuel Vadot of the USB wakeup glue layer between SSUSB and SPM; it depends on 55*c66ec88fSEmmanuel Vadot "wakeup-source", and has two arguments: 56*c66ec88fSEmmanuel Vadot - the first one : register base address of the glue layer in syscon; 57*c66ec88fSEmmanuel Vadot - the second one : hardware version of the glue layer 58*c66ec88fSEmmanuel Vadot - 1 : used by mt8173 etc 59*c66ec88fSEmmanuel Vadot - 2 : used by mt2712 etc 60*c66ec88fSEmmanuel Vadot - mediatek,u3p-dis-msk : mask to disable u3ports, bit0 for u3port0, 61*c66ec88fSEmmanuel Vadot bit1 for u3port1, ... etc; 62*c66ec88fSEmmanuel Vadot 63*c66ec88fSEmmanuel Vadotadditionally the properties from usb-hcd.yaml (in the current directory) are 64*c66ec88fSEmmanuel Vadotsupported. 65*c66ec88fSEmmanuel Vadot 66*c66ec88fSEmmanuel VadotSub-nodes: 67*c66ec88fSEmmanuel VadotThe xhci should be added as subnode to mtu3 as shown in the following example 68*c66ec88fSEmmanuel Vadotif host mode is enabled. The DT binding details of xhci can be found in: 69*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt 70*c66ec88fSEmmanuel Vadot 71*c66ec88fSEmmanuel VadotThe port would be added as subnode if use "usb-role-switch" property. 72*c66ec88fSEmmanuel Vadot see graph.txt 73*c66ec88fSEmmanuel Vadot 74*c66ec88fSEmmanuel VadotExample: 75*c66ec88fSEmmanuel Vadotssusb: usb@11271000 { 76*c66ec88fSEmmanuel Vadot compatible = "mediatek,mt8173-mtu3"; 77*c66ec88fSEmmanuel Vadot reg = <0 0x11271000 0 0x3000>, 78*c66ec88fSEmmanuel Vadot <0 0x11280700 0 0x0100>; 79*c66ec88fSEmmanuel Vadot reg-names = "mac", "ippc"; 80*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_LOW>; 81*c66ec88fSEmmanuel Vadot phys = <&phy_port0 PHY_TYPE_USB3>, 82*c66ec88fSEmmanuel Vadot <&phy_port1 PHY_TYPE_USB2>; 83*c66ec88fSEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 84*c66ec88fSEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>, 85*c66ec88fSEmmanuel Vadot <&pericfg CLK_PERI_USB0>, 86*c66ec88fSEmmanuel Vadot <&pericfg CLK_PERI_USB1>; 87*c66ec88fSEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 88*c66ec88fSEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 89*c66ec88fSEmmanuel Vadot vbus-supply = <&usb_p0_vbus>; 90*c66ec88fSEmmanuel Vadot extcon = <&extcon_usb>; 91*c66ec88fSEmmanuel Vadot dr_mode = "otg"; 92*c66ec88fSEmmanuel Vadot wakeup-source; 93*c66ec88fSEmmanuel Vadot mediatek,syscon-wakeup = <&pericfg 0x400 1>; 94*c66ec88fSEmmanuel Vadot #address-cells = <2>; 95*c66ec88fSEmmanuel Vadot #size-cells = <2>; 96*c66ec88fSEmmanuel Vadot ranges; 97*c66ec88fSEmmanuel Vadot 98*c66ec88fSEmmanuel Vadot usb_host: xhci@11270000 { 99*c66ec88fSEmmanuel Vadot compatible = "mediatek,mt8173-xhci"; 100*c66ec88fSEmmanuel Vadot reg = <0 0x11270000 0 0x1000>; 101*c66ec88fSEmmanuel Vadot reg-names = "mac"; 102*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 103*c66ec88fSEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 104*c66ec88fSEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 105*c66ec88fSEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 106*c66ec88fSEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 107*c66ec88fSEmmanuel Vadot }; 108*c66ec88fSEmmanuel Vadot}; 109