06 Feb, 2020

1 commit

  • 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
    Reviewed-by: Miquel Raynal

    Philippe Reynes
     

26 May, 2018

1 commit

  • There are no changes in this commit but a new organization of the code
    as follow.

    * cmd/ directory:
    > move existing code from cmd/tpm.c in cmd/tpm-common.c
    > move specific code in cmd/tpm-v1.c
    > create a specific header file with generic definitions for
    commands only called cmd/tpm-user-utils.h

    * lib/ directory:
    > move existing code from lib/tpm.c in lib/tpm-common.c
    > move specific code in lib/tpm-v1.c
    > create a specific header file with generic definitions for
    the library itself called lib/tpm-utils.h

    * include/ directory:
    > move existing code from include/tpm.h in include/tpm-common.h
    > move specific code in include/tpm-v1.h

    Code designated as 'common' is compiled if TPM are used. Code designated
    as 'specific' is compiled only if the right specification has been
    selected.

    All files include tpm-common.h.
    Files in cmd/ include tpm-user-utils.h.
    Files in lib/ include tpm-utils.h.
    Depending on the specification, files may include either (not both)
    tpm-v1.h or tpm-v2.h.

    Signed-off-by: Miquel Raynal
    Reviewed-by: Tom Rini
    [trini: Fix a few more cases of tpm.h -> tpm-v1.h, some Kconfig logic]
    Signed-off-by: Tom Rini

    Miquel Raynal