From: Baruch Siach <baruch@tkos.co.il>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] imx25: add support for UID read from eFuse
Date: Mon, 2 Aug 2010 14:58:52 +0300 [thread overview]
Message-ID: <13eb05d187d78209699157a4638dfc87414617a5.1280749932.git.baruch@tkos.co.il> (raw)
In-Reply-To: <cover.1280749932.git.baruch@tkos.co.il>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
arch/arm/mach-imx/imx25.c | 12 ++++++++++++
arch/arm/mach-imx/include/mach/generic.h | 1 +
arch/arm/mach-imx/include/mach/imx25-regs.h | 3 +++
3 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-imx/imx25.c b/arch/arm/mach-imx/imx25.c
index 00a1e4e..de70247 100644
--- a/arch/arm/mach-imx/imx25.c
+++ b/arch/arm/mach-imx/imx25.c
@@ -16,6 +16,8 @@
*/
#include <common.h>
+#include <mach/imx-regs.h>
+#include <asm/io.h>
#include "gpio.h"
@@ -28,3 +30,13 @@ void *imx_gpio_base[] = {
int imx_gpio_count = ARRAY_SIZE(imx_gpio_base) * 32;
+u64 imx_uid(void)
+{
+ u64 uid = 0;
+ int i;
+
+ for (i = 0; i < 8; i++)
+ uid = (uid << 8) | readb(IMX_IIM_BASE + IIM_UID + i*4);
+
+ return uid;
+}
diff --git a/arch/arm/mach-imx/include/mach/generic.h b/arch/arm/mach-imx/include/mach/generic.h
index 48ed336..4b89838 100644
--- a/arch/arm/mach-imx/include/mach/generic.h
+++ b/arch/arm/mach-imx/include/mach/generic.h
@@ -6,6 +6,7 @@ int imx_silicon_revision(void);
#define IMX35_CHIP_REVISION_1_0 0x10
#define IMX35_CHIP_REVISION_2_0 0x20
+u64 imx_uid(void);
#ifdef CONFIG_ARCH_IMX1
diff --git a/arch/arm/mach-imx/include/mach/imx25-regs.h b/arch/arm/mach-imx/include/mach/imx25-regs.h
index e91e7b6..7c2b5f9 100644
--- a/arch/arm/mach-imx/include/mach/imx25-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx25-regs.h
@@ -140,5 +140,8 @@
/* important definition of some bits of WCR */
#define WCR_WDE 0x04
+/* IIM fuse definitions */
+#define IIM_UID 0x820
+
#endif /* __ASM_ARCH_MX25_REGS_H */
--
1.7.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2010-08-02 11:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-02 11:58 [PATCH 0/3] arm/imx: serial number / UID support Baruch Siach
2010-08-02 11:58 ` [PATCH 1/3] arm: add support for the serial ATAG Baruch Siach
2010-08-02 12:13 ` Uwe Kleine-König
2010-08-02 11:58 ` Baruch Siach [this message]
2010-08-02 11:58 ` [PATCH 3/3] mx25 3ds: set CPU UID Baruch Siach
2010-08-02 12:02 ` [PATCH 0/3] arm/imx: serial number / UID support Jean-Christophe PLAGNIOL-VILLARD
2010-08-04 6:46 ` Baruch Siach
2010-08-04 10:25 ` Jean-Christophe PLAGNIOL-VILLARD
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=13eb05d187d78209699157a4638dfc87414617a5.1280749932.git.baruch@tkos.co.il \
--to=baruch@tkos.co.il \
--cc=barebox@lists.infradead.org \
/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