From 469af7b1d7f2d4f4242e056b714e416e5fe921ea Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Tue, 7 Nov 2017 09:13:19 -0800 Subject: 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 Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/22379 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie Reviewed-by: Aaron Durbin --- src/drivers/i2c/tpm/cr50.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/drivers/i2c/tpm') diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c index baf5fe0cce..9cc9e95ffb 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 @@ int tpm_vendor_probe(unsigned int bus, uint32_t addr) 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; -- cgit v1.2.3