* [PATCH] net: phy: select copper mode when Marvel 88e1111 in SGMII
@ 2015-08-07 9:07 shh.xie
2015-08-10 20:31 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: shh.xie @ 2015-08-07 9:07 UTC (permalink / raw)
To: netdev, davem; +Cc: Madalin Bucur, Shaohui Xie
From: Madalin Bucur <madalin.bucur@freescale.com>
For the Marvel 88e1111 PHY only two SGMII modes are available, both
allowing only SGMII to copper mode (with or without clock). SGMII
to fiber mode is not supported. Make sure the fiber/copper registers
selector bits are cleared for selecting copper mode.
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
drivers/net/phy/marvell.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 3320a17..e6897b6 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -52,6 +52,7 @@
#define MII_M1011_PHY_SCR_MDI_X 0x0020
#define MII_M1011_PHY_SCR_AUTO_CROSS 0x0060
+#define MII_M1145_PHY_EXT_ADDR_PAGE 0x16
#define MII_M1145_PHY_EXT_SR 0x1b
#define MII_M1145_PHY_EXT_CR 0x14
#define MII_M1145_RGMII_RX_DELAY 0x0080
@@ -552,6 +553,16 @@ static int m88e1111_config_init(struct phy_device *phydev)
err = phy_write(phydev, MII_M1111_PHY_EXT_SR, temp);
if (err < 0)
return err;
+
+ /* make sure copper is selected */
+ err = phy_read(phydev, MII_M1145_PHY_EXT_ADDR_PAGE);
+ if (err < 0)
+ return err;
+
+ err = phy_write(phydev, MII_M1145_PHY_EXT_ADDR_PAGE,
+ err & (~0xff));
+ if (err < 0)
+ return err;
}
if (phydev->interface == PHY_INTERFACE_MODE_RTBI) {
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] net: phy: select copper mode when Marvel 88e1111 in SGMII
2015-08-07 9:07 [PATCH] net: phy: select copper mode when Marvel 88e1111 in SGMII shh.xie
@ 2015-08-10 20:31 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-08-10 20:31 UTC (permalink / raw)
To: shh.xie; +Cc: netdev, madalin.bucur, Shaohui.Xie
From: <shh.xie@gmail.com>
Date: Fri, 7 Aug 2015 17:07:50 +0800
> From: Madalin Bucur <madalin.bucur@freescale.com>
>
> For the Marvel 88e1111 PHY only two SGMII modes are available, both
> allowing only SGMII to copper mode (with or without clock). SGMII
> to fiber mode is not supported. Make sure the fiber/copper registers
> selector bits are cleared for selecting copper mode.
>
> Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-10 20:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-07 9:07 [PATCH] net: phy: select copper mode when Marvel 88e1111 in SGMII shh.xie
2015-08-10 20:31 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).