From patchwork Thu Sep 5 07:29:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 19768 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BBE6724869 for ; Thu, 5 Sep 2013 07:29:32 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id jy13sf440815veb.0 for ; Thu, 05 Sep 2013 00:29:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=P5NGnweQY7jlEkcw/OFH1VD18zZxUTfXQR5ar/LfmXw=; b=Ij1MVVk3yHWzk3qvtzFbdQpwWNltwz6Ctg0Hwxx8EPLc3TkQSyDdfReDQvf+JXVA7L e2QrDDKwUzSglL2i9jYuHZOEFpfb79iBHi67/Fp6WXD+BX6GWBvnLBtHUzZT/VwXB7+8 F+ZRRQpYyubb7cu6ThzPhFAJBdncfqz9Kb1468oa0Pv8JWBCqbLN/0m9dbL7UAYfYnev XFWQ3uBYtD3TjGTlfKM2Iqcr9B89YiJ64AOMX812FxI1k35NXX2qlSeK7qo+T3vRI28N Ji7NwFwsuusclZMmmt+2sjWd9C+XZZPh9jOVpRxtUf3SXH9MXtZ5EZa/57Va8z0CaErV v6LA== X-Received: by 10.236.115.198 with SMTP id e46mr2768553yhh.33.1378366171702; Thu, 05 Sep 2013 00:29:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.102 with SMTP id 6ls17306qel.40.gmail; Thu, 05 Sep 2013 00:29:31 -0700 (PDT) X-Received: by 10.58.235.69 with SMTP id uk5mr6490744vec.17.1378366171573; Thu, 05 Sep 2013 00:29:31 -0700 (PDT) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id k20si6898782vco.61.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Sep 2013 00:29:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.53; Received: by mail-vb0-f53.google.com with SMTP id i3so859242vbh.40 for ; Thu, 05 Sep 2013 00:29:29 -0700 (PDT) X-Gm-Message-State: ALoCoQlNwWw4yib3MIFTVz+zqpBDmaoy2saoMNnRncVZO4KgQ0KBSjPR8GNi7HJgOX0KeGwQ6a70 X-Received: by 10.52.120.78 with SMTP id la14mr1382454vdb.9.1378366169237; Thu, 05 Sep 2013 00:29:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp264706vcz; Thu, 5 Sep 2013 00:29:28 -0700 (PDT) X-Received: by 10.152.29.201 with SMTP id m9mr6339801lah.6.1378366167949; Thu, 05 Sep 2013 00:29:27 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by mx.google.com with ESMTPS id d5si12339432laf.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Sep 2013 00:29:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.46 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id eh20so1222005lab.5 for ; Thu, 05 Sep 2013 00:29:27 -0700 (PDT) X-Received: by 10.152.22.227 with SMTP id h3mr197679laf.39.1378366167034; Thu, 05 Sep 2013 00:29:27 -0700 (PDT) Received: from localhost.localdomain (c83-249-210-224.bredband.comhem.se. [83.249.210.224]) by mx.google.com with ESMTPSA id u20sm12250354lbh.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 05 Sep 2013 00:29:26 -0700 (PDT) From: Linus Walleij To: Tony Lindgren Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Linus Walleij , Theodore Ts'o , Paul Walmsley Subject: [PATCH v2] ARM: omap2: throw the die id into the entropy pool Date: Thu, 5 Sep 2013 09:29:18 +0200 Message-Id: <1378366158-31183-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Atleast eight bytes of this number are totally unique for the device it seems, so this is a perfect candidate for feeding the entropy pool. One byte more or less of constants does not matter so feed in the entire OID struct. Cc: Theodore Ts'o Cc: Paul Walmsley Reviewed-by: Kevin Hilman Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Use omap_device_initcall() to avoid calling on non-OMAPs. --- arch/arm/mach-omap2/id.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 2dc62a2..9260d09 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #ifdef CONFIG_SOC_BUS @@ -130,6 +131,17 @@ void omap_get_die_id(struct omap_die_id *odi) odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3); } +static int __init omap_feed_randpool(void) +{ + struct omap_die_id odi; + + /* Throw the die ID into the entropy pool at boot */ + omap_get_die_id(&odi); + add_device_randomness(&odi, sizeof(odi)); + return 0; +} +omap_device_initcall(omap_feed_randpool); + void __init omap2xxx_check_revision(void) { int i, j;