tpm: Factor out common startup code
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tue, 12 Jul 2016 17:41:49 +0000 (11:41 -0600)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 19 Jul 2016 14:43:38 +0000 (17:43 +0300)
commitcae8b441fc20812d7260dc3b45e05ee98fcfff1b
tree25c43fb7bd96f438d00cdf6b6ca233a4e4995257
parent2b88cd96eb85d2f07873e6050e531df45d8a0cc8
tpm: Factor out common startup code

The TCG standard startup sequence (get timeouts, tpm startup, etc) for
TPM and TPM2 chips is being open coded in many drivers, move it into
the core code.

tpm_tis and tpm_crb are used as the basis for the core code
implementation and the easy drivers are converted. In the process
several small drivers bugs relating to error handling this flow
are fixed.

For now the flag TPM_OPS_AUTO_STARTUP is optional to allow a staged
driver roll out, but ultimately all drivers should use this flow and
the flag removed. Some drivers still do not implement the startup
sequence at all and will need to be tested with it enabled.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Andrew Zamansky <andrew.zamansky@nuvoton.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
12 files changed:
drivers/char/tpm/st33zp24/st33zp24.c
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm-interface.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm2-cmd.c
drivers/char/tpm/tpm_crb.c
drivers/char/tpm/tpm_i2c_atmel.c
drivers/char/tpm/tpm_i2c_infineon.c
drivers/char/tpm/tpm_i2c_nuvoton.c
drivers/char/tpm/tpm_tis_core.c
drivers/char/tpm/tpm_vtpm_proxy.c
include/linux/tpm.h