[Skiboot] [PATCH v2 15/31] libstb/drivers/tpm_i2c_nuvoton.c: write tpmgo
Claudio Carvalho
cclaudio at linux.vnet.ibm.com
Wed Sep 28 18:01:14 AEST 2016
This adds the 3/5 step performed by the TPM I2C Nuvoton driver to
transmit a command to the TPM device. In this step the driver
sets the TPMGO bit in the I2C master status register to indicate that
the command stored in the FIFO can be sent to the TPM device.
Signed-off-by: Claudio Carvalho <cclaudio at linux.vnet.ibm.com>
---
libstb/drivers/tpm_i2c_nuvoton.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libstb/drivers/tpm_i2c_nuvoton.c b/libstb/drivers/tpm_i2c_nuvoton.c
index e418d7b..91e5a1d 100644
--- a/libstb/drivers/tpm_i2c_nuvoton.c
+++ b/libstb/drivers/tpm_i2c_nuvoton.c
@@ -45,6 +45,7 @@
/* Bit masks for the TPM STATUS register */
#define TCG_PTP_STS_VALID 0x80
#define TCG_PTP_STS_COMMAND_READY 0x40
+#define TCG_PTP_STS_GO 0x20
#define TCG_PTP_STS_EXPECT 0x08
/* TPM Driver values */
@@ -305,6 +306,11 @@ static int tpm_transmit(struct tpm_dev *dev, uint8_t* buf, size_t cmdlen,
if (rc < 0)
goto out;
+ DBG("step 3/5: write tpmgo\n");
+ rc = tpm_status_write_byte(TCG_PTP_STS_GO);
+ if (rc < 0)
+ goto out;
+
out:
DBG("**** tpm_transmit %s, rc=%d ****\n",
(rc) ? "ERROR" : "SUCCESS", rc);
--
1.9.1
More information about the Skiboot
mailing list