[PATCH v1 3/5] net: phy: marvell: remove hardcoded PHY 2210 lane swap

Stefan Roese sr at denx.de
Wed Mar 24 10:20:06 CET 2021


From: Stefan Chulski <stefanc at marvell.com>

Lane swapped only if "enet-phy-lane-swap" set in device tree.

Signed-off-by: Stefan Chulski <stefanc at marvell.com>
Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins at marvell.com>
Reviewed-by: Kostya Porotchkin <kostap at marvell.com>
Reviewed-by: Yan Markman <ymarkman at marvell.com>
Reviewed-by: Marcin Wojtas <marcin at marvell.com>
Signed-off-by: Stefan Roese <sr at denx.de>
---

 drivers/net/phy/marvell.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 2e08bf3e2f79..8311b3b4722f 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -619,11 +619,17 @@ static int m88e2110_probe(struct phy_device *phydev)
 static int m88e2110_config(struct phy_device *phydev)
 {
 	u16 reg;
+	ofnode node = phy_get_ofnode(phydev);
 
-	/* Perform lane swap */
-	reg = phy_read(phydev, 1, 0xc000);
-	reg |= 0x1;
-	phy_write(phydev, 1, 0xc000, reg);
+	if (!ofnode_valid(node))
+		return -EINVAL;
+
+	if (ofnode_read_bool(node, "enet-phy-lane-swap")) {
+		/* Perform lane swap */
+		reg = phy_read(phydev, 1, 0xc000);
+		reg |= 0x1;
+		phy_write(phydev, 1, 0xc000, reg);
+	}
 
 	/* Configure auto-negotiation advertisement */
 	if (phydev->interface == PHY_INTERFACE_MODE_SFI) {
-- 
2.31.0



More information about the U-Boot mailing list