From d932fa1bced5e03f5e6525a6d472c5b135b82d6a Mon Sep 17 00:00:00 2001
From: Troy Kisky <troy.kisky@boundarydevices.com>
Date: Tue, 17 Jan 2017 17:23:20 -0700
Subject: [PATCH] phy: enable auto-negotiate with software reset

commit a058052c358c3ecf5f394ff37def6a45eb26768c
net: phy: do not read configuration register on reset

broke atheros phy at8035 for the nitrogen6sx board
maybe others too.

This was supposed to be fixed by
commit 903d384d401bdfc517266787549caf4630a7f305
Author: Alison Wang <b18965@freescale.com>
Date:   Fri Feb 19 15:52:28 2016 +0800

    net: phy: atheros: Fix problem with phy_reset() clearing BMCR
___
But still broken on Nitrogen6sx

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 4e610bf054b..04b616ad041 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -795,7 +795,7 @@ int phy_reset(struct phy_device *phydev)
 	}
 #endif
 
-	if (phy_write(phydev, devad, MII_BMCR, BMCR_RESET) < 0) {
+	if (phy_write(phydev, devad, MII_BMCR, BMCR_RESET|BMCR_ANENABLE) < 0) {
 		debug("PHY reset failed\n");
 		return -1;
 	}
-- 
GitLab