src/drivers/spi/tpm: Fix typo & capitalize TPM and IRQ

Change-Id: Ifb1e024821153865dd4a27a100f8a9c61151e0e1
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/28387
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Elyes HAOUAS 2018-08-29 17:22:44 +02:00 committed by Martin Roth
parent f87627c25b
commit 6688f466a8
1 changed files with 9 additions and 9 deletions

View File

@ -79,8 +79,8 @@ __weak int tis_plat_irq_status(void)
} }
/* /*
* TPM may trigger a irq after finish processing previous transfer. * TPM may trigger a IRQ after finish processing previous transfer.
* Waiting for this irq to sync tpm status. * Waiting for this IRQ to sync TPM status.
* *
* Returns 1 on success, 0 on failure (timeout). * Returns 1 on success, 0 on failure (timeout).
*/ */
@ -91,7 +91,7 @@ static int tpm_sync(void)
stopwatch_init_msecs_expire(&sw, 10); stopwatch_init_msecs_expire(&sw, 10);
while (!tis_plat_irq_status()) { while (!tis_plat_irq_status()) {
if (stopwatch_expired(&sw)) { if (stopwatch_expired(&sw)) {
printk(BIOS_ERR, "Timeout wait for tpm irq!\n"); printk(BIOS_ERR, "Timeout wait for TPM IRQ!\n");
return 0; return 0;
} }
} }
@ -119,7 +119,7 @@ static int start_transaction(int read_write, size_t bytes, unsigned addr)
*/ */
int wakeup_needed = 1; int wakeup_needed = 1;
/* Wait for tpm to finish previous transaction if needed */ /* Wait for TPM to finish previous transaction if needed */
if (car_get_var(tpm_sync_needed)) { if (car_get_var(tpm_sync_needed)) {
tpm_sync(); tpm_sync();
/* /*
@ -430,7 +430,7 @@ int tpm2_init(struct spi_slave *spi_if)
memcpy(spi_slave, spi_if, sizeof(*spi_if)); memcpy(spi_slave, spi_if, sizeof(*spi_if));
/* clear any pending irqs */ /* clear any pending IRQs */
tis_plat_irq_status(); tis_plat_irq_status();
/* /*
@ -442,12 +442,12 @@ int tpm2_init(struct spi_slave *spi_if)
for (retries = 15; retries > 0; retries--) { for (retries = 15; retries > 0; retries--) {
int i; int i;
/* In case of falure to read div_vid is set to zero. */ /* In case of failure to read div_vid is set to zero. */
tpm2_read_reg(TPM_DID_VID_REG, &did_vid, sizeof(did_vid)); tpm2_read_reg(TPM_DID_VID_REG, &did_vid, sizeof(did_vid));
for (i = 0; i < ARRAY_SIZE(supported_did_vids); i++) for (i = 0; i < ARRAY_SIZE(supported_did_vids); i++)
if (did_vid == supported_did_vids[i]) if (did_vid == supported_did_vids[i])
break; /* Tpm is up and ready. */ break; /* TPM is up and ready. */
if (i < ARRAY_SIZE(supported_did_vids)) if (i < ARRAY_SIZE(supported_did_vids))
break; break;
@ -643,7 +643,7 @@ size_t tpm2_process_command(const void *tpm2_command, size_t command_size,
write_tpm_sts(TPM_STS_COMMAND_READY); write_tpm_sts(TPM_STS_COMMAND_READY);
/* /*
* Tpm commands and responses written to and read from the FIFO * TPM commands and responses written to and read from the FIFO
* register (0x24) are datagrams of variable size, prepended by a 6 * register (0x24) are datagrams of variable size, prepended by a 6
* byte header. * byte header.
* *
@ -687,7 +687,7 @@ size_t tpm2_process_command(const void *tpm2_command, size_t command_size,
* TODO(vbendeb): at least drain the FIFO here or somehow let * TODO(vbendeb): at least drain the FIFO here or somehow let
* the TPM know that the response can be dropped. * the TPM know that the response can be dropped.
*/ */
printk(BIOS_ERR, " tpm response too long (%zd bytes)", printk(BIOS_ERR, " TPM response too long (%zd bytes)",
payload_size); payload_size);
return 0; return 0;
} }