cr50: log I2C slave 'wedged bus recovery' event

We want to be able to collect statistics of the i2c bus problems. This
patch logs an event each time the wedged bus recovery happens.

BRANCH=cr50
BUG=b:63760920
TEST=with the upcoming patches verified that i2c recovery events are
     logged as expected.

Change-Id: I1241b2dece33f89cd724d53a48f94e17f4415c62
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/620114
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Vadim Bendebury
2017-08-17 20:19:08 -07:00
committed by chrome-bot
parent e24bd63fae
commit 52527acbfb
2 changed files with 7 additions and 1 deletions

View File

@@ -71,6 +71,7 @@
#include "registers.h"
#include "system.h"
#include "task.h"
#include "tpm_log.h"
#define REGISTER_FILE_SIZE (1 << 6) /* 64 bytes. */
#define REGISTER_FILE_MASK (REGISTER_FILE_SIZE - 1)
@@ -175,6 +176,11 @@ static void poll_read_state(void)
i2cs_read_recovery_count++;
i2cs_register_write_complete_handler
(write_complete_handler_);
#ifdef CONFIG_TPM_LOGGING
tpm_log_event(TPM_I2C_RESET,
i2cs_read_recovery_count);
#endif
return;
}
last_i2cs_read_irq_count = i2cs_read_irq_count;

View File

@@ -10,7 +10,7 @@
enum tpm_event {
TPM_EVENT_INIT,
/* TODO: Add log events */
TPM_I2C_RESET,
};
/* Log TPM event of given type with data payload. */