Re: [PATCH v4 3/5] nvmem: rockchip-otp: Derive MAC addresses from the CPU ID
From: Andrew Lunn
Date: Wed Nov 25 2026 - 11:42:03 EST
> > That way of_get_mac_address_nvmem() just works, so the MAC driver just
> > needs to call of_get_mac_address() or of_get_ethdev_address().
>
> They still need to relax the size check as done by patch 2/5 in this
> series, because the CPUID cell is 16 bytes long. Srinivas rejected a
> prior version of this series that attempted to return cell contents of
> different sizes depending on the use case. Currently any cell size !=
> ETH_ALEN gets rejected by the net core, not just < ETH_ALEN.
Ah! I had not looked at the whole series.
Having to change the core like this is an argument for doing it in the
MAC driver. It asked for a MAC address. What it got back is not a MAC
address if it does not have 6 octets.
Please throw this all away and do it in the MAC driver. If there are
multiple RealTek MAC drivers involved, you can put it into a little
library and share it across the drivers.
It is actually an interesting idea. Maybe it should be placed in
of_net.c, so other drivers can use it. How generic is it having a CPU
ID in the OTP? Are there other vendors doing it?
Andrew