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