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: 2853845 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1B9E3C0AB5 for ; Wed, 4 Sep 2013 20:26:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1157320519 for ; Wed, 4 Sep 2013 20:26:17 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2277B20515 for ; Wed, 4 Sep 2013 20:26:16 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VHJeV-00006x-9X; Wed, 04 Sep 2013 20:26:11 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VHJeT-0007dR-3A; Wed, 04 Sep 2013 20:26:09 +0000 Received: from mail-lb0-f175.google.com ([209.85.217.175]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VHJeP-0007cY-68 for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2013 20:26:06 +0000 Received: by mail-lb0-f175.google.com with SMTP id y6so862126lbh.6 for ; Wed, 04 Sep 2013 13:25:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6o9+e5E69yC2WU9MFieGTXA19UOXi21x+AdroYuRq6g=; b=Uf9MHYv86MgCwBECnzlxM6AxY9BoSVeda4TNSTOMEW/IHJF7M+xUb7yX8jDF/PTz0N H569FiCnVLnDbHQTZh8YqMA+0Zhf/BJi98NaLmCT6JAMY3IlKmgkAv5qaTudz2138uzk fQGLSxGq+x3FI5SWOcPp8lGveTGAXhFYiWkp5kdWUElAEIAVB+W/1Xzb1of0STg1csu5 fsWwPXondBoBvdKF8PiLT2MS5eVHxCTV4ZUkXifj427yf3bWbLtuUKYdLVZy3/D8VfeJ /trXf2MFR005G+r7wk/pnoqWrw0m3C2dffLXE9PCA889HKyqnd83b4zCz+cil/QT1u4t HKPA== X-Gm-Message-State: ALoCoQka7iYMcu/VWxq/03r7CzjD1lD0JhWMH5z/avjVYbk0cIHjqi/8WCPpBx2H8qYtHNQiAwuh 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130904_162605_362028_F6E6C957 X-CRM114-Status: GOOD ( 11.13 ) X-Spam-Score: -2.6 (--) Cc: Linus Walleij , linux-omap@vger.kernel.org, Theodore Ts'o , Paul Walmsley , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Kevin Hilman --- 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;