aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2012-09-25 06:17:42 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-27 18:28:30 -0400
commitb629820d18fa65cc598390e4b9712fd5f83ee693 (patch)
tree34cc908d5397020523e2573f98e033b684c146e2
parenta3cff128c970da8400875c8893d68ac735e783fb (diff)
net: phy: smsc: Implement PHY config_init for LAN87xx
The LAN8710/LAN8720 chips do have broken the "FlexPWR" smart power-saving capability. Enabling it leads to the PHY not being able to detect Link when cold-started without cable connected. Thus, make sure this is disabled. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Christian Hohnstaedt <chohnstaedt@innominate.com> Cc: David S. Miller <davem@davemloft.net> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Otavio Salvador <otavio@ossystems.com.br> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/smsc.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 6d6192316b30..88e3991464e7 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -56,6 +56,32 @@ static int smsc_phy_config_init(struct phy_device *phydev)
56 return smsc_phy_ack_interrupt (phydev); 56 return smsc_phy_ack_interrupt (phydev);
57} 57}
58 58
59static int lan87xx_config_init(struct phy_device *phydev)
60{
61 /*
62 * Make sure the EDPWRDOWN bit is NOT set. Setting this bit on
63 * LAN8710/LAN8720 PHY causes the PHY to misbehave, likely due
64 * to a bug on the chip.
65 *
66 * When the system is powered on with the network cable being
67 * disconnected all the way until after ifconfig ethX up is
68 * issued for the LAN port with this PHY, connecting the cable
69 * afterwards does not cause LINK change detection, while the
70 * expected behavior is the Link UP being detected.
71 */
72 int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
73 if (rc < 0)
74 return rc;
75
76 rc &= ~MII_LAN83C185_EDPWRDOWN;
77
78 rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, rc);
79 if (rc < 0)
80 return rc;
81
82 return smsc_phy_ack_interrupt(phydev);
83}
84
59static int lan911x_config_init(struct phy_device *phydev) 85static int lan911x_config_init(struct phy_device *phydev)
60{ 86{
61 return smsc_phy_ack_interrupt(phydev); 87 return smsc_phy_ack_interrupt(phydev);
@@ -162,7 +188,7 @@ static struct phy_driver smsc_phy_driver[] = {
162 /* basic functions */ 188 /* basic functions */
163 .config_aneg = genphy_config_aneg, 189 .config_aneg = genphy_config_aneg,
164 .read_status = genphy_read_status, 190 .read_status = genphy_read_status,
165 .config_init = smsc_phy_config_init, 191 .config_init = lan87xx_config_init,
166 192
167 /* IRQ related */ 193 /* IRQ related */
168 .ack_interrupt = smsc_phy_ack_interrupt, 194 .ack_interrupt = smsc_phy_ack_interrupt,