public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] ARM: mx6: Add function to read UNIQUE_ID
Date: Thu, 4 Feb 2021 15:41:19 -0500	[thread overview]
Message-ID: <20210204204119.GH10169@bill-the-cat> (raw)
In-Reply-To: <20210204202948.1609959-1-sean.anderson@seco.com>

On Thu, Feb 04, 2021 at 03:29:48PM -0500, Sean Anderson wrote:

> This is almost identical to the imx7 version, except that the register
> names are different.
> 
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> ---
> 
>  arch/arm/mach-imx/mx6/soc.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
> index bf6dddfdc9..cb729be46f 100644
> --- a/arch/arm/mach-imx/mx6/soc.c
> +++ b/arch/arm/mach-imx/mx6/soc.c
> @@ -11,6 +11,7 @@
>  #include <linux/delay.h>
>  #include <linux/errno.h>
>  #include <asm/io.h>
> +#include <asm/setup.h>
>  #include <asm/arch/imx-regs.h>
>  #include <asm/arch/clock.h>
>  #include <asm/arch/sys_proto.h>
> @@ -705,6 +706,38 @@ int arch_misc_init(void)
>  }
>  #endif
>  
> +#ifdef CONFIG_SERIAL_TAG
> +/*
> + * UNIQUE_ID describes a unique ID based on silicon wafer
> + * and die X/Y position
> + *
> + * UNIQUE_ID offset 0x410
> + * 31:0 fuse 0
> + * FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID
> + *
> + * UNIQUE_ID offset 0x420
> + * 31:24 fuse 1
> + * The X-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID
> + * 23:16 fuse 1
> + * The Y-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID
> + * 15:11 fuse 1
> + * The wafer number of the wafer on which the device was fabricated/SJC
> + * CHALLENGE/ Unique ID
> + * 10:0 fuse 1
> + * FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID
> + */
> +void get_board_serial(struct tag_serialnr *serialnr)
> +{
> +	struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
> +	struct fuse_bank *bank = &ocotp->bank[0];
> +	struct fuse_bank0_regs *fuse =
> +		(struct fuse_bank0_regs *)bank->fuse_regs;
> +
> +	serialnr->low = fuse->uid_low;
> +	serialnr->high = fuse->uid_high;
> +}
> +#endif
> +
>  /*
>   * gpr_init() function is common for boards using MX6S, MX6DL, MX6D,
>   * MX6Q and MX6QP processors

NAK.  This needs to use the normal mechanism to populate "serial#"
directly and not abuse the old ATAG infrastructure.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210204/d63e1f4e/attachment.sig>

  reply	other threads:[~2021-02-04 20:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 20:29 [PATCH] ARM: mx6: Add function to read UNIQUE_ID Sean Anderson
2021-02-04 20:41 ` Tom Rini [this message]
2021-02-04 20:52   ` Sean Anderson
2021-02-04 21:04     ` Tom Rini
2021-02-04 21:46       ` Sean Anderson
2021-02-04 21:41     ` Heinrich Schuchardt
2021-02-04 21:55       ` Tom Rini
2021-02-04 20:52 ` Heinrich Schuchardt
2021-02-04 20:56   ` Sean Anderson
2021-02-04 21:09     ` Tom Rini
2021-02-04 21:46       ` Heinrich Schuchardt

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=20210204204119.GH10169@bill-the-cat \
    --to=trini@konsulko.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox