summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2020-10-19 19:47:24 +0000
committerCommit Bot <commit-bot@chromium.org>2020-10-29 18:57:56 +0000
commit9589af4d494a070ff02b4cd6fe7c33b1b2b40623 (patch)
tree0d58ca97092f0b5a1617c83564563766fb4b6a05
parent41997f691cfd87332af4ad155f8cb9268d86cae9 (diff)
downloadchrome-ec-9589af4d494a070ff02b4cd6fe7c33b1b2b40623.tar.gz
Revert "cr50: debounce successive TPM reset pulses"
This reverts commit 4805196e894a73a2a1285f1cd622d160ad248f77. Reason for revert: We aren't planning on landing this in the branch. Reduce the difference between TOT and the branch by reverting this. BUG=b:164130916 TEST=run ccd open with TOT image Original change's description: > cr50: debounce successive TPM reset pulses > > Some platforms generate more than one pulse when resetting, many Intel > SOCs generate two pulses, some other chips could go even higher. > > TPM reset on Cr50 is processed asynchronously, repetitive pulses > result in multiple reset processing cycles.In case pulses are coming > too soon one after another this could cause some race conditions. > > Let's ignore repetitive reset pulses unless there has been an attempt > by the host to read a register (which is usually the very first action > of the AP when booting up). > > BRANCH=cr50, cr50-mp > BUG=none > TEST=observed that only one reset is happening on an Octopus device, > while there are two pulses present on the PLT_RST_L line. > > Verified proper reboot multiple times in a row. > > Change-Id: Ie1b124d41be0388bd8e12d0084827782de62cfa0 > Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1755059 > Reviewed-by: Mary Ruthven <mruthven@chromium.org> Bug: none Change-Id: Ifbe8afea87c522c94cf9ab73cca8a1489ec3956b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2485927
-rw-r--r--common/tpm_registers.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c
index db2cba9b88..2bea30bb29 100644
--- a/common/tpm_registers.c
+++ b/common/tpm_registers.c
@@ -436,6 +436,9 @@ void tpm_register_put(uint32_t regaddr, const uint8_t *data, uint32_t data_size)
{
uint32_t i;
+ if (reset_in_progress)
+ return;
+
CPRINTF("%s(0x%03x, %d,", __func__, regaddr, data_size);
for (i = 0; i < data_size && i < 4; i++)
CPRINTF(" %02x", data[i]);
@@ -510,8 +513,6 @@ void tpm_register_get(uint32_t regaddr, uint8_t *dest, uint32_t data_size)
{
int i;
- reset_in_progress = 0;
-
CPRINTF("%s(0x%06x, %d)", __func__, regaddr, data_size);
switch (regaddr) {
case TPM_DID_VID:
@@ -883,6 +884,8 @@ static void tpm_reset_now(int wipe_first)
*/
hook_call_deferred(&reinstate_nvmem_commits_data, 3 * SECOND);
+ reset_in_progress = 0;
+
if_start();
}