diff options
author | Andrey Pronin <apronin@chromium.org> | 2019-01-10 17:45:52 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-01-13 13:52:14 -0800 |
commit | 0d41bed0bccfdfd82361788cf89a37caff08dd9f (patch) | |
tree | dff210ecb720e7f4a430649f3d815dcfa7783886 | |
parent | c3201953492bb906a7238345027aa9ebde42e5bd (diff) | |
download | chrome-ec-0d41bed0bccfdfd82361788cf89a37caff08dd9f.tar.gz |
cr50: reset burstcnt to max when entering idle
Before this CL, when entering idle state after aborted command
(response not read or read partially, then aborted by setting
COMMAND_READY set in STS), the last burstcnt set for the response
was carried over to processing the next command.
Reset burstcnt on entering idle to max value, as we do in tpm_init
and fifo_reg_read when the last chunk is read.
BUG=b:118178519
BRANCH=cr50, cr50-mp
TEST=1) boot, login normally;
2) imitate lost TPM ready IRQs in host tpm driver (see BUG),
verify that trunksd starts and TPM communication work after that.
Change-Id: I76061090bf48a36509ab7f4678716f8bc426846a
Signed-off-by: Andrey Pronin <apronin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1405626
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | common/tpm_registers.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c index 52f4bce91d..5a81e0ca6b 100644 --- a/common/tpm_registers.c +++ b/common/tpm_registers.c @@ -189,6 +189,9 @@ static void set_tpm_state(enum tpm_states state) tpm_.fifo_read_index = 0; tpm_.fifo_write_index = 0; tpm_.regs.sts &= ~data_avail; + /* Set burst size for the following write requests. */ + tpm_.regs.sts &= ~(burst_count_mask << burst_count_shift); + tpm_.regs.sts |= 63 << burst_count_shift; } } |