volteer+vendorcode: Retrieve Cr50 version only via SPI

No recent Chromebooks have used I2C for TPM communication, and as a
result, a bug has crept in.  The ability to extract Cr50 firmware string
is only supported via SPI, yet code in mainboard and vendorcode attempt
to do so unconditionally.

This CL makes it such that the code also compiles for future designs
using I2C.  (Whether we want to enhance the I2C protocol to be able to
provide the version string, and then implement the support is a separate
question.)

This effort is prompted by the desire to use reworked Volteer EVT
devices for validating the new Ti50/Dauntless TPM.  Dauntless will
primarily be using I2C in upcoming designs.

BRANCH=volteer
TEST=util/abuild/abuild -t GOOGLE_VOLTEER -c max -x

Change-Id: Ida1d732e486b19bdff6d95062a3ac1a7c4b58b45
Signed-off-by: jbk@chromium.org
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46436
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Caveh Jalali <caveh@chromium.org>
This commit is contained in:
Jes Klinke 2020-10-14 13:24:32 -07:00 committed by Patrick Georgi
parent d5faa90df5
commit 5c80519466
2 changed files with 21 additions and 17 deletions

View File

@ -51,7 +51,8 @@ void mainboard_update_soc_chip_config(struct soc_intel_tigerlake_config *cfg)
return; return;
} }
if (cr50_is_long_interrupt_pulse_enabled()) { if (CONFIG(MAINBOARD_HAS_SPI_TPM_CR50) &&
cr50_is_long_interrupt_pulse_enabled()) {
printk(BIOS_INFO, "Enabling S0i3.4\n"); printk(BIOS_INFO, "Enabling S0i3.4\n");
} else { } else {
/* /*

View File

@ -16,6 +16,7 @@ void cse_board_reset(void)
int ret; int ret;
struct cr50_firmware_version version; struct cr50_firmware_version version;
if (CONFIG(MAINBOARD_HAS_SPI_TPM_CR50)) {
/* Initialize TPM and get the cr50 firmware version. */ /* Initialize TPM and get the cr50 firmware version. */
ret = tlcl_lib_init(); ret = tlcl_lib_init();
if (ret != VB2_SUCCESS) { if (ret != VB2_SUCCESS) {
@ -26,13 +27,15 @@ void cse_board_reset(void)
cr50_get_firmware_version(&version); cr50_get_firmware_version(&version);
/* /*
* Cr50 firmware versions 0.[3|4].20 or newer support strap config 0xe where PLTRST from * Cr50 firmware versions 0.[3|4].20 or newer support strap
* AP is connected to cr50's PLTRST# signal. So return immediately and trigger a * config 0xe where PLTRST from AP is connected to cr50's
* global reset. * PLTRST# signal. So return immediately and trigger a global
* reset.
*/ */
if (version.epoch != 0 || version.major > 4 || if (version.epoch != 0 || version.major > 4 ||
(version.major >= 3 && version.minor >= 20)) (version.major >= 3 && version.minor >= 20))
return; return;
}
printk(BIOS_INFO, "Initiating request to EC to trigger cold reset\n"); printk(BIOS_INFO, "Initiating request to EC to trigger cold reset\n");
/* /*