Setting MAC address from I2C EEPROM - debug / commands? (Xilinx)

Michal Simek monstr at monstr.eu
Wed Nov 23 16:11:41 CET 2022



On 11/23/22 14:27, Michael Walle wrote:
>>> ethernet {
>>>       nvmem-cells = <&mac_address>;
>>>       nvmem-cell-names = "mac-address";
>>> };
>>>
>>> You'll need 2022.07 for this I think. This is the same method which
>>> Linux uses. I added this specificly to be able to load MAC addresses
>>> from EEPROMs without needing to hard code stuff into Kconfig.
>>
>> This looks good and I see Sean wired it in the U-Boot already. It should work
>> fine with all Xilinx formats but on boards just for MAC address. (FRU format is
>> also designed in a way that the same boards have MAC address at the same location).
>> The code I described above is also checking in FRU format that checksums are
>> correct and also reading more information from it for other use cases.
> 
> You might also be interested in the new NVMEM layout patch series:
> https://lore.kernel.org/lkml/20221118185118.1190044-1-michael@walle.cc/

This is interesting. But how can you use the nvmem-cell description for mac 
address reading which Sean mentioned above?

Also DT description is saying that you are particular format but it doesn't mean 
that data is correct. I see that pretty much you can in add_cells refuse to 
create description if CRCs fails but maybe any format autodetection would be 
good to have. AFAIK Xilinx is using 3 formats now where 2 are legacy and FRU 
which is very similar to onie-tlv.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs



More information about the U-Boot mailing list