diff options
author | Karthikeyan Ramasubramanian <kramasub@chromium.org> | 2020-08-20 22:53:00 -0600 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2020-08-22 00:30:57 +0000 |
commit | 7b58f9413db21b0fc71e65a99e43f699e83ea0f9 (patch) | |
tree | c6728e1a419bab0c1bc65622f6b096bcab14f182 /src/drivers/spi/tpm/tpm.c | |
parent | 4cc87d4e35899519be8bf28ffecf89f01eacc55c (diff) | |
download | coreboot-7b58f9413db21b0fc71e65a99e43f699e83ea0f9.tar.xz |
drivers/spi/tpm: Add helper to get cr50 firmware version
Introduce a helper to get the cached cr50 firmware version. This
information is in turn used to identify the strap configuration
supported by Cr50.
BUG=None
TEST=Ensure that Drawcia board boots to OS. Ensure that the version
cached cr50 firmware version is returned.
Change-Id: Id84b152993f253878a6c133cc433a0da2c990cf2
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44653
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Sam McNally <sammc@google.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/spi/tpm/tpm.c')
-rw-r--r-- | src/drivers/spi/tpm/tpm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/drivers/spi/tpm/tpm.c b/src/drivers/spi/tpm/tpm.c index bc40e852a2..66db671b50 100644 --- a/src/drivers/spi/tpm/tpm.c +++ b/src/drivers/spi/tpm/tpm.c @@ -48,11 +48,6 @@ static struct spi_slave spi_slave; /* Cached TPM device identification. */ static struct tpm2_info tpm_info; -struct cr50_firmware_version { - int epoch; - int major; - int minor; -}; static struct cr50_firmware_version cr50_firmware_version; /* @@ -849,3 +844,8 @@ size_t tpm2_process_command(const void *tpm2_command, size_t command_size, return payload_size; } + +void cr50_get_firmware_version(struct cr50_firmware_version *version) +{ + memcpy(version, &cr50_firmware_version, sizeof(*version)); +} |