blob: a214d35fc9005854b1f534c792a88207b6fcf7e7 [file] [log] [blame]
Dinh Nguyen427afbb2016-01-27 15:45:59 -06001Micrel KSZ9021/KSZ9031 Gigabit Ethernet PHY
2
3Some boards require special tuning values, particularly when it comes to
4clock delays. You can specify clock delay values by adding
5micrel-specific properties to an Ethernet OF device node.
6
7Note that these settings are applied after any phy-specific fixup from
8phy_fixup_list (see phy_init_hw() from drivers/net/phy/phy_device.c),
9and therefore may overwrite them.
10
11KSZ9021:
12
13 All skew control options are specified in picoseconds. The minimum
14 value is 0, the maximum value is 1800, and it is incremented by 120ps
15 steps.
16
James Byrne457107f2019-03-04 17:40:33 +000017 The KSZ9021 hardware supports a range of skew values from negative to
18 positive, where the specific range is property dependent. All values
19 specified in the devicetree are offset by the minimum value so they
20 can be represented as positive integers in the devicetree since it's
21 difficult to represent a negative number in the devictree.
22
23 The following 4-bit values table applies to all the skew properties:
24
25 Pad Skew Value Delay (ps) Devicetree Value
26 ------------------------------------------------------
27 0000 -840ps 0
28 0001 -720ps 120
29 0010 -600ps 240
30 0011 -480ps 360
31 0100 -360ps 480
32 0101 -240ps 600
33 0110 -120ps 720
34 0111 0ps 840
35 1000 120ps 960
36 1001 240ps 1080
37 1010 360ps 1200
38 1011 480ps 1320
39 1100 600ps 1440
40 1101 720ps 1560
41 1110 840ps 1680
42 1111 960ps 1800
43
Dinh Nguyen427afbb2016-01-27 15:45:59 -060044 Optional properties:
45
46 - rxc-skew-ps : Skew control of RXC pad
47 - rxdv-skew-ps : Skew control of RX CTL pad
48 - txc-skew-ps : Skew control of TXC pad
49 - txen-skew-ps : Skew control of TX CTL pad
50 - rxd0-skew-ps : Skew control of RX data 0 pad
51 - rxd1-skew-ps : Skew control of RX data 1 pad
52 - rxd2-skew-ps : Skew control of RX data 2 pad
53 - rxd3-skew-ps : Skew control of RX data 3 pad
54 - txd0-skew-ps : Skew control of TX data 0 pad
55 - txd1-skew-ps : Skew control of TX data 1 pad
56 - txd2-skew-ps : Skew control of TX data 2 pad
57 - txd3-skew-ps : Skew control of TX data 3 pad
58
59KSZ9031:
60
61 All skew control options are specified in picoseconds. The minimum
62 value is 0, and the maximum is property-dependent. The increment
63 step is 60ps.
64
65 The KSZ9031 hardware supports a range of skew values from negative to
66 positive, where the specific range is property dependent. All values
67 specified in the devicetree are offset by the minimum value so they
68 can be represented as positive integers in the devicetree since it's
69 difficult to represent a negative number in the devictree.
70
71 The following 5-bit values table apply to rxc-skew-ps and txc-skew-ps.
72
73 Pad Skew Value Delay (ps) Devicetree Value
74 ------------------------------------------------------
75 0_0000 -900ps 0
76 0_0001 -840ps 60
77 0_0010 -780ps 120
78 0_0011 -720ps 180
79 0_0100 -660ps 240
80 0_0101 -600ps 300
81 0_0110 -540ps 360
82 0_0111 -480ps 420
83 0_1000 -420ps 480
84 0_1001 -360ps 540
85 0_1010 -300ps 600
86 0_1011 -240ps 660
87 0_1100 -180ps 720
88 0_1101 -120ps 780
89 0_1110 -60ps 840
90 0_1111 0ps 900
91 1_0000 60ps 960
92 1_0001 120ps 1020
93 1_0010 180ps 1080
94 1_0011 240ps 1140
95 1_0100 300ps 1200
96 1_0101 360ps 1260
97 1_0110 420ps 1320
98 1_0111 480ps 1380
99 1_1000 540ps 1440
100 1_1001 600ps 1500
101 1_1010 660ps 1560
102 1_1011 720ps 1620
103 1_1100 780ps 1680
104 1_1101 840ps 1740
105 1_1110 900ps 1800
106 1_1111 960ps 1860
107
108 The following 4-bit values table apply to the txdX-skew-ps, rxdX-skew-ps
109 data pads, and the rxdv-skew-ps, txen-skew-ps control pads.
110
111 Pad Skew Value Delay (ps) Devicetree Value
112 ------------------------------------------------------
113 0000 -420ps 0
114 0001 -360ps 60
115 0010 -300ps 120
116 0011 -240ps 180
117 0100 -180ps 240
118 0101 -120ps 300
119 0110 -60ps 360
120 0111 0ps 420
121 1000 60ps 480
122 1001 120ps 540
123 1010 180ps 600
124 1011 240ps 660
125 1100 300ps 720
126 1101 360ps 780
127 1110 420ps 840
128 1111 480ps 900
129
130 Optional properties:
131
132 Maximum value of 1860:
133
134 - rxc-skew-ps : Skew control of RX clock pad
135 - txc-skew-ps : Skew control of TX clock pad
136
137 Maximum value of 900:
138
139 - rxdv-skew-ps : Skew control of RX CTL pad
140 - txen-skew-ps : Skew control of TX CTL pad
141 - rxd0-skew-ps : Skew control of RX data 0 pad
142 - rxd1-skew-ps : Skew control of RX data 1 pad
143 - rxd2-skew-ps : Skew control of RX data 2 pad
144 - rxd3-skew-ps : Skew control of RX data 3 pad
145 - txd0-skew-ps : Skew control of TX data 0 pad
146 - txd1-skew-ps : Skew control of TX data 1 pad
147 - txd2-skew-ps : Skew control of TX data 2 pad
148 - txd3-skew-ps : Skew control of TX data 3 pad
149
150Examples:
151
152 /* Attach to an Ethernet device with autodetected PHY */
153 &enet {
154 rxc-skew-ps = <1800>;
155 rxdv-skew-ps = <0>;
156 txc-skew-ps = <1800>;
157 txen-skew-ps = <0>;
158 status = "okay";
159 };
160
161 /* Attach to an explicitly-specified PHY */
162 mdio {
163 phy0: ethernet-phy@0 {
164 rxc-skew-ps = <1800>;
165 rxdv-skew-ps = <0>;
166 txc-skew-ps = <1800>;
167 txen-skew-ps = <0>;
168 reg = <0>;
169 };
170 };
171 ethernet@70000 {
172 status = "okay";
173 phy = <&phy0>;
174 phy-mode = "rgmii-id";
175 };
176
177References
178
179 Micrel ksz9021rl/rn Data Sheet, Revision 1.2. Dated 2/13/2014.
180 http://www.micrel.com/_PDF/Ethernet/datasheets/ksz9021rl-rn_ds.pdf
181
182 Micrel ksz9031rnx Data Sheet, Revision 2.1. Dated 11/20/2014.
183 http://www.micrel.com/_PDF/Ethernet/datasheets/KSZ9031RNX.pdf
184
185Notes:
186
187 Note that a previous version of the Micrel ksz9021rl/rn Data Sheet
188 was missing extended register 106 (transmit data pad skews), and
189 incorrectly specified the ps per step as 200ps/step instead of
190 120ps/step. The latest update to this document reflects the latest
191 revision of the Micrel specification even though usage in the kernel
192 still reflects that incorrect document.