summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-02-21 17:12:35 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-27 18:50:12 -0800
commit2a7683af41a65907ed81f4a448390c5d0b09cedc (patch)
treeeb482f4b6c68da76e7aca732856346236b1746a6 /test
parentec98dbfb35bb22bb6b9096eceedda93c9f88f85c (diff)
downloadchrome-ec-2a7683af41a65907ed81f4a448390c5d0b09cedc.tar.gz
cr50: Store console lock state in NvMem vars.
This commit enables the use of the nvmem vars module. The console lock state is migrated from using the long life scratch register, to nvmem vars instead which will persist across power on reboots. BUG=b:35586145 BRANCH=None TEST=Flash a dev image. Lock the console. Remove all power from the system. Power on system and verify that console is still locked. Unlock the console, remove power from the system, power on the system, verify that the console is now unlocked. TEST=Repeat the above test, but using the nvtestvar console command instead. Change-Id: I03a2098bb0017cfca59889457a332eafb0e95db6 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/445804 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/nvmem_vars.c7
-rw-r--r--test/test_config.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/test/nvmem_vars.c b/test/nvmem_vars.c
index 5e31d6a2aa..99e059215e 100644
--- a/test/nvmem_vars.c
+++ b/test/nvmem_vars.c
@@ -82,6 +82,13 @@ int nvmem_commit(void)
return EC_SUCCESS;
}
+int nvmem_erase_user_data(enum nvmem_users user)
+{
+ memset(ram_buffer, 0xff, sizeof(ram_buffer));
+ memset(flash_buffer, 0xff, sizeof(flash_buffer));
+ return EC_SUCCESS;
+}
+
/****************************************************************************/
/* Helper routines */
diff --git a/test/test_config.h b/test/test_config.h
index 029ce9bd70..d59652ec2b 100644
--- a/test/test_config.h
+++ b/test/test_config.h
@@ -199,6 +199,10 @@ enum nvmem_users {
CONFIG_FLASH_NVMEM_VARS_USER_NUM,
NVMEM_NUM_USERS
};
+/* Define a test var. */
+enum nvmem_vars {
+ NVMEM_VAR_TEST_VAR,
+};
#endif
#define CONFIG_FLASH_NVMEM_VARS_USER_SIZE 600
#endif /* TEST_NVMEM_VARS */