Rob Barnes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59479 )
Change subject: drivers/tpm: Add always-shutdown-on-suspend DSD property ......................................................................
drivers/tpm: Add always-shutdown-on-suspend DSD property
Introduce always-shutdown-on-suspend DSD ACPI property for TPM devices. This flag can be used by the kernel TPM driver to override the checks used to determine when a TPM shutdown should be sent. A shutdown will normally only be sent for S3 or S5 suspend (determined by pm_suspend_via_firmware). Some platforms also reset the TPM in S0i3, so a shutdown is always needed on suspend.
BUG=b:200578885 BRANCH=None TEST=Shutdown is triggered on s0ix suspend on guybrush with patched kernel
Change-Id: Ia48ead856fc0c6e637a2e07a5ecc58423f599c5b Signed-off-by: Rob Barnes robbarnes@google.com --- M src/drivers/i2c/tpm/chip.c M src/drivers/i2c/tpm/chip.h 2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/59479/1
diff --git a/src/drivers/i2c/tpm/chip.c b/src/drivers/i2c/tpm/chip.c index 07791c3..3f7186e 100644 --- a/src/drivers/i2c/tpm/chip.c +++ b/src/drivers/i2c/tpm/chip.c @@ -11,6 +11,7 @@
static void i2c_tpm_fill_ssdt(const struct device *dev) { + struct acpi_dp *dsd; struct drivers_i2c_tpm_config *config = dev->chip_info; const char *scope = acpi_device_scope(dev); struct acpi_i2c i2c = { @@ -47,6 +48,12 @@
acpigen_write_resourcetemplate_footer();
+ /* _DSD, Device-Specific Data */ + dsd = acpi_dp_new_table("_DSD"); + acpi_dp_add_integer(dsd, "always-shutdown-on-suspend", + config->always_shutdown_on_suspend); + acpi_dp_write(dsd); + acpigen_pop_len(); /* Device */ acpigen_pop_len(); /* Scope */
diff --git a/src/drivers/i2c/tpm/chip.h b/src/drivers/i2c/tpm/chip.h index 0ab10d7..c688b1c 100644 --- a/src/drivers/i2c/tpm/chip.h +++ b/src/drivers/i2c/tpm/chip.h @@ -10,4 +10,5 @@ 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 */ + bool always_shutdown_on_suspend; /* Always shutdown TPM on suspend */ };