1#-------------------------------------------------------------------------------
2# Copyright (c) 2022-2023, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8menu "ITS component options"
9  depends on TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
10
11config ITS_CREATE_FLASH_LAYOUT
12    bool "Create flash layout"
13    default y
14    help
15      Indicates that it is required to create an ITS flash layout.
16
17config ITS_RAM_FS
18    bool "RAM emulated file system"
19    default n
20    help
21      Enables the use of RAM instead of the persistent storage device to store
22      the FS in the ITS. The ITS regression tests write/erase storage multiple
23      time, so enabling this option can increase the life of flash memory when
24      testing.
25
26      If this option enabled, ITS_RAM_FS_SIZE must also be provided by platforms
27      in flash_layout.h to specify the size of the block of RAM to be used to
28      simulate the flash.
29
30config ITS_VALIDATE_METADATA_FROM_FLASH
31    bool "Validate filesystem metadata"
32    default y
33    help
34      Allows to enable the validation mechanism to check the metadata store in
35      flash every time the flash data is read from flash. This validation is
36      required if the flash is not hardware protected against data corruption.
37
38config ITS_MAX_ASSET_SIZE
39    int "Maximum asset size"
40    default 512
41    help
42      The maximum asset size to be stored in the ITS area.
43
44      When building for the PSA Crypto API tests, ensure the ITS max asset size
45      is set to at least the size of the largest asset created by the tests.
46
47config ITS_BUF_SIZE
48    int "Internal buffer size"
49    default ITS_MAX_ASSET_SIZE
50    help
51      Defines the size of the partition's internal data transfer buffer. If not
52      provided, then ``ITS_MAX_ASSET_SIZE`` is used to allow asset data to be
53      copied between the client and the filesystem in one iteration.
54
55      Reducing the buffer size will decrease the RAM usage of the partition at
56      the expense of latency, as data will be copied in multiple iterations.
57
58      Note: when data is copied in multiple iterations, the atomicity property
59      of the filesystem is lost in the case of an asynchronous power failure.
60
61config ITS_NUM_ASSETS
62    int "Number of assets"
63    default 10
64    help
65      Defines the maximum number of assets to be stored in the ITS area. This
66      number is used to dimension statically the filesystem metadata tables in
67      RAM (fast access) and flash (persistent storage). The memory used by the
68      filesystem metadata tables is allocated statically as ITS does not use
69      dynamic memory allocation.
70
71config ITS_STACK_SIZE
72    hex "Stack size"
73    default 0x720
74    help
75      Defines the stack size of the Internal Trusted Storage Secure Partition.
76      This value mainly depends on the platform specific flash drivers, the
77      build type (Debug, Release and MinSizeRel) and compiler.
78
79config TFM_ITS_AUTH_TAG_LENGTH
80    int "Size of the authentication tag"
81    default 16
82    depends on ITS_ENCRYPTION
83    help
84      The size of the authentication tag used when authentication/encryption of
85      ITS files is enabled
86
87config TFM_ITS_ENC_NONCE_LENGTH
88    int "Size of the nonce"
89    depends on ITS_ENCRYPTION
90    default 12
91    help
92      The size of the nonce used when ITS file encryption is enabled
93
94endmenu
95