Linux-4.1.15 : problem with LAN8720A

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Linux-4.1.15 : problem with LAN8720A

跳至解决方案
3,278 次查看
aebischerquenti
Contributor III

Hello everyone,

I have an issue related to the LAN8720A ethernet phy and linux freescale kernel 4.1.15.

The problem is that the ethernet link never goes up.

I tried using a vanilla kernel (version 4.1.37 available on kernel.org), and it works with this version.

I used the same kernel configuration (imx_v6_v7_defconfig), as well as the same DTS file (at least the parts related to the ethernet configuration).

I then went ahead and copied all the source files in the drivers/net/ethernet/freescale directory from the 4.1.37 vanilla kernel to the 4.1.15 freescale kernel. It compiled OK, but it didn't change anything (ethernet link still doesn't go up).

I don't know how the network stack works in Linux, so I don't know what other parts of the kernel are involved in this bug.

Also I have read this thread from the NXP community :i.MX6UL ENET1 (with LAN8720A PHY) working in Uboot but not in Linux

But it didn't help

I'm open to every hint / suggestion

Thank you for reading me

Quentin

标记 (1)
0 项奖励
回复
1 解答
2,358 次查看
aebischerquenti
Contributor III

OK I solved the issue ; after looking at the clock signal, I found out it was running at 125 MHz instead of 50 MHz.
In the file arch/arm/mach-imx/clk-imx6q.c, the clock is forced at 125 MHz with this line :    clk_set_rate(clk[IMX6QDL_CLK_ENET_REF], 125000000);

Commenting this line solved the issue. I'm not sure why it is set in the first place, it's not present in vanilla kernel only in freescale kernel.

Regards,

Quentin

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,359 次查看
aebischerquenti
Contributor III

OK I solved the issue ; after looking at the clock signal, I found out it was running at 125 MHz instead of 50 MHz.
In the file arch/arm/mach-imx/clk-imx6q.c, the clock is forced at 125 MHz with this line :    clk_set_rate(clk[IMX6QDL_CLK_ENET_REF], 125000000);

Commenting this line solved the issue. I'm not sure why it is set in the first place, it's not present in vanilla kernel only in freescale kernel.

Regards,

Quentin

0 项奖励
回复
2,358 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Quentin

had you replaced  #define CONFIG_PHY_MICREL  with  #define CONFIG_PHY_SMSC
in uboot/include/configs/mx6ul_14x14_evk.h

also are you observing lan8720 signals on oscilloscope (like clocks, data..)

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

0 项奖励
回复
2,358 次查看
aebischerquenti
Contributor III

Hi Igor

Thank you for your answer.

I haven't replaced #define CONFIG_PHY_MICREL with  #define CONFIG_PHY_SMSC in uboot as you said, but I don't know why it would change anything since the I assumed the kernel reconfigures the phy from scratch no ? Also I am running uboot-2015 just for info.

I haven't observed the lan8720 signals with an oscilloscope yet, because it is working with the 4.1.37 vanilla kernel and I thought I could just find out what are the differences between this kernel and the 4.1.15 freescale kernel and make it work. I will look at the signals if I can't find a software solution soon.

Also I will try ethtool to see if it prints out useful infos.

Quentin

0 项奖励
回复
2,358 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Quentin

kernel L4.1.37 is not officially supported by nxp, please try ones described on link

http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-applications-process...

recommended to start ethernet bringup on uboot as it is easier to debug.

Best regards
igor

0 项奖励
回复