summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2019-10-30 16:57:44 -0700
committerCommit Bot <commit-bot@chromium.org>2019-12-10 17:27:38 +0000
commitf6eac964c6a26b0026932a8187b6c4f76e06d0f2 (patch)
treecdf5051ec11cc9f4c6a9a766a741fbf3c7bdf322
parentdc65233ded51803c54b72bdb137ef0685f2e43a8 (diff)
downloadchrome-ec-f6eac964c6a26b0026932a8187b6c4f76e06d0f2.tar.gz
cr50: narrow the condition for custom TPM command codes
CR50 used to detects the custom TPM command code if the vendor specific bit field is set. This patch enfornces this condition by comparing the command code to 0x20000000 value. It is planned to support extended TPM commands, which are not yet standard, and those commands shall have 0x20000000|x as their command code. This patch will pass those commands to tpm2 library directly by calling ExecuteCommand(). BUG=b:140527213 BRANCH=cr50 TEST=ran gsctools with -m, -o, -i options. Cq-Depend: chromium:1892419 Change-Id: I43ce52bee96f6b6def8e4bf3a14f092b3235740a Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1891523 Reviewed-by: Andrey Pronin <apronin@chromium.org> (cherry picked from commit 939160b5b82424e57457a3d07dccfe7127681787) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1958419
-rw-r--r--common/tpm_registers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c
index 6a57fa814f..cd50c8574a 100644
--- a/common/tpm_registers.c
+++ b/common/tpm_registers.c
@@ -643,7 +643,7 @@ size_t tpm_get_burst_size(void)
/* Recognize both original extension and new vendor-specific command codes */
#define IS_CUSTOM_CODE(code) \
((code == CONFIG_EXTENSION_COMMAND) || \
- (code & TPM_CC_VENDOR_BIT_MASK))
+ (code == TPM_CC_VENDOR_BIT_MASK))
static void call_extension_command(struct tpm_cmd_header *tpmh,
size_t *total_size,