summaryrefslogtreecommitdiff
path: root/src/vboot
diff options
context:
space:
mode:
Diffstat (limited to 'src/vboot')
-rw-r--r--src/vboot/Kconfig4
-rw-r--r--src/vboot/secdata_tpm.c33
2 files changed, 20 insertions, 17 deletions
diff --git a/src/vboot/Kconfig b/src/vboot/Kconfig
index b5c862620f..e67c108d4a 100644
--- a/src/vboot/Kconfig
+++ b/src/vboot/Kconfig
@@ -142,6 +142,10 @@ config VBOOT_HAS_REC_HASH_SPACE
Set this option to indicate to vboot that recovery data hash space
is present in TPM.
+config VBOOT_SOFT_REBOOT_WORKAROUND
+ bool
+ default n
+
config VBOOT
bool "Verify firmware with vboot."
default n
diff --git a/src/vboot/secdata_tpm.c b/src/vboot/secdata_tpm.c
index c5d08ce27f..37bba80f06 100644
--- a/src/vboot/secdata_tpm.c
+++ b/src/vboot/secdata_tpm.c
@@ -424,23 +424,22 @@ uint32_t setup_tpm(struct vb2_context *ctx)
return TPM_SUCCESS;
}
-#ifdef TEGRA_SOFT_REBOOT_WORKAROUND
- result = tlcl_startup();
- if (result == TPM_E_INVALID_POSTINIT) {
- /*
- * Some prototype hardware doesn't reset the TPM on a CPU
- * reset. We do a hard reset to get around this.
- */
- VBDEBUG("TPM: soft reset detected\n", result);
- ctx->flags |= VB2_CONTEXT_SECDATA_WANTS_REBOOT;
- return TPM_E_MUST_REBOOT;
- } else if (result != TPM_SUCCESS) {
- VBDEBUG("TPM: tlcl_startup returned %08x\n", result);
- return result;
- }
-#else
- RETURN_ON_FAILURE(tlcl_startup());
-#endif
+ if (IS_ENABLED(CONFIG_VBOOT_SOFT_REBOOT_WORKAROUND)) {
+ result = tlcl_startup();
+ if (result == TPM_E_INVALID_POSTINIT) {
+ /*
+ * Some prototype hardware doesn't reset the TPM on a CPU
+ * reset. We do a hard reset to get around this.
+ */
+ VBDEBUG("TPM: soft reset detected\n");
+ ctx->flags |= VB2_CONTEXT_SECDATA_WANTS_REBOOT;
+ return TPM_E_MUST_REBOOT;
+ } else if (result != TPM_SUCCESS) {
+ VBDEBUG("TPM: tlcl_startup returned %08x\n", result);
+ return result;
+ }
+ } else
+ RETURN_ON_FAILURE(tlcl_startup());
/*
* Some TPMs start the self test automatically at power on. In that case