summaryrefslogtreecommitdiff
path: root/board/cr50/tpm2/NVMem.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/cr50/tpm2/NVMem.c')
-rw-r--r--board/cr50/tpm2/NVMem.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/board/cr50/tpm2/NVMem.c b/board/cr50/tpm2/NVMem.c
index 7dad3d5d3d..695debe26c 100644
--- a/board/cr50/tpm2/NVMem.c
+++ b/board/cr50/tpm2/NVMem.c
@@ -65,14 +65,10 @@ int _plat__NVEnable(void *platParameter)
*/
s_NV_recoverable = nvmem_get_error_state() != 0;
s_NV_unrecoverable = s_NV_recoverable;
+#endif
if (s_NV_unrecoverable)
return -1;
return s_NV_recoverable;
-#else
- if (s_NV_unrecoverable)
- return -1;
- return s_NV_recoverable;
-#endif
}
void _plat__NVDisable(void)
@@ -217,3 +213,12 @@ void _plat__ClearNvAvail(void)
s_NvIsAvailable = FALSE;
return;
}
+
+void wipe_nvram(void)
+{
+#ifdef CONFIG_FLASH_NVMEM
+ nvmem_setup(0);
+#else
+ memset(s_NV, 0xff, sizeof(s_NV));
+#endif
+}