net: mvneta: Use DM MDIO API for connecting PHY

Use the modern DM MDIO API for connecting PHY in the mvneta driver.

This requires enabling MVMDIO driver in several config files.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Marek Behún
2022-04-27 12:41:46 +02:00
committed by Stefan Roese
parent 47f0e8e21a
commit da84e409df
15 changed files with 19 additions and 6 deletions

View File

@@ -445,6 +445,7 @@ config MVNETA
bool "Marvell Armada XP/385/3700 network interface support"
depends on ARMADA_XP || ARMADA_38X || ARMADA_3700
select PHYLIB
select DM_MDIO
help
This driver supports the network interface units in the
Marvell ARMADA XP, ARMADA 38X and ARMADA 3700 SoCs

View File

@@ -1571,16 +1571,15 @@ static int mvneta_start(struct udevice *dev)
mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
} else {
/* Set phy address of the port */
mvreg_write(pp, MVNETA_PHY_ADDR, pp->phyaddr);
phydev = phy_connect(pp->bus, pp->phyaddr, dev,
pp->phy_interface);
phydev = dm_eth_phy_connect(dev);
if (!phydev) {
printf("phy_connect failed\n");
printf("dm_eth_phy_connect failed\n");
return -ENODEV;
}
/* Set PHY address in case we will enable HW polling */
mvreg_write(pp, MVNETA_PHY_ADDR, phydev->addr);
pp->phydev = phydev;
phy_config(phydev);
phy_startup(phydev);