diff mbox

[U-Boot,v2] net: phy: micrel: center FLP burst timing at 16ms

Message ID 1477085493-30388-1-git-send-email-ash.charles@savoirfairelinux.com
State Accepted
Commit f018545
Delegated to: Joe Hershberger
Headers show

Commit Message

Ash Charles Oct. 21, 2016, 9:31 p.m. UTC
Like [1], reset the FLP burst timing for the KSZ9031 to the 16ms
specified by the IEEE802.3 standard from the chip's default of 8ms.

For more details, see the "Auto-Negotiation Timing" section of the
KSZ9031RNX datasheet.

[1] https://patchwork.kernel.org/patch/6558371/

Signed-off-by: Ash Charles <ash.charles@savoirfairelinux.com>
---
 drivers/net/phy/micrel.c | 23 +++++++++++++++++++++++
 include/micrel.h         |  3 +++
 2 files changed, 26 insertions(+)

Comments

Joe Hershberger Nov. 1, 2016, 8:23 p.m. UTC | #1
On Fri, Oct 21, 2016 at 4:31 PM, Ash Charles <ashcharles@gmail.com> wrote:
> Like [1], reset the FLP burst timing for the KSZ9031 to the 16ms
> specified by the IEEE802.3 standard from the chip's default of 8ms.
>
> For more details, see the "Auto-Negotiation Timing" section of the
> KSZ9031RNX datasheet.
>
> [1] https://patchwork.kernel.org/patch/6558371/
>
> Signed-off-by: Ash Charles <ash.charles@savoirfairelinux.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger Nov. 7, 2016, 5:31 p.m. UTC | #2
Hi Ash,

https://patchwork.ozlabs.org/patch/685298/ was applied to u-boot-net.git.

Thanks!
-Joe
diff mbox

Patch

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 6b313a9..28a1401 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -415,11 +415,31 @@  static int ksz9031_of_config(struct phy_device *phydev)
 
 	return 0;
 }
+
+static int ksz9031_center_flp_timing(struct phy_device *phydev)
+{
+	struct phy_driver *drv = phydev->drv;
+	int ret = 0;
+
+	if (!drv || !drv->writeext)
+		return -EOPNOTSUPP;
+
+	ret = drv->writeext(phydev, 0, 0, MII_KSZ9031_FLP_BURST_TX_LO, 0x1A80);
+	if (ret)
+		return ret;
+
+	ret = drv->writeext(phydev, 0, 0, MII_KSZ9031_FLP_BURST_TX_HI, 0x6);
+	return ret;
+}
 #else
 static int ksz9031_of_config(struct phy_device *phydev)
 {
 	return 0;
 }
+static int ksz9031_center_flp_timing(struct phy_device *phydev)
+{
+	return 0;
+}
 #endif
 
 /* Accessors to extended registers*/
@@ -472,6 +492,9 @@  static int ksz9031_config(struct phy_device *phydev)
 	ret = ksz9031_of_config(phydev);
 	if (ret)
 		return ret;
+	ret = ksz9031_center_flp_timing(phydev);
+	if (ret)
+		return ret;
 	return genphy_config(phydev);
 }
 
diff --git a/include/micrel.h b/include/micrel.h
index e6d145d..3e6b531 100644
--- a/include/micrel.h
+++ b/include/micrel.h
@@ -20,6 +20,9 @@ 
 #define MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW	0x6
 #define MII_KSZ9031_EXT_RGMII_CLOCK_SKEW	0x8
 
+#define MII_KSZ9031_FLP_BURST_TX_LO		0x3
+#define MII_KSZ9031_FLP_BURST_TX_HI		0x4
+
 /* Registers */
 #define MMD_ACCESS_CONTROL	0xd
 #define MMD_ACCESS_REG_DATA	0xe