On 11/23/22 10:11, Michal Simek wrote:


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-mich...@walle.cc/

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

Hasn't been implemented yet. I personally don't have such a layout, so
I haven't added it.

--Sean

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


Reply via email to