1#Copyright (c) 2024 BayLibre SAS
2
3#SPDX-License-Identifier: Apache-2.0
4
5#Zephyr Memory Storage ZMS
6
7config ZMS
8	bool "Zephyr Memory Storage"
9	select CRC
10	help
11	  Enable support of Zephyr Memory Storage.
12
13if ZMS
14
15config ZMS_LOOKUP_CACHE
16	bool "ZMS lookup cache"
17	help
18	  Enable ZMS cache to reduce the ZMS data lookup time.
19	  Each cache entry holds an address of the most recent allocation
20	  table entry (ATE) for all ZMS IDs that fall into that cache position.
21
22config ZMS_LOOKUP_CACHE_SIZE
23	int "ZMS Storage lookup cache size"
24	default 128
25	range 1 65536
26	depends on ZMS_LOOKUP_CACHE
27	help
28	  Number of entries in ZMS lookup cache.
29	  It is recommended that it should be a power of 2.
30	  Every additional entry in cache will add 8 bytes in RAM
31
32config ZMS_DATA_CRC
33	bool "ZMS DATA CRC"
34	help
35	  Enables 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 this buffer means as well that ZMS could work with storage devices
44	  that have larger write-block-size which decreases ZMS performance
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