Merge git://git.denx.de/u-boot-usb
[platform/kernel/u-boot.git] / doc / device-tree-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
12 - #address-cells:       the number of cells used to represent physical
13                 base addresses.
14 - #size-cells:  the number of cells used to represent the size of an address.
15 - ranges:       the address mapping relationship to the parent, defined with
16                 - empty value: if optional 'reg' is used.
17                 - non-empty value: if optional 'reg' is not used. should set
18                         the child's base address to 0, the physical address
19                         within parent's address space, and the length of
20                         the address map.
21
22 Required nodes  : a sub-node is required for each port the controller
23                   provides. Address range information including the usual
24                   'reg' property is used inside these nodes to describe
25                   the controller's topology.
26
27 Optional properties (controller (parent) node):
28  - reg          : offset and length of register shared by multiple ports,
29                   exclude port's private register.
30  - mediatek,src-ref-clk-mhz     : frequency of reference clock for slew rate
31                   calibrate
32  - mediatek,src-coef    : coefficient for slew rate calibrate, depends on
33                   SoC process
34
35 Required properties (port (child) node):
36 - reg           : address and length of the register set for the port.
37 - #phy-cells    : should be 1 (See second example)
38                   cell after port phandle is phy type from:
39                         - PHY_TYPE_USB2
40                         - PHY_TYPE_USB3
41                         - PHY_TYPE_PCIE
42                         - PHY_TYPE_SATA
43
44 Optional properties (port (child) node):
45 - clocks        : a list of phandle + clock-specifier pairs, one for each
46                   entry in clock-names
47 - clock-names   : may contain
48                   "ref": 48M reference clock for HighSpeed (digital) phy; and 26M
49                         reference clock for SuperSpeed (digital) phy, sometimes is
50                         24M, 25M or 27M, depended on platform.
51                   "da_ref": the reference clock of analog phy, used if the clocks
52                         of analog and digital phys are separated, otherwise uses
53                         "ref" clock only if needed.
54
55 Example:
56
57         u3phy2: usb-phy@1a244000 {
58                 compatible = "mediatek,generic-tphy-v1";
59                 reg = <0x1a244000 0x0700>;
60                 #address-cells = <1>;
61                 #size-cells = <1>;
62                 ranges;
63                 status = "disabled";
64
65                 u2port1: usb-phy@1a244800 {
66                         reg = <0x1a244800 0x0100>;
67                         clocks = <&topckgen CLK_TOP_USB_PHY48M>;
68                         clock-names = "ref";
69                         #phy-cells = <1>;
70                         status = "okay";
71                 };
72
73                 u3port1: usb-phy@1a244900 {
74                         reg = <0x1a244900 0x0700>;
75                         clocks = <&clk26m>;
76                         clock-names = "ref";
77                         #phy-cells = <1>;
78                         status = "okay";
79                 };
80         };
81
82 Specifying phy control of devices
83 ---------------------------------
84
85 Device nodes should specify the configuration required in their "phys"
86 property, containing a phandle to the phy port node and a device type;
87 phy-names for each port are optional.
88
89 Example:
90
91 #include <dt-bindings/phy/phy.h>
92
93 usb30: usb@11270000 {
94         ...
95         phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>;
96         phy-names = "usb2-0", "usb3-0";
97         ...
98 };
99
100 Layout differences of banks between TPHY V1 and V2
101 -------------------------------------------------------------
102 IP V1:
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 IP V2:
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 TPHY V1 are put back into each port; a new bank MISC for
144 u2 ports and CHIP for u3 ports are added on TPHY V2.