1# Copyright (c) 2024 Nordic Semiconductor 2# SPDX-License-Identifier: Apache-2.0 3 4choice SECURE_STORAGE_ITS_STORE_IMPLEMENTATION 5 prompt "ITS store module implementation" 6 7DT_ITS_PARTITION := $(dt_chosen_path,secure_storage_its_partition) 8DT_CHOSEN_Z_SETTINGS_PARTITION := zephyr,settings-partition 9DT_SETTINGS_PARTITIION := $(dt_chosen_path,$(DT_CHOSEN_Z_SETTINGS_PARTITION)) 10DT_STORAGE_PARTITION := $(dt_nodelabel_path,storage_partition) 11 12config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS 13 bool "ITS store module implementation using ZMS for storage" 14 depends on FLASH_HAS_DRIVER_ENABLED \ 15 && $(dt_path_enabled,$(DT_ITS_PARTITION)) \ 16 && $(dt_node_has_compat,$(dt_node_parent,$(DT_ITS_PARTITION)),fixed-partitions) 17 depends on ZMS 18 help 19 This implementation of the ITS store module makes direct use of ZMS for storage. 20 It needs a `secure_storage_its_partition` devicetree chosen property that points 21 to a fixed storage partition that will be dedicated to the ITS. It has lower 22 overhead compared to the settings-based implementation, both in terms of runtime 23 execution and storage space, and also ROM footprint if the settings subsystem is disabled. 24 As this implementations directly maps the PSA storage UIDs to ZMS entry IDs, it limits 25 their values to the first 30 bits. 26 27config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS 28 bool "ITS store module implementation using the settings subsystem for storage" 29 depends on FLASH_HAS_DRIVER_ENABLED \ 30 && (($(dt_path_enabled,$(DT_SETTINGS_PARTITIION)) \ 31 && $(dt_node_has_compat,$(dt_node_parent,$(DT_SETTINGS_PARTITIION)),fixed-partitions))\ 32 || ($(dt_path_enabled,$(DT_STORAGE_PARTITION)) \ 33 && $(dt_node_has_compat,$(dt_node_parent,$(DT_STORAGE_PARTITION)),fixed-partitions))) 34 depends on SETTINGS 35 36config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE 37 bool "No ITS store module implementation" 38 39config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_CUSTOM 40 bool "Custom ITS store module implementation" 41 help 42 Implement the functions declared in <zephyr/secure_storage/its/store.h>. 43 The header is made available when this Kconfig option is enabled. 44 45endchoice # SECURE_STORAGE_ITS_STORE_IMPLEMENTATION 46 47if SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS 48 49config SECURE_STORAGE_ITS_STORE_ZMS_SECTOR_SIZE 50 int "Sector size of the ZMS partition" 51 default 4096 52 help 53 The sector size impacts the runtime behavior of ZMS and restricts the maximum 54 ITS entry data size (which is the sector size minus ZMS and ITS overhead). 55 Changing it will result in loss of existing data stored on a partition. 56 It must be a multiple of the flash page size on devices that require an erase. 57 See the ZMS documentation for more information. 58 59endif # SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS 60 61if SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS 62 63config SECURE_STORAGE_ITS_STORE_SETTINGS_PREFIX 64 string "Subtree in which to store the settings, with a trailing slash. Can be empty." 65 default "its/" 66 67endif # SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS 68