1*4882a593SmuzhiyunMediaTek T-PHY binding 2*4882a593Smuzhiyun-------------------------- 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunT-phy controller supports physical layer functionality for a number of 5*4882a593Smuzhiyuncontrollers on MediaTek SoCs, such as, USB2.0, USB3.0, PCIe, and SATA. 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunRequired properties (controller (parent) node): 8*4882a593Smuzhiyun - compatible : should be one of 9*4882a593Smuzhiyun "mediatek,generic-tphy-v1" 10*4882a593Smuzhiyun "mediatek,generic-tphy-v2" 11*4882a593Smuzhiyun "mediatek,mt2701-u3phy" (deprecated) 12*4882a593Smuzhiyun "mediatek,mt2712-u3phy" (deprecated) 13*4882a593Smuzhiyun "mediatek,mt8173-u3phy"; 14*4882a593Smuzhiyun make use of "mediatek,generic-tphy-v1" on mt2701 instead and 15*4882a593Smuzhiyun "mediatek,generic-tphy-v2" on mt2712 instead. 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun- #address-cells: the number of cells used to represent physical 18*4882a593Smuzhiyun base addresses. 19*4882a593Smuzhiyun- #size-cells: the number of cells used to represent the size of an address. 20*4882a593Smuzhiyun- ranges: the address mapping relationship to the parent, defined with 21*4882a593Smuzhiyun - empty value: if optional 'reg' is used. 22*4882a593Smuzhiyun - non-empty value: if optional 'reg' is not used. should set 23*4882a593Smuzhiyun the child's base address to 0, the physical address 24*4882a593Smuzhiyun within parent's address space, and the length of 25*4882a593Smuzhiyun the address map. 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunRequired nodes : a sub-node is required for each port the controller 28*4882a593Smuzhiyun provides. Address range information including the usual 29*4882a593Smuzhiyun 'reg' property is used inside these nodes to describe 30*4882a593Smuzhiyun the controller's topology. 31*4882a593Smuzhiyun 32*4882a593SmuzhiyunOptional properties (controller (parent) node): 33*4882a593Smuzhiyun - reg : offset and length of register shared by multiple ports, 34*4882a593Smuzhiyun exclude port's private register. It is needed on mt2701 35*4882a593Smuzhiyun and mt8173, but not on mt2712. 36*4882a593Smuzhiyun - mediatek,src-ref-clk-mhz : frequency of reference clock for slew rate 37*4882a593Smuzhiyun calibrate 38*4882a593Smuzhiyun - mediatek,src-coef : coefficient for slew rate calibrate, depends on 39*4882a593Smuzhiyun SoC process 40*4882a593Smuzhiyun 41*4882a593SmuzhiyunRequired properties (port (child) node): 42*4882a593Smuzhiyun- reg : address and length of the register set for the port. 43*4882a593Smuzhiyun- #phy-cells : should be 1 (See second example) 44*4882a593Smuzhiyun cell after port phandle is phy type from: 45*4882a593Smuzhiyun - PHY_TYPE_USB2 46*4882a593Smuzhiyun - PHY_TYPE_USB3 47*4882a593Smuzhiyun - PHY_TYPE_PCIE 48*4882a593Smuzhiyun - PHY_TYPE_SATA 49*4882a593Smuzhiyun 50*4882a593SmuzhiyunOptional properties (PHY_TYPE_USB2 port (child) node): 51*4882a593Smuzhiyun- clocks : a list of phandle + clock-specifier pairs, one for each 52*4882a593Smuzhiyun entry in clock-names 53*4882a593Smuzhiyun- clock-names : may contain 54*4882a593Smuzhiyun "ref": 48M reference clock for HighSpeed (digital) phy; and 26M 55*4882a593Smuzhiyun reference clock for SuperSpeed (digital) phy, sometimes is 56*4882a593Smuzhiyun 24M, 25M or 27M, depended on platform. 57*4882a593Smuzhiyun "da_ref": the reference clock of analog phy, used if the clocks 58*4882a593Smuzhiyun of analog and digital phys are separated, otherwise uses 59*4882a593Smuzhiyun "ref" clock only if needed. 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun- mediatek,eye-src : u32, the value of slew rate calibrate 62*4882a593Smuzhiyun- mediatek,eye-vrt : u32, the selection of VRT reference voltage 63*4882a593Smuzhiyun- mediatek,eye-term : u32, the selection of HS_TX TERM reference voltage 64*4882a593Smuzhiyun- mediatek,bc12 : bool, enable BC12 of u2phy if support it 65*4882a593Smuzhiyun- mediatek,discth : u32, the selection of disconnect threshold 66*4882a593Smuzhiyun- mediatek,intr : u32, the selection of internal R (resistance) 67*4882a593Smuzhiyun 68*4882a593SmuzhiyunExample: 69*4882a593Smuzhiyun 70*4882a593Smuzhiyunu3phy: usb-phy@11290000 { 71*4882a593Smuzhiyun compatible = "mediatek,mt8173-u3phy"; 72*4882a593Smuzhiyun reg = <0 0x11290000 0 0x800>; 73*4882a593Smuzhiyun #address-cells = <2>; 74*4882a593Smuzhiyun #size-cells = <2>; 75*4882a593Smuzhiyun ranges; 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun u2port0: usb-phy@11290800 { 78*4882a593Smuzhiyun reg = <0 0x11290800 0 0x100>; 79*4882a593Smuzhiyun clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>; 80*4882a593Smuzhiyun clock-names = "ref"; 81*4882a593Smuzhiyun #phy-cells = <1>; 82*4882a593Smuzhiyun }; 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun u3port0: usb-phy@11290900 { 85*4882a593Smuzhiyun reg = <0 0x11290800 0 0x700>; 86*4882a593Smuzhiyun clocks = <&clk26m>; 87*4882a593Smuzhiyun clock-names = "ref"; 88*4882a593Smuzhiyun #phy-cells = <1>; 89*4882a593Smuzhiyun }; 90*4882a593Smuzhiyun 91*4882a593Smuzhiyun u2port1: usb-phy@11291000 { 92*4882a593Smuzhiyun reg = <0 0x11291000 0 0x100>; 93*4882a593Smuzhiyun clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>; 94*4882a593Smuzhiyun clock-names = "ref"; 95*4882a593Smuzhiyun #phy-cells = <1>; 96*4882a593Smuzhiyun }; 97*4882a593Smuzhiyun}; 98*4882a593Smuzhiyun 99*4882a593SmuzhiyunSpecifying phy control of devices 100*4882a593Smuzhiyun--------------------------------- 101*4882a593Smuzhiyun 102*4882a593SmuzhiyunDevice nodes should specify the configuration required in their "phys" 103*4882a593Smuzhiyunproperty, containing a phandle to the phy port node and a device type; 104*4882a593Smuzhiyunphy-names for each port are optional. 105*4882a593Smuzhiyun 106*4882a593SmuzhiyunExample: 107*4882a593Smuzhiyun 108*4882a593Smuzhiyun#include <dt-bindings/phy/phy.h> 109*4882a593Smuzhiyun 110*4882a593Smuzhiyunusb30: usb@11270000 { 111*4882a593Smuzhiyun ... 112*4882a593Smuzhiyun phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>; 113*4882a593Smuzhiyun phy-names = "usb2-0", "usb3-0"; 114*4882a593Smuzhiyun ... 115*4882a593Smuzhiyun}; 116*4882a593Smuzhiyun 117*4882a593Smuzhiyun 118*4882a593SmuzhiyunLayout differences of banks between mt8173/mt2701 and mt2712 119*4882a593Smuzhiyun------------------------------------------------------------- 120*4882a593Smuzhiyunmt8173 and mt2701: 121*4882a593Smuzhiyunport offset bank 122*4882a593Smuzhiyunshared 0x0000 SPLLC 123*4882a593Smuzhiyun 0x0100 FMREG 124*4882a593Smuzhiyunu2 port0 0x0800 U2PHY_COM 125*4882a593Smuzhiyunu3 port0 0x0900 U3PHYD 126*4882a593Smuzhiyun 0x0a00 U3PHYD_BANK2 127*4882a593Smuzhiyun 0x0b00 U3PHYA 128*4882a593Smuzhiyun 0x0c00 U3PHYA_DA 129*4882a593Smuzhiyunu2 port1 0x1000 U2PHY_COM 130*4882a593Smuzhiyunu3 port1 0x1100 U3PHYD 131*4882a593Smuzhiyun 0x1200 U3PHYD_BANK2 132*4882a593Smuzhiyun 0x1300 U3PHYA 133*4882a593Smuzhiyun 0x1400 U3PHYA_DA 134*4882a593Smuzhiyunu2 port2 0x1800 U2PHY_COM 135*4882a593Smuzhiyun ... 136*4882a593Smuzhiyun 137*4882a593Smuzhiyunmt2712: 138*4882a593Smuzhiyunport offset bank 139*4882a593Smuzhiyunu2 port0 0x0000 MISC 140*4882a593Smuzhiyun 0x0100 FMREG 141*4882a593Smuzhiyun 0x0300 U2PHY_COM 142*4882a593Smuzhiyunu3 port0 0x0700 SPLLC 143*4882a593Smuzhiyun 0x0800 CHIP 144*4882a593Smuzhiyun 0x0900 U3PHYD 145*4882a593Smuzhiyun 0x0a00 U3PHYD_BANK2 146*4882a593Smuzhiyun 0x0b00 U3PHYA 147*4882a593Smuzhiyun 0x0c00 U3PHYA_DA 148*4882a593Smuzhiyunu2 port1 0x1000 MISC 149*4882a593Smuzhiyun 0x1100 FMREG 150*4882a593Smuzhiyun 0x1300 U2PHY_COM 151*4882a593Smuzhiyunu3 port1 0x1700 SPLLC 152*4882a593Smuzhiyun 0x1800 CHIP 153*4882a593Smuzhiyun 0x1900 U3PHYD 154*4882a593Smuzhiyun 0x1a00 U3PHYD_BANK2 155*4882a593Smuzhiyun 0x1b00 U3PHYA 156*4882a593Smuzhiyun 0x1c00 U3PHYA_DA 157*4882a593Smuzhiyunu2 port2 0x2000 MISC 158*4882a593Smuzhiyun ... 159*4882a593Smuzhiyun 160*4882a593Smuzhiyun SPLLC shared by u3 ports and FMREG shared by u2 ports on 161*4882a593Smuzhiyunmt8173/mt2701 are put back into each port; a new bank MISC for 162*4882a593Smuzhiyunu2 ports and CHIP for u3 ports are added on mt2712. 163