summaryrefslogtreecommitdiff
path: root/test/test_config.h
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2016-05-17 13:17:23 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-05-26 16:17:27 -0700
commitd80a5837c47de5aa42707bd708f614a6f16e7313 (patch)
treed4c318d9ec9fc8d9e31e2fd67e64d1972b2af958 /test/test_config.h
parent56ee8aefc33505a7df4e4148001a11ac461907a3 (diff)
downloadchrome-ec-d80a5837c47de5aa42707bd708f614a6f16e7313.tar.gz
NvMem: Added NV Memory module to ec/common/
Full implementation of NvMem read, write, and commit functions. Includes partition definitions, shared memory allocation, and initialization function. Includes a set of unit tests located in ec/test/nvmem.c which verify functionality. This module is required by Cr50, however this CL does not include any Cr50 specific code. BUG=chrome-os-partner:44745 BRANCH=none TEST=manual make runtests TEST_LIST_HOST=nvmem and verify that all tests pass Change-Id: I515b094f2179dbcb75dd11ab5b14434caad37edd Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/345632 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'test/test_config.h')
-rw-r--r--test/test_config.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/test_config.h b/test/test_config.h
index d7e4b7b172..5b21c8f61c 100644
--- a/test/test_config.h
+++ b/test/test_config.h
@@ -149,6 +149,33 @@ int ncp15wb_calculate_temp(uint16_t adc);
#define CONFIG_USB_PD_PORT_COUNT 2
#endif
+#ifdef TEST_NVMEM
+#define CONFIG_FLASH_NVMEM
+#define CONFIG_FLASH_NVMEM_OFFSET 0x1000
+#define CONFIG_FLASH_NVMEM_BASE (CONFIG_PROGRAM_MEMORY_BASE + \
+ CONFIG_FLASH_NVMEM_OFFSET)
+#define CONFIG_FLASH_NVMEM_SIZE 0x4000
+#define CONFIG_SW_CRC
+
+#define NVMEM_PARTITION_SIZE \
+ (CONFIG_FLASH_NVMEM_SIZE / NVMEM_NUM_PARTITIONS)
+/* User buffer definitions for test purposes */
+#define NVMEM_USER_2_SIZE 0x201
+#define NVMEM_USER_1_SIZE 0x402
+#define NVMEM_USER_0_SIZE (NVMEM_PARTITION_SIZE - \
+ NVMEM_USER_2_SIZE - NVMEM_USER_1_SIZE - \
+ sizeof(struct nvmem_tag))
+
+#ifndef __ASSEMBLER__
+enum nvmem_users {
+ NVMEM_USER_0,
+ NVMEM_USER_1,
+ NVMEM_USER_2,
+ NVMEM_NUM_USERS
+};
+#endif
+#endif
+
#ifndef __ASSEMBLER__
/* Callback function from charge_manager to send host event */
static inline void pd_send_host_event(int mask) { }