tpm/tpm_crb: Use start method value from ACPI table directly
authorJiandi An <anjiandi@codeaurora.org>
Fri, 25 Aug 2017 23:28:55 +0000 (18:28 -0500)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Wed, 18 Oct 2017 15:28:45 +0000 (18:28 +0300)
commitf5357413dbaadd82361903f3c389cb1d5763a85e
tree424e4456dda394e8a7136f4085d72e16f5505a2d
parentc37fbc09bd4977736f6bc4050c6f099c587052a7
tpm/tpm_crb: Use start method value from ACPI table directly

This patch gets rid of dealing with intermediate flag for start method
and use start method value from ACPI table directly.

For ARM64, the locality is handled by Trust Zone in FW.  The layout
does not have crb_regs_head.  It is hitting the following line.
dev_warn(dev, FW_BUG "Bad ACPI memory layout");

Current code excludes CRB_FL_ACPI_START for this check.  Now since
ARM64 support for TPM CRB is added, CRB_FL_CRB_SMC_START should also be
excluded from this check.

For goIdle and cmdReady where code was excluding CRB_FL_ACPI_START only
(do nothing for ACPI start method), CRB_FL_CRB_SMC_START was also
excluded as ARM64 SMC start method does not have TPM_CRB_CTRL_REQ.

However with special PPT workaround requiring CRB_FL_CRB_START to be
set in addition to CRB_FL_ACPI_START and the addition flag of SMC
start method CRB_FL_CRB_SMC_START, the code has become difficult to
maintain and undrestand.  It is better to make code deal with start
method value from ACPI table directly.

Signed-off-by: Jiandi An <anjiandi@codeaurora.org>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm_crb.c