diff options
author | Scott <scollyer@chromium.org> | 2016-08-30 17:21:49 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-09-02 21:16:35 -0700 |
commit | 1d46c3770842d6c1f06ea3798aa36c5eeb2b392f (patch) | |
tree | bf513b92a52722ae85a3723268b663d7aeb25511 /include | |
parent | b2a751cfd8b5f543e7b40f32c81a7a6f876c42c7 (diff) | |
download | chrome-ec-1d46c3770842d6c1f06ea3798aa36c5eeb2b392f.tar.gz |
Cr50: NvMem: Allow for partitions to not be contiguous
TPM2.0 needs more NvMem space and currently the whole block is
contiguous in memory with 2 partitions. This CL removes the
requirement that the partitions are in contiguous which allows for 1
partition to placed at top of RW_A and the other at RW_B.
This CL does not change the size of each partition as that will be
done in a subsequent CL.
BRANCH=none
BUG=chrome-os-partner:56798
TEST=manual
Tested with the unit test 'make runtests TEST_LIST_HOST=nvmem' and
verified that all tests pass.
Tested on Kevin, erased the existing NvMem area and verified that TPM
was still manufactured and executed the command: trunks_client --own
Erased parition 0 and 1 in the new locations and repeated the tests.
Change-Id: I295441f94dccdf5a152c32603c2638ffac23f471
Signed-off-by: Scott <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/378675
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Tested-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 6 | ||||
-rw-r--r-- | include/nvmem.h | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/include/config.h b/include/config.h index 1cb5b83108..5ecfe2400b 100644 --- a/include/config.h +++ b/include/config.h @@ -915,9 +915,11 @@ /* Enable NV Memory module within flash */ #undef CONFIG_FLASH_NVMEM /* Offset to start of NvMem area from base of flash */ -#undef CONFIG_FLASH_NVMEM_OFFSET +#undef CONFIG_FLASH_NVMEM_OFFSET_A +#undef CONFIG_FLASH_NVMEM_OFFSET_B /* Address of start of Nvmem area */ -#undef CONFIG_FLASH_NVMEM_BASE +#undef CONFIG_FLASH_NVMEM_BASE_A +#undef CONFIG_FLASH_NVMEM_BASE_B /* Size in bytes of NvMem area */ #undef CONFIG_FLASH_NVMEM_SIZE diff --git a/include/nvmem.h b/include/nvmem.h index 82942dbe8e..781ea219f0 100644 --- a/include/nvmem.h +++ b/include/nvmem.h @@ -32,6 +32,10 @@ * aren't fully erased, then NvMem is marked corrupt and this failure condition * must be reported back to the caller. * + * Note that the NvMem partitions can be placed anywhere in flash space, but + * must be equal in total size. A table is used by the NvMem module to get the + * correct base address and offset for each partition. + * * A version number is used to distinguish between two valid partitions with * the newsest version number (in a circular sense) marking the correct * partition to use. The parition number 0/1 is tracked via a static @@ -43,8 +47,8 @@ * * The following CONFIG_FLASH_NVMEM_ defines are required for this module: * CONFIG_FLASH_NVMEM -> enable/disable the module - * CONFIG_FLASH_NVMEM_OFFSET -> offset to start of NvMem from base of flash - * CONFIG_FLASH_NVMEM_BASE -> address of start of NvMem area + * CONFIG_FLASH_NVMEM_OFFSET_(A|B) -> offset to start of each partition + * CONFIG_FLASH_NVMEM_BASE_(A|B) -> address of start of each partition * * The board.h file must define a macro or enum named NVMEM_NUM_USERS. * The board.c file must include 1 function and an array of user buffer lengths @@ -52,7 +56,7 @@ * nvmem_compute_sha() -> function used to compute 4 byte sha (or equivalent) * * Note that total length of user buffers must satisfy the following: - * sum(user sizes) <= (CONFIG_FLASH_NVMEM_SIZE / 2) - sizeof(struct nvmem_tag) + * sum(user sizes) <= (NVMEM_PARTITION_SIZE) - sizeof(struct nvmem_tag) */ /* NvMem user buffer length table */ |