[PATCH v3 9/9] doc: uefi: Update the capsule update related documentation

2022-03-30 Thread Sughosh Ganu
Update the capsule update functionality related documentation to refect the fact that a unique image GUID is to be used per image that forms part of the capsule file. Signed-off-by: Sughosh Ganu --- Changes since V2: * Add a description for adding image index value and definition

[PATCH v3 8/9] mkeficapsule: Remove raw and FIT GUID types

2022-03-30 Thread Sughosh Ganu
options as well. Signed-off-by: Sughosh Ganu --- Changes since V2: None tools/eficapsule.h | 8 tools/mkeficapsule.c | 26 +- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/tools/eficapsule.h b/tools/eficapsule.h index 69c9c58c2f..d63b831443

[PATCH v3 6/9] test: capsule: Modify the capsule tests to use GUID values for sandbox

2022-03-30 Thread Sughosh Ganu
for testing the capsule update code. Install the FMP instance for the FIT images on the sandbox64 and sandbox_flattree variant for testing capsule update for FIT images. This is being done by splitting the capsule update script for FIT and raw images. Signed-off-by: Sughosh Ganu --- Changes since V2

[PATCH v3 7/9] FMP: Remove GUIDs for FIT and raw images

2022-03-30 Thread Sughosh Ganu
The capsule update code has been modified for getting the image GUID values from the platform code. With this, each image now has a unique GUID value. With this change, there is no longer a need for defining GUIDs for FIT and raw images. Remove these GUID values. Signed-off-by: Sughosh Ganu

[PATCH v3 4/9] board: Define set_dfu_alt_info() for boards with UEFI capsule update enabled

2022-03-30 Thread Sughosh Ganu
file, and use the function for populating the variable. With the function defined, the dfu framework populates the dfu_alt_info variable through the board file, instead of fetching the variable from the environment, thus making the update more robust. Signed-off-by: Sughosh Ganu --- Changes since

[PATCH v3 5/9] capsule: kconfig: Select SET_DFU_ALT_INFO config symbol for capsule update

2022-03-30 Thread Sughosh Ganu
update functionality is enabled. Signed-off-by: Sughosh Ganu --- Changes since V2: New Patch lib/efi_loader/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index e5e35fe51f..09fb8cbe75 100644 --- a/lib/efi_loader/Kconfig +++ b/lib

[PATCH v3 3/9] capsule: Put a check for image index before the update

2022-03-30 Thread Sughosh Ganu
through the capsule, since the image_index is used to determine the location of the update on the storage device. Signed-off-by: Sughosh Ganu --- Changes since V2: New patch lib/efi_loader/efi_capsule.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader

[PATCH v3 1/9] capsule: Add Image GUIDs and image index for platforms using capsule updates

2022-03-30 Thread Sughosh Ganu
-by: Sughosh Ganu --- Changes since V2: * Add a new member image_index to the struct efi_fw_images to allow the platforms to define the values for images. * Address review comments from Michal Simek for the xilinx boards. * Fix double inclusion of efi_loader.h as was pointed out by Heiko

[PATCH v3 2/9] capsule: FMP: Populate the image descriptor array from platform data

2022-03-30 Thread Sughosh Ganu
or a raw image GUID. This is fixed by obtaining the GUID values from the efi_fw_images array defined per platform. Signed-off-by: Sughosh Ganu --- Changes since V2: * Use the image index values defined in the platform's fw_images array for the image descriptors include/efi_loader.h

[PATCH v3 0/9] efi: capsule: Capsule Update fixes and enhancements

2022-03-30 Thread Sughosh Ganu
removes the now unused FIT and raw image GUID values from the FMP module. The eighth patch removes the --raw and --fit command line parameters in the mkeficapsule utility. The ninth patch makes corresponding changes in the capsule update related documentation. Sughosh Ganu (9): capsule: Add

Re: [RFC PATCH 1/6] capsule: Add Image GUIDs for platforms using capsule updates

2022-03-27 Thread Sughosh Ganu
hi Masami, On Sat, 26 Mar 2022 at 16:17, Masami Hiramatsu wrote: > > Hi Sughosh, > > 2022年3月25日(金) 18:59 Sughosh Ganu : > > > > hi Masami, > > > > On Fri, 25 Mar 2022 at 10:58, Masami Hiramatsu > > wrote: > > > > > > Hi Sughosh, &

Re: [PATCH v2 1/6] capsule: Add Image GUIDs for platforms using capsule updates

2022-03-26 Thread Sughosh Ganu
hi Heiko, On Sat, 26 Mar 2022 at 12:36, Heiko Thiery wrote: > > Hi > > Sughosh Ganu schrieb am Sa., 26. März 2022, 07:00: >> >> Currently, all platforms that enable capsule updates do so using >> either EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID or >> EF

[PATCH v2 6/6] mkeficapsule: Remove raw and FIT GUID types

2022-03-26 Thread Sughosh Ganu
options as well. Signed-off-by: Sughosh Ganu --- Changes since V1: None tools/eficapsule.h | 8 tools/mkeficapsule.c | 26 +- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/tools/eficapsule.h b/tools/eficapsule.h index 69c9c58c2f..d63b831443

[PATCH v2 5/6] FMP: Remove GUIDs for FIT and raw images

2022-03-26 Thread Sughosh Ganu
The capsule update code has been modified for getting the image GUID values from the platform code. With this, each image now has a unique GUID value. With this change, there is no longer a need for defining GUIDs for FIT and raw images. Remove these GUID values. Signed-off-by: Sughosh Ganu

[PATCH v2 3/6] test: capsule: Modify the capsule tests to use GUID values for sandbox

2022-03-26 Thread Sughosh Ganu
for testing the capsule update code. Install the FMP instance for the FIT images on the sandbox64 and sandbox_flattree variant for testing capsule update for FIT images. This is being done by splitting the capsule update script for FIT and raw images. Signed-off-by: Sughosh Ganu --- Changes since V1

[PATCH v2 4/6] doc: uefi: Update the capsule update related documentation

2022-03-26 Thread Sughosh Ganu
Update the capsule update functionality related documentation to refect the fact that a unique image GUID is to be used per image that forms part of the capsule file. Signed-off-by: Sughosh Ganu --- Changes since V1: None doc/develop/uefi/uefi.rst | 10 -- 1 file changed, 8 insertions

[PATCH v2 2/6] capsule: FMP: Populate the image descriptor array from platform data

2022-03-26 Thread Sughosh Ganu
or a raw image GUID. This is fixed by obtaining the GUID values from the efi_fw_images array defined per platform. Signed-off-by: Sughosh Ganu --- Changes since V1: None include/efi_loader.h | 3 ++ lib/efi_loader/efi_firmware.c | 91 +++ 2 files changed

[PATCH v2 1/6] capsule: Add Image GUIDs for platforms using capsule updates

2022-03-26 Thread Sughosh Ganu
descriptor array. Signed-off-by: Sughosh Ganu --- Changes since V1: * Make changes for the xilinx boards as suggested by Michal Simek. * Add a GUID for the sandbox FIT image .../imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 19 ++ .../imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c | 18

[PATCH v2 0/6] efi: capsule: Image GUID usage cleanup

2022-03-26 Thread Sughosh Ganu
corresponding changes in the capsule update related documentation. The fifth patch of the series removes the now unused FIT and raw image GUID values from the FMP module. The sixth patch of the series removes the --raw and --fit command line parameters in the mkeficapsule utility. Sughosh Ganu (6

Re: [RFC PATCH 1/6] capsule: Add Image GUIDs for platforms using capsule updates

2022-03-25 Thread Sughosh Ganu
Hiramatsu : > > > > Hi Sughosh, > > > > 2022年3月24日(木) 23:40 Sughosh Ganu : > > > > > > hi Masami, > > > > > > On Thu, 24 Mar 2022 at 19:14, Masami Hiramatsu > > > wrote: > > > > > > > > Hi Sughosh, > > &g

Re: [RFC PATCH 0/6] efi: capsule: Image GUID usage cleanup

2022-03-25 Thread Sughosh Ganu
hi Takahiro, On Fri, 25 Mar 2022 at 10:23, AKASHI Takahiro wrote: > > Sughosh, > > On Thu, Mar 24, 2022 at 06:08:55PM +0530, Sughosh Ganu wrote: > > > > This series is cleaning up the usage of the image GUIDs that are used > > in capsule update and the

Re: [PATCH v5 5/9] qemu: arm: Remove platform specific function to get RNG device

2022-03-24 Thread Sughosh Ganu
hi Heinrich, On Sun, 13 Mar 2022 at 20:18, Sughosh Ganu wrote: > > The Qemu platform has a function defined to get the random number > generator(RNG) device. However, the RNG device can be obtained simply > by searching for a device belonging to the RNG uclass. Remove the > super

Re: [PATCH v3 8/8] test: rng: Add a UT testcase for the rng command

2022-03-24 Thread Sughosh Ganu
hi Heinrich, On Fri, 4 Mar 2022 at 19:05, Sughosh Ganu wrote: > > The 'rng' command dumps a number of random bytes on the console. Add a > set of tests for the 'rng' command. The test function performs basic > sanity testing of the command. > > Since a unit test is being add

Re: [PATCH v5 9/9] test: rng: Add a UT testcase for the rng command

2022-03-24 Thread Sughosh Ganu
hi Heinrich, On Sun, 13 Mar 2022 at 20:19, Sughosh Ganu wrote: > > The 'rng' command dumps a number of random bytes on the console. Add a > set of tests for the 'rng' command. The test function performs basic > sanity testing of the command. > > Since a unit test is being add

Re: [PATCH v5 8/9] doc: rng: Add documentation for the rng command

2022-03-24 Thread Sughosh Ganu
hi Heinrich, On Sun, 13 Mar 2022 at 20:19, Sughosh Ganu wrote: > > Add a usage document for the 'rng' u-boot command. > > Signed-off-by: Sughosh Ganu > Reviewed-by: Ilias Apalodimas > Reviewed-by: Simon Glass > --- > > Changes since V4: > > * Reflect the fa

Re: [PATCH v5 7/9] cmd: rng: Use a statically allocated array for random bytes

2022-03-24 Thread Sughosh Ganu
hi Heinrich, On Sun, 13 Mar 2022 at 20:19, Sughosh Ganu wrote: > > Use a statically allocated buffer on stack instead of using malloc for > reading the random bytes. Using a local array is faster than > allocating heap memory on every initiation of the command. > > Signed-of

Re: [PATCH v5 6/9] cmd: rng: Add support for selecting RNG device

2022-03-24 Thread Sughosh Ganu
hi Heinrich, On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote: > > Hi Sughosh, > > On Sun, 13 Mar 2022 at 08:49, Sughosh Ganu wrote: > > > > The 'rng' u-boot command is used for printing a select number of > > random bytes on the console. Currently, the RNG device f

Re: [RFC PATCH 6/6] mkeficapsule: Remove raw and FIT GUID types

2022-03-24 Thread Sughosh Ganu
On Thu, 24 Mar 2022 at 20:40, Michal Simek wrote: > > > > On 3/24/22 15:51, Sughosh Ganu wrote: > > On Thu, 24 Mar 2022 at 19:55, Michal Simek wrote: > >> > >> > >> > >> On 3/24/22 13:39, Sughosh Ganu wrote: > >>&g

Re: [RFC PATCH 1/6] capsule: Add Image GUIDs for platforms using capsule updates

2022-03-24 Thread Sughosh Ganu
On Thu, 24 Mar 2022 at 20:21, Michal Simek wrote: > > > > On 3/24/22 15:44, Sughosh Ganu wrote: > > On Thu, 24 Mar 2022 at 19:55, Michal Simek wrote: > >> > >> > >> > >> On 3/24/22 13:38, Sughosh Ganu wrote: > >>> Currently,

Re: [RFC PATCH 6/6] mkeficapsule: Remove raw and FIT GUID types

2022-03-24 Thread Sughosh Ganu
On Thu, 24 Mar 2022 at 19:55, Michal Simek wrote: > > > > On 3/24/22 13:39, Sughosh Ganu wrote: > > While building a capsule, the GUID value of that specific image is to > > be passed through the --guid command option to the mkeficapsul

Re: [RFC PATCH 1/6] capsule: Add Image GUIDs for platforms using capsule updates

2022-03-24 Thread Sughosh Ganu
On Thu, 24 Mar 2022 at 19:55, Michal Simek wrote: > > > > On 3/24/22 13:38, Sughosh Ganu wrote: > > Currently, all platforms that enable capsule updates do so using > > either EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID or > > EFI_FIRMWARE_IMAGE_TYPE_UBOOT_FIT_GUID.

Re: [RFC PATCH 1/6] capsule: Add Image GUIDs for platforms using capsule updates

2022-03-24 Thread Sughosh Ganu
hi Masami, On Thu, 24 Mar 2022 at 19:14, Masami Hiramatsu wrote: > > Hi Sughosh, > > 2022年3月24日(木) 21:39 Sughosh Ganu : > > > > Currently, all platforms that enable capsule updates do so using > > either EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID or > > EF

[RFC PATCH 6/6] mkeficapsule: Remove raw and FIT GUID types

2022-03-24 Thread Sughosh Ganu
options as well. Signed-off-by: Sughosh Ganu --- tools/eficapsule.h | 8 tools/mkeficapsule.c | 26 +- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/tools/eficapsule.h b/tools/eficapsule.h index 69c9c58c2f..d63b831443 100644 --- a/tools

[RFC PATCH 5/6] FMP: Remove GUIDs for FIT and raw images

2022-03-24 Thread Sughosh Ganu
The capsule update code has been modified for getting the image GUID values from the platform code. With this, each image now has a unique GUID value. With this change, there is no longer a need for defining GUIDs for FIT and raw images. Remove these GUID values. Signed-off-by: Sughosh Ganu

[RFC PATCH 4/6] doc: uefi: Update the capsule update related documentation

2022-03-24 Thread Sughosh Ganu
Update the capsule update functionality related documentation to refect the fact that a unique image GUID is to be used per image that forms part of the capsule file. Signed-off-by: Sughosh Ganu --- doc/develop/uefi/uefi.rst | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

[RFC PATCH 3/6] test: capsule: Modify the capsule tests to use GUID values for sandbox

2022-03-24 Thread Sughosh Ganu
update code. Signed-off-by: Sughosh Ganu --- configs/sandbox64_defconfig | 1 - configs/sandbox_defconfig | 1 - test/py/tests/test_efi_capsule/conftest.py| 20 +-- .../test_efi_capsule/test_capsule_firmware.py | 167 ++ 4 files changed

[RFC PATCH 2/6] capsule: FMP: Populate the image descriptor array from platform data

2022-03-24 Thread Sughosh Ganu
or a raw image GUID. This is fixed by obtaining the GUID values from the efi_fw_images array defined per platform. Signed-off-by: Sughosh Ganu --- include/efi_loader.h | 3 ++ lib/efi_loader/efi_firmware.c | 91 +++ 2 files changed, 30 insertions(+), 64

[RFC PATCH 1/6] capsule: Add Image GUIDs for platforms using capsule updates

2022-03-24 Thread Sughosh Ganu
descriptor array. Signed-off-by: Sughosh Ganu --- .../imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 19 +++ .../imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c | 18 +++ board/emulation/qemu-arm/qemu-arm.c | 20 board/kontron/pitx_imx8m/pitx_imx8m.c

[RFC PATCH 0/6] efi: capsule: Image GUID usage cleanup

2022-03-24 Thread Sughosh Ganu
. The sixth patch of the series removes the --raw and --fit command line parameters in the mkeficapsule utility. Sughosh Ganu (6): capsule: Add Image GUIDs for platforms using capsule updates capsule: FMP: Populate the image descriptor array from platform data test: capsule: Modify the capsule tests

Re: [PATCH v5 4/9] tpm: Add the RNG child device

2022-03-21 Thread Sughosh Ganu
hi Simon, On Wed, 16 Mar 2022 at 02:45, Simon Glass wrote: > > Hi Ilias, > > On Tue, 15 Mar 2022 at 00:34, Ilias Apalodimas > wrote: > > > > Hi Simon, > > > > On Mon, 14 Mar 2022 at 20:24, Simon Glass wrote: > > > > > > > [...] > > > > > > > > + } > > > > > > > > > > This really should

Re: [PATCH v5 3/9] tpm: rng: Add driver model interface for TPM RNG device

2022-03-15 Thread Sughosh Ganu
hi Simon, On Mon, 14 Mar 2022 at 23:55, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 14 Mar 2022 at 05:39, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote: > > > > > > Hi Sughosh,

Re: [PATCH v5 4/9] tpm: Add the RNG child device

2022-03-15 Thread Sughosh Ganu
hi Simon, On Mon, 14 Mar 2022 at 23:54, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 14 Mar 2022 at 05:43, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote: > > > > > > Hi Sughosh,

Re: [PATCH v5 4/9] tpm: Add the RNG child device

2022-03-14 Thread Sughosh Ganu
hi Simon, On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote: > > Hi Sughosh, > > On Sun, 13 Mar 2022 at 08:48, Sughosh Ganu wrote: > > > > The TPM device comes with the random number generator(RNG) > > functionality which is built into the TPM device. Add logic t

Re: [PATCH v5 3/9] tpm: rng: Add driver model interface for TPM RNG device

2022-03-14 Thread Sughosh Ganu
hi Simon, On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote: > > Hi Sughosh, > > On Sun, 13 Mar 2022 at 08:48, Sughosh Ganu wrote: > > > > The TPM device has a builtin random number generator(RNG) > > functionality. Expose the RNG functions of the TPM dev

Re: [PATCH v5 7/9] cmd: rng: Use a statically allocated array for random bytes

2022-03-14 Thread Sughosh Ganu
hi Simon, On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote: > > Hi Sughosh, > > On Sun, 13 Mar 2022 at 08:49, Sughosh Ganu wrote: > > > > Use a statically allocated buffer on stack instead of using malloc for > > reading the random bytes. Using a local array is f

[PATCH v5 9/9] test: rng: Add a UT testcase for the rng command

2022-03-13 Thread Sughosh Ganu
The 'rng' command dumps a number of random bytes on the console. Add a set of tests for the 'rng' command. The test function performs basic sanity testing of the command. Since a unit test is being added for the command, enable it by default in the sandbox platforms. Signed-off-by: Sughosh Ganu

[PATCH v5 8/9] doc: rng: Add documentation for the rng command

2022-03-13 Thread Sughosh Ganu
Add a usage document for the 'rng' u-boot command. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V4: * Reflect the fact that a maximum of 64 bytes can be read on each invocation of the 'rng' command doc/usage/index.rst | 1 + doc

[PATCH v5 6/9] cmd: rng: Add support for selecting RNG device

2022-03-13 Thread Sughosh Ganu
through the TPM chip. Extend the 'rng' command so that the user can provide the RNG device number from which the random bytes are to be read. This will be the device index under the RNG uclass. Signed-off-by: Sughosh Ganu Tested-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- Changes

[PATCH v5 7/9] cmd: rng: Use a statically allocated array for random bytes

2022-03-13 Thread Sughosh Ganu
Use a statically allocated buffer on stack instead of using malloc for reading the random bytes. Using a local array is faster than allocating heap memory on every initiation of the command. Signed-off-by: Sughosh Ganu --- Changes since V4: * New patch based on review comments from Simon

[PATCH v5 5/9] qemu: arm: Remove platform specific function to get RNG device

2022-03-13 Thread Sughosh Ganu
-off-by: Sughosh Ganu Tested-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V4: None board/emulation/qemu-arm/qemu-arm.c | 42 - 1 file changed, 42 deletions(-) diff --git a/board/emulation/qemu-arm/qemu-arm.c b

[PATCH v5 4/9] tpm: Add the RNG child device

2022-03-13 Thread Sughosh Ganu
randomisation through the EFI_RNG_PROTOCOL interface. Signed-off-by: Sughosh Ganu --- Changes since V4: * Put a check for CONFIG_TPM_RNG for binding the RNG device with it's driver in the post_probe callback instead of putting CONFIG_{SPL,TPL}_BUILD guards drivers/tpm/tpm-uclass.c | 29

[PATCH v5 3/9] tpm: rng: Add driver model interface for TPM RNG device

2022-03-13 Thread Sughosh Ganu
to comply with the driver model api. Signed-off-by: Sughosh Ganu --- Changes since V4: * Call the existing tpm_get_random API function from the TPM RNG driver, instead of the tpm{1,2}_get_random API's * Introduce a new Kconfig symbol TPM_RNG and build the corresponding driver if the symbol

[PATCH v5 2/9] tpm: Fix the return type of tpm_startup

2022-03-13 Thread Sughosh Ganu
The tpm_startup function returns negative values for error conditions. Fix the return type of the function to a signed int instead of a u32. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V4: None include/tpm_api.h | 2 +- lib/tpm_api.c

[PATCH v5 1/9] tpm: rng: Change tpm_get_random to return an int

2022-03-13 Thread Sughosh Ganu
function. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V4: None include/tpm_api.h | 4 ++-- lib/tpm_api.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tpm_api.h b/include

[PATCH v5 0/9] tpm: rng: Move TPM RNG functionality to driver model

2022-03-13 Thread Sughosh Ganu
* Add a new patch based on review comments from Simon to not use the malloc call * Reflect the fact that a maximum of 64 bytes can be read on each invocation of the 'rng' command in the rng document Sughosh Ganu (9): tpm: rng: Change tpm_get_random to return an int tpm: Fix the return type

Re: [PATCH v4 4/8] tpm: Add the RNG child device

2022-03-13 Thread Sughosh Ganu
hi Simon, On Sat, 12 Mar 2022 at 08:14, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 9 Mar 2022 at 05:28, Sughosh Ganu wrote: > > > > The TPM device comes with the random number generator(RNG) > > functionality which is built into the TPM device. Add logic t

Re: [PATCH v4 3/8] tpm: rng: Add driver model interface for TPM RNG device

2022-03-13 Thread Sughosh Ganu
hi Simon, On Sat, 12 Mar 2022 at 08:14, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 9 Mar 2022 at 05:28, Sughosh Ganu wrote: > > > > The TPM device has a builtin random number generator(RNG) > > functionality. Expose the RNG functions of the TPM dev

Re: [PATCH v3 8/8] test: rng: Add a UT testcase for the rng command

2022-03-13 Thread Sughosh Ganu
hi Simon, On Sat, 12 Mar 2022 at 08:14, Simon Glass wrote: > > Hi Sughosh, > > On Tue, 8 Mar 2022 at 23:18, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Wed, 9 Mar 2022 at 08:06, Simon Glass wrote: > > > > > > Hi Sughosh, > &

Re: [PATCH v3 6/8] cmd: rng: Add support for selecting RNG device

2022-03-10 Thread Sughosh Ganu
hi Simon, On Wed, 9 Mar 2022 at 21:02, Simon Glass wrote: > > Hi Sugosh, > > On Fri, 4 Mar 2022 at 06:35, Sughosh Ganu wrote: > > > > The 'rng' u-boot command is used for printing a select number of > > random bytes on the console. Currently, the RNG device f

[PATCH v4 7/8] doc: rng: Add documentation for the rng command

2022-03-09 Thread Sughosh Ganu
Add a usage document for the 'rng' u-boot command. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V3: None doc/usage/index.rst | 1 + doc/usage/rng.rst | 25 + 2 files changed, 26 insertions(+) create mode

[PATCH v4 8/8] test: rng: Add a UT testcase for the rng command

2022-03-09 Thread Sughosh Ganu
The 'rng' command dumps a number of random bytes on the console. Add a set of tests for the 'rng' command. The test function performs basic sanity testing of the command. Since a unit test is being added for the command, enable it by default in the sandbox platforms. Signed-off-by: Sughosh Ganu

[PATCH v4 5/8] qemu: arm: Remove platform specific function to get RNG device

2022-03-09 Thread Sughosh Ganu
-off-by: Sughosh Ganu Tested-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V3: None board/emulation/qemu-arm/qemu-arm.c | 42 - 1 file changed, 42 deletions(-) diff --git a/board/emulation/qemu-arm/qemu-arm.c b

[PATCH v4 6/8] cmd: rng: Add support for selecting RNG device

2022-03-09 Thread Sughosh Ganu
through the TPM chip. Extend the 'rng' command so that the user can provide the RNG device number from which the random bytes are to be read. This will be the device index under the RNG uclass. Signed-off-by: Sughosh Ganu Tested-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- Changes

[PATCH v4 3/8] tpm: rng: Add driver model interface for TPM RNG device

2022-03-09 Thread Sughosh Ganu
to comply with the driver model api. Signed-off-by: Sughosh Ganu --- Changes since V3: * Move back the driver model interface for the TPM RNG devices under drivers/rng/ directory. * Add a rng read function for the tpm devices which calls the tpm*_get_random API's. * Pass the TPM device

[PATCH v4 4/8] tpm: Add the RNG child device

2022-03-09 Thread Sughosh Ganu
randomisation through the EFI_RNG_PROTOCOL interface. Signed-off-by: Sughosh Ganu --- Changes since V3: * Build the RNG child addition only for the u-boot proper stage using the CONFIG_{SPL,TPL}_BUILD guards instead of CONFIG_TPM config which gets included in all stages. * Remove

[PATCH v4 2/8] tpm: Fix the return type of tpm_startup

2022-03-09 Thread Sughosh Ganu
The tpm_startup function returns negative values for error conditions. Fix the return type of the function to a signed int instead of a u32. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V3: None include/tpm_api.h | 2 +- lib/tpm_api.c

[PATCH v4 1/8] tpm: rng: Change tpm_get_random to return an int

2022-03-09 Thread Sughosh Ganu
function. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since V3: None include/tpm_api.h | 4 ++-- lib/tpm_api.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tpm_api.h b/include

[PATCH v4 0/8] tpm: rng: Move TPM RNG functionality to driver model

2022-03-09 Thread Sughosh Ganu
the RNG child addition only for the u-boot proper stage using the CONFIG_{SPL,TPL}_BUILD guards instead of CONFIG_TPM config which gets included in all stages. * Remove the child_pre_probe callback which was starting the TPM device based on review from Simon. Sughosh Ganu (8): tpm: rng: Change

Re: [PATCH v3 3/8] tpm: rng: Add driver model interface for TPM RNG device

2022-03-09 Thread Sughosh Ganu
hi Simon, On Wed, 9 Mar 2022 at 11:30, Sughosh Ganu wrote: > > hi Simon, > > Thanks for looking into this. I now have a fair idea of the structure > that you are looking for this interface. > > On Wed, 9 Mar 2022 at 08:05, Simon Glass wrote: > > > > Hi Sugosh,

Re: [PATCH v3 8/8] test: rng: Add a UT testcase for the rng command

2022-03-08 Thread Sughosh Ganu
hi Simon, On Wed, 9 Mar 2022 at 08:06, Simon Glass wrote: > > Hi Sughosh, > > On Fri, 4 Mar 2022 at 06:35, Sughosh Ganu wrote: > > > > The 'rng' command dumps a number of random bytes on the console. Add a > > set of tests for the 'rng' command. The test func

Re: [PATCH v3 6/8] cmd: rng: Add support for selecting RNG device

2022-03-08 Thread Sughosh Ganu
hi Simon, On Wed, 9 Mar 2022 at 08:05, Simon Glass wrote: > > Hi Sughosh, > > On Fri, 4 Mar 2022 at 06:35, Sughosh Ganu wrote: > > > > The 'rng' u-boot command is used for printing a select number of > > random bytes on the console. Currently, the RNG device f

Re: [PATCH v3 4/8] tpm: Add the RNG child device

2022-03-08 Thread Sughosh Ganu
hi Simon, On Wed, 9 Mar 2022 at 08:05, Simon Glass wrote: > > Hi, > > On Fri, 4 Mar 2022 at 06:35, Sughosh Ganu wrote: > > > > The TPM device comes with the random number generator(RNG) > > functionality which is built into the TPM device. Add logic to add the &

Re: [PATCH v3 3/8] tpm: rng: Add driver model interface for TPM RNG device

2022-03-08 Thread Sughosh Ganu
hi Simon, Thanks for looking into this. I now have a fair idea of the structure that you are looking for this interface. On Wed, 9 Mar 2022 at 08:05, Simon Glass wrote: > > Hi Sugosh, > > On Fri, 4 Mar 2022 at 06:35, Sughosh Ganu wrote: > > > > The TPM device has

Re: [PATCH v2 08/10] tpm: Add the RNG child device

2022-03-05 Thread Sughosh Ganu
hi Simon, On Sun, 6 Mar 2022 at 08:37, Simon Glass wrote: > > Hi Sughosh, > > On Fri, 4 Mar 2022 at 06:44, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Fri, 4 Mar 2022 at 08:07, Simon Glass wrote: > > > > > > Hi Sughosh, > &

Re: [PATCH v2 07/10] tpm: rng: Move the TPM RNG functionality to driver model

2022-03-04 Thread Sughosh Ganu
hi Simon, On Fri, 4 Mar 2022 at 08:08, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 3 Mar 2022 at 05:07, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Thu, 3 Mar 2022 at 09:17, Simon Glass wrote: > > > > > > Hi Sughosh, > &

Re: [PATCH v2 08/10] tpm: Add the RNG child device

2022-03-04 Thread Sughosh Ganu
hi Simon, On Fri, 4 Mar 2022 at 08:07, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 3 Mar 2022 at 05:11, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Thu, 3 Mar 2022 at 09:18, Simon Glass wrote: > > > > > > Hi Sughosh, > &

[PATCH v3 6/8] cmd: rng: Add support for selecting RNG device

2022-03-04 Thread Sughosh Ganu
through the TPM chip. Extend the 'rng' command so that the user can provide the RNG device number from which the random bytes are to be read. This will be the device index under the RNG uclass. Signed-off-by: Sughosh Ganu Tested-by: Heinrich Schuchardt --- Changes since V2: None cmd/rng.c

[PATCH v3 8/8] test: rng: Add a UT testcase for the rng command

2022-03-04 Thread Sughosh Ganu
The 'rng' command dumps a number of random bytes on the console. Add a set of tests for the 'rng' command. The test function performs basic sanity testing of the command. Since a unit test is being added for the command, enable it by default in the sandbox platforms. Signed-off-by: Sughosh Ganu

[PATCH v3 4/8] tpm: Add the RNG child device

2022-03-04 Thread Sughosh Ganu
randomisation through the EFI_RNG_PROTOCOL interface. Signed-off-by: Sughosh Ganu --- Changes since V2: * Enable DM_RNG when CONFIG_TPM is enabled to build the RNG uclass code drivers/tpm/tpm-uclass.c | 60 +--- lib/Kconfig | 1 + 2 files changed

[PATCH v3 7/8] doc: rng: Add documentation for the rng command

2022-03-04 Thread Sughosh Ganu
Add a usage document for the 'rng' u-boot command. Signed-off-by: Sughosh Ganu --- Changes since V2: None doc/usage/index.rst | 1 + doc/usage/rng.rst | 25 + 2 files changed, 26 insertions(+) create mode 100644 doc/usage/rng.rst diff --git a/doc/usage/index.rst b

[PATCH v3 5/8] qemu: arm: Remove platform specific function to get RNG device

2022-03-04 Thread Sughosh Ganu
-off-by: Sughosh Ganu Tested-by: Heinrich Schuchardt --- Changes since V2: None board/emulation/qemu-arm/qemu-arm.c | 42 - 1 file changed, 42 deletions(-) diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c index 16d5a97167

[PATCH v3 3/8] tpm: rng: Add driver model interface for TPM RNG device

2022-03-04 Thread Sughosh Ganu
to comply with the driver model api. Signed-off-by: Sughosh Ganu --- Changes since V2: * Export the existing tpm*_get_random functions to the driver model instead of moving them to the drivers/rng/ directory. include/tpm-v1.h | 4 ++-- include/tpm-v2.h | 4 ++-- lib/tpm-v1.c | 28

[PATCH v3 2/8] tpm: Fix the return type of tpm_startup

2022-03-04 Thread Sughosh Ganu
The tpm_startup function returns negative values for error conditions. Fix the return type of the function to a signed int instead of a u32. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V2: None include/tpm_api.h | 2 +- lib/tpm_api.c | 3 ++- 2 files changed, 3

[PATCH v3 1/8] tpm: rng: Change tpm_get_random to return an int

2022-03-04 Thread Sughosh Ganu
function. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- Changes since V2: None include/tpm_api.h | 4 ++-- lib/tpm_api.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tpm_api.h b/include/tpm_api.h index 11aa14eb79

[PATCH v3 0/8] tpm: rng: Move TPM RNG functionality to driver model

2022-03-04 Thread Sughosh Ganu
' command as suggested by Simon Glass Sughosh Ganu (8): tpm: rng: Change tpm_get_random to return an int tpm: Fix the return type of tpm_startup tpm: rng: Add driver model interface for TPM RNG device tpm: Add the RNG child device qemu: arm: Remove platform specific function to get RNG device

Re: [PATCH v2 08/10] tpm: Add the RNG child device

2022-03-03 Thread Sughosh Ganu
hi Simon, On Thu, 3 Mar 2022 at 09:18, Simon Glass wrote: > > Hi Sughosh, > > On Tue, 1 Mar 2022 at 21:53, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Tue, 1 Mar 2022 at 20:29, Simon Glass wrote: > > > > > > Hi Sughosh, > > >

Re: [PATCH v2 07/10] tpm: rng: Move the TPM RNG functionality to driver model

2022-03-03 Thread Sughosh Ganu
hi Simon, On Thu, 3 Mar 2022 at 09:17, Simon Glass wrote: > > Hi Sughosh, > > On Tue, 1 Mar 2022 at 21:36, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Tue, 1 Mar 2022 at 20:28, Simon Glass wrote: > > > > > > Hi Sughosh, > > >

Re: [PATCH v2 06/10] configs: chromebook_coral: Build TPMV1 library routines

2022-03-02 Thread Sughosh Ganu
hi Simon, On Wed, 2 Mar 2022 at 21:02, Simon Glass wrote: > > Hi Sughosh, > > On Tue, 1 Mar 2022 at 21:50, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Tue, 1 Mar 2022 at 20:29, Simon Glass wrote: > > > > > > Hi Sughosh, > > >

Re: [PATCH v2 10/10] cmd: rng: Add support for selecting RNG device

2022-03-01 Thread Sughosh Ganu
hi Simon, On Tue, 1 Mar 2022 at 20:29, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 28 Feb 2022 at 05:07, Sughosh Ganu wrote: > > > > The 'rng' u-boot command is used for printing a select number of > > random bytes on the console. Currently, the RNG device f

Re: [PATCH v2 08/10] tpm: Add the RNG child device

2022-03-01 Thread Sughosh Ganu
hi Simon, On Tue, 1 Mar 2022 at 20:29, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 28 Feb 2022 at 05:07, Sughosh Ganu wrote: > > > > The TPM device comes with the random number generator(RNG) > > functionality which is built into the TPM device. Add logic t

Re: [PATCH v2 06/10] configs: chromebook_coral: Build TPMV1 library routines

2022-03-01 Thread Sughosh Ganu
hi Simon, On Tue, 1 Mar 2022 at 20:29, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 28 Feb 2022 at 05:07, Sughosh Ganu wrote: > > > > The TPM code currently does a runtime detection of the TPM version and > > calls appropriate functions. Chromebook Coral is

Re: [PATCH v2 04/10] tpm: Move the TPM version detection functions to the uclass driver

2022-03-01 Thread Sughosh Ganu
hi Simon, On Tue, 1 Mar 2022 at 20:29, Simon Glass wrote: > > On Mon, 28 Feb 2022 at 05:07, Sughosh Ganu wrote: > > > > Make the TPM version detection functions as external symbols and move > > them to the TPM uclass driver. These are useful functions to check th

Re: [PATCH v2 07/10] tpm: rng: Move the TPM RNG functionality to driver model

2022-03-01 Thread Sughosh Ganu
hi Simon, On Tue, 1 Mar 2022 at 20:28, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 28 Feb 2022 at 05:07, Sughosh Ganu wrote: > > > > Currently, the TPM random number generator(RNG) functions are defined > > as part of the library functions under the corresp

[PATCH v2 10/10] cmd: rng: Add support for selecting RNG device

2022-02-28 Thread Sughosh Ganu
through the TPM chip. Extend the 'rng' command so that the user can provide the RNG device number from which the random bytes are to be read. This will be the device index under the RNG uclass. Signed-off-by: Sughosh Ganu Tested-by: Heinrich Schuchardt --- Changes since V1: * Changed the help

[PATCH v2 07/10] tpm: rng: Move the TPM RNG functionality to driver model

2022-02-28 Thread Sughosh Ganu
it call the TPM RNG driver functions instead of the library functions. Signed-off-by: Sughosh Ganu --- Changes since V1: * Added existing copyrights for the rng functions taken from the tpm library routines * Return -EIO for TPM command returning an error * Simplify the logic in tpm_get_random

[PATCH v2 08/10] tpm: Add the RNG child device

2022-02-28 Thread Sughosh Ganu
randomisation through the EFI_RNG_PROTOCOL interface. Signed-off-by: Sughosh Ganu --- Changes since V1: None drivers/tpm/tpm-uclass.c | 58 +--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/drivers/tpm/tpm-uclass.c b/drivers/tpm/tpm-uclass.c

[PATCH v2 06/10] configs: chromebook_coral: Build TPMV1 library routines

2022-02-28 Thread Sughosh Ganu
and determine the TPM version at runtime like other platforms. Signed-off-by: Sughosh Ganu --- Changes since V1: None configs/chromebook_coral_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/chromebook_coral_defconfig b/configs/chromebook_coral_defconfig index 0cd8f39aa3

[PATCH v2 09/10] qemu: arm: Remove platform specific function to get RNG device

2022-02-28 Thread Sughosh Ganu
-off-by: Sughosh Ganu Tested-by: Heinrich Schuchardt --- Changes since V1: None board/emulation/qemu-arm/qemu-arm.c | 42 - 1 file changed, 42 deletions(-) diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c index 16d5a97167

[PATCH v2 05/10] configs: gazerbeam: Build TPMV2 library routines

2022-02-28 Thread Sughosh Ganu
and determine the TPM version at runtime like other platforms. Signed-off-by: Sughosh Ganu --- Changes since V1: None configs/gazerbeam_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/gazerbeam_defconfig b/configs/gazerbeam_defconfig index 199afb4d16..b18194aa0f 100644

[PATCH v2 04/10] tpm: Move the TPM version detection functions to the uclass driver

2022-02-28 Thread Sughosh Ganu
Make the TPM version detection functions as external symbols and move them to the TPM uclass driver. These are useful functions to check the TPM device version and should not be static functions. Signed-off-by: Sughosh Ganu Reviewed-by: Heinrich Schuchardt --- Changes since V1: None drivers

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