From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] mach-ux500: add a SoC ID (serial) callback for the u8500
Date: Thu, 1 Sep 2011 13:27:23 +0100 [thread overview]
Message-ID: <1314880043-22517-5-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1314880043-22517-1-git-send-email-lee.jones@linaro.org>
With this patch applied the Export SoC Information framework
will be able to callback into u8500 Platform code in order to
probe for the SoC's unique Identification (serial) number.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/mach-ux500/cpu-db8500.c | 16 ++++++++++++++++
arch/arm/mach-ux500/include/mach/db8500-regs.h | 4 ++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 655639e..9824cd3 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -167,6 +167,20 @@ static void __init db8500_add_gpios(void)
IRQ_DB8500_GPIO0, &pdata);
}
+static const char *db8500_get_soc_id(void)
+{
+ void __iomem *uid_base;
+ char buf[1024];
+ ssize_t sz = 0;
+ int i;
+
+ uid_base = __io_address(U8500_BB_UID_BASE);
+ for (i = 0; i < U8500_BB_UID_LENGTH; i++) {
+ sz += sprintf(buf + sz, "%08x", readl(uid_base + i * sizeof(u32)));
+ }
+ return kasprintf(GFP_KERNEL, "%s", buf);
+}
+
static int usb_db8500_rx_dma_cfg[] = {
DB8500_DMA_DEV38_USB_OTG_IEP_1_9,
DB8500_DMA_DEV37_USB_OTG_IEP_2_10,
@@ -208,6 +222,8 @@ void __init u8500_init_devices(void)
"cpufreq-u8500", -1, NULL, 0, NULL, 0);
if (soc_dev) {
+ soc_dev->pfn_soc_id = db8500_get_soc_id;
+
for (i=0; i<ARRAY_SIZE(platform_devs); i++)
platform_devs[i]->dev.parent = &soc_dev->dev;
}
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/include/mach/db8500-regs.h
index 0499971..f569d5c 100644
--- a/arch/arm/mach-ux500/include/mach/db8500-regs.h
+++ b/arch/arm/mach-ux500/include/mach/db8500-regs.h
@@ -166,4 +166,8 @@
#define U8500_MODEM_BASE 0xe000000
#define U8500_APE_BASE 0x6000000
+/* SoC identification number information */
+#define U8500_BB_UID_BASE (U8500_BACKUPRAM1_BASE + 0xFC0)
+#define U8500_BB_UID_LENGTH 5
+
#endif
--
1.7.4.1
next prev parent reply other threads:[~2011-09-01 12:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 12:27 [PATCH 1/5] Framework for exporting System-on-Chip information via sysfs Lee Jones
2011-09-01 12:27 ` [PATCH 2/5] Add documentation for new sysfs devices/soc functionality Lee Jones
2011-09-01 12:27 ` [PATCH 3/5] mach-ux500: export System-on-Chip information ux500 via sysfs Lee Jones
2011-09-02 14:31 ` Arnd Bergmann
2011-09-01 12:27 ` [PATCH 4/5] mach-ux500: move top level platform devices in sysfs to /sys/devices/soc/X Lee Jones
2011-09-01 12:27 ` Lee Jones [this message]
2011-09-02 14:22 ` [PATCH 5/5] mach-ux500: add a SoC ID (serial) callback for the u8500 Arnd Bergmann
2011-09-02 15:16 ` Lee Jones
2011-09-02 15:56 ` Arnd Bergmann
2011-09-01 23:34 ` [PATCH 1/5] Framework for exporting System-on-Chip information via sysfs Greg KH
2011-09-02 8:44 ` Lee Jones
2011-09-02 9:29 ` Jamie Iles
2011-09-02 9:37 ` Lee Jones
2011-09-02 9:56 ` Jamie Iles
2011-09-02 16:31 ` Greg KH
2011-09-02 17:22 ` Arnd Bergmann
2011-09-02 18:14 ` Greg KH
2011-09-06 9:41 ` Lee Jones
2011-09-06 19:33 ` Arnd Bergmann
2011-09-06 19:45 ` Greg KH
2011-09-07 6:14 ` Lee Jones
2011-09-02 14:02 ` Arnd Bergmann
2011-09-02 16:24 ` Greg KH
2011-09-02 17:32 ` Arnd Bergmann
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=1314880043-22517-5-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).