Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /*********** WARNING: This is an auto-generated file. Do not edit! ***********/ |
| 9 | |
| 10 | #ifndef __TFM_SPM_DB_INC__ |
| 11 | #define __TFM_SPM_DB_INC__ |
| 12 | |
| 13 | #include "spm_api.h" |
| 14 | |
| 15 | /**************************************************************************/ |
| 16 | /** IRQ count per partition */ |
| 17 | /**************************************************************************/ |
| 18 | #define TFM_PARTITION_TFM_SP_STORAGE_IRQ_COUNT 0 |
| 19 | |
| 20 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 21 | #define TFM_PARTITION_TFM_SP_AUDIT_LOG_IRQ_COUNT 0 |
| 22 | #endif /* TFM_PARTITION_AUDIT_LOG */ |
| 23 | |
| 24 | #define TFM_PARTITION_TFM_SP_CRYPTO_IRQ_COUNT 0 |
| 25 | |
| 26 | #ifdef TFM_PARTITION_PLATFORM |
| 27 | #define TFM_PARTITION_TFM_SP_PLATFORM_IRQ_COUNT 0 |
| 28 | #endif /* TFM_PARTITION_PLATFORM */ |
| 29 | |
| 30 | #define TFM_PARTITION_TFM_SP_INITIAL_ATTESTATION_IRQ_COUNT 0 |
| 31 | |
| 32 | #ifdef TFM_PARTITION_TEST_CORE |
| 33 | #define TFM_PARTITION_TFM_SP_CORE_TEST_IRQ_COUNT 0 |
| 34 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 35 | |
| 36 | #ifdef TFM_PARTITION_TEST_CORE |
| 37 | #define TFM_PARTITION_TFM_SP_CORE_TEST_2_IRQ_COUNT 0 |
| 38 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 39 | |
| 40 | #ifdef TFM_PARTITION_TEST_SECURE_SERVICES |
| 41 | #define TFM_PARTITION_TFM_SP_SECURE_TEST_PARTITION_IRQ_COUNT 0 |
| 42 | #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */ |
| 43 | |
| 44 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 45 | #define TFM_PARTITION_TFM_SP_IPC_SERVICE_TEST_IRQ_COUNT 0 |
| 46 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 47 | |
| 48 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 49 | #define TFM_PARTITION_TFM_SP_IPC_CLIENT_TEST_IRQ_COUNT 0 |
| 50 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 51 | |
| 52 | #ifdef TFM_PARTITION_TEST_CORE |
| 53 | #define TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT 1 |
| 54 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 55 | |
| 56 | /**************************************************************************/ |
| 57 | /** Declarations of partition init functions */ |
| 58 | /**************************************************************************/ |
| 59 | extern int32_t tfm_sst_req_mngr_init(void); |
| 60 | |
| 61 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 62 | extern int32_t audit_core_init(void); |
| 63 | #endif /* TFM_PARTITION_AUDIT_LOG */ |
| 64 | |
| 65 | extern int32_t tfm_crypto_init(void); |
| 66 | |
| 67 | #ifdef TFM_PARTITION_PLATFORM |
| 68 | extern int32_t platform_sp_init(void); |
| 69 | #endif /* TFM_PARTITION_PLATFORM */ |
| 70 | |
| 71 | extern int32_t attest_partition_init(void); |
| 72 | |
| 73 | #ifdef TFM_PARTITION_TEST_CORE |
| 74 | extern int32_t core_test_init(void); |
| 75 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 76 | |
| 77 | #ifdef TFM_PARTITION_TEST_CORE |
| 78 | extern int32_t core_test_2_init(void); |
| 79 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 80 | |
| 81 | #ifdef TFM_PARTITION_TEST_SECURE_SERVICES |
| 82 | extern int32_t tfm_secure_client_service_init(void); |
| 83 | #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */ |
| 84 | |
| 85 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 86 | extern int32_t ipc_service_test_main(void); |
| 87 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 88 | |
| 89 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 90 | extern int32_t ipc_client_test_main(void); |
| 91 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 92 | |
| 93 | #ifdef TFM_PARTITION_TEST_CORE |
| 94 | extern int32_t tfm_irq_test_1_init(void); |
| 95 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 96 | |
| 97 | /**************************************************************************/ |
| 98 | /** Memory region declarations */ |
| 99 | /**************************************************************************/ |
| 100 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, $$Base); |
| 101 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, $$Limit); |
| 102 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, $$RO$$Base); |
| 103 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, $$RO$$Limit); |
| 104 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, _DATA$$RW$$Base); |
| 105 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, _DATA$$RW$$Limit); |
| 106 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, _DATA$$ZI$$Base); |
| 107 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, _DATA$$ZI$$Limit); |
| 108 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, _STACK$$ZI$$Base); |
| 109 | REGION_DECLARE(Image$$, TFM_SP_STORAGE, _STACK$$ZI$$Limit); |
| 110 | |
| 111 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 112 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, $$Base); |
| 113 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, $$Limit); |
| 114 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, $$RO$$Base); |
| 115 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, $$RO$$Limit); |
| 116 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, _DATA$$RW$$Base); |
| 117 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, _DATA$$RW$$Limit); |
| 118 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, _DATA$$ZI$$Base); |
| 119 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, _DATA$$ZI$$Limit); |
| 120 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, _STACK$$ZI$$Base); |
| 121 | REGION_DECLARE(Image$$, TFM_SP_AUDIT_LOG, _STACK$$ZI$$Limit); |
| 122 | #endif /* TFM_PARTITION_AUDIT_LOG */ |
| 123 | |
| 124 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, $$Base); |
| 125 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, $$Limit); |
| 126 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, $$RO$$Base); |
| 127 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, $$RO$$Limit); |
| 128 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, _DATA$$RW$$Base); |
| 129 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, _DATA$$RW$$Limit); |
| 130 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, _DATA$$ZI$$Base); |
| 131 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, _DATA$$ZI$$Limit); |
| 132 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, _STACK$$ZI$$Base); |
| 133 | REGION_DECLARE(Image$$, TFM_SP_CRYPTO, _STACK$$ZI$$Limit); |
| 134 | |
| 135 | #ifdef TFM_PARTITION_PLATFORM |
| 136 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, $$Base); |
| 137 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, $$Limit); |
| 138 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, $$RO$$Base); |
| 139 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, $$RO$$Limit); |
| 140 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, _DATA$$RW$$Base); |
| 141 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, _DATA$$RW$$Limit); |
| 142 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, _DATA$$ZI$$Base); |
| 143 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, _DATA$$ZI$$Limit); |
| 144 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, _STACK$$ZI$$Base); |
| 145 | REGION_DECLARE(Image$$, TFM_SP_PLATFORM, _STACK$$ZI$$Limit); |
| 146 | #endif /* TFM_PARTITION_PLATFORM */ |
| 147 | |
| 148 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, $$Base); |
| 149 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, $$Limit); |
| 150 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, $$RO$$Base); |
| 151 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, $$RO$$Limit); |
| 152 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, _DATA$$RW$$Base); |
| 153 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, _DATA$$RW$$Limit); |
| 154 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, _DATA$$ZI$$Base); |
| 155 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, _DATA$$ZI$$Limit); |
| 156 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, _STACK$$ZI$$Base); |
| 157 | REGION_DECLARE(Image$$, TFM_SP_INITIAL_ATTESTATION, _STACK$$ZI$$Limit); |
| 158 | |
| 159 | #ifdef TFM_PARTITION_TEST_CORE |
| 160 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, $$Base); |
| 161 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, $$Limit); |
| 162 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, $$RO$$Base); |
| 163 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, $$RO$$Limit); |
| 164 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, _DATA$$RW$$Base); |
| 165 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, _DATA$$RW$$Limit); |
| 166 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, _DATA$$ZI$$Base); |
| 167 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, _DATA$$ZI$$Limit); |
| 168 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, _STACK$$ZI$$Base); |
| 169 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST, _STACK$$ZI$$Limit); |
| 170 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 171 | |
| 172 | #ifdef TFM_PARTITION_TEST_CORE |
| 173 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, $$Base); |
| 174 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, $$Limit); |
| 175 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, $$RO$$Base); |
| 176 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, $$RO$$Limit); |
| 177 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, _DATA$$RW$$Base); |
| 178 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, _DATA$$RW$$Limit); |
| 179 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, _DATA$$ZI$$Base); |
| 180 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, _DATA$$ZI$$Limit); |
| 181 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, _STACK$$ZI$$Base); |
| 182 | REGION_DECLARE(Image$$, TFM_SP_CORE_TEST_2, _STACK$$ZI$$Limit); |
| 183 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 184 | |
| 185 | #ifdef TFM_PARTITION_TEST_SECURE_SERVICES |
| 186 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, $$Base); |
| 187 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, $$Limit); |
| 188 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, $$RO$$Base); |
| 189 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, $$RO$$Limit); |
| 190 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, _DATA$$RW$$Base); |
| 191 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, _DATA$$RW$$Limit); |
| 192 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, _DATA$$ZI$$Base); |
| 193 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, _DATA$$ZI$$Limit); |
| 194 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, _STACK$$ZI$$Base); |
| 195 | REGION_DECLARE(Image$$, TFM_SP_SECURE_TEST_PARTITION, _STACK$$ZI$$Limit); |
| 196 | #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */ |
| 197 | |
| 198 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 199 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, $$Base); |
| 200 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, $$Limit); |
| 201 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, $$RO$$Base); |
| 202 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, $$RO$$Limit); |
| 203 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, _DATA$$RW$$Base); |
| 204 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, _DATA$$RW$$Limit); |
| 205 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, _DATA$$ZI$$Base); |
| 206 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, _DATA$$ZI$$Limit); |
| 207 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, _STACK$$ZI$$Base); |
| 208 | REGION_DECLARE(Image$$, TFM_SP_IPC_SERVICE_TEST, _STACK$$ZI$$Limit); |
| 209 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 210 | |
| 211 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 212 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, $$Base); |
| 213 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, $$Limit); |
| 214 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, $$RO$$Base); |
| 215 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, $$RO$$Limit); |
| 216 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, _DATA$$RW$$Base); |
| 217 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, _DATA$$RW$$Limit); |
| 218 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, _DATA$$ZI$$Base); |
| 219 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, _DATA$$ZI$$Limit); |
| 220 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, _STACK$$ZI$$Base); |
| 221 | REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, _STACK$$ZI$$Limit); |
| 222 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 223 | |
| 224 | #ifdef TFM_PARTITION_TEST_CORE |
| 225 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, $$Base); |
| 226 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, $$Limit); |
| 227 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, $$RO$$Base); |
| 228 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, $$RO$$Limit); |
| 229 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _DATA$$RW$$Base); |
| 230 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _DATA$$RW$$Limit); |
| 231 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _DATA$$ZI$$Base); |
| 232 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _DATA$$ZI$$Limit); |
| 233 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _STACK$$ZI$$Base); |
| 234 | REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _STACK$$ZI$$Limit); |
| 235 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 236 | |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 237 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 238 | /**************************************************************************/ |
| 239 | /** Context stacks for IRQ handling */ |
| 240 | /**************************************************************************/ |
| 241 | /* The max size of the context stack can be calculated as a function of the IRQ |
| 242 | * count of the secure partition: |
| 243 | * |
| 244 | * max_stack_size = intr_ctx_size + (IRQ_CNT * (intr_ctx_size + hndl_ctx_size)) |
| 245 | * |
| 246 | * where: |
| 247 | * intr_ctx: Frame pushed when the partition is interrupted |
| 248 | * hndl_ctx: Frame pushed when the partition is handling an interrupt |
| 249 | */ |
| 250 | static uint32_t ctx_stack_TFM_SP_STORAGE[ |
| 251 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 252 | (TFM_PARTITION_TFM_SP_STORAGE_IRQ_COUNT) * ( |
| 253 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 254 | sizeof(struct handler_ctx_stack_frame_t) |
| 255 | )) / sizeof(uint32_t)]; |
| 256 | |
| 257 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 258 | static uint32_t ctx_stack_TFM_SP_AUDIT_LOG[ |
| 259 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 260 | (TFM_PARTITION_TFM_SP_AUDIT_LOG_IRQ_COUNT) * ( |
| 261 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 262 | sizeof(struct handler_ctx_stack_frame_t) |
| 263 | )) / sizeof(uint32_t)]; |
| 264 | #endif /* TFM_PARTITION_AUDIT_LOG */ |
| 265 | |
| 266 | static uint32_t ctx_stack_TFM_SP_CRYPTO[ |
| 267 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 268 | (TFM_PARTITION_TFM_SP_CRYPTO_IRQ_COUNT) * ( |
| 269 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 270 | sizeof(struct handler_ctx_stack_frame_t) |
| 271 | )) / sizeof(uint32_t)]; |
| 272 | |
| 273 | #ifdef TFM_PARTITION_PLATFORM |
| 274 | static uint32_t ctx_stack_TFM_SP_PLATFORM[ |
| 275 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 276 | (TFM_PARTITION_TFM_SP_PLATFORM_IRQ_COUNT) * ( |
| 277 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 278 | sizeof(struct handler_ctx_stack_frame_t) |
| 279 | )) / sizeof(uint32_t)]; |
| 280 | #endif /* TFM_PARTITION_PLATFORM */ |
| 281 | |
| 282 | static uint32_t ctx_stack_TFM_SP_INITIAL_ATTESTATION[ |
| 283 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 284 | (TFM_PARTITION_TFM_SP_INITIAL_ATTESTATION_IRQ_COUNT) * ( |
| 285 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 286 | sizeof(struct handler_ctx_stack_frame_t) |
| 287 | )) / sizeof(uint32_t)]; |
| 288 | |
| 289 | #ifdef TFM_PARTITION_TEST_CORE |
| 290 | static uint32_t ctx_stack_TFM_SP_CORE_TEST[ |
| 291 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 292 | (TFM_PARTITION_TFM_SP_CORE_TEST_IRQ_COUNT) * ( |
| 293 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 294 | sizeof(struct handler_ctx_stack_frame_t) |
| 295 | )) / sizeof(uint32_t)]; |
| 296 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 297 | |
| 298 | #ifdef TFM_PARTITION_TEST_CORE |
| 299 | static uint32_t ctx_stack_TFM_SP_CORE_TEST_2[ |
| 300 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 301 | (TFM_PARTITION_TFM_SP_CORE_TEST_2_IRQ_COUNT) * ( |
| 302 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 303 | sizeof(struct handler_ctx_stack_frame_t) |
| 304 | )) / sizeof(uint32_t)]; |
| 305 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 306 | |
| 307 | #ifdef TFM_PARTITION_TEST_SECURE_SERVICES |
| 308 | static uint32_t ctx_stack_TFM_SP_SECURE_TEST_PARTITION[ |
| 309 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 310 | (TFM_PARTITION_TFM_SP_SECURE_TEST_PARTITION_IRQ_COUNT) * ( |
| 311 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 312 | sizeof(struct handler_ctx_stack_frame_t) |
| 313 | )) / sizeof(uint32_t)]; |
| 314 | #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */ |
| 315 | |
| 316 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 317 | static uint32_t ctx_stack_TFM_SP_IPC_SERVICE_TEST[ |
| 318 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 319 | (TFM_PARTITION_TFM_SP_IPC_SERVICE_TEST_IRQ_COUNT) * ( |
| 320 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 321 | sizeof(struct handler_ctx_stack_frame_t) |
| 322 | )) / sizeof(uint32_t)]; |
| 323 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 324 | |
| 325 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 326 | static uint32_t ctx_stack_TFM_SP_IPC_CLIENT_TEST[ |
| 327 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 328 | (TFM_PARTITION_TFM_SP_IPC_CLIENT_TEST_IRQ_COUNT) * ( |
| 329 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 330 | sizeof(struct handler_ctx_stack_frame_t) |
| 331 | )) / sizeof(uint32_t)]; |
| 332 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 333 | |
| 334 | #ifdef TFM_PARTITION_TEST_CORE |
| 335 | static uint32_t ctx_stack_TFM_IRQ_TEST_1[ |
| 336 | (sizeof(struct interrupted_ctx_stack_frame_t) + |
| 337 | (TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT) * ( |
| 338 | sizeof(struct interrupted_ctx_stack_frame_t) + |
| 339 | sizeof(struct handler_ctx_stack_frame_t) |
| 340 | )) / sizeof(uint32_t)]; |
| 341 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 342 | |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 343 | #endif /* !defined(TFM_PSA_API) */ |
| 344 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 345 | /**************************************************************************/ |
| 346 | /** The partition list for the DB */ |
| 347 | /**************************************************************************/ |
| 348 | struct spm_partition_desc_t partition_list [] = |
| 349 | { |
| 350 | {{0}}, /* placeholder for Non-secure internal partition */ |
| 351 | {{0}}, /* placeholder for TF-M Core internal partition */ |
| 352 | |
| 353 | /* -----------------------------------------------------------------------*/ |
| 354 | /* - Partition DB record for TFM_SP_STORAGE */ |
| 355 | /* -----------------------------------------------------------------------*/ |
| 356 | { |
| 357 | /* Static data */ |
| 358 | { |
| 359 | .partition_id = TFM_SP_STORAGE_ID, |
| 360 | .partition_flags = SPM_PART_FLAG_IPC |
| 361 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 362 | , |
| 363 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 364 | .partition_init = tfm_sst_req_mngr_init, |
| 365 | }, |
| 366 | |
| 367 | /* Runtime data */ |
| 368 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 369 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 370 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 371 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 372 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 373 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 374 | #if TFM_LVL != 1 |
| 375 | .stack_ptr = PART_REGION_ADDR(TFM_SP_STORAGE, _STACK$$ZI$$Limit) - |
| 376 | sizeof(struct iovec_args_t), |
| 377 | #else /* TFM_LVL != 1 */ |
| 378 | .stack_ptr = 0, |
| 379 | #endif /* TFM_LVL != 1 */ |
| 380 | .lr = 0, |
| 381 | .iovec_api = TFM_SFN_API_IOVEC, |
| 382 | .iovec_args = |
| 383 | { |
| 384 | .in_vec = {{0}}, |
| 385 | .in_len = 0, |
| 386 | .out_vec = {{0}}, |
| 387 | .out_len = 0, |
| 388 | }, |
| 389 | .orig_outvec = NULL, |
| 390 | .ctx_stack_ptr = ctx_stack_TFM_SP_STORAGE, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 391 | #else /* !defined(TFM_PSA_API) */ |
| 392 | .signal_evnt = |
| 393 | { |
| 394 | .magic = 0, |
| 395 | .owner = NULL, |
| 396 | }, |
| 397 | .signals = 0, |
| 398 | .service_list = |
| 399 | { |
| 400 | .prev = NULL, |
| 401 | .next = NULL, |
| 402 | }, |
| 403 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 404 | .signal_mask = 0, |
| 405 | }, |
| 406 | |
| 407 | .platform_data = NULL, |
| 408 | |
| 409 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 410 | /* memory_data */ |
| 411 | .memory_data = { |
| 412 | .code_start = PART_REGION_ADDR(TFM_SP_STORAGE, $$Base), |
| 413 | .code_limit = PART_REGION_ADDR(TFM_SP_STORAGE, $$Limit), |
| 414 | .ro_start = PART_REGION_ADDR(TFM_SP_STORAGE, $$RO$$Base), |
| 415 | .ro_limit = PART_REGION_ADDR(TFM_SP_STORAGE, $$RO$$Limit), |
| 416 | .rw_start = PART_REGION_ADDR(TFM_SP_STORAGE, _DATA$$RW$$Base), |
| 417 | .rw_limit = PART_REGION_ADDR(TFM_SP_STORAGE, _DATA$$RW$$Limit), |
| 418 | .zi_start = PART_REGION_ADDR(TFM_SP_STORAGE, _DATA$$ZI$$Base), |
| 419 | .zi_limit = PART_REGION_ADDR(TFM_SP_STORAGE, _DATA$$ZI$$Limit), |
| 420 | .stack_bottom = PART_REGION_ADDR(TFM_SP_STORAGE, _STACK$$ZI$$Base), |
| 421 | .stack_top = PART_REGION_ADDR(TFM_SP_STORAGE, _STACK$$ZI$$Limit), |
| 422 | }, |
| 423 | #endif |
| 424 | |
| 425 | #ifdef TFM_PSA_API |
| 426 | /* sp_thrd */ |
| 427 | .sp_thrd = { |
| 428 | .pfn = NULL, |
| 429 | .param = NULL, |
| 430 | .sp_base = NULL, |
| 431 | .sp_top = NULL, |
| 432 | .prior = THRD_PRIOR_LOWEST, |
| 433 | .status = THRD_STAT_INVALID, |
| 434 | .state_ctx = |
| 435 | { |
| 436 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 437 | }, |
| 438 | .next = NULL, |
| 439 | }, |
| 440 | #endif /* defined(TFM_PSA_API) */ |
| 441 | }, |
| 442 | |
| 443 | /* -----------------------------------------------------------------------*/ |
| 444 | /* - Partition DB record for TFM_SP_AUDIT_LOG */ |
| 445 | /* -----------------------------------------------------------------------*/ |
| 446 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 447 | { |
| 448 | /* Static data */ |
| 449 | { |
| 450 | .partition_id = TFM_SP_AUDIT_LOG_ID, |
| 451 | .partition_flags = 0 |
| 452 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 453 | , |
| 454 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 455 | .partition_init = audit_core_init, |
| 456 | }, |
| 457 | |
| 458 | /* Runtime data */ |
| 459 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 460 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 461 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 462 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 463 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 464 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 465 | #if TFM_LVL != 1 |
| 466 | .stack_ptr = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _STACK$$ZI$$Limit) - |
| 467 | sizeof(struct iovec_args_t), |
| 468 | #else /* TFM_LVL != 1 */ |
| 469 | .stack_ptr = 0, |
| 470 | #endif /* TFM_LVL != 1 */ |
| 471 | .lr = 0, |
| 472 | .iovec_api = TFM_SFN_API_IOVEC, |
| 473 | .iovec_args = |
| 474 | { |
| 475 | .in_vec = {{0}}, |
| 476 | .in_len = 0, |
| 477 | .out_vec = {{0}}, |
| 478 | .out_len = 0, |
| 479 | }, |
| 480 | .orig_outvec = NULL, |
| 481 | .ctx_stack_ptr = ctx_stack_TFM_SP_AUDIT_LOG, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 482 | #else /* !defined(TFM_PSA_API) */ |
| 483 | .signal_evnt = |
| 484 | { |
| 485 | .magic = 0, |
| 486 | .owner = NULL, |
| 487 | }, |
| 488 | .signals = 0, |
| 489 | .service_list = |
| 490 | { |
| 491 | .prev = NULL, |
| 492 | .next = NULL, |
| 493 | }, |
| 494 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 495 | .signal_mask = 0, |
| 496 | }, |
| 497 | |
| 498 | /* platform data */ |
| 499 | /* FIXME: Only adding the first mmio region */ |
| 500 | #ifdef AUDIT_UART_REDIRECTION |
| 501 | .platform_data = TFM_PERIPHERAL_UART1, |
| 502 | #else /* AUDIT_UART_REDIRECTION */ |
| 503 | .platform_data = NULL, |
| 504 | #endif /* AUDIT_UART_REDIRECTION */ |
| 505 | |
| 506 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 507 | /* memory_data */ |
| 508 | .memory_data = { |
| 509 | .code_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, $$Base), |
| 510 | .code_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, $$Limit), |
| 511 | .ro_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, $$RO$$Base), |
| 512 | .ro_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, $$RO$$Limit), |
| 513 | .rw_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _DATA$$RW$$Base), |
| 514 | .rw_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _DATA$$RW$$Limit), |
| 515 | .zi_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _DATA$$ZI$$Base), |
| 516 | .zi_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _DATA$$ZI$$Limit), |
| 517 | .stack_bottom = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _STACK$$ZI$$Base), |
| 518 | .stack_top = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _STACK$$ZI$$Limit), |
| 519 | }, |
| 520 | #endif |
| 521 | |
| 522 | #ifdef TFM_PSA_API |
| 523 | /* sp_thrd */ |
| 524 | .sp_thrd = { |
| 525 | .pfn = NULL, |
| 526 | .param = NULL, |
| 527 | .sp_base = NULL, |
| 528 | .sp_top = NULL, |
| 529 | .prior = THRD_PRIOR_LOWEST, |
| 530 | .status = THRD_STAT_INVALID, |
| 531 | .state_ctx = |
| 532 | { |
| 533 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 534 | }, |
| 535 | .next = NULL, |
| 536 | }, |
| 537 | #endif /* defined(TFM_PSA_API) */ |
| 538 | }, |
| 539 | #endif /* TFM_PARTITION_AUDIT_LOG */ |
| 540 | |
| 541 | /* -----------------------------------------------------------------------*/ |
| 542 | /* - Partition DB record for TFM_SP_CRYPTO */ |
| 543 | /* -----------------------------------------------------------------------*/ |
| 544 | { |
| 545 | /* Static data */ |
| 546 | { |
| 547 | .partition_id = TFM_SP_CRYPTO_ID, |
| 548 | .partition_flags = SPM_PART_FLAG_IPC |
| 549 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 550 | , |
| 551 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 552 | .partition_init = tfm_crypto_init, |
| 553 | }, |
| 554 | |
| 555 | /* Runtime data */ |
| 556 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 557 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 558 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 559 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 560 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 561 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 562 | #if TFM_LVL != 1 |
| 563 | .stack_ptr = PART_REGION_ADDR(TFM_SP_CRYPTO, _STACK$$ZI$$Limit) - |
| 564 | sizeof(struct iovec_args_t), |
| 565 | #else /* TFM_LVL != 1 */ |
| 566 | .stack_ptr = 0, |
| 567 | #endif /* TFM_LVL != 1 */ |
| 568 | .lr = 0, |
| 569 | .iovec_api = TFM_SFN_API_IOVEC, |
| 570 | .iovec_args = |
| 571 | { |
| 572 | .in_vec = {{0}}, |
| 573 | .in_len = 0, |
| 574 | .out_vec = {{0}}, |
| 575 | .out_len = 0, |
| 576 | }, |
| 577 | .orig_outvec = NULL, |
| 578 | .ctx_stack_ptr = ctx_stack_TFM_SP_CRYPTO, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 579 | #else /* !defined(TFM_PSA_API) */ |
| 580 | .signal_evnt = |
| 581 | { |
| 582 | .magic = 0, |
| 583 | .owner = NULL, |
| 584 | }, |
| 585 | .signals = 0, |
| 586 | .service_list = |
| 587 | { |
| 588 | .prev = NULL, |
| 589 | .next = NULL, |
| 590 | }, |
| 591 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 592 | .signal_mask = 0, |
| 593 | }, |
| 594 | |
| 595 | .platform_data = NULL, |
| 596 | |
| 597 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 598 | /* memory_data */ |
| 599 | .memory_data = { |
| 600 | .code_start = PART_REGION_ADDR(TFM_SP_CRYPTO, $$Base), |
| 601 | .code_limit = PART_REGION_ADDR(TFM_SP_CRYPTO, $$Limit), |
| 602 | .ro_start = PART_REGION_ADDR(TFM_SP_CRYPTO, $$RO$$Base), |
| 603 | .ro_limit = PART_REGION_ADDR(TFM_SP_CRYPTO, $$RO$$Limit), |
| 604 | .rw_start = PART_REGION_ADDR(TFM_SP_CRYPTO, _DATA$$RW$$Base), |
| 605 | .rw_limit = PART_REGION_ADDR(TFM_SP_CRYPTO, _DATA$$RW$$Limit), |
| 606 | .zi_start = PART_REGION_ADDR(TFM_SP_CRYPTO, _DATA$$ZI$$Base), |
| 607 | .zi_limit = PART_REGION_ADDR(TFM_SP_CRYPTO, _DATA$$ZI$$Limit), |
| 608 | .stack_bottom = PART_REGION_ADDR(TFM_SP_CRYPTO, _STACK$$ZI$$Base), |
| 609 | .stack_top = PART_REGION_ADDR(TFM_SP_CRYPTO, _STACK$$ZI$$Limit), |
| 610 | }, |
| 611 | #endif |
| 612 | |
| 613 | #ifdef TFM_PSA_API |
| 614 | /* sp_thrd */ |
| 615 | .sp_thrd = { |
| 616 | .pfn = NULL, |
| 617 | .param = NULL, |
| 618 | .sp_base = NULL, |
| 619 | .sp_top = NULL, |
| 620 | .prior = THRD_PRIOR_LOWEST, |
| 621 | .status = THRD_STAT_INVALID, |
| 622 | .state_ctx = |
| 623 | { |
| 624 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 625 | }, |
| 626 | .next = NULL, |
| 627 | }, |
| 628 | #endif /* defined(TFM_PSA_API) */ |
| 629 | }, |
| 630 | |
| 631 | /* -----------------------------------------------------------------------*/ |
| 632 | /* - Partition DB record for TFM_SP_PLATFORM */ |
| 633 | /* -----------------------------------------------------------------------*/ |
| 634 | #ifdef TFM_PARTITION_PLATFORM |
| 635 | { |
| 636 | /* Static data */ |
| 637 | { |
| 638 | .partition_id = TFM_SP_PLATFORM_ID, |
| 639 | .partition_flags = 0 |
| 640 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 641 | , |
| 642 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 643 | .partition_init = platform_sp_init, |
| 644 | }, |
| 645 | |
| 646 | /* Runtime data */ |
| 647 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 648 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 649 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 650 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 651 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 652 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 653 | #if TFM_LVL != 1 |
| 654 | .stack_ptr = PART_REGION_ADDR(TFM_SP_PLATFORM, _STACK$$ZI$$Limit) - |
| 655 | sizeof(struct iovec_args_t), |
| 656 | #else /* TFM_LVL != 1 */ |
| 657 | .stack_ptr = 0, |
| 658 | #endif /* TFM_LVL != 1 */ |
| 659 | .lr = 0, |
| 660 | .iovec_api = TFM_SFN_API_IOVEC, |
| 661 | .iovec_args = |
| 662 | { |
| 663 | .in_vec = {{0}}, |
| 664 | .in_len = 0, |
| 665 | .out_vec = {{0}}, |
| 666 | .out_len = 0, |
| 667 | }, |
| 668 | .orig_outvec = NULL, |
| 669 | .ctx_stack_ptr = ctx_stack_TFM_SP_PLATFORM, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 670 | #else /* !defined(TFM_PSA_API) */ |
| 671 | .signal_evnt = |
| 672 | { |
| 673 | .magic = 0, |
| 674 | .owner = NULL, |
| 675 | }, |
| 676 | .signals = 0, |
| 677 | .service_list = |
| 678 | { |
| 679 | .prev = NULL, |
| 680 | .next = NULL, |
| 681 | }, |
| 682 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 683 | .signal_mask = 0, |
| 684 | }, |
| 685 | |
| 686 | .platform_data = NULL, |
| 687 | |
| 688 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 689 | /* memory_data */ |
| 690 | .memory_data = { |
| 691 | .code_start = PART_REGION_ADDR(TFM_SP_PLATFORM, $$Base), |
| 692 | .code_limit = PART_REGION_ADDR(TFM_SP_PLATFORM, $$Limit), |
| 693 | .ro_start = PART_REGION_ADDR(TFM_SP_PLATFORM, $$RO$$Base), |
| 694 | .ro_limit = PART_REGION_ADDR(TFM_SP_PLATFORM, $$RO$$Limit), |
| 695 | .rw_start = PART_REGION_ADDR(TFM_SP_PLATFORM, _DATA$$RW$$Base), |
| 696 | .rw_limit = PART_REGION_ADDR(TFM_SP_PLATFORM, _DATA$$RW$$Limit), |
| 697 | .zi_start = PART_REGION_ADDR(TFM_SP_PLATFORM, _DATA$$ZI$$Base), |
| 698 | .zi_limit = PART_REGION_ADDR(TFM_SP_PLATFORM, _DATA$$ZI$$Limit), |
| 699 | .stack_bottom = PART_REGION_ADDR(TFM_SP_PLATFORM, _STACK$$ZI$$Base), |
| 700 | .stack_top = PART_REGION_ADDR(TFM_SP_PLATFORM, _STACK$$ZI$$Limit), |
| 701 | }, |
| 702 | #endif |
| 703 | |
| 704 | #ifdef TFM_PSA_API |
| 705 | /* sp_thrd */ |
| 706 | .sp_thrd = { |
| 707 | .pfn = NULL, |
| 708 | .param = NULL, |
| 709 | .sp_base = NULL, |
| 710 | .sp_top = NULL, |
| 711 | .prior = THRD_PRIOR_LOWEST, |
| 712 | .status = THRD_STAT_INVALID, |
| 713 | .state_ctx = |
| 714 | { |
| 715 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 716 | }, |
| 717 | .next = NULL, |
| 718 | }, |
| 719 | #endif /* defined(TFM_PSA_API) */ |
| 720 | }, |
| 721 | #endif /* TFM_PARTITION_PLATFORM */ |
| 722 | |
| 723 | /* -----------------------------------------------------------------------*/ |
| 724 | /* - Partition DB record for TFM_SP_INITIAL_ATTESTATION */ |
| 725 | /* -----------------------------------------------------------------------*/ |
| 726 | { |
| 727 | /* Static data */ |
| 728 | { |
| 729 | .partition_id = TFM_SP_INITIAL_ATTESTATION_ID, |
| 730 | .partition_flags = SPM_PART_FLAG_IPC |
| 731 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 732 | , |
| 733 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 734 | .partition_init = attest_partition_init, |
| 735 | }, |
| 736 | |
| 737 | /* Runtime data */ |
| 738 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 739 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 740 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 741 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 742 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 743 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 744 | #if TFM_LVL != 1 |
| 745 | .stack_ptr = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _STACK$$ZI$$Limit) - |
| 746 | sizeof(struct iovec_args_t), |
| 747 | #else /* TFM_LVL != 1 */ |
| 748 | .stack_ptr = 0, |
| 749 | #endif /* TFM_LVL != 1 */ |
| 750 | .lr = 0, |
| 751 | .iovec_api = TFM_SFN_API_IOVEC, |
| 752 | .iovec_args = |
| 753 | { |
| 754 | .in_vec = {{0}}, |
| 755 | .in_len = 0, |
| 756 | .out_vec = {{0}}, |
| 757 | .out_len = 0, |
| 758 | }, |
| 759 | .orig_outvec = NULL, |
| 760 | .ctx_stack_ptr = ctx_stack_TFM_SP_INITIAL_ATTESTATION, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 761 | #else /* !defined(TFM_PSA_API) */ |
| 762 | .signal_evnt = |
| 763 | { |
| 764 | .magic = 0, |
| 765 | .owner = NULL, |
| 766 | }, |
| 767 | .signals = 0, |
| 768 | .service_list = |
| 769 | { |
| 770 | .prev = NULL, |
| 771 | .next = NULL, |
| 772 | }, |
| 773 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 774 | .signal_mask = 0, |
| 775 | }, |
| 776 | |
| 777 | .platform_data = NULL, |
| 778 | |
| 779 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 780 | /* memory_data */ |
| 781 | .memory_data = { |
| 782 | .code_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, $$Base), |
| 783 | .code_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, $$Limit), |
| 784 | .ro_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, $$RO$$Base), |
| 785 | .ro_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, $$RO$$Limit), |
| 786 | .rw_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _DATA$$RW$$Base), |
| 787 | .rw_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _DATA$$RW$$Limit), |
| 788 | .zi_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _DATA$$ZI$$Base), |
| 789 | .zi_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _DATA$$ZI$$Limit), |
| 790 | .stack_bottom = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _STACK$$ZI$$Base), |
| 791 | .stack_top = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _STACK$$ZI$$Limit), |
| 792 | }, |
| 793 | #endif |
| 794 | |
| 795 | #ifdef TFM_PSA_API |
| 796 | /* sp_thrd */ |
| 797 | .sp_thrd = { |
| 798 | .pfn = NULL, |
| 799 | .param = NULL, |
| 800 | .sp_base = NULL, |
| 801 | .sp_top = NULL, |
| 802 | .prior = THRD_PRIOR_LOWEST, |
| 803 | .status = THRD_STAT_INVALID, |
| 804 | .state_ctx = |
| 805 | { |
| 806 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 807 | }, |
| 808 | .next = NULL, |
| 809 | }, |
| 810 | #endif /* defined(TFM_PSA_API) */ |
| 811 | }, |
| 812 | |
| 813 | /* -----------------------------------------------------------------------*/ |
| 814 | /* - Partition DB record for TFM_SP_CORE_TEST */ |
| 815 | /* -----------------------------------------------------------------------*/ |
| 816 | #ifdef TFM_PARTITION_TEST_CORE |
| 817 | { |
| 818 | /* Static data */ |
| 819 | { |
| 820 | .partition_id = TFM_SP_CORE_TEST_ID, |
| 821 | .partition_flags = SPM_PART_FLAG_IPC |
| 822 | | SPM_PART_FLAG_APP_ROT |
| 823 | , |
| 824 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 825 | .partition_init = core_test_init, |
| 826 | }, |
| 827 | |
| 828 | /* Runtime data */ |
| 829 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 830 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 831 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 832 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 833 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 834 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 835 | #if TFM_LVL != 1 |
| 836 | .stack_ptr = PART_REGION_ADDR(TFM_SP_CORE_TEST, _STACK$$ZI$$Limit) - |
| 837 | sizeof(struct iovec_args_t), |
| 838 | #else /* TFM_LVL != 1 */ |
| 839 | .stack_ptr = 0, |
| 840 | #endif /* TFM_LVL != 1 */ |
| 841 | .lr = 0, |
| 842 | .iovec_api = TFM_SFN_API_IOVEC, |
| 843 | .iovec_args = |
| 844 | { |
| 845 | .in_vec = {{0}}, |
| 846 | .in_len = 0, |
| 847 | .out_vec = {{0}}, |
| 848 | .out_len = 0, |
| 849 | }, |
| 850 | .orig_outvec = NULL, |
| 851 | .ctx_stack_ptr = ctx_stack_TFM_SP_CORE_TEST, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 852 | #else /* !defined(TFM_PSA_API) */ |
| 853 | .signal_evnt = |
| 854 | { |
| 855 | .magic = 0, |
| 856 | .owner = NULL, |
| 857 | }, |
| 858 | .signals = 0, |
| 859 | .service_list = |
| 860 | { |
| 861 | .prev = NULL, |
| 862 | .next = NULL, |
| 863 | }, |
| 864 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 865 | .signal_mask = 0, |
| 866 | }, |
| 867 | |
| 868 | /* platform data */ |
| 869 | /* FIXME: Only adding the first mmio region */ |
| 870 | .platform_data = TFM_PERIPHERAL_FPGA_IO, |
| 871 | |
| 872 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 873 | /* memory_data */ |
| 874 | .memory_data = { |
| 875 | .code_start = PART_REGION_ADDR(TFM_SP_CORE_TEST, $$Base), |
| 876 | .code_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST, $$Limit), |
| 877 | .ro_start = PART_REGION_ADDR(TFM_SP_CORE_TEST, $$RO$$Base), |
| 878 | .ro_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST, $$RO$$Limit), |
| 879 | .rw_start = PART_REGION_ADDR(TFM_SP_CORE_TEST, _DATA$$RW$$Base), |
| 880 | .rw_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST, _DATA$$RW$$Limit), |
| 881 | .zi_start = PART_REGION_ADDR(TFM_SP_CORE_TEST, _DATA$$ZI$$Base), |
| 882 | .zi_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST, _DATA$$ZI$$Limit), |
| 883 | .stack_bottom = PART_REGION_ADDR(TFM_SP_CORE_TEST, _STACK$$ZI$$Base), |
| 884 | .stack_top = PART_REGION_ADDR(TFM_SP_CORE_TEST, _STACK$$ZI$$Limit), |
| 885 | }, |
| 886 | #endif |
| 887 | |
| 888 | #ifdef TFM_PSA_API |
| 889 | /* sp_thrd */ |
| 890 | .sp_thrd = { |
| 891 | .pfn = NULL, |
| 892 | .param = NULL, |
| 893 | .sp_base = NULL, |
| 894 | .sp_top = NULL, |
| 895 | .prior = THRD_PRIOR_LOWEST, |
| 896 | .status = THRD_STAT_INVALID, |
| 897 | .state_ctx = |
| 898 | { |
| 899 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 900 | }, |
| 901 | .next = NULL, |
| 902 | }, |
| 903 | #endif /* defined(TFM_PSA_API) */ |
| 904 | }, |
| 905 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 906 | |
| 907 | /* -----------------------------------------------------------------------*/ |
| 908 | /* - Partition DB record for TFM_SP_CORE_TEST_2 */ |
| 909 | /* -----------------------------------------------------------------------*/ |
| 910 | #ifdef TFM_PARTITION_TEST_CORE |
| 911 | { |
| 912 | /* Static data */ |
| 913 | { |
| 914 | .partition_id = TFM_SP_CORE_TEST_2_ID, |
| 915 | .partition_flags = SPM_PART_FLAG_IPC |
| 916 | | SPM_PART_FLAG_APP_ROT |
| 917 | , |
| 918 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 919 | .partition_init = core_test_2_init, |
| 920 | }, |
| 921 | |
| 922 | /* Runtime data */ |
| 923 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 924 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 925 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 926 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 927 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 928 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 929 | #if TFM_LVL != 1 |
| 930 | .stack_ptr = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _STACK$$ZI$$Limit) - |
| 931 | sizeof(struct iovec_args_t), |
| 932 | #else /* TFM_LVL != 1 */ |
| 933 | .stack_ptr = 0, |
| 934 | #endif /* TFM_LVL != 1 */ |
| 935 | .lr = 0, |
| 936 | .iovec_api = TFM_SFN_API_IOVEC, |
| 937 | .iovec_args = |
| 938 | { |
| 939 | .in_vec = {{0}}, |
| 940 | .in_len = 0, |
| 941 | .out_vec = {{0}}, |
| 942 | .out_len = 0, |
| 943 | }, |
| 944 | .orig_outvec = NULL, |
| 945 | .ctx_stack_ptr = ctx_stack_TFM_SP_CORE_TEST_2, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 946 | #else /* !defined(TFM_PSA_API) */ |
| 947 | .signal_evnt = |
| 948 | { |
| 949 | .magic = 0, |
| 950 | .owner = NULL, |
| 951 | }, |
| 952 | .signals = 0, |
| 953 | .service_list = |
| 954 | { |
| 955 | .prev = NULL, |
| 956 | .next = NULL, |
| 957 | }, |
| 958 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 959 | .signal_mask = 0, |
| 960 | }, |
| 961 | |
| 962 | .platform_data = NULL, |
| 963 | |
| 964 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 965 | /* memory_data */ |
| 966 | .memory_data = { |
| 967 | .code_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, $$Base), |
| 968 | .code_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, $$Limit), |
| 969 | .ro_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, $$RO$$Base), |
| 970 | .ro_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, $$RO$$Limit), |
| 971 | .rw_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _DATA$$RW$$Base), |
| 972 | .rw_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _DATA$$RW$$Limit), |
| 973 | .zi_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _DATA$$ZI$$Base), |
| 974 | .zi_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _DATA$$ZI$$Limit), |
| 975 | .stack_bottom = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _STACK$$ZI$$Base), |
| 976 | .stack_top = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _STACK$$ZI$$Limit), |
| 977 | }, |
| 978 | #endif |
| 979 | |
| 980 | #ifdef TFM_PSA_API |
| 981 | /* sp_thrd */ |
| 982 | .sp_thrd = { |
| 983 | .pfn = NULL, |
| 984 | .param = NULL, |
| 985 | .sp_base = NULL, |
| 986 | .sp_top = NULL, |
| 987 | .prior = THRD_PRIOR_LOWEST, |
| 988 | .status = THRD_STAT_INVALID, |
| 989 | .state_ctx = |
| 990 | { |
| 991 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 992 | }, |
| 993 | .next = NULL, |
| 994 | }, |
| 995 | #endif /* defined(TFM_PSA_API) */ |
| 996 | }, |
| 997 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 998 | |
| 999 | /* -----------------------------------------------------------------------*/ |
| 1000 | /* - Partition DB record for TFM_SP_SECURE_TEST_PARTITION */ |
| 1001 | /* -----------------------------------------------------------------------*/ |
| 1002 | #ifdef TFM_PARTITION_TEST_SECURE_SERVICES |
| 1003 | { |
| 1004 | /* Static data */ |
| 1005 | { |
| 1006 | .partition_id = TFM_SP_SECURE_TEST_PARTITION_ID, |
| 1007 | .partition_flags = SPM_PART_FLAG_IPC |
| 1008 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 1009 | , |
| 1010 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 1011 | .partition_init = tfm_secure_client_service_init, |
| 1012 | }, |
| 1013 | |
| 1014 | /* Runtime data */ |
| 1015 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1016 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1017 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 1018 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 1019 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 1020 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 1021 | #if TFM_LVL != 1 |
| 1022 | .stack_ptr = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _STACK$$ZI$$Limit) - |
| 1023 | sizeof(struct iovec_args_t), |
| 1024 | #else /* TFM_LVL != 1 */ |
| 1025 | .stack_ptr = 0, |
| 1026 | #endif /* TFM_LVL != 1 */ |
| 1027 | .lr = 0, |
| 1028 | .iovec_api = TFM_SFN_API_IOVEC, |
| 1029 | .iovec_args = |
| 1030 | { |
| 1031 | .in_vec = {{0}}, |
| 1032 | .in_len = 0, |
| 1033 | .out_vec = {{0}}, |
| 1034 | .out_len = 0, |
| 1035 | }, |
| 1036 | .orig_outvec = NULL, |
| 1037 | .ctx_stack_ptr = ctx_stack_TFM_SP_SECURE_TEST_PARTITION, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1038 | #else /* !defined(TFM_PSA_API) */ |
| 1039 | .signal_evnt = |
| 1040 | { |
| 1041 | .magic = 0, |
| 1042 | .owner = NULL, |
| 1043 | }, |
| 1044 | .signals = 0, |
| 1045 | .service_list = |
| 1046 | { |
| 1047 | .prev = NULL, |
| 1048 | .next = NULL, |
| 1049 | }, |
| 1050 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1051 | .signal_mask = 0, |
| 1052 | }, |
| 1053 | |
| 1054 | /* platform data */ |
| 1055 | /* FIXME: Only adding the first mmio region */ |
| 1056 | .platform_data = TFM_PERIPHERAL_STD_UART, |
| 1057 | |
| 1058 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 1059 | /* memory_data */ |
| 1060 | .memory_data = { |
| 1061 | .code_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, $$Base), |
| 1062 | .code_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, $$Limit), |
| 1063 | .ro_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, $$RO$$Base), |
| 1064 | .ro_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, $$RO$$Limit), |
| 1065 | .rw_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _DATA$$RW$$Base), |
| 1066 | .rw_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _DATA$$RW$$Limit), |
| 1067 | .zi_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _DATA$$ZI$$Base), |
| 1068 | .zi_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _DATA$$ZI$$Limit), |
| 1069 | .stack_bottom = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _STACK$$ZI$$Base), |
| 1070 | .stack_top = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _STACK$$ZI$$Limit), |
| 1071 | }, |
| 1072 | #endif |
| 1073 | |
| 1074 | #ifdef TFM_PSA_API |
| 1075 | /* sp_thrd */ |
| 1076 | .sp_thrd = { |
| 1077 | .pfn = NULL, |
| 1078 | .param = NULL, |
| 1079 | .sp_base = NULL, |
| 1080 | .sp_top = NULL, |
| 1081 | .prior = THRD_PRIOR_LOWEST, |
| 1082 | .status = THRD_STAT_INVALID, |
| 1083 | .state_ctx = |
| 1084 | { |
| 1085 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 1086 | }, |
| 1087 | .next = NULL, |
| 1088 | }, |
| 1089 | #endif /* defined(TFM_PSA_API) */ |
| 1090 | }, |
| 1091 | #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */ |
| 1092 | |
| 1093 | /* -----------------------------------------------------------------------*/ |
| 1094 | /* - Partition DB record for TFM_SP_IPC_SERVICE_TEST */ |
| 1095 | /* -----------------------------------------------------------------------*/ |
| 1096 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 1097 | { |
| 1098 | /* Static data */ |
| 1099 | { |
| 1100 | .partition_id = TFM_SP_IPC_SERVICE_TEST_ID, |
| 1101 | .partition_flags = SPM_PART_FLAG_IPC |
| 1102 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 1103 | , |
| 1104 | .partition_priority = TFM_PRIORITY(HIGH), |
| 1105 | .partition_init = ipc_service_test_main, |
| 1106 | }, |
| 1107 | |
| 1108 | /* Runtime data */ |
| 1109 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1110 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1111 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 1112 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 1113 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 1114 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 1115 | #if TFM_LVL != 1 |
| 1116 | .stack_ptr = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _STACK$$ZI$$Limit) - |
| 1117 | sizeof(struct iovec_args_t), |
| 1118 | #else /* TFM_LVL != 1 */ |
| 1119 | .stack_ptr = 0, |
| 1120 | #endif /* TFM_LVL != 1 */ |
| 1121 | .lr = 0, |
| 1122 | .iovec_api = TFM_SFN_API_IOVEC, |
| 1123 | .iovec_args = |
| 1124 | { |
| 1125 | .in_vec = {{0}}, |
| 1126 | .in_len = 0, |
| 1127 | .out_vec = {{0}}, |
| 1128 | .out_len = 0, |
| 1129 | }, |
| 1130 | .orig_outvec = NULL, |
| 1131 | .ctx_stack_ptr = ctx_stack_TFM_SP_IPC_SERVICE_TEST, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1132 | #else /* !defined(TFM_PSA_API) */ |
| 1133 | .signal_evnt = |
| 1134 | { |
| 1135 | .magic = 0, |
| 1136 | .owner = NULL, |
| 1137 | }, |
| 1138 | .signals = 0, |
| 1139 | .service_list = |
| 1140 | { |
| 1141 | .prev = NULL, |
| 1142 | .next = NULL, |
| 1143 | }, |
| 1144 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1145 | .signal_mask = 0, |
| 1146 | }, |
| 1147 | |
| 1148 | .platform_data = NULL, |
| 1149 | |
| 1150 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 1151 | /* memory_data */ |
| 1152 | .memory_data = { |
| 1153 | .code_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, $$Base), |
| 1154 | .code_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, $$Limit), |
| 1155 | .ro_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, $$RO$$Base), |
| 1156 | .ro_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, $$RO$$Limit), |
| 1157 | .rw_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _DATA$$RW$$Base), |
| 1158 | .rw_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _DATA$$RW$$Limit), |
| 1159 | .zi_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _DATA$$ZI$$Base), |
| 1160 | .zi_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _DATA$$ZI$$Limit), |
| 1161 | .stack_bottom = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _STACK$$ZI$$Base), |
| 1162 | .stack_top = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _STACK$$ZI$$Limit), |
| 1163 | }, |
| 1164 | #endif |
| 1165 | |
| 1166 | #ifdef TFM_PSA_API |
| 1167 | /* sp_thrd */ |
| 1168 | .sp_thrd = { |
| 1169 | .pfn = NULL, |
| 1170 | .param = NULL, |
| 1171 | .sp_base = NULL, |
| 1172 | .sp_top = NULL, |
| 1173 | .prior = THRD_PRIOR_LOWEST, |
| 1174 | .status = THRD_STAT_INVALID, |
| 1175 | .state_ctx = |
| 1176 | { |
| 1177 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 1178 | }, |
| 1179 | .next = NULL, |
| 1180 | }, |
| 1181 | #endif /* defined(TFM_PSA_API) */ |
| 1182 | }, |
| 1183 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 1184 | |
| 1185 | /* -----------------------------------------------------------------------*/ |
| 1186 | /* - Partition DB record for TFM_SP_IPC_CLIENT_TEST */ |
| 1187 | /* -----------------------------------------------------------------------*/ |
| 1188 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 1189 | { |
| 1190 | /* Static data */ |
| 1191 | { |
| 1192 | .partition_id = TFM_SP_IPC_CLIENT_TEST_ID, |
| 1193 | .partition_flags = SPM_PART_FLAG_IPC |
| 1194 | | SPM_PART_FLAG_APP_ROT |
| 1195 | , |
| 1196 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 1197 | .partition_init = ipc_client_test_main, |
| 1198 | }, |
| 1199 | |
| 1200 | /* Runtime data */ |
| 1201 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1202 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1203 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 1204 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 1205 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 1206 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 1207 | #if TFM_LVL != 1 |
| 1208 | .stack_ptr = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _STACK$$ZI$$Limit) - |
| 1209 | sizeof(struct iovec_args_t), |
| 1210 | #else /* TFM_LVL != 1 */ |
| 1211 | .stack_ptr = 0, |
| 1212 | #endif /* TFM_LVL != 1 */ |
| 1213 | .lr = 0, |
| 1214 | .iovec_api = TFM_SFN_API_IOVEC, |
| 1215 | .iovec_args = |
| 1216 | { |
| 1217 | .in_vec = {{0}}, |
| 1218 | .in_len = 0, |
| 1219 | .out_vec = {{0}}, |
| 1220 | .out_len = 0, |
| 1221 | }, |
| 1222 | .orig_outvec = NULL, |
| 1223 | .ctx_stack_ptr = ctx_stack_TFM_SP_IPC_CLIENT_TEST, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1224 | #else /* !defined(TFM_PSA_API) */ |
| 1225 | .signal_evnt = |
| 1226 | { |
| 1227 | .magic = 0, |
| 1228 | .owner = NULL, |
| 1229 | }, |
| 1230 | .signals = 0, |
| 1231 | .service_list = |
| 1232 | { |
| 1233 | .prev = NULL, |
| 1234 | .next = NULL, |
| 1235 | }, |
| 1236 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1237 | .signal_mask = 0, |
| 1238 | }, |
| 1239 | |
| 1240 | .platform_data = NULL, |
| 1241 | |
| 1242 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 1243 | /* memory_data */ |
| 1244 | .memory_data = { |
| 1245 | .code_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, $$Base), |
| 1246 | .code_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, $$Limit), |
| 1247 | .ro_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, $$RO$$Base), |
| 1248 | .ro_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, $$RO$$Limit), |
| 1249 | .rw_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _DATA$$RW$$Base), |
| 1250 | .rw_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _DATA$$RW$$Limit), |
| 1251 | .zi_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _DATA$$ZI$$Base), |
| 1252 | .zi_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _DATA$$ZI$$Limit), |
| 1253 | .stack_bottom = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _STACK$$ZI$$Base), |
| 1254 | .stack_top = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _STACK$$ZI$$Limit), |
| 1255 | }, |
| 1256 | #endif |
| 1257 | |
| 1258 | #ifdef TFM_PSA_API |
| 1259 | /* sp_thrd */ |
| 1260 | .sp_thrd = { |
| 1261 | .pfn = NULL, |
| 1262 | .param = NULL, |
| 1263 | .sp_base = NULL, |
| 1264 | .sp_top = NULL, |
| 1265 | .prior = THRD_PRIOR_LOWEST, |
| 1266 | .status = THRD_STAT_INVALID, |
| 1267 | .state_ctx = |
| 1268 | { |
| 1269 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 1270 | }, |
| 1271 | .next = NULL, |
| 1272 | }, |
| 1273 | #endif /* defined(TFM_PSA_API) */ |
| 1274 | }, |
| 1275 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 1276 | |
| 1277 | /* -----------------------------------------------------------------------*/ |
| 1278 | /* - Partition DB record for TFM_IRQ_TEST_1 */ |
| 1279 | /* -----------------------------------------------------------------------*/ |
| 1280 | #ifdef TFM_PARTITION_TEST_CORE |
| 1281 | { |
| 1282 | /* Static data */ |
| 1283 | { |
| 1284 | .partition_id = TFM_IRQ_TEST_1_ID, |
| 1285 | .partition_flags = SPM_PART_FLAG_IPC |
| 1286 | | SPM_PART_FLAG_APP_ROT |
| 1287 | , |
| 1288 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 1289 | .partition_init = tfm_irq_test_1_init, |
| 1290 | }, |
| 1291 | |
| 1292 | /* Runtime data */ |
| 1293 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1294 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1295 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 1296 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 1297 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 1298 | .share = TFM_BUFFER_SHARE_DISABLE, |
| 1299 | #if TFM_LVL != 1 |
| 1300 | .stack_ptr = PART_REGION_ADDR(TFM_IRQ_TEST_1, _STACK$$ZI$$Limit) - |
| 1301 | sizeof(struct iovec_args_t), |
| 1302 | #else /* TFM_LVL != 1 */ |
| 1303 | .stack_ptr = 0, |
| 1304 | #endif /* TFM_LVL != 1 */ |
| 1305 | .lr = 0, |
| 1306 | .iovec_api = TFM_SFN_API_IOVEC, |
| 1307 | .iovec_args = |
| 1308 | { |
| 1309 | .in_vec = {{0}}, |
| 1310 | .in_len = 0, |
| 1311 | .out_vec = {{0}}, |
| 1312 | .out_len = 0, |
| 1313 | }, |
| 1314 | .orig_outvec = NULL, |
| 1315 | .ctx_stack_ptr = ctx_stack_TFM_IRQ_TEST_1, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1316 | #else /* !defined(TFM_PSA_API) */ |
| 1317 | .signal_evnt = |
| 1318 | { |
| 1319 | .magic = 0, |
| 1320 | .owner = NULL, |
| 1321 | }, |
| 1322 | .signals = 0, |
| 1323 | .service_list = |
| 1324 | { |
| 1325 | .prev = NULL, |
| 1326 | .next = NULL, |
| 1327 | }, |
| 1328 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1329 | .signal_mask = 0, |
| 1330 | }, |
| 1331 | |
| 1332 | /* platform data */ |
| 1333 | /* FIXME: Only adding the first mmio region */ |
| 1334 | .platform_data = TFM_PERIPHERAL_TIMER0, |
| 1335 | |
| 1336 | #if (TFM_LVL != 1) || defined(TFM_PSA_API) |
| 1337 | /* memory_data */ |
| 1338 | .memory_data = { |
| 1339 | .code_start = PART_REGION_ADDR(TFM_IRQ_TEST_1, $$Base), |
| 1340 | .code_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1, $$Limit), |
| 1341 | .ro_start = PART_REGION_ADDR(TFM_IRQ_TEST_1, $$RO$$Base), |
| 1342 | .ro_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1, $$RO$$Limit), |
| 1343 | .rw_start = PART_REGION_ADDR(TFM_IRQ_TEST_1, _DATA$$RW$$Base), |
| 1344 | .rw_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1, _DATA$$RW$$Limit), |
| 1345 | .zi_start = PART_REGION_ADDR(TFM_IRQ_TEST_1, _DATA$$ZI$$Base), |
| 1346 | .zi_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1, _DATA$$ZI$$Limit), |
| 1347 | .stack_bottom = PART_REGION_ADDR(TFM_IRQ_TEST_1, _STACK$$ZI$$Base), |
| 1348 | .stack_top = PART_REGION_ADDR(TFM_IRQ_TEST_1, _STACK$$ZI$$Limit), |
| 1349 | }, |
| 1350 | #endif |
| 1351 | |
| 1352 | #ifdef TFM_PSA_API |
| 1353 | /* sp_thrd */ |
| 1354 | .sp_thrd = { |
| 1355 | .pfn = NULL, |
| 1356 | .param = NULL, |
| 1357 | .sp_base = NULL, |
| 1358 | .sp_top = NULL, |
| 1359 | .prior = THRD_PRIOR_LOWEST, |
| 1360 | .status = THRD_STAT_INVALID, |
| 1361 | .state_ctx = |
| 1362 | { |
| 1363 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 1364 | }, |
| 1365 | .next = NULL, |
| 1366 | }, |
| 1367 | #endif /* defined(TFM_PSA_API) */ |
| 1368 | }, |
| 1369 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 1370 | |
| 1371 | }; |
| 1372 | |
| 1373 | struct spm_partition_db_t g_spm_partition_db = { |
| 1374 | .is_init = 0, |
| 1375 | .partition_count = sizeof(partition_list) / sizeof(partition_list[0]), |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1376 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1377 | .running_partition_idx = 0, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1378 | #endif |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1379 | .partitions = partition_list, |
| 1380 | }; |
| 1381 | |
| 1382 | #endif /* __TFM_SPM_DB_INC__ */ |