Ethernet problems with 4 wire cabling

Hello Toradex Team,

we have the problem that the ethernet connection to our apalis imx6 based products cannot be established under certain conditions.

Test hardware

  • Apalis iMX6Q 1GB V1.1(A,B,D): Yocto BSP v2.8.8 or v5.7.1
  • Ixora V1.0A (alternatively own carrier boards, all have the same problem)
  • different ethernet switches

Problem description

If a network cable with only 2 wire pairs is used (100BASE-TX 802.3u-1995), then sometimes no connection can be established. This is evident from the fact that the LEDs on the ethernet port stay off. This error occurs depending on the ethernet switch used. In our opinion, a ethernet connection should be established in any case thanks to autonegotiaon.

Tests performed

  1. The ethernet phy was limited to 100MBit/s by device-tree [1]. Using Ethtool, it is now output that the network adapter allows a maximum of 100MBit/s. Unfortunately the problem remains, link is down.
  2. If by command ethtool -s eth0 speed 100 duplex full autoneg off the speed is set, a connection is established.
    This variant is not generally usable, because it can lead to conflicts in the duplex configuration.

[1]

&fec {
	mdio {
		ethphy: ethernet-phy@7 {
			max-speed = <100>;
		};
	};
};

Can you help us to increase the ethernet compatibility?

Best regards
Andreas Weger

it seems that the issue you are experiencing is related to the autonegotiation process between the Ethernet switch and the Apalis iMX6 board.
Can you try to use a different Ethernet switch?
If the duplex configuration can lead to conflicts have you tried

ethtool -s eth0 speed 100 duplex half autoneg off

?

Hi @alex.tx,

thank you for handling the case.

We have tried several Ethernet switches. With some it works, with others it does not.

When configuring the half-duplex, it can also lead to problems, since it is not known what is set at the remote site. We have a lot of Apalis iiMX6 based products in the field, so autoneogation is inevitable. A possible compromise would be the droseling to 100MBit, but this does not seem to work (see device-tree snippet).

Best regards,
Andreas

My point is that you correctly set the 100Mbit speed by Device Tree, but your 1Gb Ethernet switch may not be able to negotiate the 100Mbit speed properly. If you believe that the Device Tree settings are not working, you can set the 100Mbit speed using the ethtool command. If you are unable to use a 4-pair Ethernet cable, you can try using 100Base-T Ethernet switches.

Hello @alex.tx ,

I have tested a little more with the ixora board. With the above entry in the device-tree, as known, the speed is throttled

 ethtool eth0
    Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: MII
        PHYAD: 7
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Link detected: no

But there is no link even with a 4-pair ethernet cable. The connection is always reset.

 [  116.901998] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
 [  116.917181] fec 2188000.ethernet eth0: Link is Down

I ask you to investigate this. I suspect the PHY is authenticating incorrectly. I came to this conclusion because other 100Mbit devices work on the same port of the 1GBit switch.

Are you using 2 pairs Ethernet cable here? Could you list your 100Mb devices?
I did try to use 2 pair cable and it works with my 1Gb switch correctly.

The switch is a Netgear GS116v2.
The working 100MBit/s devices on the same port of the switch:

  • pci ethernet card: level one FNC_0109TX with RTL8139C
  • usb ethernet card: logilink UA0144B
  • sub switch: Netgear FS308v2

I have tried both a 2 and a 4 wire cable. The mentioned devices work in any configuration.

Dear @aweger,

Sorry for the delay in answering.
I am trying to reproduce your issue and will collect some information from our internal sources which could help you. Please be patient until the end of this week.

Dear @aweger,

May I ask you if there is a specific reason why you want to use the half-duplex ethernet cables?

  1. The ethernet phy was limited to 100MBit/s by device-tree [1]. Using Ethtool, it is now output that the network adapter allows a maximum of 100MBit/s. Unfortunately the problem remains, link is down.

Could you please send me the dmesg logs from the module after you have built and deployed the device tree overlay?

But there is no link even with a 4-pair ethernet cable. The connection is always reset.

I tried to reproduce the issue here on my side on an Apalis iMX6 module with a 4-pair ethernet cable but could not. I built and deployed the same device tree overlay as yours for a max-speed of 100 mbps and I can see from my dmesg logs that the link is up and working. I might be able to help you better on this if you could provide the dmesg logs.

Dear @rudhi.tx,

thanks for your investigations.

Attention: A cable with 4 wires is NOT a half duplex cable. At 100MBit, one pair of wires is used per direction, so it is full duplex.
The reason why such cables are used is due to the building network installation of some customers. We have no influence on it and neither does the user.

In the described case there are no entries in the dmesg when connecting and disconnecting. The network lights also remain off. Therefore I suspect a misconfiguration / a bug in the network phy or its drivers.
The problem can only be corrected with selected switches, as described several times in the course. Unfortunately, neither my company nor the end user has any influence on the installed network switches. The hardware I use can also be found above.

How can we investigate further at this point?

Best regard,
Andreas

Hello @aweger,
Use 2 pair wire cable and keep gigabit autonegotiation active is a common mistake.
See Gigabit Ethernet - Wikipedia
"Since negotiation takes place on only two pairs, if two gigabit interfaces are connected through a cable with only two pairs, the interfaces will successfully choose ‘gigabit’ as the highest common denominator (HCD), but the link will never come up. ".
From my experience (yes, in the past I have done the same…), the result is that sometimes it works, sometimes not, depending on the counterpart. Some devices fallback from gigabit autoneg to 100 Mbit after some time ( maybe after 30-60 seconds…).
If you are interested (maybe I do not fully understand your usage case) I will check what I have done on my own device.

Hallo @emanuele.tx

I know that it is a mistake! That’s why I switched the network phy via DeviceTree to 100MBit/s mode. With this it must work in my opinion. I have no access to our devices in operation and can’t configure anything via ethtool or similar. Therefore the project as 100MBit device.

Hello @aweger,
I see I have one messagge waiting for approval…
It was saying to give a try with
sudo ethtool -s eth0 advertise 0x0f
If you can give a try it can help found where the problem is (maybe it is phy config from device tree).
In every case, if it work, you can modify an init script.
It is more or less like changing the device tree.
Best regards

Try to remove the device tree max-speed = <100>; and run this command before connecting cable:
sudo ethtool -s eth0 advertise 0x0f

Hi,

I have performed a test as you suggested.

Unfortunately it does not work either, here is an excerpt from the dmesg, the last two lines now appear about every 2 seconds.

[   20.428703] Micrel KSZ9031 Gigabit PHY 2188000.ethernet-1:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=2188000.ethernet-1:07, irq=116)
[   83.130808] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   83.138564] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   83.152627] fec 2188000.ethernet eth0: Link is Down
[   85.675101] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off

The settings with ethool were accepted:

root@xxx:~# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised pause frame use: No

Hi @aweger,

Could you please try with our latest version of BSP (BSP 6)? You may download the image here or from the feeds of Toradex Easy Installer GUI.
Please let us know how that goes.

Hi @aweger,

Some updates from my side:
I tried to reproduce the issue with a 4-wire ethernet cable and the same hardware setup as yours. In my tests, I found that the ethernet link just works fine at a speed of 100 Mbps even without the overlay being applied - which means it auto-negotiates to 100 Mbps. I tested on BSPS versions 2.8, 5.7 and 6.2 and I got the same results regardless.

All I did was install one of the BSPs mentioned above ( found from the Toradex Easy Installer feeds) onto the Apalis iMX6Q module (with an Ixora V1.0A carrier board) connected with a 4-wire ethernet cable. On successful completion of the boot process, I saw that the ethernet link was up with auto-negotiated to a speed of 100Mbps.

May I ask you to start over and do this simple test? If that doesn’t work, I would really recommend you to check if your 4-wire ethernet cable is working.

Hey @aweger,

Hope you are doing well. Do you have any updates on this topic?