From patchwork Wed Dec 4 11:53:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 1204144 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Scx12F9dz9sR8 for ; Wed, 4 Dec 2019 23:05:09 +1100 (AEDT) Received: by phobos.denx.de (Postfix, from userid 109) id 7DA8681532; Wed, 4 Dec 2019 13:04:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D0F9280668; Wed, 4 Dec 2019 12:54:35 +0100 (CET) Authentication-Results: mail.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3234C81532; Wed, 4 Dec 2019 12:54:34 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id D612580668 for ; Wed, 4 Dec 2019 12:54:02 +0100 (CET) Authentication-Results: mail.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 98AAA31B; Wed, 4 Dec 2019 03:54:01 -0800 (PST) Received: from usa.arm.com (a074948-lin.blr.arm.com [10.162.4.147]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 322CB3F68E; Wed, 4 Dec 2019 03:53:59 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Subject: [PATCH 0/7] Add a random number generator uclass Date: Wed, 4 Dec 2019 17:23:36 +0530 Message-Id: <1575460423-5080-1-git-send-email-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.7.4 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at mail.denx.de X-Virus-Status: Clean Add a random number generator(rng) uclass to facilitate adding drivers for rng devices. I plan to add an implementation of the EFI_RNG_PROTOCOL, which would get the random number from the rng uclass -- the protocol would be used by the efi stub for getting a random number for the kaslr feature. The patch series also adds a driver for the rng device found on the stm32mp1 platforms. A dummy rng driver for sandbox has also been added, along with the unit test for the rng uclass. Sughosh Ganu (7): dm: rng: Add random number generator(rng) uclass clk: stm32mp1: Add a clock entry for RNG1 device stm32mp1: rng: Add a driver for random number generator(rng) device configs: stm32mp15: Enable random number generator(rng) device sandbox: rng: Add a random number generator(rng) driver configs: sandbox: Enable random number generator(rng) device test: rng: Add basic test for random number generator(rng) uclass arch/sandbox/dts/test.dts | 4 + configs/sandbox64_defconfig | 2 + configs/sandbox_defconfig | 2 + configs/stm32mp15_basic_defconfig | 2 + configs/stm32mp15_optee_defconfig | 2 + configs/stm32mp15_trusted_defconfig | 2 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/clk/clk_stm32mp1.c | 1 + drivers/rng/Kconfig | 21 +++++ drivers/rng/Makefile | 8 ++ drivers/rng/rng-uclass.c | 23 +++++ drivers/rng/sandbox_rng.c | 36 ++++++++ drivers/rng/stm32mp1_rng.c | 164 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/rng.h | 25 ++++++ test/dm/Makefile | 1 + test/dm/rng.c | 26 ++++++ 18 files changed, 323 insertions(+) create mode 100644 drivers/rng/Kconfig create mode 100644 drivers/rng/Makefile create mode 100644 drivers/rng/rng-uclass.c create mode 100644 drivers/rng/sandbox_rng.c create mode 100644 drivers/rng/stm32mp1_rng.c create mode 100644 include/rng.h create mode 100644 test/dm/rng.c