mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>,
	Chris Healy <cphealy@gmail.com>
Subject: [PATCH] ARM: VFxxx: Display UID information on boot
Date: Mon,  2 Dec 2019 06:56:03 -0800	[thread overview]
Message-ID: <20191202145603.738-1-andrew.smirnov@gmail.com> (raw)

Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/include/mach/vf610.h | 2 ++
 arch/arm/mach-imx/vf610.c              | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/arch/arm/mach-imx/include/mach/vf610.h b/arch/arm/mach-imx/include/mach/vf610.h
index 6d00d2e45..7ac10a7b1 100644
--- a/arch/arm/mach-imx/include/mach/vf610.h
+++ b/arch/arm/mach-imx/include/mach/vf610.h
@@ -48,4 +48,6 @@ static inline int vf610_cpu_revision(void)
 	return readl(VF610_ROM_VERSION_OFFSET) & 0xff;
 }
 
+u64 vf610_uid(void);
+
 #endif
diff --git a/arch/arm/mach-imx/vf610.c b/arch/arm/mach-imx/vf610.c
index b548cbcb5..2fbd6393e 100644
--- a/arch/arm/mach-imx/vf610.c
+++ b/arch/arm/mach-imx/vf610.c
@@ -19,6 +19,7 @@
 #include <mach/revision.h>
 #include <mach/vf610.h>
 #include <mach/reset-reason.h>
+#include <mach/ocotp.h>
 
 static const struct imx_reset_reason vf610_reset_reasons[] = {
 	{ VF610_SRC_SRSR_POR_RST,       RESET_POR,   0 },
@@ -30,6 +31,11 @@ static const struct imx_reset_reason vf610_reset_reasons[] = {
 	{ /* sentinel */ }
 };
 
+u64 vf610_uid(void)
+{
+	return imx_ocotp_read_uid(IOMEM(VF610_OCOTP_BASE_ADDR));
+}
+
 int vf610_init(void)
 {
 	const char *cputypestr;
@@ -57,5 +63,7 @@ int vf610_init(void)
 
 	imx_set_silicon_revision(cputypestr, vf610_cpu_revision());
 	imx_set_reset_reason(src + IMX_SRC_SRSR, vf610_reset_reasons);
+	pr_info("%s unique ID: %llx\n", cputypestr, vf610_uid());
+
 	return 0;
 }
-- 
2.21.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2019-12-02 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02 14:56 Andrey Smirnov [this message]
2019-12-04  7:23 ` 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=20191202145603.738-1-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=cphealy@gmail.com \
    /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