> On 26. Sep 2022, at 13:59, Chen-Yu Tsai <w...@kernel.org> wrote: > > On Mon, Sep 26, 2022 at 7:53 PM Christian Kohlschütter > <christ...@kohlschutter.com> wrote: >> >> Some RK3399 boards, such as newer revisions of NanoPi R4S, do not >> provide an EEPROM chip containing a globally unique MAC address. >> >> Currently, this means that a randomly generated temporary MAC address >> may be generated each time the device is rebooted, leading to ARP cache >> issues and other confusing bugs. >> >> Since RK3399 CPUs provide a built-in unique serial number, we can >> reliably derive a locally MAC address from it by reading the >> corresponding bits from the non-secure efuse block. >> >> Port from uboot-rockchip 0c294d0, fix compilation issues and adjust >> coding style. >> >> rockchip: board: puma_rk3399: derive ethaddr from cpuid >> rockchip: board: puma_rk3399: add support for serial# and cpuid# >> rockchip: efuse: add (misc) driver for RK3399 non-secure efuse block >> via efuses >> >> Signed-off-by: Christian Kohlschütter <christ...@kohlschutter.com> >> --- >> board/rockchip/evb_rk3399/evb-rk3399.c | 120 +++++++++++++++++++++++++ >> configs/nanopi-r4s-rk3399_defconfig | 4 + >> drivers/misc/Makefile | 2 +- > > There's already code in arch/arm/mach-rockchip/misc.c that does pretty much > the same thing. > > IIRC all you need to do is enable MISC_INIT_R and ROCKCHIP_EFUSE > or ROCKCHIP_OTP. > > ChenYu
Oh cool, thanks ChenYu! Is there a reason to not enable these options by default (at least for the R4S)? Following up with "[PATCH] rockchip: rk3399: add ethaddr and serial# init, enable for R4S", which enables these settings in configs/nanopi-r4s-rk3399_defconfig. Cheers, Christian