From 1628ef85c9403ff694b52170ca20dc3cade6e4ef Mon Sep 17 00:00:00 2001 From: Namyoon Woo Date: Mon, 6 Apr 2020 18:05:24 -0700 Subject: prevent reading ECRW hash from TPM nvmem on non-EFS2 boards This patch make sure that cr50 attempts to read ECRW hash from TPM nvmem only if the board supports EC-EFS2. Though this attempt is not critical, it prints an read error message in console, which could mislead the reader. BUG=none TEST=none Signed-off-by: Namyoon Woo Change-Id: I95e8407b19259fd62e0d1858efdd2696042dcd95 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2138601 Reviewed-by: Mary Ruthven --- common/ec_efs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/ec_efs.c b/common/ec_efs.c index d7bc881872..a0b912b9a4 100644 --- a/common/ec_efs.c +++ b/common/ec_efs.c @@ -268,6 +268,9 @@ void ec_efs_refresh(void) { int rv; + if (!board_has_ec_cr50_comm_support()) + return; + rv = load_ec_hash_(ec_efs_ctx.hash); if (rv == EC_SUCCESS) { ec_efs_ctx.hash_is_loaded = 1; -- cgit v1.2.1