mirror of
https://xff.cz/git/u-boot/
synced 2025-11-02 03:17:29 +01:00
net: sunxi_emac: Switch to new U-Boot PHY API
Use new U-Boot phy_connect() API which also supports fixed PHYs. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
This commit is contained in:
@@ -248,10 +248,10 @@ static int emac_mdio_write(struct mii_dev *bus, int addr, int devad, int reg,
|
||||
|
||||
static int sunxi_emac_init_phy(struct emac_eth_dev *priv, void *dev)
|
||||
{
|
||||
int ret, mask = 0xffffffff;
|
||||
int ret, mask = -1;
|
||||
|
||||
#ifdef CONFIG_PHY_ADDR
|
||||
mask = 1 << CONFIG_PHY_ADDR;
|
||||
mask = CONFIG_PHY_ADDR;
|
||||
#endif
|
||||
|
||||
priv->bus = mdio_alloc();
|
||||
@@ -269,11 +269,10 @@ static int sunxi_emac_init_phy(struct emac_eth_dev *priv, void *dev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
priv->phydev = phy_find_by_mask(priv->bus, mask);
|
||||
priv->phydev = phy_connect(priv->bus, mask, dev, PHY_INTERFACE_MODE_MII);
|
||||
if (!priv->phydev)
|
||||
return -ENODEV;
|
||||
|
||||
phy_connect_dev(priv->phydev, dev, PHY_INTERFACE_MODE_MII);
|
||||
phy_config(priv->phydev);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user