drivers/i2c/tpm: Work around missing firmware_version in Ti50 < 0.0.15

Ti50 firmware versions below 0.0.15 don't support the firmware_version
register and trying to access it causes I2C errors. Some nissa boards
are still using Ti50 0.0.12, so add a workaround Kconfig to skip reading
the firmware version and select it for nissa. The firmware version is
only read to print it to the console, so it's fine to skip this. This
workaround will be removed once all ODM stocks are updated to 0.0.15 or
higher.

A similar workaround Kconfig was added in CB:63011 then removed in
CB:63158 which added support for separate handling of Cr50 and Ti50.
But we actually still need this workaround until all Ti50 stocks are
upgraded to 0.0.15 or higher.

BUG=b:224650720
TEST=Boot to OS on nereid with Ti50 0.0.14

Change-Id: Ia30d44ac231c42eba3ffb1cb1e6d83bb6593f926
Signed-off-by: Reka Norman <rekanorman@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64202
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Reka Norman
2022-05-09 11:16:49 +10:00
committed by Werner Zeh
parent 6cb787b19a
commit d88233ecd3
3 changed files with 18 additions and 0 deletions

View File

@@ -191,6 +191,13 @@ enum cb_err cr50_get_firmware_version(struct cr50_firmware_version *version)
cr50_firmware_version.minor)
goto success;
if (CONFIG(TI50_FIRMWARE_VERSION_NOT_SUPPORTED)) {
printk(BIOS_ERR, "Reading Ti50 firmware version is not supported\n");
if (version)
*version = cr50_firmware_version;
return CB_ERR;
}
int chunk_count = 0;
size_t chunk_size = 50;
char version_str[301];