From 7f339c6050c5ddd9c7235d491d80b3841a3dbb67 Mon Sep 17 00:00:00 2001 From: Yu-Ping Wu Date: Tue, 7 Jun 2022 16:10:04 +0800 Subject: mb/google/corsola: Correct EC-is-trusted logic With Cr50, the GPIO EC_IN_RW_ODL is used to determine whether EC is trusted. However, with Ti50 where corsola has been switched to, 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:235053870 TEST=emerge-corsola coreboot TEST=firmware-DevMode passed in kingler (with Ti50) BRANCH=none Change-Id: I59b16238bfb487832ef618668c0f9addc1ee7937 Signed-off-by: Yu-Ping Wu Reviewed-on: https://review.coreboot.org/c/coreboot/+/64998 Reviewed-by: Hung-Te Lin Tested-by: build bot (Jenkins) --- src/mainboard/google/corsola/chromeos.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mainboard/google') diff --git a/src/mainboard/google/corsola/chromeos.c b/src/mainboard/google/corsola/chromeos.c index 56959c3e2e..7d36a170fd 100644 --- a/src/mainboard/google/corsola/chromeos.c +++ b/src/mainboard/google/corsola/chromeos.c @@ -45,6 +45,10 @@ void fill_lb_gpios(struct lb_gpios *gpios) 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. This is active low. */ return !!gpio_get(GPIO_EC_IN_RW_ODL); } -- cgit v1.2.3