tpm: TPM2 support for tpm_calc_ordinal_durations()

Implemented TPM2 support for tpm_calc_ordinal_duration(). TPM2 version
is encapsulated into tpm2_calc_ordinal_duration() that is called by
tpm_calc_ordinal_duration() for TPM2 chips.

[jarkko.sakkinen: implemented tpm2_calc_ordinal_duration() based on
 the Wills original patch. Updated durations table to use worst case
 estimates.]

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_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_do_selftest()

Implemented tpm2_run_self_test() that runs the full (all commands)
test for the TPM chip. During the self test TPM2 commands return
with the TPM error code RC_TESTING. Waiting is done by issuing PCR
read until it executes succesfully or some other error condition
than RC_TESTING happens.

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().

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: implemented tpm2_startup() based on the Wills
 original patch.]

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

This patch adds TPM2 support for tpm_gen_interrupt().

Signed-off-by: Will Arthur <will.c.arthur@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. Assign timeout
and duration values, which are defined in the TPM2 PTP specification.

[jarkko.sakkinen: implemented durations and timeouts and handling.]

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

Added Intel copyright statements to tpm-interface.c and tpm-sysfs.c

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
tpm: TPM 2.0 CRB Interface

This patch adds a driver for TPM security chips that are compliant
with TCG CRB 2.0 TPM specification.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>