Re: [PATCH v5 0/5] net: Derive stable MAC addresses from a unique device ID
From: Alexey Charkov
Date: Fri Dec 04 2026 - 03:51:11 EST
Hi Ricardo,
On Fri, Dec 4, 2026 at 6:18 AM Ricardo Pardini <ricardo@xxxxxxxxxxx> wrote:
>
> On 25/11/2026 20:36, Alexey Charkov wrote:
> > Rockchip SoCs are shipped with a unique CPU ID in their internal OTP
> > memory, and Rockchip bootloaders use it to give boards which have no
> > dedicated storage for a MAC address a stable one anyway: they hash the CPU
> > ID and patch the resulting addresses into the device tree they hand over.
> >
> > Kernels started without that fixup, e.g. straight from the SPL in Falcon
> > mode or by any other loader which does not implement Rockchip's derivation,
> > fall back to random MAC addresses which change on every boot.
> >
> > Derive the addresses in of_get_mac_address() instead, as the last resort
> > after any stored address, from a "unique-id" NVMEM cell referenced by
> > the Ethernet controller, so that a Linux image can use the same stable
> > addresses regardless of the boot flow.
> > [...]
> Hi Alexey,
>
> I tested the whole series on v7.4-rc5 on a Seeed reComputer RK3576 Dev Kit
> (both GMACs, ethernet0/1; DT for the board is submitted with an upcoming
> v2).
>
> With U-Boot (mainline v2026.07) the fixed-up local-mac-address still wins,
> as intended. Without u-boot proper, it gives both GMACs exactly the
> addresses U-Boot would assign, and both links come up. Thus:
>
> Tested-by: Ricardo Pardini <ricardo@xxxxxxxxxxx> # Seeed reComputer RK3576 Dev Kit
Brilliant, thanks a lot for testing and reporting back!
> I also carried the approach over to RK3588 and RK356x, and it fits them
> well:
>
> - the RK3588 OTP cells move into a fixed layout without trouble, the same
> as your RK3576 patch; RK356x already had one
> - the "rockchip,cpuid" compatible goes onto the RK3588 (id@7) and RK356x
> (id@a) CPU ID cells as is
> - the GMAC "unique-id" references apply the same way. On a Mekotronics
> R58X-Pro (RK3588, gmac0 + gmac1) both GMACs got exactly U-Boot's
> addresses, and so did the single GMAC (gmac1) on a Mixtile Edge 2 (RK3568)
> - it also works for PCIe NICs: on a Mixtile Blade 3 (RK3588, not submitted yet),
> the two RTL8125B behind the PCIe switch get ethernet0/1 aliases and a
> "unique-id" reference each, and r8169 picks the derived addresses up
> through of_get_mac_address() with no driver changes.
>
> So all in all, the approach works and carries over nicely to RK356x/88. I
> can send the RK3588 and RK356x DT patches once this lands, unless you'd
> rather carry them, just let me know
I believe it would be better if you send them directly, given that you
have the hardware for tests, while I don't :)
Best regards,
Alexey