mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] nvmem: rockchip-otp: implement SoC UID reading
Date: Wed, 18 Mar 2026 11:32:33 +0100	[thread overview]
Message-ID: <abp_QTdP5UyvhdXq@pengutronix.de> (raw)
In-Reply-To: <zr3s6fhjqpwnfzu5oat3bk2qniatbjp246qlazxz7cluu5qh3p@z4kbl43wq2je>

On Tue, Mar 17, 2026 at 10:44:32PM +0100, Marco Felsch wrote:
> Hi Sascha,
> 
> On 26-03-17, Sascha Hauer wrote:
> > The Rockchip SoCs supported by the rockchip-otp driver have a SoC UID in
> > the OTP data. Read it out and forward it to barebox. The raw SoC UID
> > goes through some crc32 code before it is used. This is based on U-Boot
> > code which itself is based on the Rockchip Downstream Linux support.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  drivers/nvmem/rockchip-otp.c | 54 ++++++++++++++++++++++++++++++++++--
> >  1 file changed, 51 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c
> > index d2145bba52..041d628480 100644
> > --- a/drivers/nvmem/rockchip-otp.c
> > +++ b/drivers/nvmem/rockchip-otp.c
> > @@ -9,6 +9,7 @@
> >  #include <common.h>
> >  #include <driver.h>
> >  #include <init.h>
> > +#include <crc.h>
> >  #include <of.h>
> >  #include <of_device.h>
> >  #include <linux/clk.h>
> > @@ -86,6 +87,7 @@ struct rockchip_data {
> >  	const char * const *clks;
> >  	int num_clks;
> >  	int (*reg_read)(void *ctx, unsigned int reg, void *val, size_t val_size);
> > +	int cpuid_offset;
> 		^
> Would be nice to have it as function hook, like the reg_read() in case
> RK SoCs find just another way to readout the ID in the future or the ID
> gets more bits (like NXP did for the i.MX8MP).
> 
> In such cases the function hook is more future proof.

I think this is easy enough to refactor once we get in this situation
and once we really know in which way we have to adjust.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2026-03-18 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 13:47 Sascha Hauer
2026-03-17 21:44 ` Marco Felsch
2026-03-18 10:32   ` Sascha Hauer [this message]
2026-03-20  6:35 ` Sascha Hauer

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=abp_QTdP5UyvhdXq@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.felsch@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox