[PATCH v2] mkeficapsule: Miscellaneous fixes in the utility

2021-01-22 Thread Sughosh Ganu
Miscellaneous fixes in the mkeficapsule utility -- these include a few resource leak issues flagged by Coverity along with some additional code improvements suggested by Heinrich during code review. Signed-off-by: Sughosh Ganu --- Changes since V1: * Use a comparison with -1 for file

Re: [PATCH 1/3] efi_capsule: Move signature from DTB to .rodata

2021-07-15 Thread Sughosh Ganu
i_loader/efi_capsule_key.S | 8 + > 7 files changed, 39 insertions(+), 47 deletions(-) > delete mode 100644 board/emulation/common/qemu_capsule.c > create mode 100644 lib/efi_loader/efi_capsule_key.S > Tested the changes on Qemu arm64 virt platform. Tested-by: Sughosh Ganu -sug

Re: [PATCH 1/3 v2] efi_capsule: Move signature from DTB to .rodata

2021-07-20 Thread Sughosh Ganu
; you are going to apply. You *sign* the capsules with an external > application (like GenerateCapsule provided by edk2 and we can also > extend uboot's mkeficapsule for that). So we aren't signing anything > here > > Thanks > /Ilias > > /Ilias > > > &g

Re: [PATCH v4 14/14] qemu: arm64: Add documentation for capsule update

2021-03-02 Thread Sughosh Ganu
hi Heinrich, On Tue, 2 Mar 2021 at 16:45, Heinrich Schuchardt wrote: > On 30.12.20 14:57, Sughosh Ganu wrote: > > Add documentation highlighting the steps for using the uefi capsule > > update feature for updating the u-boot firmware image. > > > >

Re: [PATCH v4 14/14] qemu: arm64: Add documentation for capsule update

2021-03-02 Thread Sughosh Ganu
On Tue, 2 Mar 2021 at 21:27, Heinrich Schuchardt wrote: > On 02.03.21 15:48, Sughosh Ganu wrote: > > hi Heinrich, > > > > On Tue, 2 Mar 2021 at 16:45, Heinrich Schuchardt > <mailto:xypron.g...@gmx.de>> wrote: > > > > On 30.12.20 14:57, Su

Re: [PATCH v4 14/14] qemu: arm64: Add documentation for capsule update

2021-03-02 Thread Sughosh Ganu
On Tue, 2 Mar 2021 at 22:36, Heinrich Schuchardt wrote: > On 02.03.21 17:39, Sughosh Ganu wrote: > > > > > > On Tue, 2 Mar 2021 at 21:27, Heinrich Schuchardt > <mailto:xypron.g...@gmx.de>> wrote: > > > > On 02.03.21 15:48, Sughosh Ganu wrote:

Re: [PATCH] dfu: dfu_mtd: remove the mtd_block_op error when mtd_lock is not supported

2021-03-10 Thread Sughosh Ganu
;dfu_mtd: Add provision to unlock mtd device") > Signed-off-by: Patrick Delaunay > --- > Acked-by: Sughosh Ganu > > drivers/dfu/dfu_mtd.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd

Re: [PATCH 1/1] stm32mp1: rng: remove superfluous assignment

2020-02-18 Thread Sughosh Ganu
On Sun, 16 Feb 2020 at 14:41, Heinrich Schuchardt wrote: > We should not assign a value that is overwritten before use. > > Signed-off-by: Heinrich Schuchardt > Acked-by: Sughosh Ganu > --- > drivers/rng/stm32mp1_rng.c | 2 +- > 1 file changed, 1 insertion(+), 1 delet

Re: [PATCH 1/1] efi_loader: EFI_RNG_PROTOCOL

2020-02-18 Thread Sughosh Ganu
On Sat, 15 Feb 2020 at 04:04, Heinrich Schuchardt wrote: > Do not use quotation marks for Kconfig help text. > Replace rng abbreviation by full words. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_loader/Kconfig | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

Re: [PATCH 1/1] efi_loader: EFI_RNG_PROTOCOL

2020-02-18 Thread Sughosh Ganu
On Tue, 18 Feb 2020 at 19:44, Heinrich Schuchardt wrote: > > > On 2/18/20 11:26 AM, Sughosh Ganu wrote: > > > > On Sat, 15 Feb 2020 at 04:04, Heinrich Schuchardt > <mailto:xypron.g...@gmx.de>> wrote: > > > > Do not use quotation marks for Kconfi

Re: [PATCH 1/1] drivers/rng: add Amlogic hardware RNG driver

2020-02-26 Thread Sughosh Ganu
ata(dev); > + char *buffer = (char *)data; > + > + while (len) { > + u32 rand = readl(pdata->base); > + size_t step; > I believe declaration of variables in the middle of the function is frowned upon. Can be moved

Re: [PATCH 1/1] drivers/rng: add Amlogic hardware RNG driver

2020-02-26 Thread Sughosh Ganu
On Wed, 26 Feb 2020 at 23:34, Heinrich Schuchardt wrote: > On 2/26/20 11:51 AM, Sughosh Ganu wrote: > > > > On Tue, 25 Feb 2020 at 03:56, Heinrich Schuchardt > <mailto:xypron.g...@gmx.de>> wrote: > > > > Add support for the hardware

Re: [PATCH 1/2] drivers/rng: simplify Kconfig

2020-03-06 Thread Sughosh Ganu
nuconfig' shows the individual drivers neatly > indented under the DM_RNG entry. > > Signed-off-by: Heinrich Schuchardt > --- > Reviewed-by: Sughosh Ganu -sughosh configs/sandbox64_defconfig | 1 - > configs/sandbox_defconfig | 1 - > drivers/rng/Kconfig

Re: [PATCH 1/2] drivers/rng: simplify Kconfig

2020-03-06 Thread Sughosh Ganu
hi Tom, On Wed, 4 Mar 2020 at 06:47, Heinrich Schuchardt wrote: > For all sandbox systems with DM_RNG we enable RNG_SANDBOX. So we can simply > set the default to yes. > > All rng drivers depend on DM_RNG. Use a single 'if' instead of individual > dependencies. Now 'make menuconfig' shows the in

Re: [PATCH v7 00/17] efi_loader: add secure boot support

2020-04-17 Thread Sughosh Ganu
Takahiro, On Fri, 17 Apr 2020 at 12:51, AKASHI Takahiro wrote: > Heinrich, > > I was notified of some wrong implementation in this patch set. > I think that the change will be contained in efi_signature_verify() > function, but it is so essential in terms of "verification" logic. > > While I'm s

Re: [PATCH v7 04/17] efi_loader: variable: support variable authentication

2020-04-20 Thread Sughosh Ganu
On Tue, 14 Apr 2020 at 08:23, AKASHI Takahiro wrote: > With this commit, EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS > is supported for authenticated variables and the system secure state > will transfer between setup mode and user mode as UEFI specification > section 32.3 describes. > > I

Re: [PATCH v7 04/17] efi_loader: variable: support variable authentication

2020-04-20 Thread Sughosh Ganu
hello Heinrich, On Tue, 21 Apr 2020 at 01:00, Heinrich Schuchardt wrote: > On 4/20/20 9:22 PM, Sughosh Ganu wrote: > > > > On Tue, 14 Apr 2020 at 08:23, AKASHI Takahiro > > mailto:takahiro.aka...@linaro.org>> wrote: &

Re: [PATCH v2 03/17] dfu: rename dfu_tftp_write() to dfu_write_by_name()

2020-06-20 Thread Sughosh Ganu
On Wed, 17 Jun 2020 at 08:25, AKASHI Takahiro wrote: > This function is essentially independent from tffp, and will also be > utilised in implementing UEFI capsule update in a later commit. > So just give it a more generic name. > In addition, a new configuration option, CONFIG_DFU_ALT, was intro

Re: [PATCH v2 11/17] efi_loader: add firmware management protocol for FIT image

2020-06-20 Thread Sughosh Ganu
On Wed, 17 Jun 2020 at 08:26, AKASHI Takahiro wrote: > In this commit, a very simple firmware management protocol driver > is implemented. It will take a common FIT image firmware in a capsule > file and apply the data using dfu backend storage drivers via > update_fit() interface. > > So "dfu_al

Re: [PATCH v2 11/17] efi_loader: add firmware management protocol for FIT image

2020-06-20 Thread Sughosh Ganu
On Wed, 17 Jun 2020 at 08:26, AKASHI Takahiro wrote: > In this commit, a very simple firmware management protocol driver > is implemented. It will take a common FIT image firmware in a capsule > file and apply the data using dfu backend storage drivers via > update_fit() interface. > > So "dfu_al

Re: [PATCH v2 13/17] efi_loader: add firmware management protocol for raw image

2020-06-20 Thread Sughosh Ganu
On Wed, 17 Jun 2020 at 08:26, AKASHI Takahiro wrote: > In this commit, a very simple firmware management protocol driver > is implemented. It will take a binary image in a capsule file and > apply the data using dfu backend storage drivers via dfu_write_by_alt() > interface. > > So "dfu_alt_info"

Re: [PATCH v2 13/17] efi_loader: add firmware management protocol for raw image

2020-06-22 Thread Sughosh Ganu
On Mon, 22 Jun 2020 at 06:51, AKASHI Takahiro wrote: > On Sun, Jun 21, 2020 at 12:27:07AM +0530, Sughosh Ganu wrote: > > On Wed, 17 Jun 2020 at 08:26, AKASHI Takahiro < > takahiro.aka...@linaro.org> > > wrote: > > > > > In this commit, a very simple firmw

Re: [PATCH v2 11/17] efi_loader: add firmware management protocol for FIT image

2020-06-22 Thread Sughosh Ganu
On Mon, 22 Jun 2020 at 06:39, AKASHI Takahiro wrote: > On Sun, Jun 21, 2020 at 12:19:17AM +0530, Sughosh Ganu wrote: > > On Wed, 17 Jun 2020 at 08:26, AKASHI Takahiro < > takahiro.aka...@linaro.org> > > wrote: > > > > > In this commit, a very simple firmw

Re: [PATCH v2 11/17] efi_loader: add firmware management protocol for FIT image

2020-06-22 Thread Sughosh Ganu
On Mon, 22 Jun 2020 at 13:37, AKASHI Takahiro wrote: > On Mon, Jun 22, 2020 at 01:28:07PM +0530, Sughosh Ganu wrote: > > On Mon, 22 Jun 2020 at 06:39, AKASHI Takahiro < > takahiro.aka...@linaro.org> > > wrote: > > > > > On Sun, Jun 21, 2020 at 12:19:17AM +0

Re: [PATCH 1/1] rng: stm32mp1: use log() instead of printf()

2020-09-17 Thread Sughosh Ganu
On Thu, 17 Sep 2020 at 20:27, Heinrich Schuchardt wrote: > The logging system provides flexible filtering and enhanced output. > > Signed-off-by: Heinrich Schuchardt > --- > drivers/rng/stm32mp1_rng.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Revi

[PATCH 1/3] efi_loader: Add guidcpy function

2019-12-24 Thread Sughosh Ganu
Add guidcpy function to copy the source guid to the destination guid. Signed-off-by: Sughosh Ganu --- include/efi_loader.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/efi_loader.h b/include/efi_loader.h index 16a1b25..bec7873 100644 --- a/include/efi_loader.h +++ b/include

[PATCH 0/3] qemu: arm64: Add support for efi_rng_protocol

2019-12-24 Thread Sughosh Ganu
the kaslr feature. These patches apply on top of the patch series to add random number generator driver uclass[1] [1] - https://lists.denx.de/pipermail/u-boot/2019-December/394010.html Sughosh Ganu (3): efi_loader: Add guidcpy function efi: qemu: arm64: Add efi_rng_protocol implementation for

[PATCH 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-24 Thread Sughosh Ganu
data. The feature can be enabled through the following config CONFIG_EFI_RNG_PROTOCOL Signed-off-by: Sughosh Ganu --- board/emulation/qemu-arm/qemu-arm.c | 50 + include/efi_rng.h | 34 + lib/efi_loader/Kconfig | 8

[PATCH 3/3] efi_rng_protocol: Install the efi_rng_protocol on the root node

2019-12-24 Thread Sughosh Ganu
Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by the kernel for features like kaslr. Signed-off-by: Sughosh Ganu --- include/efi_loader.h | 4 lib/efi_loader/efi_rng.c | 2 ++ lib/efi_loader/efi_root_node.c | 4 3 files changed, 10 inser

Re: [PATCH 1/3] efi_loader: Add guidcpy function

2019-12-24 Thread Sughosh Ganu
On Tue, 24 Dec 2019 at 22:42, Heinrich Schuchardt wrote: > On 12/24/19 4:54 PM, Sughosh Ganu wrote: > > Add guidcpy function to copy the source guid to the destination > > guid. > > > > Signed-off-by: Sughosh Ganu > > --- > > include/efi_loader.h | 5 +

Re: [PATCH 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-24 Thread Sughosh Ganu
hi Heinrich, Thanks for the review. On Tue, 24 Dec 2019 at 22:35, Heinrich Schuchardt wrote: > On 12/24/19 4:54 PM, Sughosh Ganu wrote: > > Add support for the EFI_RNG_PROTOCOL routines for the qemu arm64 > > platform. EFI_RNG_PROTOCOL is an uefi boottime service which is > &g

Re: [PATCH 3/3] efi_rng_protocol: Install the efi_rng_protocol on the root node

2019-12-25 Thread Sughosh Ganu
On Wed, 25 Dec 2019 at 13:57, Heinrich Schuchardt wrote: > On 12/24/19 4:54 PM, Sughosh Ganu wrote: > > Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by > > the kernel for features like kaslr. > > > > Signed-off-by: Sughosh Ganu &g

Re: [PATCH v4 1/8] dm: rng: Add random number generator(rng) uclass

2019-12-25 Thread Sughosh Ganu
On Wed, 25 Dec 2019 at 06:41, Heinrich Schuchardt wrote: > On 12/17/19 12:51 PM, Sughosh Ganu wrote: > > Add a uclass for reading a random number seed from a random number > > generator device. > > > > Signed-off-by: Sughosh Ganu > > Reviewed-by: Patrice Chot

Re: [PATCH 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-25 Thread Sughosh Ganu
On Wed, 25 Dec 2019 at 13:51, Heinrich Schuchardt wrote: > On 12/25/19 7:21 AM, Sughosh Ganu wrote: > > hi Heinrich, > > Thanks for the review. > > > > On Tue, 24 Dec 2019 at 22:35, Heinrich Schuchardt > <mailto:xypron.g...@gmx.de>> wrote: > > &g

[PATCH v5 3/8] stm32mp1: rng: Add a driver for random number generator(rng) device

2019-12-26 Thread Sughosh Ganu
Add a driver for the rng device found on stm32mp1 platforms. The driver provides a routine for reading the random number seed from the hardware device. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- Changes since V4: * Return number of bytes read on a

[PATCH v5 1/8] dm: rng: Add random number generator(rng) uclass

2019-12-26 Thread Sughosh Ganu
Add a uclass for reading a random number seed from a random number generator device. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard --- Changes since V4: * Use Sphinx syntax for Return value in the read function * Return number of bytes read on a successful read, and a -ve value on

[PATCH v5 0/8] Add a random number generator uclass

2019-12-26 Thread Sughosh Ganu
UCLASS_DRIVER name from hwrng to rng, consistent with the rest of the naming convention * Handle review comment from Patrice Chotard Sughosh Ganu (8): 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

[PATCH v5 2/8] clk: stm32mp1: Add a clock entry for RNG1 device

2019-12-26 Thread Sughosh Ganu
Add an entry for allowing clock enablement for the random number generator peripheral, RNG1. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- drivers/clk/clk_stm32mp1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/clk_stm32mp1.c b

[PATCH v5 4/8] configs: stm32mp15: Enable random number generator(rng) device

2019-12-26 Thread Sughosh Ganu
Enable support for the rng device on the stm32mp15 configs. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- configs/stm32mp15_basic_defconfig | 2 ++ configs/stm32mp15_optee_defconfig | 2 ++ configs/stm32mp15_trusted_defconfig | 2 ++ 3 files

[PATCH v5 5/8] sandbox: rng: Add a random number generator(rng) driver

2019-12-26 Thread Sughosh Ganu
Add a sandbox driver for random number generation. Mostly aimed at providing a unit test for rng uclass. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard --- Changes since V4: * Return number of bytes read on a successful read, and a -ve value on error. * Modify the logic of

[PATCH v5 7/8] test: rng: Add basic test for random number generator(rng) uclass

2019-12-26 Thread Sughosh Ganu
Add a unit test for testing the rng uclass functionality using the sandbox rng driver. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard --- Changes since V4: * Change the test checking logic based on changes made in the sandbox rng driver, which now returns number of bytes read

[PATCH v5 6/8] configs: sandbox: Enable random number generator(rng) device

2019-12-26 Thread Sughosh Ganu
Enable support for random number generator on sandbox configs. This is aimed primarily at adding unit test support for rng uclass. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Patrick Delaunay --- configs/sandbox64_defconfig | 2 ++ configs/sandbox_defconfig | 2

[PATCH v5 8/8] virtio: rng: Add a random number generator(rng) driver

2019-12-26 Thread Sughosh Ganu
Add a driver for the virtio-rng device on the qemu platform. The device uses pci as a transport medium. The driver can be enabled with the following configs CONFIG_VIRTIO CONFIG_DM_RNG CONFIG_VIRTIO_PCI CONFIG_VIRTIO_RNG Signed-off-by: Sughosh Ganu --- Changes since V4: * Return number of bytes

[PATCH v2 1/3] efi_loader: Add guidcpy function

2019-12-26 Thread Sughosh Ganu
Add guidcpy function to copy the source guid to the destination guid. Use this function instead of memcpy for copying to the destination guid. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt --- Changes since V1: * Handle review comments from Heinrich Schuchardt to use guidcpy

[PATCH v2 0/3] Add support for efi_rng_protocol

2019-12-26 Thread Sughosh Ganu
implement a loop to read the number of bytes requested. This change is needed to handle the change in the rng uclass's read function, which now returns the number of bytes read, which might be less than the number of bytes requested. Sughosh Ganu (3): efi_loader: Add guidcpy fun

[PATCH v2 3/3] efi_rng_protocol: Install the efi_rng_protocol on the root node

2019-12-26 Thread Sughosh Ganu
Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by the kernel for features like kaslr. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt --- Changes since V1: * Handle review comments from Heinrich Schuchardt to change efi_rng_protocol_ops to efi_rng_pro

[PATCH v2 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-26 Thread Sughosh Ganu
data. The feature can be enabled through the following config CONFIG_EFI_RNG_PROTOCOL Signed-off-by: Sughosh Ganu --- Changes since V1: * Handle review comments from Heinrich Schuchardt. * Change the logic in the getrng routine to implement a loop to read the number of bytes requested. This

Re: [PATCH v4 5/8] sandbox: rng: Add a random number generator(rng) driver

2019-12-26 Thread Sughosh Ganu
On Wed, 25 Dec 2019 at 03:44, Heinrich Schuchardt wrote: > Resending with Cc Tom, Simon, Ilias > > On 12/17/19 12:52 PM, Sughosh Ganu wrote: > > Add a sandbox driver for random number generation. Mostly aimed at > > providing a unit test for rng uclass. > > >

Re: [PATCH v4 8/8] virtio: rng: Add a random number generator(rng) driver

2019-12-26 Thread Sughosh Ganu
On Wed, 25 Dec 2019 at 07:00, Heinrich Schuchardt wrote: > On 12/24/19 10:39 PM, Heinrich Schuchardt wrote: > > On 12/17/19 12:52 PM, Sughosh Ganu wrote: > >> Add a driver for the virtio-rng device on the qemu platform. The > >> device uses pci as a transport medium

Re: [PATCH v5 3/8] stm32mp1: rng: Add a driver for random number generator(rng) device

2019-12-27 Thread Sughosh Ganu
On Fri, 27 Dec 2019 at 13:21, Heinrich Schuchardt wrote: > On 12/26/19 6:25 PM, Sughosh Ganu wrote: > > Add a driver for the rng device found on stm32mp1 platforms. The > > driver provides a routine for reading the random number seed from the > > hardware device. > >

Re: [PATCH v5 8/8] virtio: rng: Add a random number generator(rng) driver

2019-12-27 Thread Sughosh Ganu
On Fri, 27 Dec 2019 at 12:42, Heinrich Schuchardt wrote: > On 12/26/19 6:25 PM, Sughosh Ganu wrote: > > Add a driver for the virtio-rng device on the qemu platform. The > > device uses pci as a transport medium. The driver can be enabled with > > the following configs

Re: [PATCH v5 1/8] dm: rng: Add random number generator(rng) uclass

2019-12-27 Thread Sughosh Ganu
On Fri, 27 Dec 2019 at 12:39, Heinrich Schuchardt wrote: > On 12/26/19 6:25 PM, Sughosh Ganu wrote: > > Add a uclass for reading a random number seed from a random number > > generator device. > > > > Signed-off-by: Sughosh Ganu > > Reviewed-by: Patrice Chot

Re: [PATCH v5 5/8] sandbox: rng: Add a random number generator(rng) driver

2019-12-27 Thread Sughosh Ganu
On Fri, 27 Dec 2019 at 12:29, Heinrich Schuchardt wrote: > On 12/26/19 6:25 PM, Sughosh Ganu wrote: > > Add a sandbox driver for random number generation. Mostly aimed at > > providing a unit test for rng uclass. > > > > Signed-off-by: Sughosh Ganu >

Re: [PATCH v5 3/8] stm32mp1: rng: Add a driver for random number generator(rng) device

2019-12-27 Thread Sughosh Ganu
On Fri, 27 Dec 2019 at 18:12, Heinrich Schuchardt wrote: > On 12/27/19 12:19 PM, Sughosh Ganu wrote: > > > > On Fri, 27 Dec 2019 at 13:21, Heinrich Schuchardt > <mailto:xypron.g...@gmx.de>> wrote: > > > > On 12/26/19 6:25 PM, Sughosh Ganu wrote: >

Re: [PATCH v5 3/8] stm32mp1: rng: Add a driver for random number generator(rng) device

2019-12-27 Thread Sughosh Ganu
On Fri, 27 Dec 2019 at 18:25, Heinrich Schuchardt wrote: > On 12/27/19 1:42 PM, Heinrich Schuchardt wrote: > > On 12/27/19 12:19 PM, Sughosh Ganu wrote: > >> > >> On Fri, 27 Dec 2019 at 13:21, Heinrich Schuchardt >> <mailto:xypron.g...@gmx.de>> wrote:

[PATCH v6 0/8] Add a random number generator uclass

2019-12-27 Thread Sughosh Ganu
V2: * Add a driver for the virtio-rng device on qemu platform Changes since V1: * Add a SPDX header in rng.h * Change the UCLASS_DRIVER name from hwrng to rng, consistent with the rest of the naming convention * Handle review comment from Patrice Chotard Sughosh Ganu (8): dm: rng: Add random

[PATCH v6 1/8] dm: rng: Add random number generator(rng) uclass

2019-12-27 Thread Sughosh Ganu
Add a uclass for reading a random number seed from a random number generator device. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard --- Changes since V5: * Handle review comments from Heinrich Schuchardt to read all the bytes requested in the individual drivers. drivers/Kconfig

[PATCH v6 2/8] clk: stm32mp1: Add a clock entry for RNG1 device

2019-12-27 Thread Sughosh Ganu
Add an entry for allowing clock enablement for the random number generator peripheral, RNG1. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- drivers/clk/clk_stm32mp1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/clk_stm32mp1.c b

[PATCH v6 4/8] configs: stm32mp15: Enable random number generator(rng) device

2019-12-27 Thread Sughosh Ganu
Enable support for the rng device on the stm32mp15 configs. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- configs/stm32mp15_basic_defconfig | 2 ++ configs/stm32mp15_optee_defconfig | 2 ++ configs/stm32mp15_trusted_defconfig | 2 ++ 3 files

[PATCH v6 6/8] configs: sandbox: Enable random number generator(rng) device

2019-12-27 Thread Sughosh Ganu
Enable support for random number generator on sandbox configs. This is aimed primarily at adding unit test support for rng uclass. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Patrick Delaunay --- configs/sandbox64_defconfig | 2 ++ configs/sandbox_defconfig | 2

[PATCH v6 3/8] stm32mp1: rng: Add a driver for random number generator(rng) device

2019-12-27 Thread Sughosh Ganu
Add a driver for the rng device found on stm32mp1 platforms. The driver provides a routine for reading the random number seed from the hardware device. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- Changes since V5: * Handle review comments from

[PATCH v6 5/8] sandbox: rng: Add a random number generator(rng) driver

2019-12-27 Thread Sughosh Ganu
Add a sandbox driver for random number generation. Mostly aimed at providing a unit test for rng uclass. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard --- Changes since V5: * Handle review comments from Heinrich Schuchardt to read all the bytes requested in the individual drivers

[PATCH v6 8/8] virtio: rng: Add a random number generator(rng) driver

2019-12-27 Thread Sughosh Ganu
Add a driver for the virtio-rng device on the qemu platform. The device uses pci as a transport medium. The driver can be enabled with the following configs CONFIG_VIRTIO CONFIG_DM_RNG CONFIG_VIRTIO_PCI CONFIG_VIRTIO_RNG Signed-off-by: Sughosh Ganu --- * Handle review comments from Heinrich

[PATCH v6 7/8] test: rng: Add basic test for random number generator(rng) uclass

2019-12-27 Thread Sughosh Ganu
Add a unit test for testing the rng uclass functionality using the sandbox rng driver. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard --- * Change the test checking logic based on changes made in the sandbox rng driver, which returns 0 on a successful read. test/dm/Makefile | 1

[PATCH v3 0/3] Add support for efi_rng_protocol

2019-12-27 Thread Sughosh Ganu
loop to read the number of bytes requested. This change is needed to handle the change in the rng uclass's read function, which now returns the number of bytes read, which might be less than the number of bytes requested. Sughosh Ganu (3): efi_loader: Add guidcpy function efi:

[PATCH v3 3/3] efi_rng_protocol: Install the efi_rng_protocol on the root node

2019-12-27 Thread Sughosh Ganu
Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by the kernel for features like kaslr. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 4 lib/efi_loader/efi_rng.c | 2 ++ lib/efi_loader/efi_root_node.c | 4 ++

[PATCH v3 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-27 Thread Sughosh Ganu
data. The feature can be enabled through the following config CONFIG_EFI_RNG_PROTOCOL Signed-off-by: Sughosh Ganu --- Changes since V2: * Based on review comments from Heinrich Schuchardt, the rng drivers read all the bytes requested in the individual drivers. Corresponding changes made in

[PATCH v3 1/3] efi_loader: Add guidcpy function

2019-12-27 Thread Sughosh Ganu
Add guidcpy function to copy the source guid to the destination guid. Use this function instead of memcpy for copying to the destination guid. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 5 + lib/efi_loader/efi_boottime.c | 4 ++-- 2

Re: [PATCH v6 6/8] configs: sandbox: Enable random number generator(rng) device

2019-12-28 Thread Sughosh Ganu
On Sat, 28 Dec 2019 at 11:55, Heinrich Schuchardt wrote: > On 12/27/19 3:23 PM, Sughosh Ganu wrote: > > Enable support for random number generator on sandbox configs. This is > > aimed primarily at adding unit test support for rng uclass. > > > > Signed-off-by: Su

Re: [PATCH v6 5/8] sandbox: rng: Add a random number generator(rng) driver

2019-12-28 Thread Sughosh Ganu
On Sat, 28 Dec 2019 at 12:53, Heinrich Schuchardt wrote: > On 12/27/19 3:23 PM, Sughosh Ganu wrote: > > Add a sandbox driver for random number generation. Mostly aimed at > > providing a unit test for rng uclass. > > > > Signed-off-by: Sughosh Ganu >

Re: [PATCH v3 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-28 Thread Sughosh Ganu
On Sat, 28 Dec 2019 at 20:01, Heinrich Schuchardt wrote: > On 12/27/19 3:26 PM, Sughosh Ganu wrote: > > Add support for the EFI_RNG_PROTOCOL routines for the qemu arm64 > > platform. EFI_RNG_PROTOCOL is an uefi boottime service which is > > invoked by the efi stub in t

Re: [PATCH v3 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-28 Thread Sughosh Ganu
On Sat, 28 Dec 2019 at 20:54, Heinrich Schuchardt wrote: > On 12/28/19 4:03 PM, Sughosh Ganu wrote: > > > > On Sat, 28 Dec 2019 at 20:01, Heinrich Schuchardt > <mailto:xypron.g...@gmx.de>> wrote: > > > > On 12/27/19 3:26 PM, Sughosh Gan

[PATCH v7 0/8] Add a random number generator uclass

2019-12-28 Thread Sughosh Ganu
driver for the virtio-rng device on qemu platform Changes since V1: * Add a SPDX header in rng.h * Change the UCLASS_DRIVER name from hwrng to rng, consistent with the rest of the naming convention * Handle review comment from Patrice Chotard Sughosh Ganu (8): dm: rng: Add random number generator

[PATCH v7 1/8] dm: rng: Add random number generator(rng) uclass

2019-12-28 Thread Sughosh Ganu
Add a uclass for reading a random number seed from a random number generator device. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- Changes since V6: * Handle review comment from Simon Glass to declare struct udevice in

[PATCH v7 3/8] stm32mp1: rng: Add a driver for random number generator(rng) device

2019-12-28 Thread Sughosh Ganu
Add a driver for the rng device found on stm32mp1 platforms. The driver provides a routine for reading the random number seed from the hardware device. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- drivers/rng/Kconfig| 7 ++ drivers/rng

[PATCH v7 5/8] sandbox: rng: Add a random number generator(rng) driver

2019-12-28 Thread Sughosh Ganu
Add a sandbox driver for random number generation. Mostly aimed at providing a unit test for rng uclass. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Simon Glass --- arch/sandbox/dts/test.dts | 4 drivers/rng/Kconfig | 8 +++ drivers/rng/Makefile

[PATCH v7 7/8] test: rng: Add basic test for random number generator(rng) uclass

2019-12-28 Thread Sughosh Ganu
Add a unit test for testing the rng uclass functionality using the sandbox rng driver. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Simon Glass --- test/dm/Makefile | 1 + test/dm/rng.c| 26 ++ 2 files changed, 27 insertions(+) create

[PATCH v7 4/8] configs: stm32mp15: Enable random number generator(rng) device

2019-12-28 Thread Sughosh Ganu
Enable support for the rng device on the stm32mp15 configs. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- configs/stm32mp15_basic_defconfig | 2 ++ configs/stm32mp15_optee_defconfig | 2 ++ configs/stm32mp15_trusted_defconfig | 2 ++ 3 files

[PATCH v7 6/8] configs: sandbox: Enable random number generator(rng) device

2019-12-28 Thread Sughosh Ganu
Enable support for random number generator on sandbox configs. This is aimed primarily at adding unit test support for rng uclass. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Patrick Delaunay Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 2 ++ configs

[PATCH v7 2/8] clk: stm32mp1: Add a clock entry for RNG1 device

2019-12-28 Thread Sughosh Ganu
Add an entry for allowing clock enablement for the random number generator peripheral, RNG1. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- drivers/clk/clk_stm32mp1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/clk_stm32mp1.c b

[PATCH v7 8/8] virtio: rng: Add a random number generator(rng) driver

2019-12-28 Thread Sughosh Ganu
Add a driver for the virtio-rng device on the qemu platform. The device uses pci as a transport medium. The driver can be enabled with the following configs CONFIG_VIRTIO CONFIG_DM_RNG CONFIG_VIRTIO_PCI CONFIG_VIRTIO_RNG Signed-off-by: Sughosh Ganu --- Changes since V6: * Handle review comments

[PATCH v4 1/3] efi_loader: Add guidcpy function

2019-12-28 Thread Sughosh Ganu
Add guidcpy function to copy the source guid to the destination guid. Use this function instead of memcpy for copying to the destination guid. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 5 + lib/efi_loader/efi_boottime.c | 4 ++-- 2

[PATCH v4 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-28 Thread Sughosh Ganu
data. The feature can be enabled through the following config CONFIG_EFI_RNG_PROTOCOL Signed-off-by: Sughosh Ganu --- Changes since V3: * Handle review comments from Heinrich Schuchardt related to calling EFI_EXIT at the end of the efi_rng_protocol routines using a goto label. * Add a weak

[PATCH v4 3/3] efi_rng_protocol: Install the efi_rng_protocol on the root node

2019-12-28 Thread Sughosh Ganu
Install the EFI_RNG_PROTOCOL implementation for it's subsequent use by the kernel for features like kaslr. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 4 lib/efi_loader/efi_rng.c | 2 ++ lib/efi_loader/efi_root_node.c | 4 ++

[PATCH v4 0/3] Add support for efi_rng_protocol

2019-12-28 Thread Sughosh Ganu
requested. This change is needed to handle the change in the rng uclass's read function, which now returns the number of bytes read, which might be less than the number of bytes requested. Sughosh Ganu (3): efi_loader: Add guidcpy function efi: qemu: arm64: Add efi_rng_pro

Re: [PATCH v7 8/8] virtio: rng: Add a random number generator(rng) driver

2019-12-29 Thread Sughosh Ganu
On Sun, 29 Dec 2019 at 02:59, Heinrich Schuchardt wrote: > On 12/28/19 7:28 PM, Sughosh Ganu wrote: > > Add a driver for the virtio-rng device on the qemu platform. The > > device uses pci as a transport medium. The driver can be enabled with > > the following configs

[PATCH v8 3/8] stm32mp1: rng: Add a driver for random number generator(rng) device

2019-12-29 Thread Sughosh Ganu
Add a driver for the rng device found on stm32mp1 platforms. The driver provides a routine for reading the random number seed from the hardware device. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- drivers/rng/Kconfig| 7 ++ drivers/rng

[PATCH v8 2/8] clk: stm32mp1: Add a clock entry for RNG1 device

2019-12-29 Thread Sughosh Ganu
Add an entry for allowing clock enablement for the random number generator peripheral, RNG1. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- drivers/clk/clk_stm32mp1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/clk_stm32mp1.c b

[PATCH v8 1/8] dm: rng: Add random number generator(rng) uclass

2019-12-29 Thread Sughosh Ganu
Add a uclass for reading a random number seed from a random number generator device. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/rng/Kconfig

[PATCH v8 4/8] configs: stm32mp15: Enable random number generator(rng) device

2019-12-29 Thread Sughosh Ganu
Enable support for the rng device on the stm32mp15 configs. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Acked-by: Patrick Delaunay --- configs/stm32mp15_basic_defconfig | 2 ++ configs/stm32mp15_optee_defconfig | 2 ++ configs/stm32mp15_trusted_defconfig | 2 ++ 3 files

[PATCH v8 0/8] Add a random number generator uclass

2019-12-29 Thread Sughosh Ganu
comment from Patrice Chotard Sughosh Ganu (8): 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

[PATCH v8 5/8] sandbox: rng: Add a random number generator(rng) driver

2019-12-29 Thread Sughosh Ganu
Add a sandbox driver for random number generation. Mostly aimed at providing a unit test for rng uclass. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Simon Glass --- arch/sandbox/dts/test.dts | 4 drivers/rng/Kconfig | 8 +++ drivers/rng/Makefile

[PATCH v8 8/8] virtio: rng: Add a random number generator(rng) driver

2019-12-29 Thread Sughosh Ganu
Add a driver for the virtio-rng device on the qemu platform. The device uses pci as a transport medium. The driver can be enabled with the following configs CONFIG_VIRTIO CONFIG_DM_RNG CONFIG_VIRTIO_PCI CONFIG_VIRTIO_RNG Signed-off-by: Sughosh Ganu --- Changes since V7: * Set the length to min

[PATCH v8 6/8] configs: sandbox: Enable random number generator(rng) device

2019-12-29 Thread Sughosh Ganu
Enable support for random number generator on sandbox configs. This is aimed primarily at adding unit test support for rng uclass. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Patrick Delaunay Reviewed-by: Simon Glass --- configs/sandbox64_defconfig | 2 ++ configs

[PATCH v8 7/8] test: rng: Add basic test for random number generator(rng) uclass

2019-12-29 Thread Sughosh Ganu
Add a unit test for testing the rng uclass functionality using the sandbox rng driver. Signed-off-by: Sughosh Ganu Reviewed-by: Patrice Chotard Reviewed-by: Simon Glass --- test/dm/Makefile | 1 + test/dm/rng.c| 26 ++ 2 files changed, 27 insertions(+) create

Re: [PATCH v6 0/8] Add a random number generator uclass

2019-12-30 Thread Sughosh Ganu
On Sat, 28 Dec 2019 at 13:22, Heinrich Schuchardt wrote: > On 12/27/19 3:23 PM, Sughosh Ganu wrote: > > 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 t

Re: [PATCH v6 0/8] Add a random number generator uclass

2019-12-31 Thread Sughosh Ganu
On Tue, 31 Dec 2019 at 12:38, Heinrich Schuchardt wrote: > On 12/31/19 3:56 AM, Sughosh Ganu wrote: > > > > On Sat, 28 Dec 2019 at 13:22, Heinrich Schuchardt > <mailto:xypron.g...@gmx.de>> wrote: > > > > On 12/27/19 3:23 PM, Sughosh Ganu wrote: >

Re: [PATCH v3 2/3] efi: qemu: arm64: Add efi_rng_protocol implementation for the platform

2019-12-31 Thread Sughosh Ganu
On Sat, 28 Dec 2019 at 21:09, Tuomas Tynkkynen wrote: > Hi, > > On Sat, 28 Dec 2019 at 17:19, Heinrich Schuchardt > wrote: > > > > On 12/28/19 4:03 PM, Sughosh Ganu wrote: > > > > > > On Sat, 28 Dec 2019 at 20:01, Heinrich Schuchardt > > <ma

[PATCH] qemu: arm: Scan the pci bus in board_init

2019-12-31 Thread Sughosh Ganu
Scan the pci bus in board_init routine before scanning the virtio devices. This enumerates all the virtio devices, including devices found on the pci bus. Signed-off-by: Sughosh Ganu --- board/emulation/qemu-arm/qemu-arm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/board

Re: [PATCH] qemu: arm: Scan the pci bus in board_init

2019-12-31 Thread Sughosh Ganu
On Tue, 31 Dec 2019 at 20:38, Heinrich Schuchardt wrote: > On 12/31/19 2:31 PM, Sughosh Ganu wrote: > > Scan the pci bus in board_init routine before scanning the virtio > > devices. This enumerates all the virtio devices, including devices > > found on the pci bus.

<    4   5   6   7   8   9   10   11   12   13   >