Merge remote-tracking branch 'origin/master' into drm-misc-fixes
[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
55         u2port0: usb-phy@11290800 {
56                 reg = <0 0x11290800 0 0x100>;
57                 clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>;
58                 clock-names = "ref";
59                 #phy-cells = <1>;
60         };
61
62         u3port0: usb-phy@11290900 {
63                 reg = <0 0x11290800 0 0x700>;
64                 clocks = <&clk26m>;
65                 clock-names = "ref";
66                 #phy-cells = <1>;
67         };
68
69         u2port1: usb-phy@11291000 {
70                 reg = <0 0x11291000 0 0x100>;
71                 clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>;
72                 clock-names = "ref";
73                 #phy-cells = <1>;
74         };
75 };
76
77 Specifying phy control of devices
78 ---------------------------------
79
80 Device nodes should specify the configuration required in their "phys"
81 property, containing a phandle to the phy port node and a device type;
82 phy-names for each port are optional.
83
84 Example:
85
86 #include <dt-bindings/phy/phy.h>
87
88 usb30: usb@11270000 {
89         ...
90         phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>;
91         phy-names = "usb2-0", "usb3-0";
92         ...
93 };
94
95
96 Layout differences of banks between mt8173/mt2701 and mt2712
97 -------------------------------------------------------------
98 mt8173 and mt2701:
99 port        offset    bank
100 shared      0x0000    SPLLC
101             0x0100    FMREG
102 u2 port0    0x0800    U2PHY_COM
103 u3 port0    0x0900    U3PHYD
104             0x0a00    U3PHYD_BANK2
105             0x0b00    U3PHYA
106             0x0c00    U3PHYA_DA
107 u2 port1    0x1000    U2PHY_COM
108 u3 port1    0x1100    U3PHYD
109             0x1200    U3PHYD_BANK2
110             0x1300    U3PHYA
111             0x1400    U3PHYA_DA
112 u2 port2    0x1800    U2PHY_COM
113             ...
114
115 mt2712:
116 port        offset    bank
117 u2 port0    0x0000    MISC
118             0x0100    FMREG
119             0x0300    U2PHY_COM
120 u3 port0    0x0700    SPLLC
121             0x0800    CHIP
122             0x0900    U3PHYD
123             0x0a00    U3PHYD_BANK2
124             0x0b00    U3PHYA
125             0x0c00    U3PHYA_DA
126 u2 port1    0x1000    MISC
127             0x1100    FMREG
128             0x1300    U2PHY_COM
129 u3 port1    0x1700    SPLLC
130             0x1800    CHIP
131             0x1900    U3PHYD
132             0x1a00    U3PHYD_BANK2
133             0x1b00    U3PHYA
134             0x1c00    U3PHYA_DA
135 u2 port2    0x2000    MISC
136             ...
137
138     SPLLC shared by u3 ports and FMREG shared by u2 ports on
139 mt8173/mt2701 are put back into each port; a new bank MISC for
140 u2 ports and CHIP for u3 ports are added on mt2712.