From f4c496d3e3e779b3d870d13e1e359a3b5f7087cb Mon Sep 17 00:00:00 2001 From: zengqinghong Date: Wed, 24 Jan 2024 21:00:14 +0800 Subject: [PATCH] mb/google/brya: Correct Ti50 EC-is-trusted logic With Cr50, the GPIO EC_IN_RW is used to determine whether EC is trusted. However, With the switch to Ti50, it is determined by Ti50's boot mode. If the boot mode is TRUSTED_RO, the VB2_CONTEXT_EC_TRUSTED flag will be set in check_boot_mode(). Therefore in the Ti50 case get_ec_is_trusted() can just return 0. The current code of get_ec_is_trusted() only checks the GPIO, which causes the EC to be always considered "trusted". Therefore, correct the return value to 0 for TPM_GOOGLE_TI50. BUG=b:321172119 TEST=emerge-nissa coreboot chromeos-bootimage TEST=firmware_DevMode passed in FAFT test Change-Id: I308f8b36411030911c4421d80827fc49ff325a1b Signed-off-by: Qinghong Zeng Reviewed-on: https://review.coreboot.org/c/coreboot/+/80158 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Yu-Ping Wu Reviewed-by: Tyler Wang Reviewed-by: Ian Feng Reviewed-by: Weimin Wu Reviewed-by: Eric Lai --- src/mainboard/google/brya/chromeos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mainboard/google/brya/chromeos.c b/src/mainboard/google/brya/chromeos.c index 5c99371eb1..73b7237b24 100644 --- a/src/mainboard/google/brya/chromeos.c +++ b/src/mainboard/google/brya/chromeos.c @@ -24,6 +24,10 @@ int get_write_protect_state(void) int get_ec_is_trusted(void) { + /* With Ti50, VB2_CONTEXT_EC_TRUSTED should be set according to the boot mode. */ + if (CONFIG(TPM_GOOGLE_TI50)) + return 0; + /* EC is trusted if not in RW. */ return !gpio_get(GPIO_EC_IN_RW); }