[Skiboot] [PATCH 2/4] hdata: Add TPM timeout workaround

Oliver O'Halloran oohall at gmail.com
Mon May 21 11:29:24 AEST 2018


Set the default timeout for any bus containing a TPM to one second. This
is needed to work around a bug in the firmware of certain TPMs that will
clock strech the I2C port the for up to a second. Additionally, when the
TPM is clock streching it responds to a STOP condition on the bus by
bricking itself. Clearing this error requires a hard power cycle of the
system since the TPM is powered by standby power.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hdata/i2c.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/hdata/i2c.c b/hdata/i2c.c
index 5dfdb10721b1..5cb56fafb120 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -343,6 +343,16 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		if (label)
 			dt_add_property_string(node, "label", label);
 
+		/*
+		 * Set a default timeout of 2s on the ports with a TPM. This is
+		 * to work around a bug with certain TPM firmwares that can
+		 * clock stretch for long periods of time and will lock up
+		 * until they are power cycled if a STOP condition is sent
+		 * during this period.
+		 */
+		if (dev->type == 0x3)
+			dt_add_property_cells(bus, "timeout-ms", 2000);
+
 		/* XXX: SLCA index? */
 	}
 
-- 
2.9.5



More information about the Skiboot mailing list