From patchwork Wed Jul 18 12:06:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Stigge X-Patchwork-Id: 1210811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 43E293FD4F for ; Wed, 18 Jul 2012 12:15:52 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SrT5q-0006VD-Bn; Wed, 18 Jul 2012 12:11:02 +0000 Received: from mail.work-microwave.de ([62.245.205.51] helo=work-microwave.de) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SrT23-0006Q2-RB for linux-arm-kernel@lists.infradead.org; Wed, 18 Jul 2012 12:07:12 +0000 Received: from rst-pc1.lan.work-microwave.de ([192.168.11.78]) (authenticated bits=0) by mail.work-microwave.de with ESMTP id q6IC72kS001734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Jul 2012 13:07:03 +0100 Received: by rst-pc1.lan.work-microwave.de (Postfix, from userid 1000) id D6AF7AE06E; Wed, 18 Jul 2012 14:07:02 +0200 (CEST) From: Roland Stigge To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kevin.wells@nxp.com, srinivas.bakki@nxp.com, aletes.xgr@gmail.com Subject: [PATCH 1/4] ARM: LPC32xx: Set system serial based on cpu unique id Date: Wed, 18 Jul 2012 14:06:48 +0200 Message-Id: <1342613211-13190-2-git-send-email-stigge@antcom.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1342613211-13190-1-git-send-email-stigge@antcom.de> References: <1342613211-13190-1-git-send-email-stigge@antcom.de> X-FEAS-SYSTEM-WL: rst@work-microwave.de, 192.168.11.78 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Roland Stigge X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 From: Alexandre Pereira da Silva LPC32xx SoC has a 128 bits unique id that can be used as a system serial number, if none has been provided by atags or dt. Signed-off-by: Alexandre Pereira da Silva Signed-off-by: Roland Stigge --- arch/arm/mach-lpc32xx/common.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- linux-2.6.orig/arch/arm/mach-lpc32xx/common.c +++ linux-2.6/arch/arm/mach-lpc32xx/common.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -224,7 +225,7 @@ void lpc23xx_restart(char mode, const ch ; } -static int __init lpc32xx_display_uid(void) +static int __init lpc32xx_check_uid(void) { u32 uid[4]; @@ -233,6 +234,11 @@ static int __init lpc32xx_display_uid(vo printk(KERN_INFO "LPC32XX unique ID: %08x%08x%08x%08x\n", uid[3], uid[2], uid[1], uid[0]); + if (!system_serial_low && !system_serial_high) { + system_serial_low = uid[0]; + system_serial_high = uid[1]; + } + return 1; } -arch_initcall(lpc32xx_display_uid); +arch_initcall(lpc32xx_check_uid);