diff options
author | Vadim Sukhomlinov <sukhomlinov@google.com> | 2020-06-02 11:39:41 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-04 04:28:22 +0000 |
commit | 4fd5c9a385b1a2388d6e7ab282ed5bb570e43288 (patch) | |
tree | 1e0f9a7fd5efd3e58d2dd63bb981c86aea10decc /test/tpm_test/ftdi_spi_tpm.c | |
parent | 80f707188fad40701201bc1bb13b4f7558f42528 (diff) | |
download | chrome-ec-4fd5c9a385b1a2388d6e7ab282ed5bb570e43288.tar.gz |
tpmtest/ftdi: improved stability and support for ISERIAL
FTDI module used by tpmtest has stability issues, causing unstable
connection, which seemed to be dependent on setup delay. increased delay
to make it more stable.
Also, FTDI don't work correctly with multiple Ultradebug interfaces.
Make it use ISERIAL env variable if configured to guide interface choice.
BUG=None
TEST=make
Change-Id: Ifa27aac7ef42a8eb990963fa0cf1923a7405f0c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2226139
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Diffstat (limited to 'test/tpm_test/ftdi_spi_tpm.c')
-rw-r--r-- | test/tpm_test/ftdi_spi_tpm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/tpm_test/ftdi_spi_tpm.c b/test/tpm_test/ftdi_spi_tpm.c index 4fc281aa24..ebec39b766 100644 --- a/test/tpm_test/ftdi_spi_tpm.c +++ b/test/tpm_test/ftdi_spi_tpm.c @@ -86,7 +86,7 @@ void FtdiStop(void) static void FtdiSpiPoke(void) { Start(mpsse_); - usleep(1000); + usleep(10000); Stop(mpsse_); usleep(60000); } @@ -248,7 +248,7 @@ int FtdiSpiInit(uint32_t freq, int enable_debug) freq = (freq / (100 * 1000)) * 100 * 1000; printf("Starting MPSSE at %d kHz\n", freq / 1000); - mpsse_ = MPSSE(freq, MSB, NULL); + mpsse_ = MPSSE(freq, MSB, getenv("ISERIAL")); if (!mpsse_) return false; @@ -257,6 +257,7 @@ int FtdiSpiInit(uint32_t freq, int enable_debug) FtdiSpiPoke(); + printf("Reading TPM_DID_VID register\n"); FtdiReadReg(TPM_DID_VID_REG, sizeof(did_vid), &did_vid); vid = did_vid & 0xffff; @@ -264,7 +265,7 @@ int FtdiSpiInit(uint32_t freq, int enable_debug) fprintf(stderr, "unknown did_vid: %#x\n", did_vid); return false; } - + printf("Claiming TPM locality zero.\n"); /* Try claiming locality zero. */ FtdiReadReg(TPM_ACCESS_REG, sizeof(cmd), &cmd); if ((cmd & (activeLocality & tpmRegValidSts)) == |