diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2016-10-05 21:38:23 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-10-06 03:42:14 -0700 |
commit | 9b56b51b0d6e5fa6ec02cb8675bad0fad611dd3a (patch) | |
tree | 2c6b097a577d40fe30677eb82a731b7ded7910dd /common/tpm_registers.c | |
parent | 2e4d4e2e058adafe8ce18d4a71d7b2604170d837 (diff) | |
download | chrome-ec-9b56b51b0d6e5fa6ec02cb8675bad0fad611dd3a.tar.gz |
tpm: do not try running endorsement commands before nvram is available
Recent tpm2 repository changes introduced more strict checks of the NV
RAM operations' return status. The problem is that in case TPM is not
manufactured tpm_endorse() is invoked before nvram is declared
available, and this causes endorsement operation failure.
Make sure NVRAM initialization is complete before endorsement is
attempted.
BRANCH=none
BUG=none
TEST=tpm manufacturing now succeeds again.
Change-Id: I2217f33915ab8b4d872a9498def6d6862f4b1913
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394129
Tested-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Diffstat (limited to 'common/tpm_registers.c')
-rw-r--r-- | common/tpm_registers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c index 0e2733b472..ec424202c0 100644 --- a/common/tpm_registers.c +++ b/common/tpm_registers.c @@ -550,11 +550,12 @@ static void tpm_init(void) */ TPM_Manufacture(1); _TPM_Init(); + _plat__SetNvAvail(); tpm_endorse(); + } else { + _plat__SetNvAvail(); } - _plat__SetNvAvail(); - /* Reinitialize TPM interface. */ if_restart(); } |