Dual AR8035 on IMX7D cannot get DHCP leases

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dual AR8035 on IMX7D cannot get DHCP leases

1,014 Views
christsang
Contributor III

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?

Labels (1)
Tags (2)
0 Kudos
5 Replies

823 Views
igorpadykov
NXP Employee
NXP Employee

Hi Chris

in nxp uboot (uboot-imx) seems it is done in board_eth_init(), fecmxc_initialize_multi()

mx7dsabresd.c\mx7dsabresd\freescale\board - uboot-imx - i.MX U-Boot 

common procedure for ethernet initialization is described in ..doc/README.drivers.eth

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

823 Views
christsang
Contributor III

Hi Igor,

Thanks for your reply. For you reference, my uboot version is rel_imx_4.9.x_1.0.0_ga. And even for the link your provide, i.e. rel_imx_4.9.88_2.0.0_ga, there is no board_eth_init() in mx7sabresd.c. Also fecmxc_initialize_multi() does not run at all even in fec_mxc.c

I prefer to have modification base on my current version, instead of porting a new version. But anyway, which specific uboot version do you prefer to take it as a reference?

Please advise, Igor.

Merry Christmas and thanks for your support.

Chris

0 Kudos

823 Views
igorpadykov
NXP Employee
NXP Employee

Hi Chris

sorry, correct link is uboot-imx-imx_v2016.03_4.1.15_2.0.0_ga

mx7dsabresd.c\mx7dsabresd\freescale\board - uboot-imx - i.MX U-Boot 

as this is specifc uboot question one can post this on uboot mail list

U-Boot Info Page 

Best regards
igor

0 Kudos

823 Views
christsang
Contributor III

Hi Igor,

So you mean that I have to import anther version of uboot? Is there any modification on my version that I can work on it?

Chris

0 Kudos

823 Views
igorpadykov
NXP Employee
NXP Employee

Hi Chris

this may be implemented differently in different uboot versions,

so better option post it on uboot mail list.

Best regards
igor

0 Kudos