From 939160b5b82424e57457a3d07dccfe7127681787 Mon Sep 17 00:00:00 2001 From: Namyoon Woo Date: Wed, 30 Oct 2019 16:57:44 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1891523 Reviewed-by: Andrey Pronin --- common/tpm_registers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- cgit v1.2.1