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>
This commit is contained in:
Duncan Laurie 2017-11-07 09:13:19 -08:00 committed by Furquan Shaikh
parent 605c2dc251
commit 469af7b1d7
1 changed files with 2 additions and 1 deletions

View File

@ -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;