Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 1 | /* |
2 | * Copyright (c) 2022, Arm Limited. All rights reserved. | ||||
3 | * | ||||
4 | * SPDX-License-Identifier: BSD-3-Clause | ||||
5 | * | ||||
6 | */ | ||||
7 | |||||
8 | #ifndef __CONFIG_TEST_PSA_API_H__ | ||||
9 | #define __CONFIG_TEST_PSA_API_H__ | ||||
10 | |||||
11 | /* Platform Partition Configs */ | ||||
12 | |||||
13 | /* Size of input buffer in platform service */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 14 | #ifndef PLATFORM_SERVICE_INPUT_BUFFER_SIZE |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 15 | #define PLATFORM_SERVICE_INPUT_BUFFER_SIZE 64 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 16 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 17 | |
18 | /* Size of output buffer in platform service */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 19 | #ifndef PLATFORM_SERVICE_OUTPUT_BUFFER_SIZE |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 20 | #define PLATFORM_SERVICE_OUTPUT_BUFFER_SIZE 64 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 21 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 22 | |
23 | /* The stack size of the Platform Secure Partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 24 | #ifndef PLATFORM_SP_STACK_SIZE |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 25 | #define PLATFORM_SP_STACK_SIZE 0x500 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 26 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 27 | |
28 | /* Disable Non-volatile counter module */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 29 | #ifndef PLATFORM_NV_COUNTER_MODULE_DISABLED |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 30 | #define PLATFORM_NV_COUNTER_MODULE_DISABLED 0 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 31 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 32 | |
33 | /* Crypto Partition Configs */ | ||||
34 | |||||
35 | /* | ||||
36 | * Heap size for the crypto backend | ||||
37 | * CRYPTO_ENGINE_BUF_SIZE needs to be much larger for PSA API tests. | ||||
38 | */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 39 | #ifndef CRYPTO_ENGINE_BUF_SIZE |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 40 | #define CRYPTO_ENGINE_BUF_SIZE 0x5000 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 41 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 42 | |
43 | /* The max number of concurrent operations that can be active (allocated) at any time in Crypto */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 44 | #ifndef CRYPTO_CONC_OPER_NUM |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 45 | #define CRYPTO_CONC_OPER_NUM 8 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 46 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 47 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 48 | /* Enable PSA Crypto random number generator module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 49 | #ifndef CRYPTO_RNG_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 50 | #define CRYPTO_RNG_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 51 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 52 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 53 | /* Enable PSA Crypto Key module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 54 | #ifndef CRYPTO_KEY_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 55 | #define CRYPTO_KEY_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 56 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 57 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 58 | /* Enable PSA Crypto AEAD module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 59 | #ifndef CRYPTO_AEAD_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 60 | #define CRYPTO_AEAD_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 61 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 62 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 63 | /* Enable PSA Crypto MAC module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 64 | #ifndef CRYPTO_MAC_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 65 | #define CRYPTO_MAC_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 66 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 67 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 68 | /* Enable PSA Crypto Hash module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 69 | #ifndef CRYPTO_HASH_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 70 | #define CRYPTO_HASH_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 71 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 72 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 73 | /* Enable PSA Crypto Cipher module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 74 | #ifndef CRYPTO_CIPHER_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 75 | #define CRYPTO_CIPHER_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 76 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 77 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 78 | /* Enable PSA Crypto asymmetric key signature module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 79 | #ifndef CRYPTO_ASYM_SIGN_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 80 | #define CRYPTO_ASYM_SIGN_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 81 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 82 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 83 | /* Enable PSA Crypto asymmetric key encryption module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 84 | #ifndef CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 85 | #define CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 86 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 87 | |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 88 | /* Enable PSA Crypto key derivation module */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 89 | #ifndef CRYPTO_KEY_DERIVATION_MODULE_ENABLED |
Jianliang Shen | 78ca8d4 | 2022-11-16 17:33:18 +0800 | [diff] [blame] | 90 | #define CRYPTO_KEY_DERIVATION_MODULE_ENABLED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 91 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 92 | |
93 | /* Default size of the internal scratch buffer used for PSA FF IOVec allocations */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 94 | #ifndef CRYPTO_IOVEC_BUFFER_SIZE |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 95 | #define CRYPTO_IOVEC_BUFFER_SIZE 5120 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 96 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 97 | |
98 | /* Use stored NV seed to provide entropy */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 99 | #ifndef CRYPTO_NV_SEED |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 100 | #define CRYPTO_NV_SEED 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 101 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 102 | |
103 | /* | ||||
104 | * Only enable multi-part operations in Hash, MAC, AEAD and symmetric ciphers, | ||||
105 | * to optimize memory footprint in resource-constrained devices. | ||||
106 | */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 107 | #ifndef CRYPTO_SINGLE_PART_FUNCS_DISABLED |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 108 | #define CRYPTO_SINGLE_PART_FUNCS_DISABLED 0 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 109 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 110 | |
111 | /* The stack size of the Crypto Secure Partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 112 | #ifndef CRYPTO_STACK_SIZE |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 113 | #define CRYPTO_STACK_SIZE 0x1B00 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 114 | #endif |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 115 | |
Xinyu Zhang | ff65372 | 2022-10-27 14:17:36 +0800 | [diff] [blame] | 116 | /* FWU Partition Configs */ |
117 | |||||
118 | /* Size of the FWU internal data transfer buffer */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 119 | #ifndef TFM_FWU_BUF_SIZE |
Xinyu Zhang | ff65372 | 2022-10-27 14:17:36 +0800 | [diff] [blame] | 120 | #define TFM_FWU_BUF_SIZE PSA_FWU_MAX_WRITE_SIZE |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 121 | #endif |
Xinyu Zhang | ff65372 | 2022-10-27 14:17:36 +0800 | [diff] [blame] | 122 | |
123 | /* The stack size of the Firmware Update Secure Partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 124 | #ifndef FWU_STACK_SIZE |
Xinyu Zhang | ff65372 | 2022-10-27 14:17:36 +0800 | [diff] [blame] | 125 | #define FWU_STACK_SIZE 0x600 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 126 | #endif |
Xinyu Zhang | ff65372 | 2022-10-27 14:17:36 +0800 | [diff] [blame] | 127 | |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 128 | /* Attest Partition Configs */ |
129 | |||||
130 | /* Include optional claims in initial attestation token */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 131 | #ifndef ATTEST_INCLUDE_OPTIONAL_CLAIMS |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 132 | #define ATTEST_INCLUDE_OPTIONAL_CLAIMS 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 133 | #endif |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 134 | |
135 | /* Include COSE key-id in initial attestation token */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 136 | #ifndef ATTEST_INCLUDE_COSE_KEY_ID |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 137 | #define ATTEST_INCLUDE_COSE_KEY_ID 0 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 138 | #endif |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 139 | |
140 | /* The stack size of the Initial Attestation Secure Partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 141 | #ifndef ATTEST_STACK_SIZE |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 142 | #define ATTEST_STACK_SIZE 0x700 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 143 | #endif |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 144 | |
145 | /* Set the initial attestation token profile */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 146 | #ifndef ATTEST_TOKEN_PROFILE_PSA_IOT_1 |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 147 | #define ATTEST_TOKEN_PROFILE_PSA_IOT_1 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 148 | #endif |
Xinyu Zhang | d15f99c | 2022-10-27 15:03:34 +0800 | [diff] [blame] | 149 | |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 150 | /* ITS Partition Configs */ |
151 | |||||
152 | /* Create flash FS if it doesn't exist for Internal Trusted Storage partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 153 | #ifndef ITS_CREATE_FLASH_LAYOUT |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 154 | #define ITS_CREATE_FLASH_LAYOUT 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 155 | #endif |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 156 | |
157 | /* Enable emulated RAM FS for platforms that don't have flash for Internal Trusted Storage partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 158 | #ifndef ITS_RAM_FS |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 159 | #define ITS_RAM_FS 0 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 160 | #endif |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 161 | |
162 | /* Validate filesystem metadata every time it is read from flash */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 163 | #ifndef ITS_VALIDATE_METADATA_FROM_FLASH |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 164 | #define ITS_VALIDATE_METADATA_FROM_FLASH 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 165 | #endif |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 166 | |
167 | /* The maximum asset size to be stored in the Internal Trusted Storage */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 168 | #ifndef ITS_MAX_ASSET_SIZE |
Kevin Peng | f6721c7 | 2023-03-01 16:12:45 +0800 | [diff] [blame] | 169 | #ifdef PSA_API_TEST_CRYPTO |
Xinyu Zhang | e7581b1 | 2022-11-23 14:19:02 +0800 | [diff] [blame] | 170 | /* |
171 | * When building for the PSA Crypto API tests, ensure the ITS max asset size is | ||||
172 | * set to at least the size of the largest asset created by the tests. | ||||
173 | */ | ||||
174 | #define ITS_MAX_ASSET_SIZE 1229 | ||||
175 | #else | ||||
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 176 | #define ITS_MAX_ASSET_SIZE 512 |
Xinyu Zhang | e7581b1 | 2022-11-23 14:19:02 +0800 | [diff] [blame] | 177 | #endif |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 178 | #endif |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 179 | |
180 | /* | ||||
181 | * Size of the ITS internal data transfer buffer | ||||
182 | * (Default to the max asset size so that all requests can be handled in one iteration.) | ||||
183 | */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 184 | #ifndef ITS_BUF_SIZE |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 185 | #define ITS_BUF_SIZE ITS_MAX_ASSET_SIZE |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 186 | #endif |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 187 | |
188 | /* The maximum number of assets to be stored in the Internal Trusted Storage */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 189 | #ifndef ITS_NUM_ASSETS |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 190 | #define ITS_NUM_ASSETS 10 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 191 | #endif |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 192 | |
193 | /* The stack size of the Internal Trusted Storage Secure Partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 194 | #ifndef ITS_STACK_SIZE |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 195 | #define ITS_STACK_SIZE 0x720 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 196 | #endif |
Xinyu Zhang | c8fc2c0 | 2022-10-31 12:13:45 +0800 | [diff] [blame] | 197 | |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 198 | /* PS Partition Configs */ |
199 | |||||
200 | /* Create flash FS if it doesn't exist for Protected Storage partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 201 | #ifndef PS_CREATE_FLASH_LAYOUT |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 202 | #define PS_CREATE_FLASH_LAYOUT 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 203 | #endif |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 204 | |
205 | /* Enable emulated RAM FS for platforms that don't have flash for Protected Storage partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 206 | #ifndef PS_RAM_FS |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 207 | #define PS_RAM_FS 0 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 208 | #endif |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 209 | |
210 | /* Enable rollback protection for Protected Storage partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 211 | #ifndef PS_ROLLBACK_PROTECTION |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 212 | #define PS_ROLLBACK_PROTECTION 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 213 | #endif |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 214 | |
215 | /* Validate filesystem metadata every time it is read from flash */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 216 | #ifndef PS_VALIDATE_METADATA_FROM_FLASH |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 217 | #define PS_VALIDATE_METADATA_FROM_FLASH 1 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 218 | #endif |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 219 | |
220 | /* The maximum asset size to be stored in the Protected Storage */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 221 | #ifndef PS_MAX_ASSET_SIZE |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 222 | #define PS_MAX_ASSET_SIZE 2048 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 223 | #endif |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 224 | |
225 | /* The maximum number of assets to be stored in the Protected Storage */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 226 | #ifndef PS_NUM_ASSETS |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 227 | #define PS_NUM_ASSETS 10 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 228 | #endif |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 229 | |
230 | /* The stack size of the Protected Storage Secure Partition */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 231 | #ifndef PS_STACK_SIZE |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 232 | #define PS_STACK_SIZE 0x700 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 233 | #endif |
Xinyu Zhang | 0715270 | 2022-10-31 12:35:49 +0800 | [diff] [blame] | 234 | |
Sherry Zhang | 415d713 | 2023-08-09 16:26:56 +0800 | [diff] [blame^] | 235 | /* The stack size of the NS Agent Mailbox Secure Partition */ |
236 | #ifndef NS_AGENT_MAILBOX_STACK_SIZE | ||||
237 | #define NS_AGENT_MAILBOX_STACK_SIZE 0x800 | ||||
238 | #endif | ||||
239 | |||||
Xinyu Zhang | cdbe362 | 2022-10-31 14:34:25 +0800 | [diff] [blame] | 240 | /* SPM Partition Configs */ |
241 | |||||
242 | /* The maximal number of secure services that are connected or requested at the same time */ | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 243 | #ifndef CONFIG_TFM_CONN_HANDLE_MAX_NUM |
Xinyu Zhang | cdbe362 | 2022-10-31 14:34:25 +0800 | [diff] [blame] | 244 | #define CONFIG_TFM_CONN_HANDLE_MAX_NUM 8 |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 245 | #endif |
Xinyu Zhang | cdbe362 | 2022-10-31 14:34:25 +0800 | [diff] [blame] | 246 | |
Xinyu Zhang | 44dbfa6 | 2022-11-23 14:22:32 +0800 | [diff] [blame] | 247 | /* Set the doorbell APIs */ |
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 248 | #ifndef CONFIG_TFM_DOORBELL_API |
Kevin Peng | f6721c7 | 2023-03-01 16:12:45 +0800 | [diff] [blame] | 249 | #ifdef PSA_API_TEST_IPC |
Xinyu Zhang | 44dbfa6 | 2022-11-23 14:22:32 +0800 | [diff] [blame] | 250 | /* IPC test suite uses IPC backend */ |
Xinyu Zhang | cdbe362 | 2022-10-31 14:34:25 +0800 | [diff] [blame] | 251 | #define CONFIG_TFM_DOORBELL_API 1 |
Xinyu Zhang | 44dbfa6 | 2022-11-23 14:22:32 +0800 | [diff] [blame] | 252 | #else |
253 | #define CONFIG_TFM_DOORBELL_API 0 | ||||
254 | #endif | ||||
Andrej Butok | ab8f52d | 2023-06-06 15:51:41 +0200 | [diff] [blame] | 255 | #endif |
Xinyu Zhang | cdbe362 | 2022-10-31 14:34:25 +0800 | [diff] [blame] | 256 | |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 257 | #endif /* __CONFIG_TEST_PSA_API_H__ */ |