U-boot phy ethernet auto negotiation fails

I have configure U-Boot to fetch the executable from an FTP server. The ethernet auto negotiation fails 2 times out of 3 and I need to reset the board every time. Is there any setting to fix this problem ?

Not that we are aware of. How exactly does your network environment look like?

Network is just a hub with one port connected to the Apalis board and a second port connected to the TFTP server’s PC. I have changed the hub model but I find always the same problem. Even removing the hub and having a direct connection to the PC, same problem - negotiation succeds only 30% of the tries…
I have several Apalis Boards, all of them present the same issue.

@SergioB., I assume all your devices are always configured for auto negotiation? Can you do a test where you disable auto negotiation on all devices and set it to the same settings, e.g. gigabit full duplex? Does that always work well? Do you have another Apalis SoM? If yes, does it show the same issues? Please also send us the serial number of the affected module so we can check our production log files.

I suppose I should use U-boot mii to disable auto-negotiation.
Current device is “FEC”

Current settings are:

uBOOT=>> mii dump
0. (ffff) – PHY control register –
(8000:8000) 0.15 = 1 reset
(4000:4000) 0.14 = 1 loopback
(2040:2040) 0. 6,13 = b11 speed selection = 10 Mbps
(1000:1000) 0.12 = 1 A/N enable
(0800:0800) 0.11 = 1 power-down
(0400:0400) 0.10 = 1 isolate
(0200:0200) 0. 9 = 1 restart A/N
(0100:0100) 0. 8 = 1 duplex = full
(0080:0080) 0. 7 = 1 collision test enable
(003f:003f) 0. 5- 0 = 63 (reserved)

Can you please explain how to modify these U-boot settings to disable A/N ?

The module S/N I am using are 05219405, 05219681

hi @SergioB.

Thanks for the Information.

There exists an errata of the PHY used on the Apalis iMX6. You could either use the patches phy: ksz9031: Center FLP timing at 16ms and mx6: toradex: apalis_imx6: increase phy autonegotiation timeout for U-Boot or try it out in U-Boot with the following mdio commands:

mdio write 7 0xd 0x0000
mdio write 7 0xe 0x0004
mdio write 7 0xd 0x4000
mdio write 7 0xe 0x0006
mdio write 7 0xd 0x0000
mdio write 7 0xe 0x0003
mdio write 7 0xd 0x4000
mdio write 7 0xe 0x1A80
mdio write 7 0x0 0x1340

No, those are not stored at all. Such commands are for debugging/testing purpose only.

Are these mdio settings stored in flash or should I re-edit them at every reset of U-boot ?