mainboard/google/poppy: Disable unused TPM interface dynamically
Based on the config options selected, decide at runtime which TPM interface should be disabled so that ACPI tables are not generated for that interface. TEST=Verified that unused interface does not show up in ACPI tables. Change-Id: Iee8f49e484ed024c549f60c88d874c08873b75cb Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/20141 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
This commit is contained in:
committed by
Furquan Shaikh
parent
268eea0e41
commit
b2f423578e
@ -17,6 +17,7 @@
|
|||||||
#include <baseboard/variants.h>
|
#include <baseboard/variants.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
#include <ec/ec.h>
|
#include <ec/ec.h>
|
||||||
|
#include <soc/pci_devs.h>
|
||||||
#include <soc/nhlt.h>
|
#include <soc/nhlt.h>
|
||||||
#include <vendorcode/google/chromeos/chromeos.h>
|
#include <vendorcode/google/chromeos/chromeos.h>
|
||||||
|
|
||||||
@ -56,9 +57,24 @@ static unsigned long mainboard_write_acpi_tables(device_t device,
|
|||||||
|
|
||||||
static void mainboard_enable(device_t dev)
|
static void mainboard_enable(device_t dev)
|
||||||
{
|
{
|
||||||
|
device_t tpm;
|
||||||
|
|
||||||
dev->ops->init = mainboard_init;
|
dev->ops->init = mainboard_init;
|
||||||
dev->ops->acpi_inject_dsdt_generator = chromeos_dsdt_generator;
|
dev->ops->acpi_inject_dsdt_generator = chromeos_dsdt_generator;
|
||||||
dev->ops->write_acpi_tables = mainboard_write_acpi_tables;
|
dev->ops->write_acpi_tables = mainboard_write_acpi_tables;
|
||||||
|
|
||||||
|
/* Disable unused interface(s) for TPM. */
|
||||||
|
if (!IS_ENABLED(CONFIG_POPPY_USE_SPI_TPM)) {
|
||||||
|
tpm = PCH_DEV_GSPI0;
|
||||||
|
if (tpm)
|
||||||
|
tpm->enabled = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IS_ENABLED(CONFIG_POPPY_USE_I2C_TPM)) {
|
||||||
|
tpm = PCH_DEV_I2C1;
|
||||||
|
if (tpm)
|
||||||
|
tpm->enabled = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct chip_operations mainboard_ops = {
|
struct chip_operations mainboard_ops = {
|
||||||
|
Reference in New Issue
Block a user