summaryrefslogtreecommitdiff
path: root/src/drivers/i2c/tpm
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2016-10-03 12:43:14 -0700
committerVadim Bendebury <vbendeb@chromium.org>2016-10-05 17:32:10 +0200
commit48f708d199769d03ef1c31184955703d9d73ad80 (patch)
tree758761da9d751a8cf4bd1d066bb838fe58517b1e /src/drivers/i2c/tpm
parent77ba882c67b98801232bace922471f22fafc0212 (diff)
downloadcoreboot-48f708d199769d03ef1c31184955703d9d73ad80.tar.xz
drivers/i2c/tpm/cr50: Initialize IRQ status handler before probe
Move the setup of the IRQ status handler so it will be set up properly before the early probe happens. BUG=chrome-os-partner:53336 Change-Id: I4380af1233d2a252899459635a3cb69ca196088d Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://review.coreboot.org/16861 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'src/drivers/i2c/tpm')
-rw-r--r--src/drivers/i2c/tpm/cr50.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c
index af7f2aef44..f7e667b1d9 100644
--- a/src/drivers/i2c/tpm/cr50.c
+++ b/src/drivers/i2c/tpm/cr50.c
@@ -416,6 +416,19 @@ static void cr50_vendor_init(struct tpm_chip *chip)
chip->vendor.send = &cr50_i2c_tis_send;
chip->vendor.cancel = &cr50_i2c_tis_ready;
chip->vendor.irq = CONFIG_DRIVER_TPM_I2C_IRQ;
+
+ /*
+ * Interrupts are not supported this early in firmware,
+ * use use an arch-specific method to query for interrupt status.
+ */
+ if (chip->vendor.irq > 0) {
+#if IS_ENABLED(CONFIG_ARCH_X86)
+ /* Query GPE status for interrupt */
+ chip->vendor.irq_status = &acpi_get_gpe;
+#else
+ chip->vendor.irq = -1;
+#endif
+ }
}
int tpm_vendor_probe(unsigned bus, uint32_t addr)
@@ -470,19 +483,6 @@ int tpm_vendor_init(struct tpm_chip *chip, unsigned bus, uint32_t dev_addr)
cr50_vendor_init(chip);
- /*
- * Interrupts are not supported this early in firmware,
- * use use an arch-specific method to query for interrupt status.
- */
- if (chip->vendor.irq > 0) {
-#if IS_ENABLED(CONFIG_ARCH_X86)
- /* Query GPE status for interrupt */
- chip->vendor.irq_status = &acpi_get_gpe;
-#else
- chip->vendor.irq = -1;
-#endif
- }
-
if (request_locality(chip, 0) != 0)
return -1;