Skip to content

Commit

Permalink
secure_storage: change dependencies on settings and flash
Browse files Browse the repository at this point in the history
The commit changes dependencies on SETTINGS and FLASH
to avoid circular dependencies if security storage
subsystem users select them too.

Signed-off-by: Aleksandr Khromykh <[email protected]>
  • Loading branch information
alxelax committed Jan 9, 2025
1 parent 39872cd commit ef4654f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
12 changes: 12 additions & 0 deletions doc/releases/migration-guide-4.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,18 @@ Other Subsystems
Flash map
=========

Secure storage
==============

* The :kconfig:option:`CONFIG_SECURE_STORAGE_ITS_STORE_MODULE` symbol no longer implies the
:kconfig:option:`CONFIG_FLASH` Kconfig option. Platforms using Secure storage must explicitly enable it.

* The :kconfig:option:`CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS` symbol no longer implies the
:kconfig:option:`CONFIG_FLASH_MAP` and :kconfig:option:`CONFIG_NVS` Kconfig options.
It no longer selects the :kconfig:option:`CONFIG_SETTINGS` Kconfig option either.
Platforms using it must now explicitly enable :kconfig:option:`CONFIG_FLASH_MAP`,
:kconfig:option:`CONFIG_SETTINGS` and the desired storage system (e.g. :kconfig:option:`CONFIG_ZMS`).

hawkBit
=======

Expand Down
1 change: 1 addition & 0 deletions samples/psa/its/overlay-secure_storage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y
# On top of that, the ITS implementation uses the stack for buffers.
CONFIG_MAIN_STACK_SIZE=3072

CONFIG_SETTINGS=y
CONFIG_SECURE_STORAGE=y
1 change: 1 addition & 0 deletions samples/psa/persistent_key/overlay-secure_storage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y
# On top of that, the ITS implementation uses the stack for buffers.
CONFIG_MAIN_STACK_SIZE=3072

CONFIG_SETTINGS=y
CONFIG_SECURE_STORAGE=y
1 change: 0 additions & 1 deletion subsys/secure_storage/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ endif

menuconfig SECURE_STORAGE_ITS_STORE_MODULE
bool "ITS store module"
imply FLASH # for FLASH_HAS_DRIVER_ENABLED
help
The module that handles the storage/retrieval of the ITS data to/from NVM.
Zephyr's ITS implementation calls into it.
Expand Down
5 changes: 1 addition & 4 deletions subsys/secure_storage/Kconfig.its_store
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS

config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS
bool "ITS store module implementation using the settings subsystem for storage"
depends on FLASH_HAS_DRIVER_ENABLED \
depends on FLASH_HAS_DRIVER_ENABLED && SETTINGS\
&& (($(dt_path_enabled,$(DT_SETTINGS_PARTITIION)) \
&& $(dt_node_has_compat,$(dt_node_parent,$(DT_SETTINGS_PARTITIION)),fixed-partitions))\
|| ($(dt_path_enabled,$(DT_STORAGE_PARTITION)) \
&& $(dt_node_has_compat,$(dt_node_parent,$(DT_STORAGE_PARTITION)),fixed-partitions)))
imply FLASH_MAP
imply NVS
select SETTINGS

config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE
bool "No ITS store module implementation"
Expand Down
4 changes: 4 additions & 0 deletions tests/subsys/secure_storage/psa/crypto/overlay-settings.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

0 comments on commit ef4654f

Please sign in to comment.