From patchwork Wed Sep 4 20:25:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 19767 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 240DB25AC6 for ; Wed, 4 Sep 2013 20:25:45 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q5sf800824yen.0 for ; Wed, 04 Sep 2013 13:25:44 -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=6o9+e5E69yC2WU9MFieGTXA19UOXi21x+AdroYuRq6g=; b=kT2r2Vj1hAS88jZZFycly9SQkGjK2JDqO8FwV7O3alVqmnsi99094hWWQqcuN/5A09 Zog+4LjlWSWIKnixq7NNBwGp58zxKAJg/34OzsXU7KpIEuMa1+LJeG/ccA9HM3I7cQDT r0DonHdlb/9YxgPlP56hjsf5wPMX7L3xvWY88Gp4TCmJqveqN2Nh+sOrY4ZI2cJDZRHj FNdnm5HfM2n/0UXdyHdw1IzlU0AS9fas6LWSrzKsKwrKkAM2O9/ItMYBsqS0oLfx8Fhn VrJgWcJMFrf39aieBgUM26b7hNh5Nxpp53Xu3oqfKKCuA/Lkkr0WBjDzJO/wyYdsnmSM 6c0A== X-Received: by 10.236.140.130 with SMTP id e2mr1610919yhj.10.1378326344769; Wed, 04 Sep 2013 13:25:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.169 with SMTP id d9ls294985qed.61.gmail; Wed, 04 Sep 2013 13:25:44 -0700 (PDT) X-Received: by 10.220.74.69 with SMTP id t5mr3559437vcj.18.1378326344653; Wed, 04 Sep 2013 13:25:44 -0700 (PDT) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by mx.google.com with ESMTPS id xe6si6301666vdb.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Sep 2013 13:25:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.48 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.48; Received: by mail-vb0-f48.google.com with SMTP id w16so513197vbf.7 for ; Wed, 04 Sep 2013 13:25:44 -0700 (PDT) X-Gm-Message-State: ALoCoQkIpaPWh7T2kPLW7UYFT326g1BLwYCx5FUEOyBg6ncptWDa15+2A3q/QGJkhreLQQHAnafT X-Received: by 10.220.91.16 with SMTP id k16mr495667vcm.21.1378326344516; Wed, 04 Sep 2013 13:25:44 -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 u4csp240694vcz; Wed, 4 Sep 2013 13:25:43 -0700 (PDT) X-Received: by 10.112.172.137 with SMTP id bc9mr3915826lbc.21.1378326342988; Wed, 04 Sep 2013 13:25:42 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id jk7si11435033lbc.145.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Sep 2013 13:25:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.53 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id el20so782517lab.40 for ; Wed, 04 Sep 2013 13:25:42 -0700 (PDT) X-Received: by 10.112.156.166 with SMTP id wf6mr3886271lbb.13.1378326342223; Wed, 04 Sep 2013 13:25:42 -0700 (PDT) Received: from localhost.localdomain (c83-249-208-223.bredband.comhem.se. [83.249.208.223]) by mx.google.com with ESMTPSA id ua4sm11383709lbb.17.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 04 Sep 2013 13:25:41 -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] ARM: omap2: throw the die id into the entropy pool Date: Wed, 4 Sep 2013 22:25:24 +0200 Message-Id: <1378326324-7170-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.48 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 Signed-off-by: Linus Walleij --- 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..fc03cc6 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; +} +device_initcall(omap_feed_randpool); + void __init omap2xxx_check_revision(void) { int i, j;