summaryrefslogtreecommitdiff
path: root/common/nvmem.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-08-05 09:39:51 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-08-08 20:19:44 -0700
commit37784e1e868fc9c722a80dbf1179a72782c87056 (patch)
tree0f2fc7795818e06b373447bb74e5a3312edd5d0e /common/nvmem.c
parent7e14583689f2e6e89f3f27e1abb171910ea875a7 (diff)
downloadchrome-ec-37784e1e868fc9c722a80dbf1179a72782c87056.tar.gz
cr50: fix nvmem calculations
The nvmem space defined in the ec code base for the cr50 board is used by the TPM2 library, which has its own nvram size definition. The two definitions must match. On top of the fact that the definitions are not locked to each other, there is a third completely unrelated nvram size definition in board/cr50/board.c. This patch unifies nvmem size definitions between cr50 and tpm2 repositories by adding a compile time check for the size to be the same on both sides. Also, it turns out that two certificates (RSA and ECC) together do not quite fit into the cr50 TPM nvram. Hence the total allocated nvmem space is being increased to 20K (note that the actual nvram size available to the TPM is less than half of this). BRANCH=none BUG=chrome-os-partner:55898 TEST=tpm does not lock up any more when 'tpm_client --own' is ran on the Kevin-tpm2 command line CQ-DEPEND=CL:367010 Change-Id: I20b4f54118bd2fa12e5bd5741d6c58fbe91f65d1 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/366796 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'common/nvmem.c')
-rw-r--r--common/nvmem.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/common/nvmem.c b/common/nvmem.c
index 8cf88909c0..36784b4ec5 100644
--- a/common/nvmem.c
+++ b/common/nvmem.c
@@ -19,13 +19,6 @@
#define NVMEM_ACQUIRE_CACHE_MAX_ATTEMPTS (250 / NVMEM_ACQUIRE_CACHE_SLEEP_MS)
#define NVMEM_NOT_INITIALIZED (-1)
-/* Structure MvMem Partition */
-struct nvmem_partition {
- struct nvmem_tag tag;
- uint8_t buffer[NVMEM_PARTITION_SIZE -
- sizeof(struct nvmem_tag)];
-};
-
/* NvMem user buffer start offset table */
static uint32_t nvmem_user_start_offset[NVMEM_NUM_USERS];