All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@kernel.org>
To: "Christian Kohlschütter" <christian@kohlschutter.com>
Cc: u-boot@lists.denx.de, Kever Yang <kever.yang@rock-chips.com>,
	 Simon Glass <sjg@chromium.org>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	 Xiaobo Tian <peterwillcn@gmail.com>
Subject: Re: [PATCH] rockchip: rk3399: add ethaddr and serial# init, enable for R4S
Date: Mon, 26 Sep 2022 19:59:41 +0800	[thread overview]
Message-ID: <CAGb2v67ebv5hyzLMzQYnrCzSRO1Y713-M7AgWNnicQpWHgV=jw@mail.gmail.com> (raw)
In-Reply-To: <20220925170733.19787-1-christian@kohlschutter.com>

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

  reply	other threads:[~2022-09-26 12:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 17:07 [PATCH] rockchip: rk3399: add ethaddr and serial# init, enable for R4S Christian Kohlschütter
2022-09-26 11:59 ` Chen-Yu Tsai [this message]
2022-09-26 21:27   ` Christian Kohlschütter
2022-09-27  4:23     ` Chen-Yu Tsai
2022-09-27 15:06       ` Christian Kohlschütter
2022-09-26 21:23 Christian Kohlschütter
2022-09-27 15:07 ` Christian Kohlschütter
2022-09-28  7:50 ` Kever Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGb2v67ebv5hyzLMzQYnrCzSRO1Y713-M7AgWNnicQpWHgV=jw@mail.gmail.com' \
    --to=wens@kernel.org \
    --cc=christian@kohlschutter.com \
    --cc=kever.yang@rock-chips.com \
    --cc=peterwillcn@gmail.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.