aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/phy/broadcom.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 3262a2474b07..f81e53222230 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -19,6 +19,11 @@
19 19
20#define PHY_ID_BCM50610 0x0143bd60 20#define PHY_ID_BCM50610 0x0143bd60
21#define PHY_ID_BCM50610M 0x0143bd70 21#define PHY_ID_BCM50610M 0x0143bd70
22#define PHY_ID_BCM57780 0x03625d90
23
24#define BRCM_PHY_MODEL(phydev) \
25 ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
26
22 27
23#define MII_BCM54XX_ECR 0x10 /* BCM54xx extended control register */ 28#define MII_BCM54XX_ECR 0x10 /* BCM54xx extended control register */
24#define MII_BCM54XX_ECR_IM 0x1000 /* Interrupt mask */ 29#define MII_BCM54XX_ECR_IM 0x1000 /* Interrupt mask */
@@ -118,6 +123,7 @@
118#define MII_BCM54XX_EXP_EXP08_EARLY_DAC_WAKE 0x0200 123#define MII_BCM54XX_EXP_EXP08_EARLY_DAC_WAKE 0x0200
119#define MII_BCM54XX_EXP_EXP75 0x0f75 124#define MII_BCM54XX_EXP_EXP75 0x0f75
120#define MII_BCM54XX_EXP_EXP75_VDACCTRL 0x003c 125#define MII_BCM54XX_EXP_EXP75_VDACCTRL 0x003c
126#define MII_BCM54XX_EXP_EXP75_CM_OSC 0x0001
121#define MII_BCM54XX_EXP_EXP96 0x0f96 127#define MII_BCM54XX_EXP_EXP96 0x0f96
122#define MII_BCM54XX_EXP_EXP96_MYST 0x0010 128#define MII_BCM54XX_EXP_EXP96_MYST 0x0010
123#define MII_BCM54XX_EXP_EXP97 0x0f97 129#define MII_BCM54XX_EXP_EXP97 0x0f97
@@ -194,7 +200,7 @@ static int bcm54xx_shadow_write(struct phy_device *phydev, u16 shadow, u16 val)
194} 200}
195 201
196/* Indirect register access functions for the Expansion Registers */ 202/* Indirect register access functions for the Expansion Registers */
197static int bcm54xx_exp_read(struct phy_device *phydev, u8 regnum) 203static int bcm54xx_exp_read(struct phy_device *phydev, u16 regnum)
198{ 204{
199 int val; 205 int val;
200 206
@@ -308,6 +314,33 @@ static int bcm54xx_config_init(struct phy_device *phydev)
308 return err; 314 return err;
309 } 315 }
310 316
317 if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
318 int err2;
319
320 err = bcm54xx_auxctl_write(phydev,
321 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
322 MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA |
323 MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
324 if (err < 0)
325 return err;
326
327 reg = bcm54xx_exp_read(phydev, MII_BCM54XX_EXP_EXP75);
328 if (reg < 0)
329 goto error;
330
331 reg |= MII_BCM54XX_EXP_EXP75_CM_OSC;
332 err = bcm54xx_exp_write(phydev, MII_BCM54XX_EXP_EXP75, reg);
333
334error:
335 err2 = bcm54xx_auxctl_write(phydev,
336 MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
337 MII_BCM54XX_AUXCTL_ACTL_TX_6DB);
338 if (err)
339 return err;
340 if (err2)
341 return err2;
342 }
343
311 return 0; 344 return 0;
312} 345}
313 346
@@ -694,7 +727,7 @@ static struct phy_driver bcm50610m_driver = {
694}; 727};
695 728
696static struct phy_driver bcm57780_driver = { 729static struct phy_driver bcm57780_driver = {
697 .phy_id = 0x03625d90, 730 .phy_id = PHY_ID_BCM57780,
698 .phy_id_mask = 0xfffffff0, 731 .phy_id_mask = 0xfffffff0,
699 .name = "Broadcom BCM57780", 732 .name = "Broadcom BCM57780",
700 .features = PHY_GBIT_FEATURES | 733 .features = PHY_GBIT_FEATURES |