From c4852e71579cd4b1a702dccae63d5c39f59cade6 Mon Sep 17 00:00:00 2001 From: Daniel Kurtz Date: Fri, 21 Apr 2017 14:11:51 +0800 Subject: drivers/i2c/tpm/cr50: Use tis_plat_irq_status for Cr50 IRQ status The Cr50 TPM uses an IRQ to provide a "status" signal used for hand-shaking the reception of commands. Real IRQs are not supported in firmware, however firmware can still poll interrupt status registers for the same effect. Commit 94cc485338a3 ("drivers/i2c/tpm/cr50: Support interrupts for status") added support for the Cr50 driver on X86 platforms to use a KConfig file to supply an IRQ which it would poll using acpi_get_gpe. If the IRQ is not supplied, the Cr50 driver inserts a 20 ms wait. Unfortunately this doesn't work so well when using the i2c connected Cr50 on ARM platforms. Luckily, a more generic implementation to allow a mainboard to supply a Cr50 IRQ status polling function was solved for SPI connected Cr50s by commit 19e3d335bddb ("drivers/spi/tpm: using tpm irq to sync tpm transaction"). Let's refactor the i2c c50 driver to use this same approach, and change eve and reef boards to make use of DRIVER_TPM_TIS_ACPI_INTERRUPT for specifying the TPM flow control interrupt. This essentially reverts these two commits: 48f708d199 drivers/i2c/tpm/cr50: Initialize IRQ status handler before probe 94cc485338 drivers/i2c/tpm/cr50: Support interrupts for status And ports this commit to i2c/tpm/cr50: 19e3d335bd drivers/spi/tpm: using tpm irq to sync tpm transaction As a side effect the tpm_vendor_specific IRQ field goes back to its original usage as the "TPM 1.2 command complete" interrupt, instead of being repurposed to hold the flow control IRQ. BRANCH=none BUG=b:36786804 TEST=Boot reef w/ serial enabled firmware, verify verstage sees "cr50 TPM" and does not complain about lack of tis_plat_irq_status(). TEST=Boot eve w/ serial enabled firmware, verify verstage sees "cr50 TPM" and does not complain about lack of tis_plat_irq_status(). Change-Id: I004329eae1d8aabda51c46b8504bf210484782b4 Signed-off-by: Daniel Kurtz Reviewed-on: https://review.coreboot.org/19363 Reviewed-by: Julius Werner Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/drivers/i2c/tpm/Kconfig | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/drivers/i2c/tpm/Kconfig') diff --git a/src/drivers/i2c/tpm/Kconfig b/src/drivers/i2c/tpm/Kconfig index 9e3a0aa82e..db6777e65d 100644 --- a/src/drivers/i2c/tpm/Kconfig +++ b/src/drivers/i2c/tpm/Kconfig @@ -44,11 +44,6 @@ config DRIVER_TPM_I2C_ADDR default 0x2 # FIXME, workaround for Kconfig BS depends on I2C_TPM -config DRIVER_TPM_I2C_IRQ - int "IRQ or GPE to use for TPM interrupt" - default -1 - depends on I2C_TPM - config DRIVER_I2C_TPM_ACPI depends on I2C_TPM bool "Generate I2C TPM ACPI device" -- cgit v1.2.3