AnsweredAssumed Answered

Dual AR8035 on IMX7D cannot get DHCP leases

Question asked by Chris Tsang on Dec 20, 2018
Latest reply on Dec 24, 2018 by igorpadykov

Hi everyone,

 

I am using IMX7D with two AR8035 chips as ethernet ports. Either one of the ethernet port cannot get dhcp leases from dhcp server in both uboot and kernel. They are configured with two different PHY address - 0x0 and 0x1.

 

The root cause for this issue is that only one device is configured in uboot fec_mxc.c fec_phy_init(). I just have a workaround for this with hard code PHY address for the second ethernet. 

 

static int fec_phy_init(struct fec_priv *priv, struct udevice *dev)
{
     struct phy_device *phydev;
     int mask = 0xffffffff;

#ifdef CONFIG_PHYLIB
     mask = 1 << CONFIG_FEC_MXC_PHYADDR;
#endif

     phydev = phy_find_by_mask(priv->bus, mask, priv->interface);
     if (!phydev)
          return -ENODEV;

     phy_connect_dev(phydev, dev);

     priv->phydev = phydev;
     phy_config(phydev);

#ifdef DUAL_AR8035_WORKAROUND
#ifdef CONFIG_PHYLIB
     /*TODO: set second phy */
     mask = 1 << (CONFIG_FEC_MXC_PHYADDR + 1);
#endif

     phydev = phy_find_by_mask(priv->bus, mask, priv->interface);
     if (!phydev)
          return -ENODEV;

     phy_connect_dev(phydev, dev);

     priv->phydev = phydev;
     phy_config(phydev);
#endif /*DUAL_AR8035_WORKAROUND*/

     return 0;
}

I have two questions:

1. Why there is not such problem for IMX7D Sabre board in kernel? IMX7D Sabre uses BCM54220 which has two PHYs on it.

2. Is it better for me to fix it under kernel? And how?

Outcomes