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-09 18:09:01 +0000
commit939160b5b82424e57457a3d07dccfe7127681787 (patch)
tree5c2d381704826810cc892f73a2755d14b56c8e23
parent76f923047f4395993d4df7bae0c7d7d515075887 (diff)
downloadchrome-ec-939160b5b82424e57457a3d07dccfe7127681787.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>
-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,