tpm: TPM2 support for tpm_pcr_read_dev()

Implemented TPM2 support for tpm_pcr_read_dev() and 'pcrs' sysfs
file.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
tpm: TPM2 support for tpm_getcap

This patch adds TPM2 protocol support for tpm_getcap(). A new
parameter 'property_id' was added to the function definition
in order to select a property.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
tpm: TPM2 support for tpm_pcr_extend()

Implemented TPM2 protocol support for tpm_pcr_extend().

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
tpm: TPM2 support for tpm_get_random().

Implemented TPM2 support for tpm_get_random().

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
tpm: TPM2 support for tpm_startup()

This patch implements TPM2 support for tpm_startup().

[jarkko.sakkinen: splitted this function to its own patch and did
 some code cleanup.]

Signed-off-by: Will Arthur <will.c.arthur@intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
tpm: TPM2 support for tpm_gen_interrupt().

This patch adds TPM2 support for tpm_gen_interrupt().

[jarkko.sakkinen: splitted into its own patch and did some
 minor code cleanup.]

Signed-off-by: Will Arthur <will.c.arthur@intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
tpm: enable TPM2 in the existing TIS driver

Added support for extended STS register.  This allows driver
to access the bits for detecting TPM 1.2 vs 2.0 and for
sending cancel and resetEstBit commands.

[jarkko.sakkinen: fixed a resource leak in tpm_tis_init().]

Signed-off-by: Will Arthur <will.c.arthur@intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
tpm: workaround for selftest when firmware does not execute TPM2_Startup

This patch adds a workaround to tpm_do_selftest() for the situation
when firmware does not execute TPM2_Startup. This does not happen
usually in production hardware but is sometimes case with development
hardware.

[jarkko.sakkinen: made this a separate commit and added proper
 explanation to the commit message.]

Signed-off-by: Will Arthur <will.c.arthur@intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>