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 <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64998
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Yu-Ping Wu 2022-06-07 16:10:04 +08:00 committed by Felix Held
parent b95ebf9fcf
commit 7f339c6050
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}