[coreboot-gerrit] Change in coreboot[master]: mainboard/google/poppy: Disable unused TPM interface dynamic...

Furquan Shaikh (Code Review) gerrit at coreboot.org
Sat Jun 10 03:01:15 CEST 2017


Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/20141


Change subject: mainboard/google/poppy: Disable unused TPM interface dynamically
......................................................................

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.

Change-Id: Iee8f49e484ed024c549f60c88d874c08873b75cb
Signed-off-by: Furquan Shaikh <furquan at chromium.org>
---
M src/mainboard/google/poppy/mainboard.c
1 file changed, 19 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/20141/1

diff --git a/src/mainboard/google/poppy/mainboard.c b/src/mainboard/google/poppy/mainboard.c
index 3ee0146..a8103b9 100644
--- a/src/mainboard/google/poppy/mainboard.c
+++ b/src/mainboard/google/poppy/mainboard.c
@@ -17,6 +17,7 @@
 #include <baseboard/variants.h>
 #include <device/device.h>
 #include <ec/ec.h>
+#include <soc/pci_devs.h>
 #include <soc/nhlt.h>
 #include <vendorcode/google/chromeos/chromeos.h>
 
@@ -54,11 +55,29 @@
 	return end_addr;
 }
 
+#define POPPY_SPI_TPM_DEVFN	PCH_DEVFN_GSPI0
+#define POPPY_I2C_TPM_DEVFN	PCH_DEVFN_I2C1
+
 static void mainboard_enable(device_t dev)
 {
+	device_t tpm;
+
 	dev->ops->init = mainboard_init;
 	dev->ops->acpi_inject_dsdt_generator = chromeos_dsdt_generator;
 	dev->ops->write_acpi_tables = mainboard_write_acpi_tables;
+
+	/* Disable unused interface for TPM. */
+	if (!IS_ENABLED(CONFIG_POPPY_USE_SPI_TPM)) {
+		tpm = dev_find_slot(0, POPPY_SPI_TPM_DEVFN);
+		if (tpm)
+			tpm->enabled = 0;
+	}
+
+	if (!IS_ENABLED(CONFIG_POPPY_USE_I2C_TPM)) {
+		tpm = dev_find_slot(0, POPPY_I2C_TPM_DEVFN);
+		if (tpm)
+			tpm->enabled = 0;
+	}
 }
 
 struct chip_operations mainboard_ops = {

-- 
To view, visit https://review.coreboot.org/20141
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee8f49e484ed024c549f60c88d874c08873b75cb
Gerrit-Change-Number: 20141
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan at google.com>



More information about the coreboot-gerrit mailing list