blob: b4612c1cfd6c8272f04806866174aa93f51f3852 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Andy Fleming60ca78b2011-04-07 21:56:05 -05002/*
3 * RealTek PHY drivers
4 *
Codrin Ciubotariude947a12015-02-13 14:47:58 +02005 * Copyright 2010-2011, 2015 Freescale Semiconductor, Inc.
Andy Fleming60ca78b2011-04-07 21:56:05 -05006 * author Andy Fleming
Karsten Merker10800de2016-03-21 20:29:07 +01007 * Copyright 2016 Karsten Merker <merker@debian.org>
Andy Fleming60ca78b2011-04-07 21:56:05 -05008 */
Andy Fleming60ca78b2011-04-07 21:56:05 -05009#include <common.h>
oliver@schinagl.nlec1b26f2016-11-08 17:38:57 +010010#include <linux/bitops.h>
Andy Fleming60ca78b2011-04-07 21:56:05 -050011#include <phy.h>
Simon Glassdbd79542020-05-10 11:40:11 -060012#include <linux/delay.h>
Andy Fleming60ca78b2011-04-07 21:56:05 -050013
oliver@schinagl.nl6a250902016-11-08 17:38:59 +010014#define PHY_RTL8211x_FORCE_MASTER BIT(1)
kevans@FreeBSD.org7c824012018-02-14 17:02:15 -060015#define PHY_RTL8211E_PINE64_GIGABIT_FIX BIT(2)
Carlo Caionecf93d022019-01-24 08:54:37 +000016#define PHY_RTL8211F_FORCE_EEE_RXC_ON BIT(3)
oliver@schinagl.nl6a250902016-11-08 17:38:59 +010017
Andy Fleming60ca78b2011-04-07 21:56:05 -050018#define PHY_AUTONEGOTIATE_TIMEOUT 5000
19
Michael Haas0cf2b4e2016-03-25 18:22:50 +010020/* RTL8211x 1000BASE-T Control Register */
oliver@schinagl.nlec1b26f2016-11-08 17:38:57 +010021#define MIIM_RTL8211x_CTRL1000T_MSCE BIT(12);
oliver@schinagl.nl1beb7352016-11-08 17:38:58 +010022#define MIIM_RTL8211x_CTRL1000T_MASTER BIT(11);
Michael Haas0cf2b4e2016-03-25 18:22:50 +010023
Bhupesh Sharma85eb7802013-07-18 13:58:20 +053024/* RTL8211x PHY Status Register */
25#define MIIM_RTL8211x_PHY_STATUS 0x11
26#define MIIM_RTL8211x_PHYSTAT_SPEED 0xc000
27#define MIIM_RTL8211x_PHYSTAT_GBIT 0x8000
28#define MIIM_RTL8211x_PHYSTAT_100 0x4000
29#define MIIM_RTL8211x_PHYSTAT_DUPLEX 0x2000
30#define MIIM_RTL8211x_PHYSTAT_SPDDONE 0x0800
31#define MIIM_RTL8211x_PHYSTAT_LINK 0x0400
Andy Fleming60ca78b2011-04-07 21:56:05 -050032
Codrin Ciubotariude947a12015-02-13 14:47:58 +020033/* RTL8211x PHY Interrupt Enable Register */
34#define MIIM_RTL8211x_PHY_INER 0x12
35#define MIIM_RTL8211x_PHY_INTR_ENA 0x9f01
36#define MIIM_RTL8211x_PHY_INTR_DIS 0x0000
37
38/* RTL8211x PHY Interrupt Status Register */
39#define MIIM_RTL8211x_PHY_INSR 0x13
Andy Fleming60ca78b2011-04-07 21:56:05 -050040
Shengzhou Liu210f17f2015-03-12 18:54:59 +080041/* RTL8211F PHY Status Register */
42#define MIIM_RTL8211F_PHY_STATUS 0x1a
43#define MIIM_RTL8211F_AUTONEG_ENABLE 0x1000
44#define MIIM_RTL8211F_PHYSTAT_SPEED 0x0030
45#define MIIM_RTL8211F_PHYSTAT_GBIT 0x0020
46#define MIIM_RTL8211F_PHYSTAT_100 0x0010
47#define MIIM_RTL8211F_PHYSTAT_DUPLEX 0x0008
48#define MIIM_RTL8211F_PHYSTAT_SPDDONE 0x0800
49#define MIIM_RTL8211F_PHYSTAT_LINK 0x0004
50
kevans@FreeBSD.org7c824012018-02-14 17:02:15 -060051#define MIIM_RTL8211E_CONFREG 0x1c
52#define MIIM_RTL8211E_CONFREG_TXD 0x0002
53#define MIIM_RTL8211E_CONFREG_RXD 0x0004
54#define MIIM_RTL8211E_CONFREG_MAGIC 0xb400 /* Undocumented */
55
56#define MIIM_RTL8211E_EXT_PAGE_SELECT 0x1e
57
Shengzhou Liu210f17f2015-03-12 18:54:59 +080058#define MIIM_RTL8211F_PAGE_SELECT 0x1f
Shengzhou Liu67500892015-04-24 16:57:17 +080059#define MIIM_RTL8211F_TX_DELAY 0x100
Fugang Duan030ccaa2020-05-03 22:41:16 +080060#define MIIM_RTL8211F_RX_DELAY 0x8
Shengzhou Liu5487fc62015-05-21 18:07:35 +080061#define MIIM_RTL8211F_LCR 0x10
Shengzhou Liu210f17f2015-03-12 18:54:59 +080062
Carlo Caioneb8d167e2019-01-16 11:34:50 +000063static int rtl8211f_phy_extread(struct phy_device *phydev, int addr,
64 int devaddr, int regnum)
65{
66 int oldpage = phy_read(phydev, MDIO_DEVAD_NONE,
67 MIIM_RTL8211F_PAGE_SELECT);
68 int val;
69
70 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, devaddr);
71 val = phy_read(phydev, MDIO_DEVAD_NONE, regnum);
72 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, oldpage);
73
74 return val;
75}
76
77static int rtl8211f_phy_extwrite(struct phy_device *phydev, int addr,
78 int devaddr, int regnum, u16 val)
79{
80 int oldpage = phy_read(phydev, MDIO_DEVAD_NONE,
81 MIIM_RTL8211F_PAGE_SELECT);
82
83 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, devaddr);
84 phy_write(phydev, MDIO_DEVAD_NONE, regnum, val);
85 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, oldpage);
86
87 return 0;
88}
89
oliver@schinagl.nl6a250902016-11-08 17:38:59 +010090static int rtl8211b_probe(struct phy_device *phydev)
91{
92#ifdef CONFIG_RTL8211X_PHY_FORCE_MASTER
93 phydev->flags |= PHY_RTL8211x_FORCE_MASTER;
94#endif
95
96 return 0;
97}
98
kevans@FreeBSD.org7c824012018-02-14 17:02:15 -060099static int rtl8211e_probe(struct phy_device *phydev)
100{
101#ifdef CONFIG_RTL8211E_PINE64_GIGABIT_FIX
102 phydev->flags |= PHY_RTL8211E_PINE64_GIGABIT_FIX;
103#endif
104
105 return 0;
106}
107
Carlo Caionecf93d022019-01-24 08:54:37 +0000108static int rtl8211f_probe(struct phy_device *phydev)
109{
110#ifdef CONFIG_RTL8211F_PHY_FORCE_EEE_RXC_ON
111 phydev->flags |= PHY_RTL8211F_FORCE_EEE_RXC_ON;
112#endif
113
114 return 0;
115}
116
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530117/* RealTek RTL8211x */
118static int rtl8211x_config(struct phy_device *phydev)
Andy Fleming60ca78b2011-04-07 21:56:05 -0500119{
120 phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
121
Codrin Ciubotariude947a12015-02-13 14:47:58 +0200122 /* mask interrupt at init; if the interrupt is
123 * needed indeed, it should be explicitly enabled
124 */
125 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_INER,
126 MIIM_RTL8211x_PHY_INTR_DIS);
oliver@schinagl.nl6a250902016-11-08 17:38:59 +0100127
128 if (phydev->flags & PHY_RTL8211x_FORCE_MASTER) {
129 unsigned int reg;
130
131 reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_CTRL1000);
132 /* force manual master/slave configuration */
133 reg |= MIIM_RTL8211x_CTRL1000T_MSCE;
134 /* force master mode */
135 reg |= MIIM_RTL8211x_CTRL1000T_MASTER;
136 phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000, reg);
137 }
kevans@FreeBSD.org7c824012018-02-14 17:02:15 -0600138 if (phydev->flags & PHY_RTL8211E_PINE64_GIGABIT_FIX) {
139 unsigned int reg;
140
141 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT,
142 7);
143 phy_write(phydev, MDIO_DEVAD_NONE,
144 MIIM_RTL8211E_EXT_PAGE_SELECT, 0xa4);
145 reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211E_CONFREG);
146 /* Ensure both internal delays are turned off */
147 reg &= ~(MIIM_RTL8211E_CONFREG_TXD | MIIM_RTL8211E_CONFREG_RXD);
148 /* Flip the magic undocumented bits */
149 reg |= MIIM_RTL8211E_CONFREG_MAGIC;
150 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211E_CONFREG, reg);
151 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT,
152 0);
153 }
Codrin Ciubotariude947a12015-02-13 14:47:58 +0200154 /* read interrupt status just to clear it */
155 phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_INER);
156
Andy Fleming60ca78b2011-04-07 21:56:05 -0500157 genphy_config_aneg(phydev);
158
159 return 0;
160}
161
Shengzhou Liu67500892015-04-24 16:57:17 +0800162static int rtl8211f_config(struct phy_device *phydev)
163{
164 u16 reg;
165
Carlo Caionecf93d022019-01-24 08:54:37 +0000166 if (phydev->flags & PHY_RTL8211F_FORCE_EEE_RXC_ON) {
167 unsigned int reg;
168
169 reg = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL1);
170 reg &= ~MDIO_PCS_CTRL1_CLKSTOP_EN;
171 phy_write_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL1, reg);
172 }
173
Shengzhou Liu67500892015-04-24 16:57:17 +0800174 phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
175
Madalin Bucur83ba7aa2017-08-18 11:35:24 +0300176 phy_write(phydev, MDIO_DEVAD_NONE,
177 MIIM_RTL8211F_PAGE_SELECT, 0xd08);
178 reg = phy_read(phydev, MDIO_DEVAD_NONE, 0x11);
179
180 /* enable TX-delay for rgmii-id and rgmii-txid, otherwise disable it */
181 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
182 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
Shengzhou Liu67500892015-04-24 16:57:17 +0800183 reg |= MIIM_RTL8211F_TX_DELAY;
Madalin Bucur83ba7aa2017-08-18 11:35:24 +0300184 else
185 reg &= ~MIIM_RTL8211F_TX_DELAY;
186
187 phy_write(phydev, MDIO_DEVAD_NONE, 0x11, reg);
Fugang Duan030ccaa2020-05-03 22:41:16 +0800188
189 /* enable RX-delay for rgmii-id and rgmii-rxid, otherwise disable it */
190 reg = phy_read(phydev, MDIO_DEVAD_NONE, 0x15);
191 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
192 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
193 reg |= MIIM_RTL8211F_RX_DELAY;
194 else
195 reg &= ~MIIM_RTL8211F_RX_DELAY;
196 phy_write(phydev, MDIO_DEVAD_NONE, 0x15, reg);
197
Madalin Bucur83ba7aa2017-08-18 11:35:24 +0300198 /* restore to default page 0 */
199 phy_write(phydev, MDIO_DEVAD_NONE,
200 MIIM_RTL8211F_PAGE_SELECT, 0x0);
Shengzhou Liu67500892015-04-24 16:57:17 +0800201
Shengzhou Liu5487fc62015-05-21 18:07:35 +0800202 /* Set green LED for Link, yellow LED for Active */
203 phy_write(phydev, MDIO_DEVAD_NONE,
204 MIIM_RTL8211F_PAGE_SELECT, 0xd04);
205 phy_write(phydev, MDIO_DEVAD_NONE, 0x10, 0x617f);
206 phy_write(phydev, MDIO_DEVAD_NONE,
207 MIIM_RTL8211F_PAGE_SELECT, 0x0);
208
Shengzhou Liu67500892015-04-24 16:57:17 +0800209 genphy_config_aneg(phydev);
210
211 return 0;
212}
213
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530214static int rtl8211x_parse_status(struct phy_device *phydev)
Andy Fleming60ca78b2011-04-07 21:56:05 -0500215{
216 unsigned int speed;
217 unsigned int mii_reg;
218
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530219 mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_STATUS);
Andy Fleming60ca78b2011-04-07 21:56:05 -0500220
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530221 if (!(mii_reg & MIIM_RTL8211x_PHYSTAT_SPDDONE)) {
Andy Fleming60ca78b2011-04-07 21:56:05 -0500222 int i = 0;
223
224 /* in case of timeout ->link is cleared */
225 phydev->link = 1;
226 puts("Waiting for PHY realtime link");
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530227 while (!(mii_reg & MIIM_RTL8211x_PHYSTAT_SPDDONE)) {
Andy Fleming60ca78b2011-04-07 21:56:05 -0500228 /* Timeout reached ? */
229 if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
230 puts(" TIMEOUT !\n");
231 phydev->link = 0;
232 break;
233 }
234
235 if ((i++ % 1000) == 0)
236 putc('.');
237 udelay(1000); /* 1 ms */
238 mii_reg = phy_read(phydev, MDIO_DEVAD_NONE,
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530239 MIIM_RTL8211x_PHY_STATUS);
Andy Fleming60ca78b2011-04-07 21:56:05 -0500240 }
241 puts(" done\n");
242 udelay(500000); /* another 500 ms (results in faster booting) */
243 } else {
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530244 if (mii_reg & MIIM_RTL8211x_PHYSTAT_LINK)
Andy Fleming60ca78b2011-04-07 21:56:05 -0500245 phydev->link = 1;
246 else
247 phydev->link = 0;
248 }
249
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530250 if (mii_reg & MIIM_RTL8211x_PHYSTAT_DUPLEX)
Andy Fleming60ca78b2011-04-07 21:56:05 -0500251 phydev->duplex = DUPLEX_FULL;
252 else
253 phydev->duplex = DUPLEX_HALF;
254
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530255 speed = (mii_reg & MIIM_RTL8211x_PHYSTAT_SPEED);
Andy Fleming60ca78b2011-04-07 21:56:05 -0500256
257 switch (speed) {
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530258 case MIIM_RTL8211x_PHYSTAT_GBIT:
Andy Fleming60ca78b2011-04-07 21:56:05 -0500259 phydev->speed = SPEED_1000;
260 break;
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530261 case MIIM_RTL8211x_PHYSTAT_100:
Andy Fleming60ca78b2011-04-07 21:56:05 -0500262 phydev->speed = SPEED_100;
263 break;
264 default:
265 phydev->speed = SPEED_10;
266 }
267
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800268 return 0;
269}
270
271static int rtl8211f_parse_status(struct phy_device *phydev)
272{
273 unsigned int speed;
274 unsigned int mii_reg;
275 int i = 0;
276
277 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, 0xa43);
278 mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PHY_STATUS);
279
280 phydev->link = 1;
281 while (!(mii_reg & MIIM_RTL8211F_PHYSTAT_LINK)) {
282 if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
283 puts(" TIMEOUT !\n");
284 phydev->link = 0;
285 break;
286 }
287
288 if ((i++ % 1000) == 0)
289 putc('.');
290 udelay(1000);
291 mii_reg = phy_read(phydev, MDIO_DEVAD_NONE,
292 MIIM_RTL8211F_PHY_STATUS);
293 }
294
295 if (mii_reg & MIIM_RTL8211F_PHYSTAT_DUPLEX)
296 phydev->duplex = DUPLEX_FULL;
297 else
298 phydev->duplex = DUPLEX_HALF;
299
300 speed = (mii_reg & MIIM_RTL8211F_PHYSTAT_SPEED);
301
302 switch (speed) {
303 case MIIM_RTL8211F_PHYSTAT_GBIT:
304 phydev->speed = SPEED_1000;
305 break;
306 case MIIM_RTL8211F_PHYSTAT_100:
307 phydev->speed = SPEED_100;
308 break;
309 default:
310 phydev->speed = SPEED_10;
311 }
312
Andy Fleming60ca78b2011-04-07 21:56:05 -0500313 return 0;
314}
315
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530316static int rtl8211x_startup(struct phy_device *phydev)
Andy Fleming60ca78b2011-04-07 21:56:05 -0500317{
Michal Simek5ff89662016-05-18 12:46:12 +0200318 int ret;
319
Andy Fleming60ca78b2011-04-07 21:56:05 -0500320 /* Read the Status (2x to make sure link is right) */
Michal Simek5ff89662016-05-18 12:46:12 +0200321 ret = genphy_update_link(phydev);
322 if (ret)
323 return ret;
Andy Fleming60ca78b2011-04-07 21:56:05 -0500324
Michal Simek5ff89662016-05-18 12:46:12 +0200325 return rtl8211x_parse_status(phydev);
Andy Fleming60ca78b2011-04-07 21:56:05 -0500326}
327
Michal Simekbdf0b722016-02-13 10:31:32 +0100328static int rtl8211e_startup(struct phy_device *phydev)
329{
Michal Simek5ff89662016-05-18 12:46:12 +0200330 int ret;
331
332 ret = genphy_update_link(phydev);
333 if (ret)
334 return ret;
Michal Simekbdf0b722016-02-13 10:31:32 +0100335
Michal Simek5ff89662016-05-18 12:46:12 +0200336 return genphy_parse_link(phydev);
Michal Simekbdf0b722016-02-13 10:31:32 +0100337}
338
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800339static int rtl8211f_startup(struct phy_device *phydev)
340{
Michal Simek5ff89662016-05-18 12:46:12 +0200341 int ret;
342
343 /* Read the Status (2x to make sure link is right) */
344 ret = genphy_update_link(phydev);
345 if (ret)
346 return ret;
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800347 /* Read the Status (2x to make sure link is right) */
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800348
Michal Simek5ff89662016-05-18 12:46:12 +0200349 return rtl8211f_parse_status(phydev);
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800350}
351
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530352/* Support for RTL8211B PHY */
Andy Fleming60ca78b2011-04-07 21:56:05 -0500353static struct phy_driver RTL8211B_driver = {
354 .name = "RealTek RTL8211B",
Karsten Merker10800de2016-03-21 20:29:07 +0100355 .uid = 0x1cc912,
Bhupesh Sharmaad4cd952013-09-01 04:40:52 +0530356 .mask = 0xffffff,
Andy Fleming60ca78b2011-04-07 21:56:05 -0500357 .features = PHY_GBIT_FEATURES,
oliver@schinagl.nl6a250902016-11-08 17:38:59 +0100358 .probe = &rtl8211b_probe,
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530359 .config = &rtl8211x_config,
360 .startup = &rtl8211x_startup,
Andy Fleming60ca78b2011-04-07 21:56:05 -0500361 .shutdown = &genphy_shutdown,
362};
363
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530364/* Support for RTL8211E-VB-CG, RTL8211E-VL-CG and RTL8211EG-VB-CG PHYs */
365static struct phy_driver RTL8211E_driver = {
366 .name = "RealTek RTL8211E",
367 .uid = 0x1cc915,
Bhupesh Sharmaad4cd952013-09-01 04:40:52 +0530368 .mask = 0xffffff,
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530369 .features = PHY_GBIT_FEATURES,
kevans@FreeBSD.org7c824012018-02-14 17:02:15 -0600370 .probe = &rtl8211e_probe,
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530371 .config = &rtl8211x_config,
Michal Simekbdf0b722016-02-13 10:31:32 +0100372 .startup = &rtl8211e_startup,
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530373 .shutdown = &genphy_shutdown,
374};
375
376/* Support for RTL8211DN PHY */
377static struct phy_driver RTL8211DN_driver = {
378 .name = "RealTek RTL8211DN",
379 .uid = 0x1cc914,
Bhupesh Sharmaad4cd952013-09-01 04:40:52 +0530380 .mask = 0xffffff,
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530381 .features = PHY_GBIT_FEATURES,
382 .config = &rtl8211x_config,
383 .startup = &rtl8211x_startup,
384 .shutdown = &genphy_shutdown,
385};
386
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800387/* Support for RTL8211F PHY */
388static struct phy_driver RTL8211F_driver = {
389 .name = "RealTek RTL8211F",
390 .uid = 0x1cc916,
391 .mask = 0xffffff,
392 .features = PHY_GBIT_FEATURES,
Carlo Caionecf93d022019-01-24 08:54:37 +0000393 .probe = &rtl8211f_probe,
Shengzhou Liu67500892015-04-24 16:57:17 +0800394 .config = &rtl8211f_config,
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800395 .startup = &rtl8211f_startup,
396 .shutdown = &genphy_shutdown,
Carlo Caioneb8d167e2019-01-16 11:34:50 +0000397 .readext = &rtl8211f_phy_extread,
398 .writeext = &rtl8211f_phy_extwrite,
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800399};
400
Andy Fleming60ca78b2011-04-07 21:56:05 -0500401int phy_realtek_init(void)
402{
403 phy_register(&RTL8211B_driver);
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530404 phy_register(&RTL8211E_driver);
Shengzhou Liu210f17f2015-03-12 18:54:59 +0800405 phy_register(&RTL8211F_driver);
Bhupesh Sharma85eb7802013-07-18 13:58:20 +0530406 phy_register(&RTL8211DN_driver);
Andy Fleming60ca78b2011-04-07 21:56:05 -0500407
408 return 0;
409}