blob: 30f35cced9d60d03d65cd8eede5c0cf11a112313 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Andy Fleming9082eea2011-04-07 21:56:05 -05002/*
3 * RealTek PHY drivers
4 *
Codrin Ciubotariu3cee1382015-02-13 14:47:58 +02005 * Copyright 2010-2011, 2015 Freescale Semiconductor, Inc.
Andy Fleming9082eea2011-04-07 21:56:05 -05006 * author Andy Fleming
Karsten Merker563d8d92016-03-21 20:29:07 +01007 * Copyright 2016 Karsten Merker <merker@debian.org>
Andy Fleming9082eea2011-04-07 21:56:05 -05008 */
oliver@schinagl.nl020f6762016-11-08 17:38:57 +01009#include <linux/bitops.h>
Andy Fleming9082eea2011-04-07 21:56:05 -050010#include <phy.h>
Simon Glassc05ed002020-05-10 11:40:11 -060011#include <linux/delay.h>
Andy Fleming9082eea2011-04-07 21:56:05 -050012
oliver@schinagl.nlcebf3f52016-11-08 17:38:59 +010013#define PHY_RTL8211x_FORCE_MASTER BIT(1)
Carlo Caioned47cfdb2019-01-24 08:54:37 +000014#define PHY_RTL8211F_FORCE_EEE_RXC_ON BIT(3)
Amit Singh Tomarfa6539a2020-05-09 19:55:11 +053015#define PHY_RTL8201F_S700_RMII_TIMINGS BIT(4)
oliver@schinagl.nlcebf3f52016-11-08 17:38:59 +010016
Andy Fleming9082eea2011-04-07 21:56:05 -050017#define PHY_AUTONEGOTIATE_TIMEOUT 5000
18
Michael Haas525d1872016-03-25 18:22:50 +010019/* RTL8211x 1000BASE-T Control Register */
oliver@schinagl.nl020f6762016-11-08 17:38:57 +010020#define MIIM_RTL8211x_CTRL1000T_MSCE BIT(12);
oliver@schinagl.nlcbe40e12016-11-08 17:38:58 +010021#define MIIM_RTL8211x_CTRL1000T_MASTER BIT(11);
Michael Haas525d1872016-03-25 18:22:50 +010022
Bhupesh Sharmac624d162013-07-18 13:58:20 +053023/* RTL8211x PHY Status Register */
24#define MIIM_RTL8211x_PHY_STATUS 0x11
25#define MIIM_RTL8211x_PHYSTAT_SPEED 0xc000
26#define MIIM_RTL8211x_PHYSTAT_GBIT 0x8000
27#define MIIM_RTL8211x_PHYSTAT_100 0x4000
28#define MIIM_RTL8211x_PHYSTAT_DUPLEX 0x2000
29#define MIIM_RTL8211x_PHYSTAT_SPDDONE 0x0800
30#define MIIM_RTL8211x_PHYSTAT_LINK 0x0400
Andy Fleming9082eea2011-04-07 21:56:05 -050031
Codrin Ciubotariu3cee1382015-02-13 14:47:58 +020032/* RTL8211x PHY Interrupt Enable Register */
33#define MIIM_RTL8211x_PHY_INER 0x12
34#define MIIM_RTL8211x_PHY_INTR_ENA 0x9f01
35#define MIIM_RTL8211x_PHY_INTR_DIS 0x0000
36
37/* RTL8211x PHY Interrupt Status Register */
38#define MIIM_RTL8211x_PHY_INSR 0x13
Andy Fleming9082eea2011-04-07 21:56:05 -050039
Shengzhou Liu3d6af742015-03-12 18:54:59 +080040/* RTL8211F PHY Status Register */
41#define MIIM_RTL8211F_PHY_STATUS 0x1a
42#define MIIM_RTL8211F_AUTONEG_ENABLE 0x1000
43#define MIIM_RTL8211F_PHYSTAT_SPEED 0x0030
44#define MIIM_RTL8211F_PHYSTAT_GBIT 0x0020
45#define MIIM_RTL8211F_PHYSTAT_100 0x0010
46#define MIIM_RTL8211F_PHYSTAT_DUPLEX 0x0008
47#define MIIM_RTL8211F_PHYSTAT_SPDDONE 0x0800
48#define MIIM_RTL8211F_PHYSTAT_LINK 0x0004
49
Samuel Hollandf11513d2021-10-12 21:07:32 -050050#define MIIM_RTL8211E_CONFREG 0x1c
51#define MIIM_RTL8211E_CTRL_DELAY BIT(13)
52#define MIIM_RTL8211E_TX_DELAY BIT(12)
53#define MIIM_RTL8211E_RX_DELAY BIT(11)
kevans@FreeBSD.org66526e72018-02-14 17:02:15 -060054
55#define MIIM_RTL8211E_EXT_PAGE_SELECT 0x1e
56
Shengzhou Liu3d6af742015-03-12 18:54:59 +080057#define MIIM_RTL8211F_PAGE_SELECT 0x1f
Shengzhou Liu793ea942015-04-24 16:57:17 +080058#define MIIM_RTL8211F_TX_DELAY 0x100
Fugang Duane32e4d02020-05-03 22:41:16 +080059#define MIIM_RTL8211F_RX_DELAY 0x8
Shengzhou Liu90712742015-05-21 18:07:35 +080060#define MIIM_RTL8211F_LCR 0x10
Shengzhou Liu3d6af742015-03-12 18:54:59 +080061
Amit Singh Tomarfa6539a2020-05-09 19:55:11 +053062#define RTL8201F_RMSR 0x10
63
64#define RMSR_RX_TIMING_SHIFT BIT(2)
65#define RMSR_RX_TIMING_MASK GENMASK(7, 4)
66#define RMSR_RX_TIMING_VAL 0x4
67#define RMSR_TX_TIMING_SHIFT BIT(3)
68#define RMSR_TX_TIMING_MASK GENMASK(11, 8)
69#define RMSR_TX_TIMING_VAL 0x5
70
Carlo Caionee57c9fd2019-01-16 11:34:50 +000071static int rtl8211f_phy_extread(struct phy_device *phydev, int addr,
72 int devaddr, int regnum)
73{
74 int oldpage = phy_read(phydev, MDIO_DEVAD_NONE,
75 MIIM_RTL8211F_PAGE_SELECT);
76 int val;
77
78 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, devaddr);
79 val = phy_read(phydev, MDIO_DEVAD_NONE, regnum);
80 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, oldpage);
81
82 return val;
83}
84
85static int rtl8211f_phy_extwrite(struct phy_device *phydev, int addr,
86 int devaddr, int regnum, u16 val)
87{
88 int oldpage = phy_read(phydev, MDIO_DEVAD_NONE,
89 MIIM_RTL8211F_PAGE_SELECT);
90
91 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, devaddr);
92 phy_write(phydev, MDIO_DEVAD_NONE, regnum, val);
93 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, oldpage);
94
95 return 0;
96}
97
oliver@schinagl.nlcebf3f52016-11-08 17:38:59 +010098static int rtl8211b_probe(struct phy_device *phydev)
99{
100#ifdef CONFIG_RTL8211X_PHY_FORCE_MASTER
101 phydev->flags |= PHY_RTL8211x_FORCE_MASTER;
102#endif
103
104 return 0;
105}
106
kevans@FreeBSD.org66526e72018-02-14 17:02:15 -0600107static int rtl8211e_probe(struct phy_device *phydev)
108{
kevans@FreeBSD.org66526e72018-02-14 17:02:15 -0600109 return 0;
110}
111
Carlo Caioned47cfdb2019-01-24 08:54:37 +0000112static int rtl8211f_probe(struct phy_device *phydev)
113{
114#ifdef CONFIG_RTL8211F_PHY_FORCE_EEE_RXC_ON
115 phydev->flags |= PHY_RTL8211F_FORCE_EEE_RXC_ON;
116#endif
117
118 return 0;
119}
120
Amit Singh Tomarfa6539a2020-05-09 19:55:11 +0530121static int rtl8210f_probe(struct phy_device *phydev)
122{
123#ifdef CONFIG_RTL8201F_PHY_S700_RMII_TIMINGS
124 phydev->flags |= PHY_RTL8201F_S700_RMII_TIMINGS;
125#endif
126
127 return 0;
128}
129
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530130/* RealTek RTL8211x */
131static int rtl8211x_config(struct phy_device *phydev)
Andy Fleming9082eea2011-04-07 21:56:05 -0500132{
133 phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
134
Codrin Ciubotariu3cee1382015-02-13 14:47:58 +0200135 /* mask interrupt at init; if the interrupt is
136 * needed indeed, it should be explicitly enabled
137 */
138 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_INER,
139 MIIM_RTL8211x_PHY_INTR_DIS);
oliver@schinagl.nlcebf3f52016-11-08 17:38:59 +0100140
141 if (phydev->flags & PHY_RTL8211x_FORCE_MASTER) {
142 unsigned int reg;
143
144 reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_CTRL1000);
145 /* force manual master/slave configuration */
146 reg |= MIIM_RTL8211x_CTRL1000T_MSCE;
147 /* force master mode */
148 reg |= MIIM_RTL8211x_CTRL1000T_MASTER;
149 phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000, reg);
150 }
Codrin Ciubotariu3cee1382015-02-13 14:47:58 +0200151 /* read interrupt status just to clear it */
152 phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_INER);
153
Andy Fleming9082eea2011-04-07 21:56:05 -0500154 genphy_config_aneg(phydev);
155
156 return 0;
157}
158
Amit Singh Tomarb0778d92020-05-09 19:55:10 +0530159/* RealTek RTL8201F */
160static int rtl8201f_config(struct phy_device *phydev)
161{
Amit Singh Tomarfa6539a2020-05-09 19:55:11 +0530162 unsigned int reg;
163
164 if (phydev->flags & PHY_RTL8201F_S700_RMII_TIMINGS) {
165 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT,
166 7);
167 reg = phy_read(phydev, MDIO_DEVAD_NONE, RTL8201F_RMSR);
168 reg &= ~(RMSR_RX_TIMING_MASK | RMSR_TX_TIMING_MASK);
169 /* Set the needed Rx/Tx Timings for proper PHY operation */
170 reg |= (RMSR_RX_TIMING_VAL << RMSR_RX_TIMING_SHIFT)
171 | (RMSR_TX_TIMING_VAL << RMSR_TX_TIMING_SHIFT);
172 phy_write(phydev, MDIO_DEVAD_NONE, RTL8201F_RMSR, reg);
173 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT,
174 0);
175 }
176
Amit Singh Tomarb0778d92020-05-09 19:55:10 +0530177 genphy_config_aneg(phydev);
178
179 return 0;
180}
181
Samuel Hollandf11513d2021-10-12 21:07:32 -0500182static int rtl8211e_config(struct phy_device *phydev)
183{
184 int reg, val;
185
186 /* enable TX/RX delay for rgmii-* modes, and disable them for rgmii. */
187 switch (phydev->interface) {
188 case PHY_INTERFACE_MODE_RGMII:
189 val = MIIM_RTL8211E_CTRL_DELAY;
190 break;
191 case PHY_INTERFACE_MODE_RGMII_ID:
192 val = MIIM_RTL8211E_CTRL_DELAY | MIIM_RTL8211E_TX_DELAY |
193 MIIM_RTL8211E_RX_DELAY;
194 break;
195 case PHY_INTERFACE_MODE_RGMII_RXID:
196 val = MIIM_RTL8211E_CTRL_DELAY | MIIM_RTL8211E_RX_DELAY;
197 break;
198 case PHY_INTERFACE_MODE_RGMII_TXID:
199 val = MIIM_RTL8211E_CTRL_DELAY | MIIM_RTL8211E_TX_DELAY;
200 break;
201 default: /* the rest of the modes imply leaving delays as is. */
202 goto default_delay;
203 }
204
205 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, 7);
206 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211E_EXT_PAGE_SELECT, 0xa4);
207
208 reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211E_CONFREG);
209 reg &= ~(MIIM_RTL8211E_TX_DELAY | MIIM_RTL8211E_RX_DELAY);
210 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211E_CONFREG, reg | val);
211
212 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, 0);
213
214default_delay:
215 genphy_config_aneg(phydev);
216
217 return 0;
218}
219
Shengzhou Liu793ea942015-04-24 16:57:17 +0800220static int rtl8211f_config(struct phy_device *phydev)
221{
222 u16 reg;
223
Carlo Caioned47cfdb2019-01-24 08:54:37 +0000224 if (phydev->flags & PHY_RTL8211F_FORCE_EEE_RXC_ON) {
225 unsigned int reg;
226
227 reg = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL1);
228 reg &= ~MDIO_PCS_CTRL1_CLKSTOP_EN;
229 phy_write_mmd(phydev, MDIO_MMD_PCS, MDIO_CTRL1, reg);
230 }
231
Shengzhou Liu793ea942015-04-24 16:57:17 +0800232 phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET);
233
Madalin Bucur05b29aa2017-08-18 11:35:24 +0300234 phy_write(phydev, MDIO_DEVAD_NONE,
235 MIIM_RTL8211F_PAGE_SELECT, 0xd08);
236 reg = phy_read(phydev, MDIO_DEVAD_NONE, 0x11);
237
238 /* enable TX-delay for rgmii-id and rgmii-txid, otherwise disable it */
239 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
240 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
Shengzhou Liu793ea942015-04-24 16:57:17 +0800241 reg |= MIIM_RTL8211F_TX_DELAY;
Madalin Bucur05b29aa2017-08-18 11:35:24 +0300242 else
243 reg &= ~MIIM_RTL8211F_TX_DELAY;
244
245 phy_write(phydev, MDIO_DEVAD_NONE, 0x11, reg);
Fugang Duane32e4d02020-05-03 22:41:16 +0800246
247 /* enable RX-delay for rgmii-id and rgmii-rxid, otherwise disable it */
248 reg = phy_read(phydev, MDIO_DEVAD_NONE, 0x15);
249 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
250 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
251 reg |= MIIM_RTL8211F_RX_DELAY;
252 else
253 reg &= ~MIIM_RTL8211F_RX_DELAY;
254 phy_write(phydev, MDIO_DEVAD_NONE, 0x15, reg);
255
Madalin Bucur05b29aa2017-08-18 11:35:24 +0300256 /* restore to default page 0 */
257 phy_write(phydev, MDIO_DEVAD_NONE,
258 MIIM_RTL8211F_PAGE_SELECT, 0x0);
Shengzhou Liu793ea942015-04-24 16:57:17 +0800259
Shengzhou Liu90712742015-05-21 18:07:35 +0800260 /* Set green LED for Link, yellow LED for Active */
261 phy_write(phydev, MDIO_DEVAD_NONE,
262 MIIM_RTL8211F_PAGE_SELECT, 0xd04);
263 phy_write(phydev, MDIO_DEVAD_NONE, 0x10, 0x617f);
264 phy_write(phydev, MDIO_DEVAD_NONE,
265 MIIM_RTL8211F_PAGE_SELECT, 0x0);
266
Shengzhou Liu793ea942015-04-24 16:57:17 +0800267 genphy_config_aneg(phydev);
268
269 return 0;
270}
271
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530272static int rtl8211x_parse_status(struct phy_device *phydev)
Andy Fleming9082eea2011-04-07 21:56:05 -0500273{
274 unsigned int speed;
275 unsigned int mii_reg;
276
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530277 mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_STATUS);
Andy Fleming9082eea2011-04-07 21:56:05 -0500278
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530279 if (!(mii_reg & MIIM_RTL8211x_PHYSTAT_SPDDONE)) {
Andy Fleming9082eea2011-04-07 21:56:05 -0500280 int i = 0;
281
282 /* in case of timeout ->link is cleared */
283 phydev->link = 1;
284 puts("Waiting for PHY realtime link");
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530285 while (!(mii_reg & MIIM_RTL8211x_PHYSTAT_SPDDONE)) {
Andy Fleming9082eea2011-04-07 21:56:05 -0500286 /* Timeout reached ? */
287 if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
288 puts(" TIMEOUT !\n");
289 phydev->link = 0;
290 break;
291 }
292
293 if ((i++ % 1000) == 0)
294 putc('.');
295 udelay(1000); /* 1 ms */
296 mii_reg = phy_read(phydev, MDIO_DEVAD_NONE,
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530297 MIIM_RTL8211x_PHY_STATUS);
Andy Fleming9082eea2011-04-07 21:56:05 -0500298 }
299 puts(" done\n");
300 udelay(500000); /* another 500 ms (results in faster booting) */
301 } else {
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530302 if (mii_reg & MIIM_RTL8211x_PHYSTAT_LINK)
Andy Fleming9082eea2011-04-07 21:56:05 -0500303 phydev->link = 1;
304 else
305 phydev->link = 0;
306 }
307
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530308 if (mii_reg & MIIM_RTL8211x_PHYSTAT_DUPLEX)
Andy Fleming9082eea2011-04-07 21:56:05 -0500309 phydev->duplex = DUPLEX_FULL;
310 else
311 phydev->duplex = DUPLEX_HALF;
312
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530313 speed = (mii_reg & MIIM_RTL8211x_PHYSTAT_SPEED);
Andy Fleming9082eea2011-04-07 21:56:05 -0500314
315 switch (speed) {
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530316 case MIIM_RTL8211x_PHYSTAT_GBIT:
Andy Fleming9082eea2011-04-07 21:56:05 -0500317 phydev->speed = SPEED_1000;
318 break;
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530319 case MIIM_RTL8211x_PHYSTAT_100:
Andy Fleming9082eea2011-04-07 21:56:05 -0500320 phydev->speed = SPEED_100;
321 break;
322 default:
323 phydev->speed = SPEED_10;
324 }
325
326 return 0;
327}
328
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800329static int rtl8211f_parse_status(struct phy_device *phydev)
330{
331 unsigned int speed;
332 unsigned int mii_reg;
333 int i = 0;
334
335 phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, 0xa43);
336 mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PHY_STATUS);
337
338 phydev->link = 1;
339 while (!(mii_reg & MIIM_RTL8211F_PHYSTAT_LINK)) {
340 if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
341 puts(" TIMEOUT !\n");
342 phydev->link = 0;
343 break;
344 }
345
346 if ((i++ % 1000) == 0)
347 putc('.');
348 udelay(1000);
349 mii_reg = phy_read(phydev, MDIO_DEVAD_NONE,
350 MIIM_RTL8211F_PHY_STATUS);
351 }
352
353 if (mii_reg & MIIM_RTL8211F_PHYSTAT_DUPLEX)
354 phydev->duplex = DUPLEX_FULL;
355 else
356 phydev->duplex = DUPLEX_HALF;
357
358 speed = (mii_reg & MIIM_RTL8211F_PHYSTAT_SPEED);
359
360 switch (speed) {
361 case MIIM_RTL8211F_PHYSTAT_GBIT:
362 phydev->speed = SPEED_1000;
363 break;
364 case MIIM_RTL8211F_PHYSTAT_100:
365 phydev->speed = SPEED_100;
366 break;
367 default:
368 phydev->speed = SPEED_10;
369 }
370
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800371 return 0;
372}
373
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530374static int rtl8211x_startup(struct phy_device *phydev)
Andy Fleming9082eea2011-04-07 21:56:05 -0500375{
Michal Simekb733c272016-05-18 12:46:12 +0200376 int ret;
Andy Fleming9082eea2011-04-07 21:56:05 -0500377
Michal Simekb733c272016-05-18 12:46:12 +0200378 /* Read the Status (2x to make sure link is right) */
379 ret = genphy_update_link(phydev);
380 if (ret)
381 return ret;
382
383 return rtl8211x_parse_status(phydev);
Andy Fleming9082eea2011-04-07 21:56:05 -0500384}
385
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800386static int rtl8211f_startup(struct phy_device *phydev)
387{
Michal Simekb733c272016-05-18 12:46:12 +0200388 int ret;
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800389
Michal Simekb733c272016-05-18 12:46:12 +0200390 /* Read the Status (2x to make sure link is right) */
391 ret = genphy_update_link(phydev);
392 if (ret)
393 return ret;
394 /* Read the Status (2x to make sure link is right) */
395
396 return rtl8211f_parse_status(phydev);
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800397}
398
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530399/* Support for RTL8211B PHY */
Marek Vasutf2e0be32023-03-19 18:03:01 +0100400U_BOOT_PHY_DRIVER(rtl8211b) = {
Andy Fleming9082eea2011-04-07 21:56:05 -0500401 .name = "RealTek RTL8211B",
Karsten Merker563d8d92016-03-21 20:29:07 +0100402 .uid = 0x1cc912,
Bhupesh Sharma42205042013-09-01 04:40:52 +0530403 .mask = 0xffffff,
Andy Fleming9082eea2011-04-07 21:56:05 -0500404 .features = PHY_GBIT_FEATURES,
oliver@schinagl.nlcebf3f52016-11-08 17:38:59 +0100405 .probe = &rtl8211b_probe,
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530406 .config = &rtl8211x_config,
407 .startup = &rtl8211x_startup,
408 .shutdown = &genphy_shutdown,
409};
410
411/* Support for RTL8211E-VB-CG, RTL8211E-VL-CG and RTL8211EG-VB-CG PHYs */
Marek Vasutf2e0be32023-03-19 18:03:01 +0100412U_BOOT_PHY_DRIVER(rtl8211e) = {
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530413 .name = "RealTek RTL8211E",
414 .uid = 0x1cc915,
Bhupesh Sharma42205042013-09-01 04:40:52 +0530415 .mask = 0xffffff,
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530416 .features = PHY_GBIT_FEATURES,
kevans@FreeBSD.org66526e72018-02-14 17:02:15 -0600417 .probe = &rtl8211e_probe,
Samuel Hollandf11513d2021-10-12 21:07:32 -0500418 .config = &rtl8211e_config,
Rasmus Villemoes0b99afe2023-03-28 23:21:08 +0200419 .startup = &genphy_startup,
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530420 .shutdown = &genphy_shutdown,
421};
422
423/* Support for RTL8211DN PHY */
Marek Vasutf2e0be32023-03-19 18:03:01 +0100424U_BOOT_PHY_DRIVER(rtl8211dn) = {
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530425 .name = "RealTek RTL8211DN",
426 .uid = 0x1cc914,
Bhupesh Sharma42205042013-09-01 04:40:52 +0530427 .mask = 0xffffff,
Bhupesh Sharmac624d162013-07-18 13:58:20 +0530428 .features = PHY_GBIT_FEATURES,
429 .config = &rtl8211x_config,
430 .startup = &rtl8211x_startup,
Andy Fleming9082eea2011-04-07 21:56:05 -0500431 .shutdown = &genphy_shutdown,
432};
433
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800434/* Support for RTL8211F PHY */
Marek Vasutf2e0be32023-03-19 18:03:01 +0100435U_BOOT_PHY_DRIVER(rtl8211f) = {
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800436 .name = "RealTek RTL8211F",
437 .uid = 0x1cc916,
438 .mask = 0xffffff,
439 .features = PHY_GBIT_FEATURES,
Carlo Caioned47cfdb2019-01-24 08:54:37 +0000440 .probe = &rtl8211f_probe,
Shengzhou Liu793ea942015-04-24 16:57:17 +0800441 .config = &rtl8211f_config,
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800442 .startup = &rtl8211f_startup,
443 .shutdown = &genphy_shutdown,
Carlo Caionee57c9fd2019-01-16 11:34:50 +0000444 .readext = &rtl8211f_phy_extread,
445 .writeext = &rtl8211f_phy_extwrite,
Shengzhou Liu3d6af742015-03-12 18:54:59 +0800446};
447
Sébastien Szymanskif93571692023-10-17 11:45:00 +0200448/* Support for RTL8211F-VD PHY */
449U_BOOT_PHY_DRIVER(rtl8211fvd) = {
450 .name = "RealTek RTL8211F-VD",
451 .uid = 0x1cc878,
452 .mask = 0xffffff,
453 .features = PHY_GBIT_FEATURES,
454 .probe = &rtl8211f_probe,
455 .config = &rtl8211f_config,
456 .startup = &rtl8211f_startup,
457 .shutdown = &genphy_shutdown,
458 .readext = &rtl8211f_phy_extread,
459 .writeext = &rtl8211f_phy_extwrite,
460};
461
Amit Singh Tomarb0778d92020-05-09 19:55:10 +0530462/* Support for RTL8201F PHY */
Marek Vasutf2e0be32023-03-19 18:03:01 +0100463U_BOOT_PHY_DRIVER(rtl8201f) = {
Amit Singh Tomarb0778d92020-05-09 19:55:10 +0530464 .name = "RealTek RTL8201F 10/100Mbps Ethernet",
465 .uid = 0x1cc816,
466 .mask = 0xffffff,
467 .features = PHY_BASIC_FEATURES,
Amit Singh Tomarfa6539a2020-05-09 19:55:11 +0530468 .probe = &rtl8210f_probe,
Amit Singh Tomarb0778d92020-05-09 19:55:10 +0530469 .config = &rtl8201f_config,
Rasmus Villemoes0b99afe2023-03-28 23:21:08 +0200470 .startup = &genphy_startup,
Amit Singh Tomarb0778d92020-05-09 19:55:10 +0530471 .shutdown = &genphy_shutdown,
472};