summaryrefslogtreecommitdiffstats
path: root/libstb/drivers/tpm_i2c_interface.c
Commit message (Collapse)AuthorAgeFilesLines
* tpm_i2c_interface: decouple rc from being done with i2c requestStewart Smith2016-11-241-4/+14
| | | | | | | | | This ensures the i2c subsystem is done with the i2c request before we continue. Since it handles timeouts, we don't have to here. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Tested-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* tpm_i2c_interface: set timeout before each requestStewart Smith2016-11-241-1/+1
| | | | | | | | | The i2c code manipulates req->timeout, so it has to be reset before re-sending. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Tested-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* i2c: Add i2c_run_req() to crank the state machine for a requestStewart Smith2016-11-241-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing everything asynchronously is brilliant, it's exactly what we want to do. Except... the tpm driver wants to do things synchronously, which isn't so cool. For reasons that are not yet completely known, we spend an awful lot of time in the main thread *not* running pollers (potentially seconds), which doesn't bode well for I2C timeouts. Since the TPM measure is done in a secondary thread, we do *not* run pollers there either (as of 323c8aeb54bd4e0b9004091fcbb4a9daeda2f576 - which is roughly as of skiboot 2.1.1). But we still need to crank the i2c state machine, so we introduce a call to do just that. It will return how long the poll interval should be, so that we can time_wait() for a more appropriate time for whatever i2c implementation is sitting behind things. Without this, it was "easy" to get to a situation where the i2c state machine wasn't cranked at all, and you'd hit the i2c timeout (for the issued operation) before the poller to crank i2c was ever called. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Tested-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb: bump up the byte timeout for tpm i2c requestsClaudio Carvalho2016-11-111-1/+1
| | | | | | | | This bumps up the byte timeout for tpm i2c requests from 10ms to 30ms. Some p8dtu systems are getting i2c request timeout. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libstb/drivers: add tpm_i2c interfaceClaudio Carvalho2016-10-101-0/+130
This adds the functions that TPM I2C drivers can use to send requests to I2C master. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud