From: Stefan Chulski <[email protected]> Lane swapped only if "enet-phy-lane-swap" set in device tree.
Signed-off-by: Stefan Chulski <[email protected]> Tested-by: sa_ip-sw-jenkins <[email protected]> Reviewed-by: Kostya Porotchkin <[email protected]> Reviewed-by: Yan Markman <[email protected]> Reviewed-by: Marcin Wojtas <[email protected]> Signed-off-by: Stefan Roese <[email protected]> --- 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

