tpm: baseline for TPM2

This patch adds a flag called 'tpm2' to struct tpm_chip, which tells
whether the given device uses TPM2 protocol or not. This variable is
also exported through sysfs so that the user space software knows which
protocol to use.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
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.]

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

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 and for
sending cancel and resetEstBit commands.

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

This patch adds TPM2 support tpm_get_timeouts().

[jarkko.sakkinen: implemented tpm2_get_timeouts() based on the Wills
 original patch.]

Signed-off-by: Will Arthur <will.c.arthur@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>