netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Uvarov <muvarov@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com,
	davem@davemloft.net, Max Uvarov <muvarov@gmail.com>
Subject: [PATCH v2 2/4] net: phy: dp83867: increase SGMII autoneg timer duration
Date: Mon, 27 May 2019 09:16:05 +0300	[thread overview]
Message-ID: <20190527061607.30030-3-muvarov@gmail.com> (raw)
In-Reply-To: <20190527061607.30030-1-muvarov@gmail.com>

After reset SGMII Autoneg timer is set to 2us (bits 6 and 5 are 01).
That us not enough to finalize autonegatiation on some devices.
Increase this timer duration to maximum supported 16ms.

Signed-off-by: Max Uvarov <muvarov@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/dp83867.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 75861b8f3b4d..5fafcc091525 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -295,6 +295,16 @@ static int dp83867_config_init(struct phy_device *phydev)
 				    DP83867_10M_SGMII_CFG, val);
 		if (ret)
 			return ret;
+
+		/* After reset SGMII Autoneg timer is set to 2us (bits 6 and 5
+		 * are 01). That us not enough to finalize autoneg on some
+		 * devices. Increase this timer duration to maximum 16ms.
+		 */
+		val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4);
+		val &= ~(BIT(5) | BIT(6));
+		ret = phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4, val);
+		if (ret)
+			return ret;
 	}
 
 	/* Enable Interrupt output INT_OE in CFG3 register */
-- 
2.17.1


  parent reply	other threads:[~2019-05-27  6:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27  6:16 [PATCH v2 0/4] net: phy: dp83867: add some fixes Max Uvarov
2019-05-27  6:16 ` [PATCH v2 1/4] net: phy: dp83867: fix speed 10 in sgmii mode Max Uvarov
2019-05-27  6:39   ` Heiner Kallweit
2019-05-27 19:12   ` Florian Fainelli
2019-05-27  6:16 ` Max Uvarov [this message]
2019-05-27  6:44   ` [PATCH v2 2/4] net: phy: dp83867: increase SGMII autoneg timer duration Heiner Kallweit
2019-05-27 19:16   ` Florian Fainelli
2019-05-27  6:16 ` [PATCH v2 3/4] net: phy: dp83867: do not call config_init twice Max Uvarov
2019-05-27 19:15   ` Florian Fainelli
2019-05-27  6:16 ` [PATCH v2 4/4] net: phy: dp83867: Set up RGMII TX delay Max Uvarov
2019-05-27 19:15   ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190527061607.30030-3-muvarov@gmail.com \
    --to=muvarov@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).