mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
tpm: wait for valid status
The TPM specification says that the EXPECT_DATA bit is not valid until the VALID bit is set. Wait for that bit to be set. Fixes problems with Ifineon SPI TPM. Signed-off-by: Roman Kapl <rka@sysgo.com>
This commit is contained in:
parent
2e8a720246
commit
27eb177b39
|
@ -295,6 +295,14 @@ static int tpm_tis_spi_wait_for_stat(struct udevice *dev, u8 mask,
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static u8 tpm_tis_spi_valid_status(struct udevice *dev, u8 *status)
|
||||||
|
{
|
||||||
|
struct tpm_chip *chip = dev_get_priv(dev);
|
||||||
|
|
||||||
|
return tpm_tis_spi_wait_for_stat(dev, TPM_STS_VALID,
|
||||||
|
chip->timeout_c, status);
|
||||||
|
}
|
||||||
|
|
||||||
static int tpm_tis_spi_get_burstcount(struct udevice *dev)
|
static int tpm_tis_spi_get_burstcount(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct tpm_chip *chip = dev_get_priv(dev);
|
struct tpm_chip *chip = dev_get_priv(dev);
|
||||||
|
@ -455,7 +463,7 @@ static int tpm_tis_spi_send(struct udevice *dev, const u8 *buf, size_t len)
|
||||||
i += size;
|
i += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = tpm_tis_spi_status(dev, &status);
|
ret = tpm_tis_spi_valid_status(dev, &status);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
||||||
|
@ -469,7 +477,7 @@ static int tpm_tis_spi_send(struct udevice *dev, const u8 *buf, size_t len)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
||||||
ret = tpm_tis_spi_status(dev, &status);
|
ret = tpm_tis_spi_valid_status(dev, &status);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user