[PATCH RFC] cmd: fix net list command

Michal Simek michal.simek at xilinx.com
Mon Nov 15 17:12:02 CET 2021



On 11/15/21 16:20, Wolfgang Denk wrote:
> Dear Michal,
> 
> In message <2a51974b-41cf-56e4-c9c9-e6b699f27f5c at xilinx.com> you wrote:
>>
>> As we discussed in previous thread. I think there shouldn't be a problem
>> when u-boot passes random mac address (in whatever way) but if Linux
>> driver know how to get correct one it should be tried first.
> 
> No, I strongly disagree here.  If I set a MAC address in U-Boot and
> pass it to the kernel, I want that the kernel uses this address.
> there may be very good reasons to chose some other address - even if
> the "correct" one is known in U-Boot (say, by accident there are
> several boards using the same MAC address).

MAC addresses can be provided in OTP location of qspi. Or on eeprom 
which is accessible only when PL is loaded. Also information on 1wire, 
or PL gpio pins, etc.
It means mac address is on the board but at u-boot stage doesn't need to 
be accessible (or it is not useful to waste time/money on writing driver 
for it).

In perfect world u-boot will just get it and use. And if manufacturer 
doesn't do it properly but want to enable ethernet in u-boot random 
address could be a solution for them.
And then in Linux where drivers are available you will use the right one.

But back to this patch. I think it is good that net list will show all 
mac addresses even they are not saved in environment.

And I will let you guys to discuss if makes sense to share random 
address up which is what the whole discussion is about. And I have 
created a patch which is exactly aligned what it is described above. If 
u-boot starts to use random mac I want to see it in Linux too.

Thanks,
Michal


More information about the U-Boot mailing list