public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v6 0/7] tpm: rng: Move TPM RNG functionality to driver model
@ 2022-07-04 13:34 Sughosh Ganu
  2022-07-04 13:34 ` [PATCH v6 1/7] tpm: Export the TPM-version functions Sughosh Ganu
                   ` (7 more replies)
  0 siblings, 8 replies; 30+ messages in thread
From: Sughosh Ganu @ 2022-07-04 13:34 UTC (permalink / raw)
  To: u-boot; +Cc: Heinrich Schuchardt, Ilias Apalodimas, Simon Glass, Tom Rini


The TPM device provides the random number generator(RNG)
functionality, whereby sending a command to the TPM device results in
the TPM device responding with random bytes.

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.

The TPM uclass driver adds the RNG child device as part of it's
post_probe function.

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.

This series depends on a patch[2] from Simon Glass for moving the TPM
device version detection functions to the tpm_api.h header as static
inline functions.

These patches were under discussion earlier, specifically the patch to
add the RNG functionality under the TPM device as a child, either
through manual binding or through the device tree. Ilias had commented
on the discussion last[3]. The discussion can be resumed through this
version.

I have dropped certain patches which were changing some of the TPM API
functions to return an int instead of the current u32. These patches
have been dropped due to review comments from Simon[4]. This work can
be taken up separately, if desired.

[1] - https://lore.kernel.org/u-boot/20220103120738.47835-1-ilias.apalodimas@linaro.org/
[2] - https://lore.kernel.org/u-boot/20220301001125.1554442-2-sjg@chromium.org/T/#u
[3] - https://lists.denx.de/pipermail/u-boot/2022-April/481708.html
[4] - https://lists.denx.de/pipermail/u-boot/2022-March/477883.html

Simon Glass (1):
  tpm: Export the TPM-version functions

Sughosh Ganu (6):
  tpm: rng: Add driver model interface for TPM RNG device
  tpm: Add the RNG child device
  cmd: rng: Add support for selecting RNG device
  cmd: rng: Use a statically allocated array for random bytes
  doc: rng: Add documentation for the rng command
  test: rng: Add a UT testcase for the rng command

 cmd/Kconfig              |  1 +
 cmd/rng.c                | 42 +++++++++++------
 doc/usage/cmd/rng.rst    | 26 +++++++++++
 doc/usage/index.rst      |  1 +
 drivers/rng/Kconfig      | 11 +++++
 drivers/rng/Makefile     |  1 +
 drivers/rng/tpm_rng.c    | 23 ++++++++++
 drivers/tpm/tpm-uclass.c | 37 +++++++++++++--
 include/tpm_api.h        | 10 ++++
 lib/Kconfig              |  1 +
 lib/tpm-v1.c             | 13 +++---
 lib/tpm-v2.c             |  6 +--
 lib/tpm_api.c            | 98 ++++++++++++++++++----------------------
 test/dm/rng.c            | 29 ++++++++++++
 14 files changed, 217 insertions(+), 82 deletions(-)
 create mode 100644 doc/usage/cmd/rng.rst
 create mode 100644 drivers/rng/tpm_rng.c

-- 
2.25.1



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

end of thread, other threads:[~2022-07-15 15:39 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-04 13:34 [PATCH v6 0/7] tpm: rng: Move TPM RNG functionality to driver model Sughosh Ganu
2022-07-04 13:34 ` [PATCH v6 1/7] tpm: Export the TPM-version functions Sughosh Ganu
2022-07-06  8:59   ` Ilias Apalodimas
2022-07-04 13:34 ` [PATCH v6 2/7] tpm: rng: Add driver model interface for TPM RNG device Sughosh Ganu
2022-07-05  9:47   ` Simon Glass
2022-07-05 17:23     ` Sughosh Ganu
2022-07-12 10:58       ` Simon Glass
2022-07-06 13:26   ` Ilias Apalodimas
2022-07-04 13:34 ` [PATCH v6 3/7] tpm: Add the RNG child device Sughosh Ganu
2022-07-05  9:47   ` Simon Glass
2022-07-08  8:23     ` Ilias Apalodimas
2022-07-12 10:58       ` Simon Glass
2022-07-12 14:11         ` Rob Herring
2022-07-13 15:28           ` Simon Glass
2022-07-13 18:09             ` Tom Rini
2022-07-14 10:21               ` Simon Glass
2022-07-14 11:19                 ` Tom Rini
2022-07-14 14:51                   ` Simon Glass
2022-07-14 15:47                     ` Ilias Apalodimas
2022-07-14 16:04                       ` Tom Rini
2022-07-14 17:55             ` Rob Herring
2022-07-15 15:38               ` Simon Glass
2022-07-04 13:34 ` [PATCH v6 4/7] cmd: rng: Add support for selecting RNG device Sughosh Ganu
2022-07-04 13:34 ` [PATCH v6 5/7] cmd: rng: Use a statically allocated array for random bytes Sughosh Ganu
2022-07-05  9:47   ` Simon Glass
2022-07-06 13:31   ` Ilias Apalodimas
2022-07-04 13:34 ` [PATCH v6 6/7] doc: rng: Add documentation for the rng command Sughosh Ganu
2022-07-04 13:34 ` [PATCH v6 7/7] test: rng: Add a UT testcase " Sughosh Ganu
2022-07-06 13:32   ` Ilias Apalodimas
2022-07-05  9:47 ` [PATCH v6 0/7] tpm: rng: Move TPM RNG functionality to driver model Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox