summaryrefslogtreecommitdiff
path: root/src/drivers/i2c/tpm/tpm.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2016-08-31 13:51:14 -0700
committerDuncan Laurie <dlaurie@chromium.org>2016-09-06 22:51:25 +0200
commit40ae1706a447ca81fed31287ec30f28823504c01 (patch)
treeb80076100a3b18afe98322d939f33aacd7e030a2 /src/drivers/i2c/tpm/tpm.h
parent4a560769ad7811b9cab09325f577d389491f17ed (diff)
downloadcoreboot-40ae1706a447ca81fed31287ec30f28823504c01.tar.xz
drivers/i2c/tpm: Make driver safe for use in x86 pre-ram
Use CAR accessors where needed for accessing static data. In some cases this required some minor restructuring to pass in a variable instead of use a global one. For the tpm_vendor_init the structure no longer has useful defaults, which nobody was depending on anyway. This now requires the caller to provide a non-zero address. Tested by enabling I2C TPM on reef and compiling successfully. Change-Id: I8e02fbcebf5fe10c4122632eda1c48b247478289 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://review.coreboot.org/16394 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/drivers/i2c/tpm/tpm.h')
-rw-r--r--src/drivers/i2c/tpm/tpm.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/i2c/tpm/tpm.h b/src/drivers/i2c/tpm/tpm.h
index 625679de75..7dfd59481d 100644
--- a/src/drivers/i2c/tpm/tpm.h
+++ b/src/drivers/i2c/tpm/tpm.h
@@ -47,9 +47,9 @@ enum tpm_timeout {
struct tpm_chip;
struct tpm_vendor_specific {
- const uint8_t req_complete_mask;
- const uint8_t req_complete_val;
- const uint8_t req_canceled;
+ uint8_t req_complete_mask;
+ uint8_t req_complete_val;
+ uint8_t req_canceled;
int irq;
int (*recv)(struct tpm_chip *, uint8_t *, size_t);
int (*send)(struct tpm_chip *, uint8_t *, size_t);
@@ -121,7 +121,7 @@ struct tpm_cmd_t {
/* ---------- Interface for TPM vendor ------------ */
-int tpm_vendor_init(unsigned bus, uint32_t dev_addr);
+int tpm_vendor_init(struct tpm_chip *chip, unsigned bus, uint32_t dev_addr);
void tpm_vendor_cleanup(struct tpm_chip *chip);