summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drivers/spi/tpm/tpm.c10
-rw-r--r--src/drivers/spi/tpm/tpm.h10
2 files changed, 15 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));
+}
diff --git a/src/drivers/spi/tpm/tpm.h b/src/drivers/spi/tpm/tpm.h
index b3e3f45ee9..39d54e74b3 100644
--- a/src/drivers/spi/tpm/tpm.h
+++ b/src/drivers/spi/tpm/tpm.h
@@ -16,6 +16,13 @@ struct tpm2_info {
uint16_t revision;
};
+/* Structure describing the elements of Cr50 firmware version. */
+struct cr50_firmware_version {
+ int epoch;
+ int major;
+ int minor;
+};
+
/*
* Initialize a TPM2 device: read its id, claim locality of zero, verify that
* this indeed is a TPM2 device. Use the passed in handle to access the right
@@ -44,4 +51,7 @@ void tpm2_get_info(struct tpm2_info *info);
/* Indicates whether Cr50 ready pulses are guaranteed to be at least 100us. */
bool cr50_is_long_interrupt_pulse_enabled(void);
+/* Get the cr50 firmware version information. */
+void cr50_get_firmware_version(struct cr50_firmware_version *version);
+
#endif /* ! __COREBOOT_SRC_DRIVERS_SPI_TPM_TPM_H */