diff options
author | Grzegorz Bernacki <bernacki@google.com> | 2023-06-14 12:01:32 +0000 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-07-06 16:16:43 +0000 |
commit | 7758b47e3be128ab8c1c3fecb63b8f0054351ee0 (patch) | |
tree | 626cdc57c8c0eb979e336af506da07b4e4ea77e0 /src/drivers/i2c | |
parent | 15d75aa999709ab2006b816f7c0335b52147f945 (diff) |
drivers/tpm: Move tis_plat_irq_status to cr50 driver
tis_plat_irq_status() function is used only by Google TPM. It should
be moved to drivers/tpm/cr50.c. The name of the function was changed
to cr50_plat_irq_status().
BUG=b:277787305
TEST=Build all affected platforms
Change-Id: I78dc39f2c7b44232b06947d3dfe6afa52807ced8
Signed-off-by: Grzegorz Bernacki <bernacki@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75917
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/drivers/i2c')
-rw-r--r-- | src/drivers/i2c/tpm/cr50.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c index d9088233c2..7c0c488658 100644 --- a/src/drivers/i2c/tpm/cr50.c +++ b/src/drivers/i2c/tpm/cr50.c @@ -33,7 +33,6 @@ #define CR50_TIMEOUT_INIT_MS 30000 /* Very long timeout for TPM init */ #define CR50_TIMEOUT_LONG_MS 2000 /* Long timeout while waiting for TPM */ #define CR50_TIMEOUT_SHORT_MS 2 /* Short timeout during transactions */ -#define CR50_TIMEOUT_NOIRQ_MS 20 /* Timeout for TPM ready without IRQ */ #define CR50_DID_VID 0x00281ae0L #define TI50_DID_VID 0x504a6666L @@ -46,20 +45,6 @@ struct tpm_inf_dev { static struct tpm_inf_dev tpm_dev; -__weak int tis_plat_irq_status(void) -{ - static int warning_displayed; - - if (!warning_displayed) { - printk(BIOS_WARNING, "%s() not implemented, wasting 20ms to wait on" - " Cr50!\n", __func__); - warning_displayed = 1; - } - mdelay(CR50_TIMEOUT_NOIRQ_MS); - - return 1; -} - /* * cr50_i2c_read() - read from TPM register * @@ -79,7 +64,7 @@ static int cr50_i2c_read(uint8_t addr, uint8_t *buffer, size_t len) return -1; /* Clear interrupt before starting transaction */ - tis_plat_irq_status(); + cr50_plat_irq_status(); /* Send the register address byte to the TPM */ if (i2c_write_raw(tpm_dev.bus, tpm_dev.addr, &addr, 1)) { @@ -125,7 +110,7 @@ static int cr50_i2c_write(uint8_t addr, const uint8_t *buffer, size_t len) memcpy(tpm_dev.buf + 1, buffer, len); /* Clear interrupt before starting transaction */ - tis_plat_irq_status(); + cr50_plat_irq_status(); /* Send write request buffer with address */ if (i2c_write_raw(tpm_dev.bus, tpm_dev.addr, tpm_dev.buf, len + 1)) { |