]> git.dujemihanovic.xyz Git - u-boot.git/commit
net: eth-uclass: Setup ROM source only when ROM reading passes
authorMichal Simek <michal.simek@amd.com>
Fri, 15 Sep 2023 14:10:06 +0000 (16:10 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 5 Nov 2023 21:11:38 +0000 (16:11 -0500)
commitd71e7f41bfc3f68e259b8070706c586d95a49157
treeb3589a0610dc090e3a28e86b0aaaaebae529b333
parent6b5c8d98e2043d321216961ba67edb757a1a16eb
net: eth-uclass: Setup ROM source only when ROM reading passes

There is no reason to setup ROM source if read_rom_hwaddr hook doesn't
exist or reading mac address fails. It is ending up with confusion about
mac address source.

It is nicely visible if you put mac address to DT as
local-mac-address = [ff ff ff ff ff ff];
but also save ethaddr to variables
setenv -f ethaddr 02:18:31:7e:3e:01

Before this patch U-Boot prints that source is ROM
Address in ROM is ff:ff:ff:ff:ff:ff
Address in environment is 02:18:31:7e:3e:01

After that source is DT:
Address in DT is ff:ff:ff:ff:ff:ff
Address in environment is 02:18:31:7e:3e:01

Signed-off-by: Michal Simek <michal.simek@amd.com>
net/eth-uclass.c