Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 1 | /* |
| 2 | * RealTek PHY drivers |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 5 | * |
Codrin Ciubotariu | 3cee138 | 2015-02-13 14:47:58 +0200 | [diff] [blame] | 6 | * Copyright 2010-2011, 2015 Freescale Semiconductor, Inc. |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 7 | * author Andy Fleming |
Karsten Merker | 563d8d9 | 2016-03-21 20:29:07 +0100 | [diff] [blame] | 8 | * Copyright 2016 Karsten Merker <merker@debian.org> |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 9 | */ |
| 10 | #include <config.h> |
| 11 | #include <common.h> |
oliver@schinagl.nl | 020f676 | 2016-11-08 17:38:57 +0100 | [diff] [blame] | 12 | #include <linux/bitops.h> |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 13 | #include <phy.h> |
| 14 | |
oliver@schinagl.nl | cebf3f5 | 2016-11-08 17:38:59 +0100 | [diff] [blame] | 15 | #define PHY_RTL8211x_FORCE_MASTER BIT(1) |
| 16 | |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 17 | #define PHY_AUTONEGOTIATE_TIMEOUT 5000 |
| 18 | |
Michael Haas | 525d187 | 2016-03-25 18:22:50 +0100 | [diff] [blame] | 19 | /* RTL8211x 1000BASE-T Control Register */ |
oliver@schinagl.nl | 020f676 | 2016-11-08 17:38:57 +0100 | [diff] [blame] | 20 | #define MIIM_RTL8211x_CTRL1000T_MSCE BIT(12); |
oliver@schinagl.nl | cbe40e1 | 2016-11-08 17:38:58 +0100 | [diff] [blame] | 21 | #define MIIM_RTL8211x_CTRL1000T_MASTER BIT(11); |
Michael Haas | 525d187 | 2016-03-25 18:22:50 +0100 | [diff] [blame] | 22 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 23 | /* 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 Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 31 | |
Codrin Ciubotariu | 3cee138 | 2015-02-13 14:47:58 +0200 | [diff] [blame] | 32 | /* 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 Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 39 | |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 40 | /* 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 | |
| 50 | #define MIIM_RTL8211F_PAGE_SELECT 0x1f |
Shengzhou Liu | 793ea94 | 2015-04-24 16:57:17 +0800 | [diff] [blame] | 51 | #define MIIM_RTL8211F_TX_DELAY 0x100 |
Shengzhou Liu | 9071274 | 2015-05-21 18:07:35 +0800 | [diff] [blame] | 52 | #define MIIM_RTL8211F_LCR 0x10 |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 53 | |
oliver@schinagl.nl | cebf3f5 | 2016-11-08 17:38:59 +0100 | [diff] [blame] | 54 | static int rtl8211b_probe(struct phy_device *phydev) |
| 55 | { |
| 56 | #ifdef CONFIG_RTL8211X_PHY_FORCE_MASTER |
| 57 | phydev->flags |= PHY_RTL8211x_FORCE_MASTER; |
| 58 | #endif |
| 59 | |
| 60 | return 0; |
| 61 | } |
| 62 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 63 | /* RealTek RTL8211x */ |
| 64 | static int rtl8211x_config(struct phy_device *phydev) |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 65 | { |
| 66 | phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET); |
| 67 | |
Codrin Ciubotariu | 3cee138 | 2015-02-13 14:47:58 +0200 | [diff] [blame] | 68 | /* mask interrupt at init; if the interrupt is |
| 69 | * needed indeed, it should be explicitly enabled |
| 70 | */ |
| 71 | phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_INER, |
| 72 | MIIM_RTL8211x_PHY_INTR_DIS); |
oliver@schinagl.nl | cebf3f5 | 2016-11-08 17:38:59 +0100 | [diff] [blame] | 73 | |
| 74 | if (phydev->flags & PHY_RTL8211x_FORCE_MASTER) { |
| 75 | unsigned int reg; |
| 76 | |
| 77 | reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_CTRL1000); |
| 78 | /* force manual master/slave configuration */ |
| 79 | reg |= MIIM_RTL8211x_CTRL1000T_MSCE; |
| 80 | /* force master mode */ |
| 81 | reg |= MIIM_RTL8211x_CTRL1000T_MASTER; |
| 82 | phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000, reg); |
| 83 | } |
Codrin Ciubotariu | 3cee138 | 2015-02-13 14:47:58 +0200 | [diff] [blame] | 84 | /* read interrupt status just to clear it */ |
| 85 | phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_INER); |
| 86 | |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 87 | genphy_config_aneg(phydev); |
| 88 | |
| 89 | return 0; |
| 90 | } |
| 91 | |
Shengzhou Liu | 793ea94 | 2015-04-24 16:57:17 +0800 | [diff] [blame] | 92 | static int rtl8211f_config(struct phy_device *phydev) |
| 93 | { |
| 94 | u16 reg; |
| 95 | |
| 96 | phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR, BMCR_RESET); |
| 97 | |
Madalin Bucur | 05b29aa | 2017-08-18 11:35:24 +0300 | [diff] [blame] | 98 | phy_write(phydev, MDIO_DEVAD_NONE, |
| 99 | MIIM_RTL8211F_PAGE_SELECT, 0xd08); |
| 100 | reg = phy_read(phydev, MDIO_DEVAD_NONE, 0x11); |
| 101 | |
| 102 | /* enable TX-delay for rgmii-id and rgmii-txid, otherwise disable it */ |
| 103 | if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || |
| 104 | phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) |
Shengzhou Liu | 793ea94 | 2015-04-24 16:57:17 +0800 | [diff] [blame] | 105 | reg |= MIIM_RTL8211F_TX_DELAY; |
Madalin Bucur | 05b29aa | 2017-08-18 11:35:24 +0300 | [diff] [blame] | 106 | else |
| 107 | reg &= ~MIIM_RTL8211F_TX_DELAY; |
| 108 | |
| 109 | phy_write(phydev, MDIO_DEVAD_NONE, 0x11, reg); |
| 110 | /* restore to default page 0 */ |
| 111 | phy_write(phydev, MDIO_DEVAD_NONE, |
| 112 | MIIM_RTL8211F_PAGE_SELECT, 0x0); |
Shengzhou Liu | 793ea94 | 2015-04-24 16:57:17 +0800 | [diff] [blame] | 113 | |
Shengzhou Liu | 9071274 | 2015-05-21 18:07:35 +0800 | [diff] [blame] | 114 | /* Set green LED for Link, yellow LED for Active */ |
| 115 | phy_write(phydev, MDIO_DEVAD_NONE, |
| 116 | MIIM_RTL8211F_PAGE_SELECT, 0xd04); |
| 117 | phy_write(phydev, MDIO_DEVAD_NONE, 0x10, 0x617f); |
| 118 | phy_write(phydev, MDIO_DEVAD_NONE, |
| 119 | MIIM_RTL8211F_PAGE_SELECT, 0x0); |
| 120 | |
Shengzhou Liu | 793ea94 | 2015-04-24 16:57:17 +0800 | [diff] [blame] | 121 | genphy_config_aneg(phydev); |
| 122 | |
| 123 | return 0; |
| 124 | } |
| 125 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 126 | static int rtl8211x_parse_status(struct phy_device *phydev) |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 127 | { |
| 128 | unsigned int speed; |
| 129 | unsigned int mii_reg; |
| 130 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 131 | mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211x_PHY_STATUS); |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 132 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 133 | if (!(mii_reg & MIIM_RTL8211x_PHYSTAT_SPDDONE)) { |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 134 | int i = 0; |
| 135 | |
| 136 | /* in case of timeout ->link is cleared */ |
| 137 | phydev->link = 1; |
| 138 | puts("Waiting for PHY realtime link"); |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 139 | while (!(mii_reg & MIIM_RTL8211x_PHYSTAT_SPDDONE)) { |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 140 | /* Timeout reached ? */ |
| 141 | if (i > PHY_AUTONEGOTIATE_TIMEOUT) { |
| 142 | puts(" TIMEOUT !\n"); |
| 143 | phydev->link = 0; |
| 144 | break; |
| 145 | } |
| 146 | |
| 147 | if ((i++ % 1000) == 0) |
| 148 | putc('.'); |
| 149 | udelay(1000); /* 1 ms */ |
| 150 | mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 151 | MIIM_RTL8211x_PHY_STATUS); |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 152 | } |
| 153 | puts(" done\n"); |
| 154 | udelay(500000); /* another 500 ms (results in faster booting) */ |
| 155 | } else { |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 156 | if (mii_reg & MIIM_RTL8211x_PHYSTAT_LINK) |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 157 | phydev->link = 1; |
| 158 | else |
| 159 | phydev->link = 0; |
| 160 | } |
| 161 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 162 | if (mii_reg & MIIM_RTL8211x_PHYSTAT_DUPLEX) |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 163 | phydev->duplex = DUPLEX_FULL; |
| 164 | else |
| 165 | phydev->duplex = DUPLEX_HALF; |
| 166 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 167 | speed = (mii_reg & MIIM_RTL8211x_PHYSTAT_SPEED); |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 168 | |
| 169 | switch (speed) { |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 170 | case MIIM_RTL8211x_PHYSTAT_GBIT: |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 171 | phydev->speed = SPEED_1000; |
| 172 | break; |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 173 | case MIIM_RTL8211x_PHYSTAT_100: |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 174 | phydev->speed = SPEED_100; |
| 175 | break; |
| 176 | default: |
| 177 | phydev->speed = SPEED_10; |
| 178 | } |
| 179 | |
| 180 | return 0; |
| 181 | } |
| 182 | |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 183 | static int rtl8211f_parse_status(struct phy_device *phydev) |
| 184 | { |
| 185 | unsigned int speed; |
| 186 | unsigned int mii_reg; |
| 187 | int i = 0; |
| 188 | |
| 189 | phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, 0xa43); |
| 190 | mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PHY_STATUS); |
| 191 | |
| 192 | phydev->link = 1; |
| 193 | while (!(mii_reg & MIIM_RTL8211F_PHYSTAT_LINK)) { |
| 194 | if (i > PHY_AUTONEGOTIATE_TIMEOUT) { |
| 195 | puts(" TIMEOUT !\n"); |
| 196 | phydev->link = 0; |
| 197 | break; |
| 198 | } |
| 199 | |
| 200 | if ((i++ % 1000) == 0) |
| 201 | putc('.'); |
| 202 | udelay(1000); |
| 203 | mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, |
| 204 | MIIM_RTL8211F_PHY_STATUS); |
| 205 | } |
| 206 | |
| 207 | if (mii_reg & MIIM_RTL8211F_PHYSTAT_DUPLEX) |
| 208 | phydev->duplex = DUPLEX_FULL; |
| 209 | else |
| 210 | phydev->duplex = DUPLEX_HALF; |
| 211 | |
| 212 | speed = (mii_reg & MIIM_RTL8211F_PHYSTAT_SPEED); |
| 213 | |
| 214 | switch (speed) { |
| 215 | case MIIM_RTL8211F_PHYSTAT_GBIT: |
| 216 | phydev->speed = SPEED_1000; |
| 217 | break; |
| 218 | case MIIM_RTL8211F_PHYSTAT_100: |
| 219 | phydev->speed = SPEED_100; |
| 220 | break; |
| 221 | default: |
| 222 | phydev->speed = SPEED_10; |
| 223 | } |
| 224 | |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 225 | return 0; |
| 226 | } |
| 227 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 228 | static int rtl8211x_startup(struct phy_device *phydev) |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 229 | { |
Michal Simek | b733c27 | 2016-05-18 12:46:12 +0200 | [diff] [blame] | 230 | int ret; |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 231 | |
Michal Simek | b733c27 | 2016-05-18 12:46:12 +0200 | [diff] [blame] | 232 | /* Read the Status (2x to make sure link is right) */ |
| 233 | ret = genphy_update_link(phydev); |
| 234 | if (ret) |
| 235 | return ret; |
| 236 | |
| 237 | return rtl8211x_parse_status(phydev); |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 238 | } |
| 239 | |
Michal Simek | 6a10bc5 | 2016-02-13 10:31:32 +0100 | [diff] [blame] | 240 | static int rtl8211e_startup(struct phy_device *phydev) |
| 241 | { |
Michal Simek | b733c27 | 2016-05-18 12:46:12 +0200 | [diff] [blame] | 242 | int ret; |
Michal Simek | 6a10bc5 | 2016-02-13 10:31:32 +0100 | [diff] [blame] | 243 | |
Michal Simek | b733c27 | 2016-05-18 12:46:12 +0200 | [diff] [blame] | 244 | ret = genphy_update_link(phydev); |
| 245 | if (ret) |
| 246 | return ret; |
| 247 | |
| 248 | return genphy_parse_link(phydev); |
Michal Simek | 6a10bc5 | 2016-02-13 10:31:32 +0100 | [diff] [blame] | 249 | } |
| 250 | |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 251 | static int rtl8211f_startup(struct phy_device *phydev) |
| 252 | { |
Michal Simek | b733c27 | 2016-05-18 12:46:12 +0200 | [diff] [blame] | 253 | int ret; |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 254 | |
Michal Simek | b733c27 | 2016-05-18 12:46:12 +0200 | [diff] [blame] | 255 | /* Read the Status (2x to make sure link is right) */ |
| 256 | ret = genphy_update_link(phydev); |
| 257 | if (ret) |
| 258 | return ret; |
| 259 | /* Read the Status (2x to make sure link is right) */ |
| 260 | |
| 261 | return rtl8211f_parse_status(phydev); |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 262 | } |
| 263 | |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 264 | /* Support for RTL8211B PHY */ |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 265 | static struct phy_driver RTL8211B_driver = { |
| 266 | .name = "RealTek RTL8211B", |
Karsten Merker | 563d8d9 | 2016-03-21 20:29:07 +0100 | [diff] [blame] | 267 | .uid = 0x1cc912, |
Bhupesh Sharma | 4220504 | 2013-09-01 04:40:52 +0530 | [diff] [blame] | 268 | .mask = 0xffffff, |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 269 | .features = PHY_GBIT_FEATURES, |
oliver@schinagl.nl | cebf3f5 | 2016-11-08 17:38:59 +0100 | [diff] [blame] | 270 | .probe = &rtl8211b_probe, |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 271 | .config = &rtl8211x_config, |
| 272 | .startup = &rtl8211x_startup, |
| 273 | .shutdown = &genphy_shutdown, |
| 274 | }; |
| 275 | |
| 276 | /* Support for RTL8211E-VB-CG, RTL8211E-VL-CG and RTL8211EG-VB-CG PHYs */ |
| 277 | static struct phy_driver RTL8211E_driver = { |
| 278 | .name = "RealTek RTL8211E", |
| 279 | .uid = 0x1cc915, |
Bhupesh Sharma | 4220504 | 2013-09-01 04:40:52 +0530 | [diff] [blame] | 280 | .mask = 0xffffff, |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 281 | .features = PHY_GBIT_FEATURES, |
| 282 | .config = &rtl8211x_config, |
Michal Simek | 6a10bc5 | 2016-02-13 10:31:32 +0100 | [diff] [blame] | 283 | .startup = &rtl8211e_startup, |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 284 | .shutdown = &genphy_shutdown, |
| 285 | }; |
| 286 | |
| 287 | /* Support for RTL8211DN PHY */ |
| 288 | static struct phy_driver RTL8211DN_driver = { |
| 289 | .name = "RealTek RTL8211DN", |
| 290 | .uid = 0x1cc914, |
Bhupesh Sharma | 4220504 | 2013-09-01 04:40:52 +0530 | [diff] [blame] | 291 | .mask = 0xffffff, |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 292 | .features = PHY_GBIT_FEATURES, |
| 293 | .config = &rtl8211x_config, |
| 294 | .startup = &rtl8211x_startup, |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 295 | .shutdown = &genphy_shutdown, |
| 296 | }; |
| 297 | |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 298 | /* Support for RTL8211F PHY */ |
| 299 | static struct phy_driver RTL8211F_driver = { |
| 300 | .name = "RealTek RTL8211F", |
| 301 | .uid = 0x1cc916, |
| 302 | .mask = 0xffffff, |
| 303 | .features = PHY_GBIT_FEATURES, |
Shengzhou Liu | 793ea94 | 2015-04-24 16:57:17 +0800 | [diff] [blame] | 304 | .config = &rtl8211f_config, |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 305 | .startup = &rtl8211f_startup, |
| 306 | .shutdown = &genphy_shutdown, |
| 307 | }; |
| 308 | |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 309 | int phy_realtek_init(void) |
| 310 | { |
| 311 | phy_register(&RTL8211B_driver); |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 312 | phy_register(&RTL8211E_driver); |
Shengzhou Liu | 3d6af74 | 2015-03-12 18:54:59 +0800 | [diff] [blame] | 313 | phy_register(&RTL8211F_driver); |
Bhupesh Sharma | c624d16 | 2013-07-18 13:58:20 +0530 | [diff] [blame] | 314 | phy_register(&RTL8211DN_driver); |
Andy Fleming | 9082eea | 2011-04-07 21:56:05 -0500 | [diff] [blame] | 315 | |
| 316 | return 0; |
| 317 | } |