1# Copyright (c) 2018 Laczen
2# Copyright (c) 2024 BayLibre SAS
3
4# SPDX-License-Identifier: Apache-2.0
5
6# Zephyr Memory Storage ZMS
7
8config ZMS
9	bool "Zephyr Memory Storage"
10	select CRC
11	help
12	  Enable Zephyr Memory Storage, which is a key-value storage system designed to work with
13	  all types of non-volatile storage technologies.
14	  It supports classical on-chip NOR flash as well as new technologies like RRAM and MRAM.
15
16if ZMS
17
18config ZMS_LOOKUP_CACHE
19	bool "ZMS lookup cache"
20	help
21	  Enable ZMS cache to reduce the ZMS data lookup time.
22	  Each cache entry holds an address of the most recent allocation
23	  table entry (ATE) for all ZMS IDs that fall into that cache position.
24
25config ZMS_LOOKUP_CACHE_SIZE
26	int "ZMS lookup cache size"
27	default 128
28	range 1 65536
29	depends on ZMS_LOOKUP_CACHE
30	help
31	  Number of entries in the ZMS lookup cache.
32	  Every additional entry in cache will use 8 bytes of RAM.
33
34config ZMS_DATA_CRC
35	bool "ZMS data CRC"
36
37config ZMS_CUSTOMIZE_BLOCK_SIZE
38	bool "Customize the size of the buffer used internally for reads and writes"
39	help
40	  ZMS uses an internal buffer to read/write and compare stored data.
41	  Increasing the size of this buffer should be done carefully in order to not
42	  overflow the stack.
43	  Increasing it makes ZMS able to work with storage devices
44	  that have a larger `write-block-size` (which decreases the performance of ZMS).
45
46config ZMS_CUSTOM_BLOCK_SIZE
47	int "ZMS internal buffer size"
48	default 32
49	depends on ZMS_CUSTOMIZE_BLOCK_SIZE
50	help
51	  Changes the internal buffer size of ZMS
52
53config ZMS_NO_DOUBLE_WRITE
54	bool "Avoid writing the same data again in the storage"
55	help
56	  For some memory technologies, write cycles for memory cells are limited and any
57	  unncessary writes should be avoided.
58	  Enable this config to avoid rewriting data in the storage if it already exists.
59	  This option will reduce write performance as it will need to do a research of the
60	  data in the whole storage before any write.
61
62module = ZMS
63module-str = zms
64source "subsys/logging/Kconfig.template.log_config"
65
66endif # ZMS
67