Merge tag 'edac_for_4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / phy / phy-mtk-tphy.txt
1 MediaTek T-PHY binding
2 --------------------------
3
4 T-phy controller supports physical layer functionality for a number of
5 controllers on MediaTek SoCs, such as, USB2.0, USB3.0, PCIe, and SATA.
6
7 Required properties (controller (parent) node):
8  - compatible   : should be one of
9                   "mediatek,generic-tphy-v1"
10                   "mediatek,generic-tphy-v2"
11                   "mediatek,mt2701-u3phy" (deprecated)
12                   "mediatek,mt2712-u3phy" (deprecated)
13                   "mediatek,mt8173-u3phy";
14                   make use of "mediatek,generic-tphy-v1" on mt2701 instead and
15                   "mediatek,generic-tphy-v2" on mt2712 instead.
16  - clocks       : (deprecated, use port's clocks instead) a list of phandle +
17                   clock-specifier pairs, one for each entry in clock-names
18  - clock-names  : (deprecated, use port's one instead) must contain
19                   "u3phya_ref": for reference clock of usb3.0 analog phy.
20
21 Required nodes  : a sub-node is required for each port the controller
22                   provides. Address range information including the usual
23                   'reg' property is used inside these nodes to describe
24                   the controller's topology.
25
26 Optional properties (controller (parent) node):
27  - reg          : offset and length of register shared by multiple ports,
28                   exclude port's private register. It is needed on mt2701
29                   and mt8173, but not on mt2712.
30
31 Required properties (port (child) node):
32 - reg           : address and length of the register set for the port.
33 - clocks        : a list of phandle + clock-specifier pairs, one for each
34                   entry in clock-names
35 - clock-names   : must contain
36                   "ref": 48M reference clock for HighSpeed analog phy; and 26M
37                         reference clock for SuperSpeed analog phy, sometimes is
38                         24M, 25M or 27M, depended on platform.
39 - #phy-cells    : should be 1 (See second example)
40                   cell after port phandle is phy type from:
41                         - PHY_TYPE_USB2
42                         - PHY_TYPE_USB3
43                         - PHY_TYPE_PCIE
44                         - PHY_TYPE_SATA
45
46 Example:
47
48 u3phy: usb-phy@11290000 {
49         compatible = "mediatek,mt8173-u3phy";
50         reg = <0 0x11290000 0 0x800>;
51         #address-cells = <2>;
52         #size-cells = <2>;
53         ranges;
54         status = "okay";
55
56         u2port0: usb-phy@11290800 {
57                 reg = <0 0x11290800 0 0x100>;
58                 clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>;
59                 clock-names = "ref";
60                 #phy-cells = <1>;
61                 status = "okay";
62         };
63
64         u3port0: usb-phy@11290900 {
65                 reg = <0 0x11290800 0 0x700>;
66                 clocks = <&clk26m>;
67                 clock-names = "ref";
68                 #phy-cells = <1>;
69                 status = "okay";
70         };
71
72         u2port1: usb-phy@11291000 {
73                 reg = <0 0x11291000 0 0x100>;
74                 clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>;
75                 clock-names = "ref";
76                 #phy-cells = <1>;
77                 status = "okay";
78         };
79 };
80
81 Specifying phy control of devices
82 ---------------------------------
83
84 Device nodes should specify the configuration required in their "phys"
85 property, containing a phandle to the phy port node and a device type;
86 phy-names for each port are optional.
87
88 Example:
89
90 #include <dt-bindings/phy/phy.h>
91
92 usb30: usb@11270000 {
93         ...
94         phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>;
95         phy-names = "usb2-0", "usb3-0";
96         ...
97 };
98
99
100 Layout differences of banks between mt8173/mt2701 and mt2712
101 -------------------------------------------------------------
102 mt8173 and mt2701:
103 port        offset    bank
104 shared      0x0000    SPLLC
105             0x0100    FMREG
106 u2 port0    0x0800    U2PHY_COM
107 u3 port0    0x0900    U3PHYD
108             0x0a00    U3PHYD_BANK2
109             0x0b00    U3PHYA
110             0x0c00    U3PHYA_DA
111 u2 port1    0x1000    U2PHY_COM
112 u3 port1    0x1100    U3PHYD
113             0x1200    U3PHYD_BANK2
114             0x1300    U3PHYA
115             0x1400    U3PHYA_DA
116 u2 port2    0x1800    U2PHY_COM
117             ...
118
119 mt2712:
120 port        offset    bank
121 u2 port0    0x0000    MISC
122             0x0100    FMREG
123             0x0300    U2PHY_COM
124 u3 port0    0x0700    SPLLC
125             0x0800    CHIP
126             0x0900    U3PHYD
127             0x0a00    U3PHYD_BANK2
128             0x0b00    U3PHYA
129             0x0c00    U3PHYA_DA
130 u2 port1    0x1000    MISC
131             0x1100    FMREG
132             0x1300    U2PHY_COM
133 u3 port1    0x1700    SPLLC
134             0x1800    CHIP
135             0x1900    U3PHYD
136             0x1a00    U3PHYD_BANK2
137             0x1b00    U3PHYA
138             0x1c00    U3PHYA_DA
139 u2 port2    0x2000    MISC
140             ...
141
142     SPLLC shared by u3 ports and FMREG shared by u2 ports on
143 mt8173/mt2701 are put back into each port; a new bank MISC for
144 u2 ports and CHIP for u3 ports are added on mt2712.