IMX28 custom board ethernet link toggling up and down

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

IMX28 custom board ethernet link toggling up and down

2,790 Views
vinugopalakrish
Contributor III

Hi NXP community,

We are using a Custom imx28-evk based board with the latest iMX yocto images (Zeus) ported into it. Linux version 5.4.20-fslc+g18d5e274c780.

The problem is when the board boots up we keep on getting prints from Ethernet driver like this
Configuring network interfaces... [   15.759903] SMSC LAN8710/LAN8720 800f0000.ethernet-1:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=800f0000.ethernet-1:00, irq=POLL)
udhcpc: started, v1.31.0
udhcpc: sending discover
[   17.871399] fec 800f0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   18.940173] fec 800f0000.ethernet eth0: Link is Down
udhcpc: sending discover
[   19.949639] fec 800f0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   21.019241] fec 800f0000.ethernet eth0: Link is Down
[   22.029599] fec 800f0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
udhcpc: sending discover
[   23.099242] fec 800f0000.ethernet eth0: Link is Down
[   24.109620] fec 800f0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   25.180685] fec 800f0000.ethernet eth0: Link is Down

Board never gets assigned any IP. This prints goes on forever. Ethernet works fine in bootloader. We are able to do TFTP from u-boot.

Also in the kernel everything works fine with static ip configuration with a PC.

There are no errors in packet reception. output of ifconfig
eth0      Link encap:Ethernet  HWaddr 00:04:00:00:00:00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:66 (66.0 B)  TX bytes:5130 (5.0 KiB)
But this was a five year old post and seems like the mentioned patch is not relevant at all.
Our device tree contents are 
<arch/arm/boot/dts/imx28.dtsi>
                mac0: ethernet@800f0000 {
                        compatible = "fsl,imx28-fec";
                        reg = <0x800f0000 0x4000>;
                        interrupts = <101>;
                        clocks = <&clks 57>, <&clks 57>, <&clks 64>;
                        clock-names = "ipg", "ahb", "enet_out";
                        status = "disabled";
                };
<arch/arm/boot/dts/imx28-evk.dts>
                mac0: ethernet@800f0000 {
                        phy-mode = "rmii";
                        pinctrl-names = "default";
                        pinctrl-0 = <&mac0_pins_a>;
                        phy-supply = <&reg_fec_3v3>;
                        phy-reset-gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
                        phy-reset-duration = <1000>;
                        status = "okay";
                };
Note: when we manually set the link speed to 10mbps using ethtool, Ethernet works fine.This issue occurs with 100mbps speed and it seems to have some issue with autonegotiation.
Please consider this issue in priority and help to resolve this issue at the earliest.
regards,
Vinu
Labels (1)
5 Replies

2,565 Views
vinugopalakrish
Contributor III

Hi,

We were able to resolve the issue using a "hack" from the link Problem with "swinging" ethernet link on i.MX28 based device - Patchwork 

From the link we found that If one makes the following change in the Ethernet driver,


>> --- a/drivers/net/ethernet/freescale/fec_main.c
>> +++ b/drivers/net/ethernet/freescale/fec_main.c
>> @@ -936,7 +936,7 @@ fec_restart(struct net_device *ndev)
>> if (fep->quirks & FEC_QUIRK_HAS_AVB) {
>> writel(0, fep->hwp + FEC_ECNTRL);
>> } else {
>> - writel(1, fep->hwp + FEC_ECNTRL);
>> + //writel(1, fep->hwp + FEC_ECNTRL);
>> udelay(10);
>> }

the device gets a stable DHCP connection from router. At this moment this is probably the only "solution" that we could find for this issue. If anyone has anything better, do comment.

regards,

Vinu

0 Kudos
Reply

2,565 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Vinu,

Maybe the problem is the transceiver, the ENET supports 10/100-Mbps MII (18 pins altogether), 10/100-Mbps RMII (10 pins, including serial management interface), for connection to an external Ethernet transceiver. All signals are compatible with transceivers operating at a voltage of 3.3 V. BTW you probably use the community BSP since 5.4 kernel is not supported, you should ask to BSP community.

Regards

0 Kudos
Reply

2,565 Views
vinugopalakrish
Contributor III

Hi Bio_TICFSL,

Can you please share the link to BSP community forum ? I searched but was unable to find them.

regards,

Vinu

0 Kudos
Reply

2,565 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

FSL Community BSP 

Regards

0 Kudos
Reply

2,565 Views
vinugopalakrish
Contributor III

Hi,
Any updates?