1# Flash map abstraction module
2
3# Copyright (c) 2017 Nordic Semiconductor ASA
4# SPDX-License-Identifier: Apache-2.0
5
6#
7# Flash map
8#
9
10menuconfig FLASH_MAP
11	bool "Flash map abstraction module"
12	depends on FLASH_HAS_DRIVER_ENABLED
13	help
14	  Enable support of flash map abstraction.
15
16if FLASH_MAP
17
18config FLASH_MAP_SHELL
19	bool "Flash map shell interface"
20	depends on SHELL
21	imply FLASH_MAP_LABELS
22	help
23	  This enables shell commands to list and test flash maps.
24
25config FLASH_MAP_CUSTOM
26	bool "Custom flash map description"
27	help
28	  This option enables custom flash map description.
29	  User must provide such a description in place of default on
30	  if had enabled this option.
31
32config FLASH_AREA_CHECK_INTEGRITY
33	bool "Flash check functions"
34	help
35	  If enabled, there will be available the backend to check flash
36	  integrity using SHA-256 verification algorithm.
37
38config FLASH_MAP_LABELS
39	bool "Access flash area labels at runtime"
40	help
41	  If enabled the label property of the flash map can be retrieved
42	  at runtime. The available labels will also be displayed in the
43	  flash_map list shell command.
44
45if FLASH_AREA_CHECK_INTEGRITY
46
47choice FLASH_AREA_CHECK_INTEGRITY_BACKEND
48	prompt "Crypto backend for the flash check functions"
49	default FLASH_AREA_CHECK_INTEGRITY_PSA if BUILD_WITH_TFM
50	default FLASH_AREA_CHECK_INTEGRITY_MBEDTLS if !BUILD_WITH_TFM
51
52config FLASH_AREA_CHECK_INTEGRITY_PSA
53	bool "Use PSA"
54	select PSA_WANT_ALG_SHA_256
55	help
56	  Use the PSA API to perform the integrity check.
57
58config FLASH_AREA_CHECK_INTEGRITY_MBEDTLS
59	bool "Use Mbed TLS"
60	select MBEDTLS
61	select MBEDTLS_SHA256
62	help
63	  Use the Mbed TLS library to perform the integrity check.
64
65endchoice
66
67endif # FLASH_AREA_CHECK_INTEGRITY
68
69endif
70