U-Boot Driver for Ethernet Controller

“Energy Efficient Ethernet” (EEE) is mentioned as another possible root cause for the observed behaviour and is enabled in Angström per default:

root@apalis-tk1:~# ethtool --show-eee enp1s0                                                                                                                                                                                                                   
EEE Settings for enp1s0:                                                                                                                                                                                                                                       
        EEE status: enabled - active                                                                                                                                                                                                                           
        Tx LPI: 0 (us)                                                                                                                                                                                                                                         
        Supported EEE link modes:  100baseT/Full                                                                                                                                                                                                               
        Advertised EEE link modes:  100baseT/Full                                                                                                                                                                                                              
        Link partner advertised EEE link modes:  100baseT/Full                                                                                                                                                                                                 

I disabled EEE with ethtool --set-eee enp1s0 eee off termporarily. I connected/reconnected the ethernet cable to from/to the switch over and over again and was not able to reproduce the missing link (the behaviour observed of my colleague).

Unfortunately I am not able to test the same in the warm-start and cold-start scenarios because the EEE configuration is enabled again after every reset or power cycle.

Do you know how to disable EEE persistently over reboots?

I open another question because that’s a different topic…

I received the Phidgetes “Digital Output” to control the DC power supply yesterday. I wrote a test script and was able to reproduce the issue with the Apalis TK1 Linux BSP v2.7b3 for the cold-start scenario as well (after 2 1/2 hours cyclic power cycles every approx. 45 seconds). I will be able to reproduce that again. Please let me know what types of log files will be valuable for you. I can provide them to you then.

I will run the test script over the weekend with our image (which has EEE disabled). Hopefully the issue is not reproducible with that change anymore…

In an approx. 60 hour run with EEE disabled during kernel boot in our image over the weekend the issue did not occur again. I can run the same script with your image v2.7b3 with EEE disabled in u-boot as well over night till tomorrow morning (approx. 12 hours).

I create new question specific to the user space link establishment issue.

It turns out that the current PCIe reset implementation in the PCIe board init function is not quite working reliably due to PCIe reset timing violations. Fix this by overriding the tegra_pcie_board_port_reset() function.

Please find resp. patches on our U-Boot -next branch.

Great. Thanks a lot for the patch. Does this patch fix issue on the linux (kernel/user) level as well? (related forum question)

I guess that depends. Most possibly yes should one already bring up the link in U-Boot. However a regular boot won’t do that. I’m actually working on an improved solution for Linux as well and will update resp. thread shortly.

BTW: Please note that my -next stuff already went through multiple iterations with the latest one dating back to yesterday evening.

Ok. We will figure it out either way when we run the tests again.

I’m in the final stages of testing and will commit the Linux kernel part soon as well.

Great. Thanks.

What do you mean with “Also allow optionally bringing up the PCIe switch as found on the Apalis Evaluation board. Note however that the Apalis PCIe port is also left disabled in the device tree by default.” in the commit message of the bugfix in u-boot exactly?

It means exactly that. One may optionally bring up the PCIe switch also in U-Boot if desired/required or whatever. But regular booting does not require any of that and in fact regular booting actually does not touch PCIe at all. Basically unless one explicitly does pci enum PCIe won’t be touched.

That means if I depend on pci enum in u-boot for an optional firmware update after the poweron of the TK1 I should enable the option CONFIG_APALIS_TK1_PCIE_EVALBOARD_INIT=y in e.g. /configs/apalis-tk1_defconfig to enable it during the build of u-boot where make apalis-tk1_defconfig is invoked, right? (Actually not apalis-tk1_defconfig but a file which is based on apalis-tk1_defconfig.)

I merged the patch into our u-boot. However the build of u-boot fails with

board/toradex/apalis-tk1/apalis-tk1.c:13:23: fatal error: pci_tegra.h: No such file or directory
compilation terminated.
make[1]: *** [board/toradex/apalis-tk1/apalis-tk1.o] Error 1

because the file #include <pci_tegra.h> seems to be missing.


I missed to merge the other commits before as well…

Please note the fix is not just a single commit but rather a series of dependent ones.

I applied patch “pci: tegra: introduce weak tegra_pcie_board_port_reset() function”, patch “apalis-tk1: fix pcie reset for reliable gigabit ethernet operation” and enabled CONFIG_APALIS_TK1_PCIE_EVALBOARD_INIT=y in /configs/apalis-tk1_defconfig. The link is still not established sometimes. Which commits did I miss?

Ok, I missed the other “apalis-tk1:” commits…

I would actually recommend using the tip of the -next branch unless you plan to explicitly skip certain enhancements.

What means “Note that by default the PCIe port is also left disabled in the device tree which needs changing as well for this to actually work.” in the description for APALIS_TK1_PCIE_EVALBOARD_INIT? Has there to be done something in addition?

Not unless you do require the PCIe switch on the Apalis Evaluation board to also be initialised in U-Boot upon explicitly doing pci enum. As mentioned before regular booting does not need any such. Also just gigabit Ethernet does not need this as that one is always initialised by default upon explicitly doing pci enum.