1*c66ec88fSEmmanuel VadotMT8173 xHCI 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotThe device node for Mediatek SOC USB3.0 host controller 4*c66ec88fSEmmanuel Vadot 5*c66ec88fSEmmanuel VadotThere are two scenarios: the first one only supports xHCI driver; 6*c66ec88fSEmmanuel Vadotthe second one supports dual-role mode, and the host is based on xHCI 7*c66ec88fSEmmanuel Vadotdriver. Take account of backward compatibility, we divide bindings 8*c66ec88fSEmmanuel Vadotinto two parts. 9*c66ec88fSEmmanuel Vadot 10*c66ec88fSEmmanuel Vadot1st: only supports xHCI driver 11*c66ec88fSEmmanuel Vadot------------------------------------------------------------------------ 12*c66ec88fSEmmanuel Vadot 13*c66ec88fSEmmanuel VadotRequired properties: 14*c66ec88fSEmmanuel Vadot - compatible : should be "mediatek,<soc-model>-xhci", "mediatek,mtk-xhci", 15*c66ec88fSEmmanuel Vadot soc-model is the name of SoC, such as mt8173, mt2712 etc, when using 16*c66ec88fSEmmanuel Vadot "mediatek,mtk-xhci" compatible string, you need SoC specific ones in 17*c66ec88fSEmmanuel Vadot addition, one of: 18*c66ec88fSEmmanuel Vadot - "mediatek,mt8173-xhci" 19*c66ec88fSEmmanuel Vadot - reg : specifies physical base address and size of the registers 20*c66ec88fSEmmanuel Vadot - reg-names: should be "mac" for xHCI MAC and "ippc" for IP port control 21*c66ec88fSEmmanuel Vadot - interrupts : interrupt used by the controller 22*c66ec88fSEmmanuel Vadot - power-domains : a phandle to USB power domain node to control USB's 23*c66ec88fSEmmanuel Vadot mtcmos 24*c66ec88fSEmmanuel Vadot - vusb33-supply : regulator of USB avdd3.3v 25*c66ec88fSEmmanuel Vadot 26*c66ec88fSEmmanuel Vadot - clocks : a list of phandle + clock-specifier pairs, one for each 27*c66ec88fSEmmanuel Vadot entry in clock-names 28*c66ec88fSEmmanuel Vadot - clock-names : must contain 29*c66ec88fSEmmanuel Vadot "sys_ck": controller clock used by normal mode, 30*c66ec88fSEmmanuel Vadot the following ones are optional: 31*c66ec88fSEmmanuel Vadot "ref_ck": reference clock used by low power mode etc, 32*c66ec88fSEmmanuel Vadot "mcu_ck": mcu_bus clock for register access, 33*c66ec88fSEmmanuel Vadot "dma_ck": dma_bus clock for data transfer by DMA, 34*c66ec88fSEmmanuel Vadot "xhci_ck": controller clock 35*c66ec88fSEmmanuel Vadot 36*c66ec88fSEmmanuel Vadot - phys : see usb-hcd.yaml in the current directory 37*c66ec88fSEmmanuel Vadot 38*c66ec88fSEmmanuel VadotOptional properties: 39*c66ec88fSEmmanuel Vadot - wakeup-source : enable USB remote wakeup; 40*c66ec88fSEmmanuel Vadot - mediatek,syscon-wakeup : phandle to syscon used to access the register 41*c66ec88fSEmmanuel Vadot of the USB wakeup glue layer between xHCI and SPM; it depends on 42*c66ec88fSEmmanuel Vadot "wakeup-source", and has two arguments: 43*c66ec88fSEmmanuel Vadot - the first one : register base address of the glue layer in syscon; 44*c66ec88fSEmmanuel Vadot - the second one : hardware version of the glue layer 45*c66ec88fSEmmanuel Vadot - 1 : used by mt8173 etc 46*c66ec88fSEmmanuel Vadot - 2 : used by mt2712 etc 47*c66ec88fSEmmanuel Vadot - mediatek,u3p-dis-msk : mask to disable u3ports, bit0 for u3port0, 48*c66ec88fSEmmanuel Vadot bit1 for u3port1, ... etc; 49*c66ec88fSEmmanuel Vadot - vbus-supply : reference to the VBUS regulator; 50*c66ec88fSEmmanuel Vadot - usb3-lpm-capable : supports USB3.0 LPM 51*c66ec88fSEmmanuel Vadot - pinctrl-names : a pinctrl state named "default" must be defined 52*c66ec88fSEmmanuel Vadot - pinctrl-0 : pin control group 53*c66ec88fSEmmanuel Vadot See: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt 54*c66ec88fSEmmanuel Vadot - imod-interval-ns: default interrupt moderation interval is 5000ns 55*c66ec88fSEmmanuel Vadot 56*c66ec88fSEmmanuel Vadotadditionally the properties from usb-hcd.yaml (in the current directory) are 57*c66ec88fSEmmanuel Vadotsupported. 58*c66ec88fSEmmanuel Vadot 59*c66ec88fSEmmanuel VadotExample: 60*c66ec88fSEmmanuel Vadotusb30: usb@11270000 { 61*c66ec88fSEmmanuel Vadot compatible = "mediatek,mt8173-xhci"; 62*c66ec88fSEmmanuel Vadot reg = <0 0x11270000 0 0x1000>, 63*c66ec88fSEmmanuel Vadot <0 0x11280700 0 0x0100>; 64*c66ec88fSEmmanuel Vadot reg-names = "mac", "ippc"; 65*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 66*c66ec88fSEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 67*c66ec88fSEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>, 68*c66ec88fSEmmanuel Vadot <&pericfg CLK_PERI_USB0>, 69*c66ec88fSEmmanuel Vadot <&pericfg CLK_PERI_USB1>; 70*c66ec88fSEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 71*c66ec88fSEmmanuel Vadot phys = <&phy_port0 PHY_TYPE_USB3>, 72*c66ec88fSEmmanuel Vadot <&phy_port1 PHY_TYPE_USB2>; 73*c66ec88fSEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 74*c66ec88fSEmmanuel Vadot vbus-supply = <&usb_p1_vbus>; 75*c66ec88fSEmmanuel Vadot usb3-lpm-capable; 76*c66ec88fSEmmanuel Vadot mediatek,syscon-wakeup = <&pericfg 0x400 1>; 77*c66ec88fSEmmanuel Vadot wakeup-source; 78*c66ec88fSEmmanuel Vadot imod-interval-ns = <10000>; 79*c66ec88fSEmmanuel Vadot}; 80*c66ec88fSEmmanuel Vadot 81*c66ec88fSEmmanuel Vadot2nd: dual-role mode with xHCI driver 82*c66ec88fSEmmanuel Vadot------------------------------------------------------------------------ 83*c66ec88fSEmmanuel Vadot 84*c66ec88fSEmmanuel VadotIn the case, xhci is added as subnode to mtu3. An example and the DT binding 85*c66ec88fSEmmanuel Vadotdetails of mtu3 can be found in: 86*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/usb/mediatek,mtu3.txt 87*c66ec88fSEmmanuel Vadot 88*c66ec88fSEmmanuel VadotRequired properties: 89*c66ec88fSEmmanuel Vadot - compatible : should be "mediatek,<soc-model>-xhci", "mediatek,mtk-xhci", 90*c66ec88fSEmmanuel Vadot soc-model is the name of SoC, such as mt8173, mt2712 etc, when using 91*c66ec88fSEmmanuel Vadot "mediatek,mtk-xhci" compatible string, you need SoC specific ones in 92*c66ec88fSEmmanuel Vadot addition, one of: 93*c66ec88fSEmmanuel Vadot - "mediatek,mt8173-xhci" 94*c66ec88fSEmmanuel Vadot - reg : specifies physical base address and size of the registers 95*c66ec88fSEmmanuel Vadot - reg-names: should be "mac" for xHCI MAC 96*c66ec88fSEmmanuel Vadot - interrupts : interrupt used by the host controller 97*c66ec88fSEmmanuel Vadot - power-domains : a phandle to USB power domain node to control USB's 98*c66ec88fSEmmanuel Vadot mtcmos 99*c66ec88fSEmmanuel Vadot - vusb33-supply : regulator of USB avdd3.3v 100*c66ec88fSEmmanuel Vadot 101*c66ec88fSEmmanuel Vadot - clocks : a list of phandle + clock-specifier pairs, one for each 102*c66ec88fSEmmanuel Vadot entry in clock-names 103*c66ec88fSEmmanuel Vadot - clock-names : must contain "sys_ck", and the following ones are optional: 104*c66ec88fSEmmanuel Vadot "ref_ck", "mcu_ck" and "dma_ck", "xhci_ck" 105*c66ec88fSEmmanuel Vadot 106*c66ec88fSEmmanuel VadotOptional properties: 107*c66ec88fSEmmanuel Vadot - vbus-supply : reference to the VBUS regulator; 108*c66ec88fSEmmanuel Vadot - usb3-lpm-capable : supports USB3.0 LPM 109*c66ec88fSEmmanuel Vadot 110*c66ec88fSEmmanuel VadotExample: 111*c66ec88fSEmmanuel Vadotusb30: usb@11270000 { 112*c66ec88fSEmmanuel Vadot compatible = "mediatek,mt8173-xhci"; 113*c66ec88fSEmmanuel Vadot reg = <0 0x11270000 0 0x1000>; 114*c66ec88fSEmmanuel Vadot reg-names = "mac"; 115*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 116*c66ec88fSEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; 117*c66ec88fSEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; 118*c66ec88fSEmmanuel Vadot clock-names = "sys_ck", "ref_ck"; 119*c66ec88fSEmmanuel Vadot vusb33-supply = <&mt6397_vusb_reg>; 120*c66ec88fSEmmanuel Vadot usb3-lpm-capable; 121*c66ec88fSEmmanuel Vadot}; 122