From patchwork Thu Sep 1 12:27:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1119042 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p81CTofl016745 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 1 Sep 2011 12:30:11 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qz6O9-00016m-2a; Thu, 01 Sep 2011 12:28:59 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qz6O5-0001AP-Dj; Thu, 01 Sep 2011 12:28:53 +0000 Received: from mail-ww0-f49.google.com ([74.125.82.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qz6N3-0000oz-Du for linux-arm-kernel@lists.infradead.org; Thu, 01 Sep 2011 12:27:50 +0000 Received: by mail-ww0-f49.google.com with SMTP id 10so1275855wwf.18 for ; Thu, 01 Sep 2011 05:27:49 -0700 (PDT) Received: by 10.216.161.200 with SMTP id w50mr116114wek.69.1314880068995; Thu, 01 Sep 2011 05:27:48 -0700 (PDT) Received: from localhost.localdomain (cpc2-aztw13-0-0-cust146.aztw.cable.virginmedia.com [77.99.12.147]) by mx.google.com with ESMTPS id r57sm355985weq.12.2011.09.01.05.27.47 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Sep 2011 05:27:48 -0700 (PDT) From: 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 Message-Id: <1314880043-22517-5-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314880043-22517-1-git-send-email-lee.jones@linaro.org> References: <1314880043-22517-1-git-send-email-lee.jones@linaro.org> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110901_082749_717139_6595A2EB X-CRM114-Status: GOOD ( 15.94 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] Cc: jamie@jamieiles.com, gregkh@suse.de, Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 01 Sep 2011 12:30:11 +0000 (UTC) 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 --- 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; idev.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