aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2018-05-21 11:29:24 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-05-23 00:36:54 -0500
commited21a758a43a41040817be940b3edbcd75763ebd (patch)
tree40b615c068e096361419bea4884da083d22bda1c
parente22f7e46dfa322ab58ba240a5f6ce6dee107e6a7 (diff)
downloadskiboot-ed21a758a43a41040817be940b3edbcd75763ebd.zip
skiboot-ed21a758a43a41040817be940b3edbcd75763ebd.tar.gz
skiboot-ed21a758a43a41040817be940b3edbcd75763ebd.tar.bz2
hdata: Add TPM timeout workaround
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@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com> (cherry picked from commit 3668dc88a1bdfc087ab7d329eabde5ac0086f9bf) Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--hdata/i2c.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hdata/i2c.c b/hdata/i2c.c
index 5dfdb10..5cb56fa 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? */
}