summaryrefslogtreecommitdiff
path: root/common/tpm_registers.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-02-28 20:11:28 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-04-05 09:21:44 -0700
commit171578b67f40355528cbb5f34b78e8e8ed83e335 (patch)
tree2303b74da9487ca2d046b93ad04212feff6164ac /common/tpm_registers.c
parent1d6c7bb9773f76aa70ce65822fa001ff72892cd2 (diff)
downloadchrome-ec-171578b67f40355528cbb5f34b78e8e8ed83e335.tar.gz
cr50: complete support of the new NVMEM structure
This patch eliminates unnecessary legacy nvmem.c and nvmem_vars.c code and brings the code base to the state where the new NVMEM layout is fully functional. BRANCH=cr50, cr50-mp BUG=b:69907320, b:129710256 CQ-DEPEND=CL:1450278 TEST=the following tests pass: - test cases in ./test/nvmem.c - TCG suite (passes on par with the existing Cr50 code with the reduced code footprint TPM2 library) - Chrome OS device migrates from legacy to new implementation with user account maintained. - Chrome OS user account is maintained over AP and H1 reboots and deep sleep cycles. Change-Id: If4bc2dd125873a79dbe0e268eb32100a8b8b352d Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1496607 Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'common/tpm_registers.c')
-rw-r--r--common/tpm_registers.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/common/tpm_registers.c b/common/tpm_registers.c
index 142261ecf3..947a3b089a 100644
--- a/common/tpm_registers.c
+++ b/common/tpm_registers.c
@@ -13,7 +13,7 @@
#include "console.h"
#include "extension.h"
#include "link_defs.h"
-#include "nvmem.h"
+#include "new_nvmem.h"
#include "printf.h"
#include "signed_header.h"
#include "sps.h"
@@ -828,20 +828,11 @@ static void tpm_reset_now(int wipe_first)
if (wipe_first)
/* Now wipe the TPM's nvmem */
- wipe_result = nvmem_erase_user_data(NVMEM_TPM);
+ wipe_result = nvmem_erase_tpm_data();
else
wipe_result = EC_SUCCESS;
/*
- * Clear the TPM library's zero-init data. Note that the linker script
- * includes this file's .bss in the same section, so it will be cleared
- * at the same time.
- */
- memset(&__bss_libtpm2_start, 0,
- (uintptr_t)(&__bss_libtpm2_end) -
- (uintptr_t)(&__bss_libtpm2_start));
-
- /*
* NOTE: If any __initialized variables need reinitializing after
* reset, this is the place to do it.
*/
@@ -853,6 +844,15 @@ static void tpm_reset_now(int wipe_first)
nvmem_enable_commits();
/*
+ * Clear the TPM library's zero-init data. Note that the linker script
+ * includes this file's .bss in the same section, so it will be cleared
+ * at the same time.
+ */
+ memset(&__bss_libtpm2_start, 0,
+ (uintptr_t)(&__bss_libtpm2_end) -
+ (uintptr_t)(&__bss_libtpm2_start));
+
+ /*
* Prevent NVRAM commits until further notice, unless running in
* factory mode.
*/