[PATCH 3/4] nvmem: layouts: Add Rockchip OTP CPUID layout driver
Miquel Raynal
miquel.raynal at bootlin.com
Wed Sep 2 02:40:52 PDT 2026
On 01/09/2026 at 19:33:13 +04, Alexey Charkov <alchark at flipper.net> wrote:
> Rockchip SoCs customarily use the CPU ID programmed into their on-chip OTP
> memory to derive stable Ethernet MAC addresses even when a board doesn't
> otherwise have dedicated storage for those. The derivation depends on the
> particular bootloader implementation (e.g. it is done by upstream U-Boot,
> which patches the derived MAC addresses at runtime into the device tree it
> hands to the kernel). Using less featureful bootloaders, such as direct
> boot to Linux from SPL, leaves the kernel with only a random MAC address
> instead, even though everything required for the derivation is equally
> available to Linux as it is to U-Boot.
>
> Reproduce the same derivation in the kernel and expose the result as an
> nvmem cell named "mac-address", so that of_get_mac_address() picks it up
> through its standard nvmem fallback. The address index comes from the DT
> phandle argument, which lets both interfaces of a dual Ethernet board
> share a single cell.
>
> Enable the layout by default on Rockchip, as consumers of its cells would
> otherwise defer their probe indefinitely.
>
> Signed-off-by: Alexey Charkov <alchark at flipper.net>
Quick review on my side, looks good to me.
Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>
More information about the linux-arm-kernel
mailing list