[PATCH V2 2/2] cmd: tpm: add a subcommand device

Simon Glass sjg at chromium.org
Fri Jan 10 10:39:28 CET 2020


On Fri, 10 Jan 2020 at 03:25, Philippe Reynes
<philippe.reynes at softathome.com> wrote:
>
> The command tpm (and tpm2) search the tpm and use it.
> On sandbox, there are two tpm (tpm 1.x and tpm 2.0).
> So the command tpm and tpm2 are always executed with
> the first tpm (tpm 1.x), and the command tpm2 always
> fails.
>
> This add a subcommand device to command tpm and
> command tpm2. Then the command tpm and tpm2 use
> the device selected with the subcommand device.
>
> To be compatible with previous behaviour, if the
> subcommand device is not used before a tpm (or tpm2)
> command, the device 0 is selected.
>
> Signed-off-by: Philippe Reynes <philippe.reynes at softathome.com>
> ---
>  cmd/tpm-common.c     | 77 +++++++++++++++++++++++++++++++++++++++++++++++++---
>  cmd/tpm-user-utils.h |  1 +
>  cmd/tpm-v1.c         |  3 ++
>  cmd/tpm-v2.c         |  3 ++
>  4 files changed, 80 insertions(+), 4 deletions(-)
>
> Changelog:
> v2:
> - use helper for tpm device (idea from Miquel)
> - don't set tpm in the look (feedback from Miquel)
> - add a comment to explain the backward code (feedback from Miquel)
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list