[PATCH] rockchip: rk3399: add ethaddr and serial# init, enable for R4S

Chen-Yu Tsai wens at kernel.org
Mon Sep 26 13:59:41 CEST 2022


On Mon, Sep 26, 2022 at 7:53 PM Christian Kohlschütter
<christian at 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 <christian at 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


More information about the U-Boot mailing list