diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2016-09-19 19:21:24 -0700 |
---|---|---|
committer | Duncan Laurie <dlaurie@chromium.org> | 2016-09-19 19:21:24 -0700 |
commit | bf7faa1a634e8bed0d0a8b6634dfe10f42ab986c (patch) | |
tree | dafce8770f91809093bd9597e257d26d1bb8804f /src/drivers/i2c/tpm/tpm.c | |
parent | 9b8ebfb96cf0937add6ad8478887d8932450e255 (diff) |
Revert "drivers/i2c/tpm: Move common variables to header"
This reverts commit 64df72e8e2d1c086705325533767ca5e201e842a.
Diffstat (limited to 'src/drivers/i2c/tpm/tpm.c')
-rw-r--r-- | src/drivers/i2c/tpm/tpm.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/drivers/i2c/tpm/tpm.c b/src/drivers/i2c/tpm/tpm.c index 6b96774f60..f75bcd7269 100644 --- a/src/drivers/i2c/tpm/tpm.c +++ b/src/drivers/i2c/tpm/tpm.c @@ -240,6 +240,28 @@ static int iic_tpm_write_long(uint8_t addr, uint8_t *buffer, size_t len) MAX_COUNT_LONG); } +#define TPM_HEADER_SIZE 10 + +enum tis_access { + TPM_ACCESS_VALID = 0x80, + TPM_ACCESS_ACTIVE_LOCALITY = 0x20, + TPM_ACCESS_REQUEST_PENDING = 0x04, + TPM_ACCESS_REQUEST_USE = 0x02, +}; + +enum tis_status { + TPM_STS_VALID = 0x80, + TPM_STS_COMMAND_READY = 0x40, + TPM_STS_GO = 0x20, + TPM_STS_DATA_AVAIL = 0x10, + TPM_STS_DATA_EXPECT = 0x08, +}; + +#define TPM_ACCESS(l) (0x0000 | ((l) << 4)) +#define TPM_STS(l) (0x0001 | ((l) << 4)) +#define TPM_DATA_FIFO(l) (0x0005 | ((l) << 4)) +#define TPM_DID_VID(l) (0x0006 | ((l) << 4)) + static int check_locality(struct tpm_chip *chip, int loc) { uint8_t buf; |