drivers/i2c/tpm/cr50: Increase init delay to 30 seconds
In case the TPM is doing a long crypto operation the initial probe
could be very delayed. Rather than end up in recovery make the delay
long enough to accommodate the (current) long crypto times.
BUG=b:65867313, b:68729265
TEST=Verified that Soraka no longer hangs during EC reboot test.
Change-Id: I3bccff70e001dfc065c24be8ad34ef239a144db1
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/22379
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c
index baf5fe0..9cc9e95 100644
--- a/src/drivers/i2c/tpm/cr50.c
+++ b/src/drivers/i2c/tpm/cr50.c
@@ -43,6 +43,7 @@
#include "tpm.h"
#define CR50_MAX_BUFSIZE 63
+#define CR50_TIMEOUT_INIT_MS 30000 /* Very long timeout for TPM init */
#define CR50_TIMEOUT_LONG_MS 2000 /* Long timeout while waiting for TPM */
#define CR50_TIMEOUT_SHORT_MS 2 /* Short timeout during transactions */
#define CR50_TIMEOUT_NOIRQ_MS 20 /* Timeout for TPM ready without IRQ */
@@ -423,7 +424,7 @@
struct stopwatch sw;
uint8_t buf = 0;
int ret;
- long sw_run_duration = CR50_TIMEOUT_LONG_MS;
+ long sw_run_duration = CR50_TIMEOUT_INIT_MS;
tpm_dev->bus = bus;
tpm_dev->addr = addr;