summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2018-09-26 17:40:22 +0800
committerPatrick Georgi <pgeorgi@google.com>2018-10-17 12:04:41 +0000
commit15eb58d77bf7f4d5630c0331ac46a602551931ab (patch)
treea31f85bb2a0a7690210a34b53078c597689c54e1 /src
parent10d7845f0946b41faeac6f08b16f99051bc38660 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/security/tpm/tspi/tspi.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c
index fccf224519..c1779e677a 100644
--- a/src/security/tpm/tspi/tspi.c
+++ b/src/security/tpm/tspi/tspi.c
@@ -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)
+ switch (result) {
+ case TPM_SUCCESS:
+ break;
+
+ 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;
- return TPM_SUCCESS;
+ default:
+ printk(BIOS_ERR, "TPM: Resume failed (%#x).\n", result);
+ break;
+
+ }
+ goto out;
}
result = tlcl_startup();