tpm/tpm_setup: fail on invalid result from tlcl_resume

BUG=b:114018226
TEST=compile coreboot

Change-Id: I8f5df2b0119d35e4000fe62bf1bba6ca07f925f3
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://review.coreboot.org/28748
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Joel Kitching 2018-09-26 17:40:22 +08:00 committed by Patrick Georgi
parent 10d7845f09
commit 15eb58d77b
1 changed files with 18 additions and 3 deletions

View File

@ -97,10 +97,25 @@ uint32_t tpm_setup(int s3flag)
/* Handle special init for S3 resume path */
if (s3flag) {
result = tlcl_resume();
if (result == TPM_E_INVALID_POSTINIT)
printk(BIOS_INFO, "TPM: Already initialized.\n");
switch (result) {
case TPM_SUCCESS:
break;
return TPM_SUCCESS;
case TPM_E_INVALID_POSTINIT:
/*
* We're on a platform where the TPM maintains power
* in S3, so it's already initialized.
*/
printk(BIOS_INFO, "TPM: Already initialized.\n");
result = TPM_SUCCESS;
break;
default:
printk(BIOS_ERR, "TPM: Resume failed (%#x).\n", result);
break;
}
goto out;
}
result = tlcl_startup();