From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Date: Mon, 7 Nov 2022 21:05:18 +0100
Subject: net: phy: motorcomm: Disable rgmii rx delay

Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
---
 drivers/net/phy/motorcomm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
index c7593f224177..35a4f2a76996 100644
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -160,6 +160,7 @@
 
 #define YT8521_CHIP_CONFIG_REG			0xA001
 #define YT8521_CCR_SW_RST			BIT(15)
+#define YT8521_CCR_RXC_DLY_EN			BIT(8)
 
 #define YT8521_CCR_MODE_SEL_MASK		(BIT(2) | BIT(1) | BIT(0))
 #define YT8521_CCR_MODE_UTP_TO_RGMII		0
@@ -1150,6 +1151,12 @@ static int yt8521_config_init(struct phy_device *phydev)
 				       val);
 		if (ret < 0)
 			goto err_restore_page;
+
+		/* disable rx delay */
+		ret = ytphy_modify_ext(phydev, YT8521_CHIP_CONFIG_REG,
+				       YT8521_CCR_RXC_DLY_EN, 0);
+		if (ret < 0)
+			goto err_restore_page;
 	}
 
 	/* disable auto sleep */
-- 
Armbian

