summaryrefslogtreecommitdiffstats
path: root/hdata
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-22 02:50:57 -0500
commit3668dc88a1bdfc087ab7d329eabde5ac0086f9bf (patch)
tree2ab295af227fd5b669f26988c0dfefbcf1ec1db9 /hdata
parentac6059026442f0da98293f800aa002271d579097 (diff)
downloadblackbird-skiboot-3668dc88a1bdfc087ab7d329eabde5ac0086f9bf.tar.gz
blackbird-skiboot-3668dc88a1bdfc087ab7d329eabde5ac0086f9bf.zip
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>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/i2c.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hdata/i2c.c b/hdata/i2c.c
index 5dfdb107..5cb56faf 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? */
}
OpenPOWER on IntegriCloud