diff options
| author | David S. Miller <davem@davemloft.net> | 2014-08-23 14:12:08 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-08-23 14:12:08 -0400 |
| commit | f9474ddfaa009ead12bba44fa8fd49dc4536a124 (patch) | |
| tree | a1738a74ac909d84cc80af674d7c0b78af10a413 /drivers/net/phy | |
| parent | 989e04c5bc3ff77d65e1f0d87bf7904dfa30d41c (diff) | |
| parent | a45e92a599e77ee6a850eabdd0141633fde03915 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pulling to get some TIPC fixes that a net-next series depends
upon.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
| -rw-r--r-- | drivers/net/phy/bcm7xxx.c | 42 | ||||
| -rw-r--r-- | drivers/net/phy/smsc.c | 33 |
2 files changed, 42 insertions, 33 deletions
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c index 526b94cea569..fdce1ea28790 100644 --- a/drivers/net/phy/bcm7xxx.c +++ b/drivers/net/phy/bcm7xxx.c | |||
| @@ -157,6 +157,23 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev) | |||
| 157 | return bcm7xxx_28nm_afe_config_init(phydev); | 157 | return bcm7xxx_28nm_afe_config_init(phydev); |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | static int bcm7xxx_28nm_resume(struct phy_device *phydev) | ||
| 161 | { | ||
| 162 | int ret; | ||
| 163 | |||
| 164 | /* Re-apply workarounds coming out suspend/resume */ | ||
| 165 | ret = bcm7xxx_28nm_config_init(phydev); | ||
| 166 | if (ret) | ||
| 167 | return ret; | ||
| 168 | |||
| 169 | /* 28nm Gigabit PHYs come out of reset without any half-duplex | ||
| 170 | * or "hub" compliant advertised mode, fix that. This does not | ||
| 171 | * cause any problems with the PHY library since genphy_config_aneg() | ||
| 172 | * gracefully handles auto-negotiated and forced modes. | ||
| 173 | */ | ||
| 174 | return genphy_config_aneg(phydev); | ||
| 175 | } | ||
| 176 | |||
| 160 | static int phy_set_clr_bits(struct phy_device *dev, int location, | 177 | static int phy_set_clr_bits(struct phy_device *dev, int location, |
| 161 | int set_mask, int clr_mask) | 178 | int set_mask, int clr_mask) |
| 162 | { | 179 | { |
| @@ -212,7 +229,7 @@ static int bcm7xxx_config_init(struct phy_device *phydev) | |||
| 212 | } | 229 | } |
| 213 | 230 | ||
| 214 | /* Workaround for putting the PHY in IDDQ mode, required | 231 | /* Workaround for putting the PHY in IDDQ mode, required |
| 215 | * for all BCM7XXX PHYs | 232 | * for all BCM7XXX 40nm and 65nm PHYs |
| 216 | */ | 233 | */ |
| 217 | static int bcm7xxx_suspend(struct phy_device *phydev) | 234 | static int bcm7xxx_suspend(struct phy_device *phydev) |
| 218 | { | 235 | { |
| @@ -257,8 +274,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
| 257 | .config_init = bcm7xxx_28nm_afe_config_init, | 274 | .config_init = bcm7xxx_28nm_afe_config_init, |
| 258 | .config_aneg = genphy_config_aneg, | 275 | .config_aneg = genphy_config_aneg, |
| 259 | .read_status = genphy_read_status, | 276 | .read_status = genphy_read_status, |
| 260 | .suspend = bcm7xxx_suspend, | 277 | .resume = bcm7xxx_28nm_resume, |
| 261 | .resume = bcm7xxx_28nm_afe_config_init, | ||
| 262 | .driver = { .owner = THIS_MODULE }, | 278 | .driver = { .owner = THIS_MODULE }, |
| 263 | }, { | 279 | }, { |
| 264 | .phy_id = PHY_ID_BCM7439, | 280 | .phy_id = PHY_ID_BCM7439, |
| @@ -270,8 +286,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
| 270 | .config_init = bcm7xxx_28nm_afe_config_init, | 286 | .config_init = bcm7xxx_28nm_afe_config_init, |
| 271 | .config_aneg = genphy_config_aneg, | 287 | .config_aneg = genphy_config_aneg, |
| 272 | .read_status = genphy_read_status, | 288 | .read_status = genphy_read_status, |
| 273 | .suspend = bcm7xxx_suspend, | 289 | .resume = bcm7xxx_28nm_resume, |
| 274 | .resume = bcm7xxx_28nm_afe_config_init, | ||
| 275 | .driver = { .owner = THIS_MODULE }, | 290 | .driver = { .owner = THIS_MODULE }, |
| 276 | }, { | 291 | }, { |
| 277 | .phy_id = PHY_ID_BCM7445, | 292 | .phy_id = PHY_ID_BCM7445, |
| @@ -283,21 +298,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
| 283 | .config_init = bcm7xxx_28nm_config_init, | 298 | .config_init = bcm7xxx_28nm_config_init, |
| 284 | .config_aneg = genphy_config_aneg, | 299 | .config_aneg = genphy_config_aneg, |
| 285 | .read_status = genphy_read_status, | 300 | .read_status = genphy_read_status, |
| 286 | .suspend = bcm7xxx_suspend, | 301 | .resume = bcm7xxx_28nm_afe_config_init, |
| 287 | .resume = bcm7xxx_28nm_config_init, | ||
| 288 | .driver = { .owner = THIS_MODULE }, | ||
| 289 | }, { | ||
| 290 | .name = "Broadcom BCM7XXX 28nm", | ||
| 291 | .phy_id = PHY_ID_BCM7XXX_28, | ||
| 292 | .phy_id_mask = PHY_BCM_OUI_MASK, | ||
| 293 | .features = PHY_GBIT_FEATURES | | ||
| 294 | SUPPORTED_Pause | SUPPORTED_Asym_Pause, | ||
| 295 | .flags = PHY_IS_INTERNAL, | ||
| 296 | .config_init = bcm7xxx_28nm_config_init, | ||
| 297 | .config_aneg = genphy_config_aneg, | ||
| 298 | .read_status = genphy_read_status, | ||
| 299 | .suspend = bcm7xxx_suspend, | ||
| 300 | .resume = bcm7xxx_28nm_config_init, | ||
| 301 | .driver = { .owner = THIS_MODULE }, | 302 | .driver = { .owner = THIS_MODULE }, |
| 302 | }, { | 303 | }, { |
| 303 | .phy_id = PHY_BCM_OUI_4, | 304 | .phy_id = PHY_BCM_OUI_4, |
| @@ -331,7 +332,6 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = { | |||
| 331 | { PHY_ID_BCM7366, 0xfffffff0, }, | 332 | { PHY_ID_BCM7366, 0xfffffff0, }, |
| 332 | { PHY_ID_BCM7439, 0xfffffff0, }, | 333 | { PHY_ID_BCM7439, 0xfffffff0, }, |
| 333 | { PHY_ID_BCM7445, 0xfffffff0, }, | 334 | { PHY_ID_BCM7445, 0xfffffff0, }, |
| 334 | { PHY_ID_BCM7XXX_28, 0xfffffc00 }, | ||
| 335 | { PHY_BCM_OUI_4, 0xffff0000 }, | 335 | { PHY_BCM_OUI_4, 0xffff0000 }, |
| 336 | { PHY_BCM_OUI_5, 0xffffff00 }, | 336 | { PHY_BCM_OUI_5, 0xffffff00 }, |
| 337 | { } | 337 | { } |
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index 180c49479c42..a4b08198fb9f 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c | |||
| @@ -43,6 +43,22 @@ static int smsc_phy_ack_interrupt(struct phy_device *phydev) | |||
| 43 | 43 | ||
| 44 | static int smsc_phy_config_init(struct phy_device *phydev) | 44 | static int smsc_phy_config_init(struct phy_device *phydev) |
| 45 | { | 45 | { |
| 46 | int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); | ||
| 47 | |||
| 48 | if (rc < 0) | ||
| 49 | return rc; | ||
| 50 | |||
| 51 | /* Enable energy detect mode for this SMSC Transceivers */ | ||
| 52 | rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, | ||
| 53 | rc | MII_LAN83C185_EDPWRDOWN); | ||
| 54 | if (rc < 0) | ||
| 55 | return rc; | ||
| 56 | |||
| 57 | return smsc_phy_ack_interrupt(phydev); | ||
| 58 | } | ||
| 59 | |||
| 60 | static int smsc_phy_reset(struct phy_device *phydev) | ||
| 61 | { | ||
| 46 | int rc = phy_read(phydev, MII_LAN83C185_SPECIAL_MODES); | 62 | int rc = phy_read(phydev, MII_LAN83C185_SPECIAL_MODES); |
| 47 | if (rc < 0) | 63 | if (rc < 0) |
| 48 | return rc; | 64 | return rc; |
| @@ -66,18 +82,7 @@ static int smsc_phy_config_init(struct phy_device *phydev) | |||
| 66 | rc = phy_read(phydev, MII_BMCR); | 82 | rc = phy_read(phydev, MII_BMCR); |
| 67 | } while (rc & BMCR_RESET); | 83 | } while (rc & BMCR_RESET); |
| 68 | } | 84 | } |
| 69 | 85 | return 0; | |
| 70 | rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); | ||
| 71 | if (rc < 0) | ||
| 72 | return rc; | ||
| 73 | |||
| 74 | /* Enable energy detect mode for this SMSC Transceivers */ | ||
| 75 | rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, | ||
| 76 | rc | MII_LAN83C185_EDPWRDOWN); | ||
| 77 | if (rc < 0) | ||
| 78 | return rc; | ||
| 79 | |||
| 80 | return smsc_phy_ack_interrupt (phydev); | ||
| 81 | } | 86 | } |
| 82 | 87 | ||
| 83 | static int lan911x_config_init(struct phy_device *phydev) | 88 | static int lan911x_config_init(struct phy_device *phydev) |
| @@ -142,6 +147,7 @@ static struct phy_driver smsc_phy_driver[] = { | |||
| 142 | .config_aneg = genphy_config_aneg, | 147 | .config_aneg = genphy_config_aneg, |
| 143 | .read_status = genphy_read_status, | 148 | .read_status = genphy_read_status, |
| 144 | .config_init = smsc_phy_config_init, | 149 | .config_init = smsc_phy_config_init, |
| 150 | .soft_reset = smsc_phy_reset, | ||
| 145 | 151 | ||
| 146 | /* IRQ related */ | 152 | /* IRQ related */ |
| 147 | .ack_interrupt = smsc_phy_ack_interrupt, | 153 | .ack_interrupt = smsc_phy_ack_interrupt, |
| @@ -164,6 +170,7 @@ static struct phy_driver smsc_phy_driver[] = { | |||
| 164 | .config_aneg = genphy_config_aneg, | 170 | .config_aneg = genphy_config_aneg, |
| 165 | .read_status = genphy_read_status, | 171 | .read_status = genphy_read_status, |
| 166 | .config_init = smsc_phy_config_init, | 172 | .config_init = smsc_phy_config_init, |
| 173 | .soft_reset = smsc_phy_reset, | ||
| 167 | 174 | ||
| 168 | /* IRQ related */ | 175 | /* IRQ related */ |
| 169 | .ack_interrupt = smsc_phy_ack_interrupt, | 176 | .ack_interrupt = smsc_phy_ack_interrupt, |
| @@ -186,6 +193,7 @@ static struct phy_driver smsc_phy_driver[] = { | |||
| 186 | .config_aneg = genphy_config_aneg, | 193 | .config_aneg = genphy_config_aneg, |
| 187 | .read_status = genphy_read_status, | 194 | .read_status = genphy_read_status, |
| 188 | .config_init = smsc_phy_config_init, | 195 | .config_init = smsc_phy_config_init, |
| 196 | .soft_reset = smsc_phy_reset, | ||
| 189 | 197 | ||
| 190 | /* IRQ related */ | 198 | /* IRQ related */ |
| 191 | .ack_interrupt = smsc_phy_ack_interrupt, | 199 | .ack_interrupt = smsc_phy_ack_interrupt, |
| @@ -230,6 +238,7 @@ static struct phy_driver smsc_phy_driver[] = { | |||
| 230 | .config_aneg = genphy_config_aneg, | 238 | .config_aneg = genphy_config_aneg, |
| 231 | .read_status = lan87xx_read_status, | 239 | .read_status = lan87xx_read_status, |
| 232 | .config_init = smsc_phy_config_init, | 240 | .config_init = smsc_phy_config_init, |
| 241 | .soft_reset = smsc_phy_reset, | ||
| 233 | 242 | ||
| 234 | /* IRQ related */ | 243 | /* IRQ related */ |
| 235 | .ack_interrupt = smsc_phy_ack_interrupt, | 244 | .ack_interrupt = smsc_phy_ack_interrupt, |
