diff mbox series

rk3399: r4s: Derive local MAC address if EEPROM is missing

Message ID 20220927150521.26036-1-christian@kohlschutter.com
State Accepted
Commit c2d5edff916379abd2da4590e8171c965d9a3e1d
Delegated to: Kever Yang
Headers show
Series rk3399: r4s: Derive local MAC address if EEPROM is missing | expand

Commit Message

Christian Kohlschütter Sept. 27, 2022, 3:05 p.m. UTC
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.

Enable configuration options that allow deriving a local MAC address
from the CPU serial number.
---
 configs/nanopi-r4s-rk3399_defconfig | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kever Yang April 25, 2023, 3:48 a.m. UTC | #1
Hi Christian,

     Sorry for reply late for this patch, could you pls send again with 
sign-off-by.

for the code change looks OK for me.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever

On 2022/9/27 23:05, Christian Kohlschütter 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.
>
> Enable configuration options that allow deriving a local MAC address
> from the CPU serial number.
> ---
>   configs/nanopi-r4s-rk3399_defconfig | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
> index 46ba07f4d5..aa89ac5854 100644
> --- a/configs/nanopi-r4s-rk3399_defconfig
> +++ b/configs/nanopi-r4s-rk3399_defconfig
> @@ -63,3 +63,7 @@ CONFIG_VIDEO_ROCKCHIP=y
>   CONFIG_DISPLAY_ROCKCHIP_HDMI=y
>   CONFIG_SPL_TINY_MEMSET=y
>   CONFIG_ERRNO_STR=y
> +CONFIG_MISC=y
> +CONFIG_MISC_INIT_R=y
> +CONFIG_ROCKCHIP_EFUSE=y
> +CONFIG_ROCKCHIP_OTP=y
diff mbox series

Patch

diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
index 46ba07f4d5..aa89ac5854 100644
--- a/configs/nanopi-r4s-rk3399_defconfig
+++ b/configs/nanopi-r4s-rk3399_defconfig
@@ -63,3 +63,7 @@  CONFIG_VIDEO_ROCKCHIP=y
 CONFIG_DISPLAY_ROCKCHIP_HDMI=y
 CONFIG_SPL_TINY_MEMSET=y
 CONFIG_ERRNO_STR=y
+CONFIG_MISC=y
+CONFIG_MISC_INIT_R=y
+CONFIG_ROCKCHIP_EFUSE=y
+CONFIG_ROCKCHIP_OTP=y