summaryrefslogtreecommitdiff
path: root/common/flash_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/flash_common.c')
-rw-r--r--common/flash_common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/flash_common.c b/common/flash_common.c
index 6afa4adc6e..11cb8150f3 100644
--- a/common/flash_common.c
+++ b/common/flash_common.c
@@ -13,6 +13,7 @@
#include "shared_mem.h"
#include "system.h"
#include "util.h"
+#include "vboot_hash.h"
int flash_dataptr(int offset, int size_req, int align, char **ptrp)
{
@@ -48,6 +49,10 @@ int flash_write(int offset, int size, const char *data)
if (flash_dataptr(offset, size, CONFIG_FLASH_WRITE_SIZE, NULL) < 0)
return EC_ERROR_INVAL; /* Invalid range */
+#ifdef CONFIG_TASK_VBOOTHASH
+ vboot_hash_invalidate(offset, size);
+#endif
+
return flash_physical_write(offset, size, data);
}
@@ -56,6 +61,10 @@ int flash_erase(int offset, int size)
if (flash_dataptr(offset, size, CONFIG_FLASH_ERASE_SIZE, NULL) < 0)
return EC_ERROR_INVAL; /* Invalid range */
+#ifdef CONFIG_TASK_VBOOTHASH
+ vboot_hash_invalidate(offset, size);
+#endif
+
return flash_physical_erase(offset, size);
}