[PATCH] ARM: mach-imx: set system_serial from ocotp registers

Stefan Lengfeld contact at stefanchrist.eu
Fri Nov 27 05:22:52 EST 2020


Hi Arnd and Robert,

On Thu, Nov 26, 2020 at 08:35:24PM +0100, Arnd Bergmann wrote:
> On Thu, Nov 26, 2020 at 4:28 PM Robert Karszniewicz
> <r.karszniewicz at phytec.de> wrote:
> >
> > From: Stefan Christ <s.christ at phytec.de>
> >
> > The i.MX6 fuses have two 32 bit registers (OCOTP_CFG0 and OCOTP_CFG1)
> > that contain an 64 bit unique id. Use them to setup the system serial,
> > which can be seen in '/proc/cpuinfo'.
> >
> > Signed-off-by: Stefan Christ <s.christ at phytec.de>
> > Signed-off-by: Yunus Bas <y.bas at phytec.de>
> > Cc: Stefan Lengfeld <contact at stefanchrist.eu>
> > Signed-off-by: Robert Karszniewicz <r.karszniewicz at phytec.de>
> > ---
> > Hello,
> >
> > I've noticed that arch/arm/mach-imx/ocotp.c duplicates functionality of
> > drivers/soc/imx/soc-imx.c . Should this be resolved?
> 
> I think it would be best to just have drivers/soc/imx/soc-imx.c
> and not add another one. In particular, the serial number is
> not normally exposed through system_serial_low/system_serial_high
> these days, but rather the architecture-independent soc device.
  
I would also suggest to just drop the patch.

Reading the serial number was added in 2019/v5.5 to the mainline kernel.
See commit 8267ff89b7131 ("ARM: imx: Add serial number support for
i.MX6/7 SoCs"):

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8267ff89b7131

It's just exposed at "/sys/devices/soc0/serial_number" instead of in
"/proc/cpuinfo" to userspace.

Kind regards,
Stefan



More information about the linux-arm-kernel mailing list