Skip to content

Commit

Permalink
hdata: Add TPM timeout workaround
Browse files Browse the repository at this point in the history
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 3668dc8)
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed May 23, 2018
1 parent e22f7e4 commit ed21a75
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hdata/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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? */
}

Expand Down

0 comments on commit ed21a75

Please sign in to comment.