summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin TerAvest <teravest@chromium.org>2018-01-29 19:14:19 -0700
committerAaron Durbin <adurbin@chromium.org>2018-01-30 05:40:05 +0000
commitec91dd8feb16ea89d5a5d35b701bca09d1200afa (patch)
treee6e560a4b8dbd89af38b08a8440707f692db43d8
parent309d6ef4abba17099aedb373744d79b39811c07c (diff)
downloadcoreboot-ec91dd8feb16ea89d5a5d35b701bca09d1200afa.tar.xz
drivers/i2c/tpm: Add irq_gpio support to tpm.
Grunt (a amd-stoneyridge based platform) uses a GPIO to interface with the tpm. This change allows devicetree entries to use a irq_gpio entry to describe the interface with the TPM. BUG=b:72655090 Change-Id: I08289891408d7176f68eb9c67f7a417a2448c2de Signed-off-by: Justin TerAvest <teravest@chromium.org> Reviewed-on: https://review.coreboot.org/23500 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r--src/drivers/i2c/tpm/chip.c6
-rw-r--r--src/drivers/i2c/tpm/chip.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/drivers/i2c/tpm/chip.c b/src/drivers/i2c/tpm/chip.c
index 6d5c28a446..2655b0da07 100644
--- a/src/drivers/i2c/tpm/chip.c
+++ b/src/drivers/i2c/tpm/chip.c
@@ -55,7 +55,11 @@ static void i2c_tpm_fill_ssdt(struct device *dev)
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
acpi_device_write_i2c(&i2c);
- acpi_device_write_interrupt(&config->irq);
+ if (config->irq_gpio.pin_count)
+ acpi_device_write_gpio(&config->irq_gpio);
+ else
+ acpi_device_write_interrupt(&config->irq);
+
acpigen_write_resourcetemplate_footer();
acpigen_pop_len(); /* Device */
diff --git a/src/drivers/i2c/tpm/chip.h b/src/drivers/i2c/tpm/chip.h
index 5abd3a94f3..149627f8f4 100644
--- a/src/drivers/i2c/tpm/chip.h
+++ b/src/drivers/i2c/tpm/chip.h
@@ -7,4 +7,5 @@ struct drivers_i2c_tpm_config {
unsigned int uid; /* ACPI _UID */
enum i2c_speed speed; /* Bus speed in Hz, default is I2C_SPEED_FAST */
struct acpi_irq irq; /* Interrupt */
+ struct acpi_gpio irq_gpio; /* GPIO interrupt */
};