summaryrefslogtreecommitdiff
path: root/src/drivers/i2c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2014-03-26 21:51:41 -0700
committerMarc Jones <marc.jones@se-eng.com>2014-10-22 03:52:42 +0200
commit3f5644593de7ff5583595028896866fc91eaddca (patch)
treebe8b24b3b98fd48f537598fcf64f6f85be039358 /src/drivers/i2c
parent1b969f672e84c1e96439943995376e6cd944cbfe (diff)
downloadcoreboot-3f5644593de7ff5583595028896866fc91eaddca.tar.xz
tpm: i2c: When probing the TPM, write a 0 into the TPM access register.
Not doing so makes it fail when run at high frequency. Change-Id: I1cfb69c55f03cb90f66f437289803d897a1aad5c Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://chromium-review.googlesource.com/191812 Reviewed-by: Tom Warren <twarren@nvidia.com> Reviewed-by: Jimmy Zhang <jimmzhang@nvidia.com> Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: Tom Warren <twarren@nvidia.com> Commit-Queue: Gabe Black <gabeblack@chromium.org> (cherry picked from commit 04452441d2bfe2cacd3e0b6990c0e9261b5350d1) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/7007 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'src/drivers/i2c')
-rw-r--r--src/drivers/i2c/tpm/tis.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/i2c/tpm/tis.c b/src/drivers/i2c/tpm/tis.c
index 3a5f519ee0..e8d69acfbf 100644
--- a/src/drivers/i2c/tpm/tis.c
+++ b/src/drivers/i2c/tpm/tis.c
@@ -79,10 +79,10 @@ int tis_init(void)
* Probe TPM twice; the first probing might fail because TPM is asleep,
* and the probing can wake up TPM.
*/
- uint8_t tmp;
+ uint8_t tmp = 0;
- if (i2c_read(bus, chip, 0, 0, &tmp, sizeof(tmp)) &&
- i2c_read(bus, chip, 0, 0, &tmp, sizeof(tmp)))
+ if (i2c_write(bus, chip, 0, 1, &tmp, sizeof(tmp)) &&
+ i2c_write(bus, chip, 0, 1, &tmp, sizeof(tmp)))
return -1;
return 0;