]> git.baikalelectronics.ru Git - uboot.git/commit
tpm: add a function that performs selftest + startup
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Wed, 25 Jan 2023 10:18:36 +0000 (12:18 +0200)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 28 Feb 2023 07:44:19 +0000 (09:44 +0200)
commit8b64daa6bedc76ecb78988de9329a3f63696e1c7
tree514219591d90388d18495638c3de6800a2cd5438
parent84742ecf18a5a5118ce4f2f816114093452f5309
tpm: add a function that performs selftest + startup

As described in [0] if a command requires use of an untested algorithm
or functional module, the TPM performs the test and then completes the
command actions.

Since we don't check for TPM_RC_NEEDS_TEST (which is the return code of
the TPM in that case) and even if we would, it would complicate our TPM
code for no apparent reason,  add a wrapper function that performs both
the selftest and the startup sequence of the TPM.

It's worth noting that this is implemented on TPMv2.0.  The code for
1.2 would look similar,  but I don't have a device available to test.

[0]
https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.07-2014-03-13.pdf
ยง12.3 Self-test modes

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
include/tpm-v2.h
include/tpm_api.h
lib/tpm-v2.c
lib/tpm_api.c