From patchwork Wed Oct 3 12:29:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11973 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A628624158 for ; Wed, 3 Oct 2012 12:29:46 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 563CEA18232 for ; Wed, 3 Oct 2012 12:29:46 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so16493274iej.11 for ; Wed, 03 Oct 2012 05:29:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=9LeDclCVEkhZ7R16iePN8r4VoyHqAmIFL5PRn9COTsg=; b=LGhvtPp4fESU3bzyt98uadXTXMjFQUcZqomPikKoJwOdOxXi/tBTzQ0wLR8LBYx7Sd deACZ6ASJgqJc+fpfn/tvSBJIffQ/EJuNKv/h1RHyZad9qT8lFbT3zUsgYjyno8c1GqG deJQstGu47eEI+dR6KZQLo8AvgccW91hUxu3Y6tHggynaFDMsHMxPZFrUgkik+of6gCP 0kZy2yC9eoyugp1D/TQrCK551cDFJGCPQugXa86IPSzj11Rf/GV2ebQB80ZqfyUYD+Es WqGO1sFM7l244Owc3KKu7xGtndoglBIGoWm8oq+U3P5Z/j/W0PfohVBWD5QD4EAlrqzC ONEA== Received: by 10.50.155.136 with SMTP id vw8mr1620564igb.28.1349267386000; Wed, 03 Oct 2012 05:29:46 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp5432igc; Wed, 3 Oct 2012 05:29:44 -0700 (PDT) Received: by 10.14.219.198 with SMTP id m46mr2413036eep.18.1349267384268; Wed, 03 Oct 2012 05:29:44 -0700 (PDT) Received: from eu1sys200aog116.obsmtp.com (eu1sys200aog116.obsmtp.com [207.126.144.141]) by mx.google.com with SMTP id f43si2963950eem.66.2012.10.03.05.29.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Oct 2012 05:29:44 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.141; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob116.postini.com ([207.126.147.11]) with SMTP ID DSNKUGwvss4teLjCbwXC59wNmPlBmA0PTSPL@postini.com; Wed, 03 Oct 2012 12:29:43 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 61DC8108; Wed, 3 Oct 2012 12:29:23 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F3ADD46B4; Wed, 3 Oct 2012 12:29:22 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id BDBA124C07C; Wed, 3 Oct 2012 14:29:15 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 3 Oct 2012 14:29:22 +0200 From: Linus Walleij To: Cc: Anmar Oueja , Linus Walleij , Theodore Tso Subject: [PATCH] ARM: ux500: add DB serial number to entropy pool Date: Wed, 3 Oct 2012 14:29:16 +0200 Message-ID: <1349267356-32171-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmVSqswI2mMIHEFUHug4mR+92v1ImVqr9rfhDkz8Np7lcE/2LE3RbQRigH/Sf4fmmMcPzW0 From: Linus Walleij This throws the DB (digital baseband, ASIC) serial number, process type etc into the entropy pool by way of the device_add_randomness() call. This should make every device have a unique pool state upon boot. Cc: Theodore Tso Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/cpu-db8500.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index bcdfe6b..50202a1 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -24,7 +26,6 @@ #include #include #include -#include #include #include "devices-db8500.h" @@ -187,6 +188,8 @@ static const char *db8500_read_soc_id(void) { void __iomem *uid = __io_address(U8500_BB_UID_BASE); + /* Throw these device-specific numbers into the entropy pool */ + add_device_randomness(uid, 0x14); return kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x", readl((u32 *)uid+1), readl((u32 *)uid+1), readl((u32 *)uid+2),