Skip to contentSkip to conversation

net: phy: ti: Enable automatic crossover mode

PATCH New Michal Simek 3 participants 3 messages Jan 14, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: ti: Enable automatic crossover mode

Enable automatic crossover cable detection.

---

 drivers/net/phy/ti.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/ti.c +3 -0
index 541a57f98028..c3912d52f320 100644
@@ -41,6 +41,8 @@
 
 /* PHY CTRL bits */
 #define DP83867_PHYCR_FIFO_DEPTH_SHIFT		14
+#define DP83867_MDI_CROSSOVER		5
+#define DP83867_MDI_CROSSOVER_AUTO	2
 
 /* RGMIIDCTL bits */
 #define DP83867_RGMII_TX_CLK_DELAY_SHIFT	4
@@ -149,6 +151,7 @@ static int dp83867_config(struct phy_device *phydev)
 
 	if (phy_interface_is_rgmii(phydev)) {
 		ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_DP83867_PHYCTRL,
+			(DP83867_MDI_CROSSOVER_AUTO << DP83867_MDI_CROSSOVER) |
 			(FIFO_DEPTH << DP83867_PHYCR_FIFO_DEPTH_SHIFT));
 		if (ret)
 			return ret;
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 net: phy: ti: Enable automatic crossover mode

Quoted 3 lines · Michal Simek

Enable automatic crossover cable detection.

Quoted 29 lines

---

 drivers/net/phy/ti.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/ti.c +3 -0
index 541a57f98028..c3912d52f320 100644
@@ -41,6 +41,8 @@
 
 /* PHY CTRL bits */
 #define DP83867_PHYCR_FIFO_DEPTH_SHIFT		14
+#define DP83867_MDI_CROSSOVER		5
+#define DP83867_MDI_CROSSOVER_AUTO	2
 
 /* RGMIIDCTL bits */
 #define DP83867_RGMII_TX_CLK_DELAY_SHIFT	4
@@ -149,6 +151,7 @@ static int dp83867_config(struct phy_device *phydev)
 
 	if (phy_interface_is_rgmii(phydev)) {
 		ret = phy_write(phydev, MDIO_DEVAD_NONE, MII_DP83867_PHYCTRL,
+			(DP83867_MDI_CROSSOVER_AUTO << DP83867_MDI_CROSSOVER) |
 			(FIFO_DEPTH << DP83867_PHYCR_FIFO_DEPTH_SHIFT));
 		if (ret)
 			return ret;
Signature · 1 line
1.9.1