summaryrefslogtreecommitdiff
path: root/src/security/tpm/tspi
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2019-10-14 17:06:27 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-10-17 15:07:31 +0000
commit6d5fcf4fbe90bb869d4ac1057ce6f23cd4b03567 (patch)
treeb7ccd4d09b9a901409d64ccf0e5978c50340f5be /src/security/tpm/tspi
parente67dce0f9467340679950dab8fbe6dfe4f0ce1ba (diff)
security/tpm: Add a Kconfig to disregard INVALID_POSTINIT on startup
There are use cases where TPM has already been set up in a previous stage, e.g. TXT or when a CPU reset without a platform reset happens. If this is the case the TPM startup will return a INVALID_POSTINIT (return code 0x26). This adds a Kconfig to allow platforms to disregard that return code. Change-Id: I238b30866f78608c414de877b05a73cf8fdb9bbd Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36027 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/security/tpm/tspi')
-rw-r--r--src/security/tpm/tspi/tspi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c
index 4698a4dc8c..966b8b7c77 100644
--- a/src/security/tpm/tspi/tspi.c
+++ b/src/security/tpm/tspi/tspi.c
@@ -141,6 +141,11 @@ uint32_t tpm_setup(int s3flag)
}
result = tlcl_startup();
+ if (CONFIG(TPM_STARTUP_IGNORE_POSTINIT)
+ && result == TPM_E_INVALID_POSTINIT) {
+ printk(BIOS_DEBUG, "TPM: ignoring invalid POSTINIT\n");
+ result = TPM_SUCCESS;
+ }
if (result != TPM_SUCCESS) {
printk(BIOS_ERR, "TPM: Can't run startup command.\n");
return tpm_setup_epilogue(result);