[U-Boot] Setting up MAC address for eth drivers

Michal Simek michal.simek at xilinx.com
Fri Mar 13 13:25:35 CET 2015


Hi,

I have a question regarding setting mac address for drivers.
Drivers setting up write_hwaddr via eth_write_hwaddr via eth_initialize
which is called from common/board_r.c.

But then there are some drivers(macb, designware, altera_tse) which also calls
mac setup from dev->init which has side effect for example when you setup CONFIG_ENV_OVERWRITE
and change mac address you can directly use it.

It also means if there is intention to call hwaddr from dev->init
that for the first packet mac address is setup twice - in eth core init
and then before every driver use.

I am asking this question because I would like to know the right flow
for eth mac setup.
If it is
set ethaddr xx....
saveenv
reset
eth with new mac

or if
set ethaddr
eth with new mac
should work

The second approach looks reasonable when ethaddr is not set at all
but then at least our driver needs to be fixed to support this feature.

Thanks,
Michal


More information about the U-Boot mailing list