- Ethernet does not work on my board. But everything is fine
when I use the ethernet interface in
U-Boot (for example by performing a TFTP download).
This is a bug in U-Boot, right?
- No. It's a bug in the Linux ethernet driver.
In some cases the Linux driver fails to set the MAC address.
That's a buggy driver then - Linux ethernet drivers are supposed to
read the MAC address at startup.
On ->open, they are supposed to reprogram the MAC address back into the
chip (but not the EEPROM, if any) whether or not the address has been changed.
In general, a Linux driver shall
not make any assumptions about any initialization being done (or not
done) by a boot loader; instead, that driver is responsible
for performing all of the necessary initialization itself.
And U-Boot shall not touch any hardware it does not access itself.
If you don't use the ethernet interface in U-Boot, it won't be
initialized by U-Boot.
A pretty extensive discussion of this issue can be found in
the thread ATAG for MAC address on the ARM Linux mailing list.
Some current methods for handling the MAC
- use custom ATAGs (ARM systems)
- use a Flattened Device Tree (if your arch/port supports it)
- parse the U-Boot environment directly
- pass it via the command line
If your device driver does not support one of these sources directly, then do it yourself:
- add an init board hook
- program it from user space (`ifconfig hw ...`)
- for people who need to do NFS root or similar, then use initramfs -- this is what it was designed for !