Linux-4.1.15 : problem with LAN8720A

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

Linux-4.1.15 : problem with LAN8720A

Jump to solution
3,430 Views
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

Tags (1)
0 Kudos
Reply
1 Solution
2,510 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
2,511 Views
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 Kudos
Reply
2,510 Views
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 Kudos
Reply
2,510 Views
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 Kudos
Reply
2,510 Views
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 Kudos
Reply