[PATCH 2/4] net: phy: marvell: Allow targets to skip MII RX/TX errata
Timothy Pearson
tpearson at raptorengineering.com
Sat Mar 22 03:30:04 AEDT 2025
application
Upstream-Status: Pending
Signed-off-by: Timothy Pearson <tpearson at raptorengineering.com>
---
drivers/net/phy/Kconfig | 8 ++++++++
drivers/net/phy/marvell.c | 10 ++++++++++
2 files changed, 18 insertions(+)
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index f6dde8af1ce..c79883e4172 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -112,6 +112,14 @@ config PHY_LXT
config PHY_MARVELL
bool "Marvell Ethernet PHYs support"
+if PHY_MARVELL
+
+config PHY_MARVELL_APPLY_MII_RXTX_ERRATA
+ bool
+ default n
+
+endif # PHY_MARVELL
+
config PHY_MESON_GXL
bool "Amlogic Meson GXL Internal PHY support"
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index efbbd31ff71..345d3a65104 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -379,7 +379,15 @@ static int m88e1518_config(struct phy_device *phydev)
phy_write(phydev, MDIO_DEVAD_NONE, MII_MARVELL_PHY_PAGE, 2);
reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_88E151x_PHY_MSCR);
+
reg &= ~MIIM_88E151x_RGMII_RXTX_DELAY;
+
+ /* Per the vendor, certain Marvell devices will not function if
+ * the RGMII TX/RX delay registers are modified. If an
+ * affected design has been selected, do not write the
+ * RX/TX delay registers.
+ */
+#if !defined(CONFIG_PHY_MARVELL_APPLY_MII_RXTX_ERRATA)
if (phydev->interface == PHY_INTERFACE_MODE_RGMII ||
phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
reg |= MIIM_88E151x_RGMII_RXTX_DELAY;
@@ -387,6 +395,8 @@ static int m88e1518_config(struct phy_device *phydev)
reg |= MIIM_88E151x_RGMII_RX_DELAY;
else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
reg |= MIIM_88E151x_RGMII_TX_DELAY;
+#endif
+
phy_write(phydev, MDIO_DEVAD_NONE, MIIM_88E151x_PHY_MSCR, reg);
phy_write(phydev, MDIO_DEVAD_NONE, MII_MARVELL_PHY_PAGE, 0);
--
2.39.5
More information about the openbmc
mailing list