From fcd736bf35fd93b563e9bbf594f2aa7b62028cc9 Mon Sep 17 00:00:00 2001
From: lin <lin@kickpi.com>
Date: Thu, 14 Aug 2025 02:17:25 +0000
Subject: [PATCH] feat(eth0): add MAE0621A phy support

---
 longan/kernel/linux-4.9/drivers/net/phy/phy_device.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/longan/kernel/linux-4.9/drivers/net/phy/phy_device.c b/longan/kernel/linux-4.9/drivers/net/phy/phy_device.c
index 5048a6d..fd821fe 100644
--- a/longan/kernel/linux-4.9/drivers/net/phy/phy_device.c
+++ b/longan/kernel/linux-4.9/drivers/net/phy/phy_device.c
@@ -487,6 +487,15 @@
 	if (is_c45)
 		return get_phy_c45_ids(bus, addr, phy_id, c45_ids);
 
+#ifdef CONFIG_MAXIO_PHY
+        /*
+         *An MDIO connects to multiple PHYs requiring write before read.
+         *This operation does not affect one MDIO connected to a single PHY
+         *MII_PHYSID2 is a read-only register and writine to it has no effect
+         */
+        mdiobus_write(bus,addr,MII_PHYSID2,0);
+#endif
+
 	/* Grab the bits from PHYIR1, and put them in the upper half */
 	phy_reg = mdiobus_read(bus, addr, MII_PHYSID1);
 	if (phy_reg < 0)

--
Gitblit v1.6.2