Hi Matthew,

On Thu, 4 Nov 2021 at 03:14, Mathew McBride <m...@traverse.com.au> wrote:
>
> Without get_desc, the tpm command will not provide a
> description of the device in 'tpm device' or 'tpm info'.
>
> Due to the characteristics of the Atmel TPM it isn't
> possible to determine certain attributes (e.g open/close
> status) without using the TPM stack (compare Infineon
> and ST TPM drivers), so just print out
> the udevice name as a unique identifier.
>
> Signed-off-by: Mathew McBride <m...@traverse.com.au>
> ---
>  drivers/tpm/tpm_atmel_twi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tpm/tpm_atmel_twi.c b/drivers/tpm/tpm_atmel_twi.c
> index 71b101406d..9ca33e4334 100644
> --- a/drivers/tpm/tpm_atmel_twi.c
> +++ b/drivers/tpm/tpm_atmel_twi.c
> @@ -52,7 +52,10 @@ static int tpm_atmel_twi_close(struct udevice *dev)
>   */
>  static int tpm_atmel_twi_get_desc(struct udevice *dev, char *buf, int size)
>  {
> -       return 0;
> +       if (size < 50)
> +               return -ENOSPC;
> +
> +       return snprintf(buf, size, "Atmel 1.2 TPM (%s)", dev->name);

Is there anything more helpful we can print on that? Device ID,
manufacturer ID maybe?


Regards
/Ilias
>  }
>
>  /*
> --
> 2.30.1
>

Reply via email to