diff options
author | Allen Webb <allenwebb@google.com> | 2018-08-21 07:44:37 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-07 18:36:34 -0700 |
commit | 8961872603f6d7b66ef97d444711e83d6a55e2f4 (patch) | |
tree | 814d6cf13e2fc23162daf6437dcef7625d7c84bf /common/nvcounter.c | |
parent | 5c5555a49d89154f14efa0c68c99938ef1313b73 (diff) | |
download | chrome-ec-8961872603f6d7b66ef97d444711e83d6a55e2f4.tar.gz |
common: flash and nvmem fixes for compatibility with the host board.
This CL
1) Forces alignment of __host_flash so it can be used with nvcounter
2) Disables a compile time check for the host board that failes because
the host board uses a variable to emulate flash memory.
3) Disables nvmem_vars console commands that are specific to a unit test
for fuzzing targets.
BRANCH=none
BUG=chromium:876582
TEST=make -j buildfuzztests (with cr50_fuzz CL)
Change-Id: Id6257132d8f2dd73ae07e796efd0da3df83b30d6
Signed-off-by: Allen Webb <allenwebb@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1183533
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/nvcounter.c')
-rw-r--r-- | common/nvcounter.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/nvcounter.c b/common/nvcounter.c index de00d8857c..6c267e3a4c 100644 --- a/common/nvcounter.c +++ b/common/nvcounter.c @@ -21,9 +21,15 @@ static uint32_t *FLASH_CNT_LO = (uint32_t *)CONFIG_FLASH_NVCTR_BASE_A; static uint32_t *FLASH_CNT_HI = (uint32_t *)CONFIG_FLASH_NVCTR_BASE_B; -/* Ensure the 2 flash counter areas are aligned on flash pages */ + +#ifndef CHIP_HOST +/* Ensure the 2 flash counter areas are aligned on flash pages except for the + * host board which simulates flash with a variable that cannot be checked + * at compile time. + */ BUILD_ASSERT(CONFIG_FLASH_NVCTR_BASE_A % CONFIG_FLASH_ERASE_SIZE == 0); BUILD_ASSERT(CONFIG_FLASH_NVCTR_BASE_B % CONFIG_FLASH_ERASE_SIZE == 0); +#endif /* * An anti-rollback, persistent flash counter. This counter requires two pages |