u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] tpm: rng: Move TPM RNG functionality to driver model
@ 2022-02-24 18:05 Sughosh Ganu
  2022-02-24 18:05 ` [PATCH 01/10] tpm: Move tpm-utils header under the include directory Sughosh Ganu
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ messages in thread
From: Sughosh Ganu @ 2022-02-24 18:05 UTC (permalink / raw)
  To: u-boot; +Cc: Ilias Apalodimas, Simon Glass, Heinrich Schuchardt, Mario Six

There was a discussion on the mailing list earlier[1], where it was
explained that platforms with a TPM device can install the
EFI_RNG_PROTOCOL for getting the random bytes instead of populating
the dtb with the kaslr-seed property. That would make it possible to
measure the dtb.

This patchset moves the already existing functions for getting random
bytes from the TPM device to drivers complying with the RNG
uclass. This is done since the EFI_RNG_PROTOCOL's get_rng routine uses
the RNG uclass's dm_rng_read api to get the random bytes.

The TPM uclass driver adds the RNG child device as part of it's
post_probe function. The TPM uclass driver's child_pre_probe function
initialises the TPM parent device for use -- this enables the RNG
child device to be used subsequently.

Some additional changes have also been made to facilitate the
use of the RNG devices, including extending the 'rng' command to take
the RNG device as one of the command-line parameters.

[1] - https://lore.kernel.org/u-boot/20220103120738.47835-1-ilias.apalodimas@linaro.org/


Sughosh Ganu (10):
  tpm: Move tpm-utils header under the include directory
  tpm: rng: Change tpm_get_random to return an int
  tpm: Fix the return type of tpm_startup
  tpm: Move the TPM version detection functions to the uclass driver
  configs: gazerbeam: Build TPMV2 library routines
  configs: chromebook_coral: Build TPMV1 library routines
  tpm: rng: Move the TPM RNG functionality to driver model
  tpm: Add the RNG child device
  qemu: arm: Remove platform specific function to get RNG device
  cmd: rng: Add support for selecting RNG device

 board/emulation/qemu-arm/qemu-arm.c | 42 ------------------
 cmd/rng.c                           | 31 +++++++++----
 configs/chromebook_coral_defconfig  |  1 -
 configs/gazerbeam_defconfig         |  1 -
 drivers/rng/Makefile                |  1 +
 drivers/rng/tpm1_rng.c              | 68 ++++++++++++++++++++++++++++
 drivers/rng/tpm2_rng.c              | 68 ++++++++++++++++++++++++++++
 drivers/tpm/tpm-uclass.c            | 69 +++++++++++++++++++++++++++--
 {lib => include}/tpm-utils.h        |  0
 include/tpm_api.h                   | 26 +++++++++--
 lib/tpm-common.c                    |  2 +-
 lib/tpm-v1.c                        | 46 +------------------
 lib/tpm-v2.c                        | 46 +------------------
 lib/tpm_api.c                       | 42 +++++++++++-------
 14 files changed, 276 insertions(+), 167 deletions(-)
 create mode 100644 drivers/rng/tpm1_rng.c
 create mode 100644 drivers/rng/tpm2_rng.c
 rename {lib => include}/tpm-utils.h (100%)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2022-02-27 12:44 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 18:05 [PATCH 00/10] tpm: rng: Move TPM RNG functionality to driver model Sughosh Ganu
2022-02-24 18:05 ` [PATCH 01/10] tpm: Move tpm-utils header under the include directory Sughosh Ganu
2022-02-24 18:36   ` Heinrich Schuchardt
2022-02-25 15:15   ` Ilias Apalodimas
2022-02-24 18:05 ` [PATCH 02/10] tpm: rng: Change tpm_get_random to return an int Sughosh Ganu
2022-02-24 19:10   ` Heinrich Schuchardt
2022-02-25 15:19   ` Ilias Apalodimas
2022-02-24 18:05 ` [PATCH 03/10] tpm: Fix the return type of tpm_startup Sughosh Ganu
2022-02-24 18:55   ` Heinrich Schuchardt
2022-02-27 12:43     ` Sughosh Ganu
2022-02-24 18:05 ` [PATCH 04/10] tpm: Move the TPM version detection functions to the uclass driver Sughosh Ganu
2022-02-24 18:57   ` Heinrich Schuchardt
2022-02-24 18:05 ` [PATCH 05/10] configs: gazerbeam: Build TPMV2 library routines Sughosh Ganu
2022-02-24 18:05 ` [PATCH 06/10] configs: chromebook_coral: Build TPMV1 " Sughosh Ganu
2022-02-24 18:05 ` [PATCH 07/10] tpm: rng: Move the TPM RNG functionality to driver model Sughosh Ganu
2022-02-24 18:48   ` Heinrich Schuchardt
2022-02-25  5:47     ` Sughosh Ganu
2022-02-25 15:42   ` Ilias Apalodimas
2022-02-24 18:05 ` [PATCH 08/10] tpm: Add the RNG child device Sughosh Ganu
2022-02-24 18:51   ` Heinrich Schuchardt
2022-02-25  5:45     ` Sughosh Ganu
2022-02-25  6:30       ` Heinrich Schuchardt
2022-02-25  6:41         ` Sughosh Ganu
2022-02-24 18:05 ` [PATCH 09/10] qemu: arm: Remove platform specific function to get RNG device Sughosh Ganu
2022-02-24 18:33   ` Heinrich Schuchardt
2022-02-24 18:05 ` [PATCH 10/10] cmd: rng: Add support for selecting " Sughosh Ganu
2022-02-24 18:29   ` Heinrich Schuchardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).