summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-11-07 08:00:21 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-12-16 01:13:14 +0000
commit1e9994dc36a1e46392afef75dd4d07192efe5559 (patch)
treede3615453cce5afee8e8bfdaf2152e56213a2c4a
parent6c9daae64eee67fc15dead5e1bf1e88de370f245 (diff)
downloadchrome-ec-1e9994dc36a1e46392afef75dd4d07192efe5559.tar.gz
cr50: fix event definition collision
Events used when TPM task is running are defined in two different places, one of them shared with other boards running on H1. Let's avoid collision by redefining Cr50 only events to be different from shared ones used by dcrypto. BRANCH=cr50 BUG=b:68729265 TEST=verified that there is no more 'tpm_reset_request: already scheduled' messages generated when TPM is reset when performing long dcrypto operation. Change-Id: Ic9517fa98be21f3ef5f19b82c593d96b0ddbaf6b Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/756914 Reviewed-by: Nagendra Modadugu <ngm@google.com> Reviewed-by: Duncan Laurie <dlaurie@google.com> Reviewed-by: Mary Ruthven <mruthven@chromium.org> (cherry picked from commit 0e7186422fea5046f11d15fdcf0647887b2aa4f9) Reviewed-on: https://chromium-review.googlesource.com/766077 (cherry picked from commit ff75794afa2c57db7ff941b41e44d90229724db8) Reviewed-on: https://chromium-review.googlesource.com/828684
-rw-r--r--chip/g/dcrypto/dcrypto_runtime.c4
-rw-r--r--common/tpm_registers.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/chip/g/dcrypto/dcrypto_runtime.c b/chip/g/dcrypto/dcrypto_runtime.c
index 3775ffa13a..e182ca5c3c 100644
--- a/chip/g/dcrypto/dcrypto_runtime.c
+++ b/chip/g/dcrypto/dcrypto_runtime.c
@@ -68,6 +68,10 @@ void dcrypto_unlock(void)
}
#define DCRYPTO_CALL_TIMEOUT_US (700 * 1000)
+/*
+ * When running on Cr50 this event belongs in the TPM task event space. Make
+ * sure there is no collision with events defined in ./common/tpm_regsters.c.
+ */
#define TASK_EVENT_DCRYPTO_DONE TASK_EVENT_CUSTOM(1)
uint32_t dcrypto_call(uint32_t adr)
diff --git a/common/tpm_registers.c b/common/tpm_registers.c
index 06366e3a49..c6813ad633 100644
--- a/common/tpm_registers.c
+++ b/common/tpm_registers.c
@@ -668,10 +668,13 @@ static void call_extension_command(struct tpm_cmd_header *tpmh,
}
#endif
-/* Event (to TPM task) to request reset, or (from TPM task) on completion. */
-#define TPM_EVENT_RESET TASK_EVENT_CUSTOM(1 << 0)
-#define TPM_EVENT_COMMIT TASK_EVENT_CUSTOM(1 << 1)
-#define TPM_EVENT_ALT_EXTENSION TASK_EVENT_CUSTOM(1 << 2)
+/*
+ * Events used on the TPM task context. Make sure there is no collision with
+ * event(s) defined in chip/g/dcrypto/dcrypto_runtime.c
+ */
+#define TPM_EVENT_RESET TASK_EVENT_CUSTOM(1 << 1)
+#define TPM_EVENT_COMMIT TASK_EVENT_CUSTOM(1 << 2)
+#define TPM_EVENT_ALT_EXTENSION TASK_EVENT_CUSTOM(1 << 3)
/*
* Result of executing of the TPM command on the alternative path, could have