imx6ul eth work abnormal

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

imx6ul eth work abnormal

Jump to solution
4,413 Views
zhangbin_eos
Contributor III

hi,

my board is imx6ul-14x14-evk, BSP is L4.1.15_2.0.0

I did not modify the hardware and device tree,but when I use the ETH0 and ETH1,there are some problems.

No1. my default ip  as follow: 

root@imx6ulevk:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:91:FC:66
inet addr:192.168.1.39 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::250:56ff:fe91:fc66%1995724496/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:40 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2640 (2.5 KiB) TX bytes:586 (586.0 B)

eth1 Link encap:Ethernet HWaddr 00:04:9F:04:EE:F9
inet addr:192.168.2.39 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::204:9fff:fe04:eef9%1995724496/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:40 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2640 (2.5 KiB) TX bytes:586 (586.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1%1995724496/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

In PC, 

ping 192.168.1.39  is ok

ping 192.168.2.39  is ok

when insert eth0 ,unplug eth1,in pc :

ping 192.168.1.39  is ok

ping 192.168.2.39  is ok

when unplug eth0 ,insert eth1,in pc :

ping 192.168.1.39  is error

ping 192.168.2.39  is error

No2.

When I set eth0/eth0 up and down ,print as follow,

root@imx6ulevk:~# ifconfig eth0 down

root@imx6ulevk:~# ifconfig eth0 up
fec 20b4000.ethernet eth0: Freescale FEC PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=20b4000.ethernet:01, irq=-1)
root@imx6ulevk:~# fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx


root@imx6ulevk:~# ifconfig eth1 down
root@imx6ulevk:~# ifconfig eth1 up
fec 2188000.ethernet eth1: Freescale FEC PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=20b4000.ethernet:02, irq=-1)
root@imx6ulevk:~# fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx

Is there a bug in the network in this version(4.1.15_2.0.0), and is replacing the new version helpful to this problem?

Labels (1)
Tags (1)
0 Kudos
1 Solution
3,693 Views
rakesh_patel
Senior Contributor I

Hi zhangbin.eos@foxmail.com,

Yes, you will be able to use eth0 and eth1 independently.

Are you using prebuilt sd card image?

From your above logs, it seems that you have same mac address for both ethernet ports. This can be the issue for ping not working in your case. To overcome this please perform below steps :

  1.  Power up the board
  2. Stop the console at u-boot
  3. Enter command "env del ethaddr"
  4. Enter command "saveenv"
  5. Enter command "run bootcmd" (This will boot the kernel)

Now, you will be able to see two ethernet port with different mac and IP address. Try to ping them as you are doing with plug and unplug both the ethernet cables.

In case you are still facing an issue with ping then can you please sniff the packets and send the Wireshark file?

Regards,

Rakesh

View solution in original post

0 Kudos
8 Replies
3,693 Views
zhangbin_eos
Contributor III

igorpadykov

Thank you .

In the new link,I don't find  function "init_gpr()" in u-boot-imx code.

Can you confirm that eth0 and eth1 can work independently in NXP official Demo Image?
That is, when eth1 is plugged in and eth0 is not plugged in, the network can work normally.

Please.

0 Kudos
3,694 Views
rakesh_patel
Senior Contributor I

Hi zhangbin.eos@foxmail.com,

Yes, you will be able to use eth0 and eth1 independently.

Are you using prebuilt sd card image?

From your above logs, it seems that you have same mac address for both ethernet ports. This can be the issue for ping not working in your case. To overcome this please perform below steps :

  1.  Power up the board
  2. Stop the console at u-boot
  3. Enter command "env del ethaddr"
  4. Enter command "saveenv"
  5. Enter command "run bootcmd" (This will boot the kernel)

Now, you will be able to see two ethernet port with different mac and IP address. Try to ping them as you are doing with plug and unplug both the ethernet cables.

In case you are still facing an issue with ping then can you please sniff the packets and send the Wireshark file?

Regards,

Rakesh

0 Kudos
3,693 Views
igorpadykov
NXP Employee
NXP Employee

Hi 斌 张 

what bsp used in the case, one can try with NXP official Demo Image

i.MX 6UltraLite EVK Linux Binary Demo Files

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

0 Kudos
3,693 Views
zhangbin_eos
Contributor III

Hi,

The BSP that I used is L4.1.15_2.0.0_ga ,and I  have also tested the L4.14.78_1.0.0_ga_images_MX6UL7D

In the  L4.14.78_1.0.0_ga , No2 is work well , but No1 still exists.

I know this is a very obvious question. I want to know how NXP designed the dual-port function of imx6ul-evk .
Under normal circumstances, whether eth0 and eth1 have relevance?
Can they work independently of each other?

0 Kudos
3,693 Views
igorpadykov
NXP Employee
NXP Employee

can be useful to check

How to use two Ethernet ports at same time on i.MX6UL 

Best regards
igor

0 Kudos
3,693 Views
zhangbin_eos
Contributor III

Hi,

Thank you so soon response ! I see the linkNo improvement.

my intrefaces file as follow:

auto eth0
iface eth0 inet static
   address 192.168.1.39
   netmask 255.255.0.0
   gateway 192.168.0.1
   broadcast 192.168.255.255
# pre-up ifconfig eth0 hw ether 00:50:56:91:FC:65

auto eth1
iface eth1 inet static
   address 192.168.2.39
   netmask 255.255.0.0
   gateway 192.168.0.1
   broadcast 192.168.255.255
# pre-up ifconfig eth1 hw ether 00:50:56:91:FC:66

and the ifconfig print as follow:

eth0 Link encap:Ethernet HWaddr 00:04:9F:04:EE:F9
      inet addr:192.168.1.39 Bcast:192.168.255.255 Mask:255.255.0.0
      inet6 addr: fe80::204:9fff:fe04:eef9%1995880144/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
      RX packets:4641 errors:0 dropped:194 overruns:0 frame:0
      TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:395352 (386.0 KiB) TX bytes:258 (258.0 B)

eth1 Link encap:Ethernet HWaddr 00:04:9F:04:EE:F9
      inet addr:192.168.2.39 Bcast:192.168.255.255 Mask:255.255.0.0
      inet6 addr: fe80::204:9fff:fe04:eef9%1995880144/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
      RX packets:4635 errors:0 dropped:194 overruns:0 frame:0
      TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:394886 (385.6 KiB) TX bytes:648 (648.0 B)

lo Link encap:Local Loopback
       inet addr:127.0.0.1 Mask:255.0.0.0
      inet6 addr: ::1%1995880144/128 Scope:Host
        UP LOOPBACK RUNNING MTU:65536 Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Why is it that eth0's MAC is the same as eth1's MAC when I haven't set it up in /etc/network/interfaces?

Can you confirm that eth0 and eth1 can work independently in NXP official Demo Image?
That is, when eth1 is plugged in and eth0 is not plugged in, the network can work normally.
If so, I'm going to swap the PHY of eth0 and the PHY of eth1 for testing.

Best regards

0 Kudos
3,693 Views
igorpadykov
NXP Employee
NXP Employee

on below link customer succeeded to operate both enet ports

i.MX6ULL using both ethernet ports, but ENET1 won't work 

Best regards
igor

0 Kudos
3,693 Views
zhangbin_eos
Contributor III

in the drivers/net/ethernet/freescale/fec_main.c  : fec_enet_mii_init()

/*
* The i.MX28 dual fec interfaces are not equal.
* Here are the differences:
*
* - fec0 supports MII & RMII modes while fec1 only supports RMII
* - fec0 acts as the 1588 time master while fec1 is slave
* - external phys can only be configured by fec0
*
* That is to say fec1 can not work independently. It only works
* when fec0 is working. The reason behind this design is that the
* second interface is added primarily for Switch mode.
*
* Because of the last point above, both phys are attached on fec0
* mdio interface in board design, and need to be configured by
* fec0 mii_bus.
*/
if ((fep->quirks & FEC_QUIRK_ENET_MAC) && fep->dev_id > 0) {
/* fec1 uses fec0 mii_bus */
if (mii_cnt && fec0_mii_bus) {
fep->mii_bus = fec0_mii_bus;
*fec_mii_bus_share = FEC0_MII_BUS_SHARE_TRUE;
mii_cnt++;
return 0;
}
return -ENOENT;
}

for imx6ul, Can fec0 and fec1  work independently in NXP official Demo Image?

0 Kudos