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 | |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 52 | #ifdef TFM_ENABLE_IRQ_TEST |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 53 | #define TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT 1 |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 54 | #endif /* TFM_ENABLE_IRQ_TEST */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 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 | |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 93 | #ifdef TFM_ENABLE_IRQ_TEST |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 94 | extern int32_t tfm_irq_test_1_init(void); |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 95 | #endif /* TFM_ENABLE_IRQ_TEST */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 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 | |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 224 | #ifdef TFM_ENABLE_IRQ_TEST |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 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); |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 235 | #endif /* TFM_ENABLE_IRQ_TEST */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 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 | |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 334 | #ifdef TFM_ENABLE_IRQ_TEST |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 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)]; |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 341 | #endif /* TFM_ENABLE_IRQ_TEST */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 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 */ |
Mingyang Sun | da01a97 | 2019-07-12 17:32:59 +0800 | [diff] [blame] | 351 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 352 | {{0}}, /* placeholder for TF-M Core internal partition */ |
Mingyang Sun | da01a97 | 2019-07-12 17:32:59 +0800 | [diff] [blame] | 353 | #endif /* !ifndefined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 354 | |
| 355 | /* -----------------------------------------------------------------------*/ |
| 356 | /* - Partition DB record for TFM_SP_STORAGE */ |
| 357 | /* -----------------------------------------------------------------------*/ |
| 358 | { |
| 359 | /* Static data */ |
| 360 | { |
| 361 | .partition_id = TFM_SP_STORAGE_ID, |
| 362 | .partition_flags = SPM_PART_FLAG_IPC |
| 363 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 364 | , |
| 365 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 366 | .partition_init = tfm_sst_req_mngr_init, |
| 367 | }, |
| 368 | |
| 369 | /* Runtime data */ |
| 370 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 371 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 372 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 373 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 374 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 375 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 376 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 377 | .lr = 0, |
| 378 | .iovec_api = TFM_SFN_API_IOVEC, |
| 379 | .iovec_args = |
| 380 | { |
| 381 | .in_vec = {{0}}, |
| 382 | .in_len = 0, |
| 383 | .out_vec = {{0}}, |
| 384 | .out_len = 0, |
| 385 | }, |
| 386 | .orig_outvec = NULL, |
| 387 | .ctx_stack_ptr = ctx_stack_TFM_SP_STORAGE, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 388 | #else /* !defined(TFM_PSA_API) */ |
| 389 | .signal_evnt = |
| 390 | { |
| 391 | .magic = 0, |
| 392 | .owner = NULL, |
| 393 | }, |
| 394 | .signals = 0, |
| 395 | .service_list = |
| 396 | { |
| 397 | .prev = NULL, |
| 398 | .next = NULL, |
| 399 | }, |
| 400 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 401 | .signal_mask = 0, |
| 402 | }, |
| 403 | |
| 404 | .platform_data = NULL, |
| 405 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 406 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 407 | /* memory_data */ |
| 408 | .memory_data = { |
| 409 | .code_start = PART_REGION_ADDR(TFM_SP_STORAGE, $$Base), |
| 410 | .code_limit = PART_REGION_ADDR(TFM_SP_STORAGE, $$Limit), |
| 411 | .ro_start = PART_REGION_ADDR(TFM_SP_STORAGE, $$RO$$Base), |
| 412 | .ro_limit = PART_REGION_ADDR(TFM_SP_STORAGE, $$RO$$Limit), |
| 413 | .rw_start = PART_REGION_ADDR(TFM_SP_STORAGE, _DATA$$RW$$Base), |
| 414 | .rw_limit = PART_REGION_ADDR(TFM_SP_STORAGE, _DATA$$RW$$Limit), |
| 415 | .zi_start = PART_REGION_ADDR(TFM_SP_STORAGE, _DATA$$ZI$$Base), |
| 416 | .zi_limit = PART_REGION_ADDR(TFM_SP_STORAGE, _DATA$$ZI$$Limit), |
| 417 | .stack_bottom = PART_REGION_ADDR(TFM_SP_STORAGE, _STACK$$ZI$$Base), |
| 418 | .stack_top = PART_REGION_ADDR(TFM_SP_STORAGE, _STACK$$ZI$$Limit), |
| 419 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 420 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 421 | /* sp_thrd */ |
| 422 | .sp_thrd = { |
| 423 | .pfn = NULL, |
| 424 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 425 | .sp_btm = 0, |
| 426 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 427 | .prior = THRD_PRIOR_LOWEST, |
| 428 | .status = THRD_STAT_INVALID, |
| 429 | .state_ctx = |
| 430 | { |
| 431 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 432 | }, |
| 433 | .next = NULL, |
| 434 | }, |
| 435 | #endif /* defined(TFM_PSA_API) */ |
| 436 | }, |
| 437 | |
| 438 | /* -----------------------------------------------------------------------*/ |
| 439 | /* - Partition DB record for TFM_SP_AUDIT_LOG */ |
| 440 | /* -----------------------------------------------------------------------*/ |
| 441 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 442 | { |
| 443 | /* Static data */ |
| 444 | { |
| 445 | .partition_id = TFM_SP_AUDIT_LOG_ID, |
| 446 | .partition_flags = 0 |
| 447 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 448 | , |
| 449 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 450 | .partition_init = audit_core_init, |
| 451 | }, |
| 452 | |
| 453 | /* Runtime data */ |
| 454 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 455 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 456 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 457 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 458 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 459 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 460 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 461 | .lr = 0, |
| 462 | .iovec_api = TFM_SFN_API_IOVEC, |
| 463 | .iovec_args = |
| 464 | { |
| 465 | .in_vec = {{0}}, |
| 466 | .in_len = 0, |
| 467 | .out_vec = {{0}}, |
| 468 | .out_len = 0, |
| 469 | }, |
| 470 | .orig_outvec = NULL, |
| 471 | .ctx_stack_ptr = ctx_stack_TFM_SP_AUDIT_LOG, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 472 | #else /* !defined(TFM_PSA_API) */ |
| 473 | .signal_evnt = |
| 474 | { |
| 475 | .magic = 0, |
| 476 | .owner = NULL, |
| 477 | }, |
| 478 | .signals = 0, |
| 479 | .service_list = |
| 480 | { |
| 481 | .prev = NULL, |
| 482 | .next = NULL, |
| 483 | }, |
| 484 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 485 | .signal_mask = 0, |
| 486 | }, |
| 487 | |
| 488 | /* platform data */ |
| 489 | /* FIXME: Only adding the first mmio region */ |
| 490 | #ifdef AUDIT_UART_REDIRECTION |
| 491 | .platform_data = TFM_PERIPHERAL_UART1, |
| 492 | #else /* AUDIT_UART_REDIRECTION */ |
| 493 | .platform_data = NULL, |
| 494 | #endif /* AUDIT_UART_REDIRECTION */ |
| 495 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 496 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 497 | /* memory_data */ |
| 498 | .memory_data = { |
| 499 | .code_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, $$Base), |
| 500 | .code_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, $$Limit), |
| 501 | .ro_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, $$RO$$Base), |
| 502 | .ro_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, $$RO$$Limit), |
| 503 | .rw_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _DATA$$RW$$Base), |
| 504 | .rw_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _DATA$$RW$$Limit), |
| 505 | .zi_start = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _DATA$$ZI$$Base), |
| 506 | .zi_limit = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _DATA$$ZI$$Limit), |
| 507 | .stack_bottom = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _STACK$$ZI$$Base), |
| 508 | .stack_top = PART_REGION_ADDR(TFM_SP_AUDIT_LOG, _STACK$$ZI$$Limit), |
| 509 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 510 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 511 | /* sp_thrd */ |
| 512 | .sp_thrd = { |
| 513 | .pfn = NULL, |
| 514 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 515 | .sp_btm = 0, |
| 516 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 517 | .prior = THRD_PRIOR_LOWEST, |
| 518 | .status = THRD_STAT_INVALID, |
| 519 | .state_ctx = |
| 520 | { |
| 521 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 522 | }, |
| 523 | .next = NULL, |
| 524 | }, |
| 525 | #endif /* defined(TFM_PSA_API) */ |
| 526 | }, |
| 527 | #endif /* TFM_PARTITION_AUDIT_LOG */ |
| 528 | |
| 529 | /* -----------------------------------------------------------------------*/ |
| 530 | /* - Partition DB record for TFM_SP_CRYPTO */ |
| 531 | /* -----------------------------------------------------------------------*/ |
| 532 | { |
| 533 | /* Static data */ |
| 534 | { |
| 535 | .partition_id = TFM_SP_CRYPTO_ID, |
| 536 | .partition_flags = SPM_PART_FLAG_IPC |
| 537 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 538 | , |
| 539 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 540 | .partition_init = tfm_crypto_init, |
| 541 | }, |
| 542 | |
| 543 | /* Runtime data */ |
| 544 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 545 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 546 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 547 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 548 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 549 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 550 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 551 | .lr = 0, |
| 552 | .iovec_api = TFM_SFN_API_IOVEC, |
| 553 | .iovec_args = |
| 554 | { |
| 555 | .in_vec = {{0}}, |
| 556 | .in_len = 0, |
| 557 | .out_vec = {{0}}, |
| 558 | .out_len = 0, |
| 559 | }, |
| 560 | .orig_outvec = NULL, |
| 561 | .ctx_stack_ptr = ctx_stack_TFM_SP_CRYPTO, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 562 | #else /* !defined(TFM_PSA_API) */ |
| 563 | .signal_evnt = |
| 564 | { |
| 565 | .magic = 0, |
| 566 | .owner = NULL, |
| 567 | }, |
| 568 | .signals = 0, |
| 569 | .service_list = |
| 570 | { |
| 571 | .prev = NULL, |
| 572 | .next = NULL, |
| 573 | }, |
| 574 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 575 | .signal_mask = 0, |
| 576 | }, |
| 577 | |
| 578 | .platform_data = NULL, |
| 579 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 580 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 581 | /* memory_data */ |
| 582 | .memory_data = { |
| 583 | .code_start = PART_REGION_ADDR(TFM_SP_CRYPTO, $$Base), |
| 584 | .code_limit = PART_REGION_ADDR(TFM_SP_CRYPTO, $$Limit), |
| 585 | .ro_start = PART_REGION_ADDR(TFM_SP_CRYPTO, $$RO$$Base), |
| 586 | .ro_limit = PART_REGION_ADDR(TFM_SP_CRYPTO, $$RO$$Limit), |
| 587 | .rw_start = PART_REGION_ADDR(TFM_SP_CRYPTO, _DATA$$RW$$Base), |
| 588 | .rw_limit = PART_REGION_ADDR(TFM_SP_CRYPTO, _DATA$$RW$$Limit), |
| 589 | .zi_start = PART_REGION_ADDR(TFM_SP_CRYPTO, _DATA$$ZI$$Base), |
| 590 | .zi_limit = PART_REGION_ADDR(TFM_SP_CRYPTO, _DATA$$ZI$$Limit), |
| 591 | .stack_bottom = PART_REGION_ADDR(TFM_SP_CRYPTO, _STACK$$ZI$$Base), |
| 592 | .stack_top = PART_REGION_ADDR(TFM_SP_CRYPTO, _STACK$$ZI$$Limit), |
| 593 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 594 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 595 | /* sp_thrd */ |
| 596 | .sp_thrd = { |
| 597 | .pfn = NULL, |
| 598 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 599 | .sp_btm = 0, |
| 600 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 601 | .prior = THRD_PRIOR_LOWEST, |
| 602 | .status = THRD_STAT_INVALID, |
| 603 | .state_ctx = |
| 604 | { |
| 605 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 606 | }, |
| 607 | .next = NULL, |
| 608 | }, |
| 609 | #endif /* defined(TFM_PSA_API) */ |
| 610 | }, |
| 611 | |
| 612 | /* -----------------------------------------------------------------------*/ |
| 613 | /* - Partition DB record for TFM_SP_PLATFORM */ |
| 614 | /* -----------------------------------------------------------------------*/ |
| 615 | #ifdef TFM_PARTITION_PLATFORM |
| 616 | { |
| 617 | /* Static data */ |
| 618 | { |
| 619 | .partition_id = TFM_SP_PLATFORM_ID, |
| 620 | .partition_flags = 0 |
| 621 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 622 | , |
| 623 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 624 | .partition_init = platform_sp_init, |
| 625 | }, |
| 626 | |
| 627 | /* Runtime data */ |
| 628 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 629 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 630 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 631 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 632 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 633 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 634 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 635 | .lr = 0, |
| 636 | .iovec_api = TFM_SFN_API_IOVEC, |
| 637 | .iovec_args = |
| 638 | { |
| 639 | .in_vec = {{0}}, |
| 640 | .in_len = 0, |
| 641 | .out_vec = {{0}}, |
| 642 | .out_len = 0, |
| 643 | }, |
| 644 | .orig_outvec = NULL, |
| 645 | .ctx_stack_ptr = ctx_stack_TFM_SP_PLATFORM, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 646 | #else /* !defined(TFM_PSA_API) */ |
| 647 | .signal_evnt = |
| 648 | { |
| 649 | .magic = 0, |
| 650 | .owner = NULL, |
| 651 | }, |
| 652 | .signals = 0, |
| 653 | .service_list = |
| 654 | { |
| 655 | .prev = NULL, |
| 656 | .next = NULL, |
| 657 | }, |
| 658 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 659 | .signal_mask = 0, |
| 660 | }, |
| 661 | |
| 662 | .platform_data = NULL, |
| 663 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 664 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 665 | /* memory_data */ |
| 666 | .memory_data = { |
| 667 | .code_start = PART_REGION_ADDR(TFM_SP_PLATFORM, $$Base), |
| 668 | .code_limit = PART_REGION_ADDR(TFM_SP_PLATFORM, $$Limit), |
| 669 | .ro_start = PART_REGION_ADDR(TFM_SP_PLATFORM, $$RO$$Base), |
| 670 | .ro_limit = PART_REGION_ADDR(TFM_SP_PLATFORM, $$RO$$Limit), |
| 671 | .rw_start = PART_REGION_ADDR(TFM_SP_PLATFORM, _DATA$$RW$$Base), |
| 672 | .rw_limit = PART_REGION_ADDR(TFM_SP_PLATFORM, _DATA$$RW$$Limit), |
| 673 | .zi_start = PART_REGION_ADDR(TFM_SP_PLATFORM, _DATA$$ZI$$Base), |
| 674 | .zi_limit = PART_REGION_ADDR(TFM_SP_PLATFORM, _DATA$$ZI$$Limit), |
| 675 | .stack_bottom = PART_REGION_ADDR(TFM_SP_PLATFORM, _STACK$$ZI$$Base), |
| 676 | .stack_top = PART_REGION_ADDR(TFM_SP_PLATFORM, _STACK$$ZI$$Limit), |
| 677 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 678 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 679 | /* sp_thrd */ |
| 680 | .sp_thrd = { |
| 681 | .pfn = NULL, |
| 682 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 683 | .sp_btm = 0, |
| 684 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 685 | .prior = THRD_PRIOR_LOWEST, |
| 686 | .status = THRD_STAT_INVALID, |
| 687 | .state_ctx = |
| 688 | { |
| 689 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 690 | }, |
| 691 | .next = NULL, |
| 692 | }, |
| 693 | #endif /* defined(TFM_PSA_API) */ |
| 694 | }, |
| 695 | #endif /* TFM_PARTITION_PLATFORM */ |
| 696 | |
| 697 | /* -----------------------------------------------------------------------*/ |
| 698 | /* - Partition DB record for TFM_SP_INITIAL_ATTESTATION */ |
| 699 | /* -----------------------------------------------------------------------*/ |
| 700 | { |
| 701 | /* Static data */ |
| 702 | { |
| 703 | .partition_id = TFM_SP_INITIAL_ATTESTATION_ID, |
| 704 | .partition_flags = SPM_PART_FLAG_IPC |
| 705 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 706 | , |
| 707 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 708 | .partition_init = attest_partition_init, |
| 709 | }, |
| 710 | |
| 711 | /* Runtime data */ |
| 712 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 713 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 714 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 715 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 716 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 717 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 718 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 719 | .lr = 0, |
| 720 | .iovec_api = TFM_SFN_API_IOVEC, |
| 721 | .iovec_args = |
| 722 | { |
| 723 | .in_vec = {{0}}, |
| 724 | .in_len = 0, |
| 725 | .out_vec = {{0}}, |
| 726 | .out_len = 0, |
| 727 | }, |
| 728 | .orig_outvec = NULL, |
| 729 | .ctx_stack_ptr = ctx_stack_TFM_SP_INITIAL_ATTESTATION, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 730 | #else /* !defined(TFM_PSA_API) */ |
| 731 | .signal_evnt = |
| 732 | { |
| 733 | .magic = 0, |
| 734 | .owner = NULL, |
| 735 | }, |
| 736 | .signals = 0, |
| 737 | .service_list = |
| 738 | { |
| 739 | .prev = NULL, |
| 740 | .next = NULL, |
| 741 | }, |
| 742 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 743 | .signal_mask = 0, |
| 744 | }, |
| 745 | |
| 746 | .platform_data = NULL, |
| 747 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 748 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 749 | /* memory_data */ |
| 750 | .memory_data = { |
| 751 | .code_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, $$Base), |
| 752 | .code_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, $$Limit), |
| 753 | .ro_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, $$RO$$Base), |
| 754 | .ro_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, $$RO$$Limit), |
| 755 | .rw_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _DATA$$RW$$Base), |
| 756 | .rw_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _DATA$$RW$$Limit), |
| 757 | .zi_start = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _DATA$$ZI$$Base), |
| 758 | .zi_limit = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _DATA$$ZI$$Limit), |
| 759 | .stack_bottom = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _STACK$$ZI$$Base), |
| 760 | .stack_top = PART_REGION_ADDR(TFM_SP_INITIAL_ATTESTATION, _STACK$$ZI$$Limit), |
| 761 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 762 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 763 | /* sp_thrd */ |
| 764 | .sp_thrd = { |
| 765 | .pfn = NULL, |
| 766 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 767 | .sp_btm = 0, |
| 768 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 769 | .prior = THRD_PRIOR_LOWEST, |
| 770 | .status = THRD_STAT_INVALID, |
| 771 | .state_ctx = |
| 772 | { |
| 773 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 774 | }, |
| 775 | .next = NULL, |
| 776 | }, |
| 777 | #endif /* defined(TFM_PSA_API) */ |
| 778 | }, |
| 779 | |
| 780 | /* -----------------------------------------------------------------------*/ |
| 781 | /* - Partition DB record for TFM_SP_CORE_TEST */ |
| 782 | /* -----------------------------------------------------------------------*/ |
| 783 | #ifdef TFM_PARTITION_TEST_CORE |
| 784 | { |
| 785 | /* Static data */ |
| 786 | { |
| 787 | .partition_id = TFM_SP_CORE_TEST_ID, |
| 788 | .partition_flags = SPM_PART_FLAG_IPC |
| 789 | | SPM_PART_FLAG_APP_ROT |
| 790 | , |
| 791 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 792 | .partition_init = core_test_init, |
| 793 | }, |
| 794 | |
| 795 | /* Runtime data */ |
| 796 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 797 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 798 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 799 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 800 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 801 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 802 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 803 | .lr = 0, |
| 804 | .iovec_api = TFM_SFN_API_IOVEC, |
| 805 | .iovec_args = |
| 806 | { |
| 807 | .in_vec = {{0}}, |
| 808 | .in_len = 0, |
| 809 | .out_vec = {{0}}, |
| 810 | .out_len = 0, |
| 811 | }, |
| 812 | .orig_outvec = NULL, |
| 813 | .ctx_stack_ptr = ctx_stack_TFM_SP_CORE_TEST, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 814 | #else /* !defined(TFM_PSA_API) */ |
| 815 | .signal_evnt = |
| 816 | { |
| 817 | .magic = 0, |
| 818 | .owner = NULL, |
| 819 | }, |
| 820 | .signals = 0, |
| 821 | .service_list = |
| 822 | { |
| 823 | .prev = NULL, |
| 824 | .next = NULL, |
| 825 | }, |
| 826 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 827 | .signal_mask = 0, |
| 828 | }, |
| 829 | |
| 830 | /* platform data */ |
| 831 | /* FIXME: Only adding the first mmio region */ |
| 832 | .platform_data = TFM_PERIPHERAL_FPGA_IO, |
| 833 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 834 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 835 | /* memory_data */ |
| 836 | .memory_data = { |
| 837 | .code_start = PART_REGION_ADDR(TFM_SP_CORE_TEST, $$Base), |
| 838 | .code_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST, $$Limit), |
| 839 | .ro_start = PART_REGION_ADDR(TFM_SP_CORE_TEST, $$RO$$Base), |
| 840 | .ro_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST, $$RO$$Limit), |
| 841 | .rw_start = PART_REGION_ADDR(TFM_SP_CORE_TEST, _DATA$$RW$$Base), |
| 842 | .rw_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST, _DATA$$RW$$Limit), |
| 843 | .zi_start = PART_REGION_ADDR(TFM_SP_CORE_TEST, _DATA$$ZI$$Base), |
| 844 | .zi_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST, _DATA$$ZI$$Limit), |
| 845 | .stack_bottom = PART_REGION_ADDR(TFM_SP_CORE_TEST, _STACK$$ZI$$Base), |
| 846 | .stack_top = PART_REGION_ADDR(TFM_SP_CORE_TEST, _STACK$$ZI$$Limit), |
| 847 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 848 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 849 | /* sp_thrd */ |
| 850 | .sp_thrd = { |
| 851 | .pfn = NULL, |
| 852 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 853 | .sp_btm = 0, |
| 854 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 855 | .prior = THRD_PRIOR_LOWEST, |
| 856 | .status = THRD_STAT_INVALID, |
| 857 | .state_ctx = |
| 858 | { |
| 859 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 860 | }, |
| 861 | .next = NULL, |
| 862 | }, |
| 863 | #endif /* defined(TFM_PSA_API) */ |
| 864 | }, |
| 865 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 866 | |
| 867 | /* -----------------------------------------------------------------------*/ |
| 868 | /* - Partition DB record for TFM_SP_CORE_TEST_2 */ |
| 869 | /* -----------------------------------------------------------------------*/ |
| 870 | #ifdef TFM_PARTITION_TEST_CORE |
| 871 | { |
| 872 | /* Static data */ |
| 873 | { |
| 874 | .partition_id = TFM_SP_CORE_TEST_2_ID, |
| 875 | .partition_flags = SPM_PART_FLAG_IPC |
| 876 | | SPM_PART_FLAG_APP_ROT |
| 877 | , |
| 878 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 879 | .partition_init = core_test_2_init, |
| 880 | }, |
| 881 | |
| 882 | /* Runtime data */ |
| 883 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 884 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 885 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 886 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 887 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 888 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 889 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 890 | .lr = 0, |
| 891 | .iovec_api = TFM_SFN_API_IOVEC, |
| 892 | .iovec_args = |
| 893 | { |
| 894 | .in_vec = {{0}}, |
| 895 | .in_len = 0, |
| 896 | .out_vec = {{0}}, |
| 897 | .out_len = 0, |
| 898 | }, |
| 899 | .orig_outvec = NULL, |
| 900 | .ctx_stack_ptr = ctx_stack_TFM_SP_CORE_TEST_2, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 901 | #else /* !defined(TFM_PSA_API) */ |
| 902 | .signal_evnt = |
| 903 | { |
| 904 | .magic = 0, |
| 905 | .owner = NULL, |
| 906 | }, |
| 907 | .signals = 0, |
| 908 | .service_list = |
| 909 | { |
| 910 | .prev = NULL, |
| 911 | .next = NULL, |
| 912 | }, |
| 913 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 914 | .signal_mask = 0, |
| 915 | }, |
| 916 | |
| 917 | .platform_data = NULL, |
| 918 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 919 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 920 | /* memory_data */ |
| 921 | .memory_data = { |
| 922 | .code_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, $$Base), |
| 923 | .code_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, $$Limit), |
| 924 | .ro_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, $$RO$$Base), |
| 925 | .ro_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, $$RO$$Limit), |
| 926 | .rw_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _DATA$$RW$$Base), |
| 927 | .rw_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _DATA$$RW$$Limit), |
| 928 | .zi_start = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _DATA$$ZI$$Base), |
| 929 | .zi_limit = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _DATA$$ZI$$Limit), |
| 930 | .stack_bottom = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _STACK$$ZI$$Base), |
| 931 | .stack_top = PART_REGION_ADDR(TFM_SP_CORE_TEST_2, _STACK$$ZI$$Limit), |
| 932 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 933 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 934 | /* sp_thrd */ |
| 935 | .sp_thrd = { |
| 936 | .pfn = NULL, |
| 937 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 938 | .sp_btm = 0, |
| 939 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 940 | .prior = THRD_PRIOR_LOWEST, |
| 941 | .status = THRD_STAT_INVALID, |
| 942 | .state_ctx = |
| 943 | { |
| 944 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 945 | }, |
| 946 | .next = NULL, |
| 947 | }, |
| 948 | #endif /* defined(TFM_PSA_API) */ |
| 949 | }, |
| 950 | #endif /* TFM_PARTITION_TEST_CORE */ |
| 951 | |
| 952 | /* -----------------------------------------------------------------------*/ |
| 953 | /* - Partition DB record for TFM_SP_SECURE_TEST_PARTITION */ |
| 954 | /* -----------------------------------------------------------------------*/ |
| 955 | #ifdef TFM_PARTITION_TEST_SECURE_SERVICES |
| 956 | { |
| 957 | /* Static data */ |
| 958 | { |
| 959 | .partition_id = TFM_SP_SECURE_TEST_PARTITION_ID, |
| 960 | .partition_flags = SPM_PART_FLAG_IPC |
| 961 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 962 | , |
| 963 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 964 | .partition_init = tfm_secure_client_service_init, |
| 965 | }, |
| 966 | |
| 967 | /* Runtime data */ |
| 968 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 969 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 970 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 971 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 972 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 973 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 974 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 975 | .lr = 0, |
| 976 | .iovec_api = TFM_SFN_API_IOVEC, |
| 977 | .iovec_args = |
| 978 | { |
| 979 | .in_vec = {{0}}, |
| 980 | .in_len = 0, |
| 981 | .out_vec = {{0}}, |
| 982 | .out_len = 0, |
| 983 | }, |
| 984 | .orig_outvec = NULL, |
| 985 | .ctx_stack_ptr = ctx_stack_TFM_SP_SECURE_TEST_PARTITION, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 986 | #else /* !defined(TFM_PSA_API) */ |
| 987 | .signal_evnt = |
| 988 | { |
| 989 | .magic = 0, |
| 990 | .owner = NULL, |
| 991 | }, |
| 992 | .signals = 0, |
| 993 | .service_list = |
| 994 | { |
| 995 | .prev = NULL, |
| 996 | .next = NULL, |
| 997 | }, |
| 998 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 999 | .signal_mask = 0, |
| 1000 | }, |
| 1001 | |
| 1002 | /* platform data */ |
| 1003 | /* FIXME: Only adding the first mmio region */ |
| 1004 | .platform_data = TFM_PERIPHERAL_STD_UART, |
| 1005 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 1006 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1007 | /* memory_data */ |
| 1008 | .memory_data = { |
| 1009 | .code_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, $$Base), |
| 1010 | .code_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, $$Limit), |
| 1011 | .ro_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, $$RO$$Base), |
| 1012 | .ro_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, $$RO$$Limit), |
| 1013 | .rw_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _DATA$$RW$$Base), |
| 1014 | .rw_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _DATA$$RW$$Limit), |
| 1015 | .zi_start = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _DATA$$ZI$$Base), |
| 1016 | .zi_limit = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _DATA$$ZI$$Limit), |
| 1017 | .stack_bottom = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _STACK$$ZI$$Base), |
| 1018 | .stack_top = PART_REGION_ADDR(TFM_SP_SECURE_TEST_PARTITION, _STACK$$ZI$$Limit), |
| 1019 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1020 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1021 | /* sp_thrd */ |
| 1022 | .sp_thrd = { |
| 1023 | .pfn = NULL, |
| 1024 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 1025 | .sp_btm = 0, |
| 1026 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1027 | .prior = THRD_PRIOR_LOWEST, |
| 1028 | .status = THRD_STAT_INVALID, |
| 1029 | .state_ctx = |
| 1030 | { |
| 1031 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 1032 | }, |
| 1033 | .next = NULL, |
| 1034 | }, |
| 1035 | #endif /* defined(TFM_PSA_API) */ |
| 1036 | }, |
| 1037 | #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */ |
| 1038 | |
| 1039 | /* -----------------------------------------------------------------------*/ |
| 1040 | /* - Partition DB record for TFM_SP_IPC_SERVICE_TEST */ |
| 1041 | /* -----------------------------------------------------------------------*/ |
| 1042 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 1043 | { |
| 1044 | /* Static data */ |
| 1045 | { |
| 1046 | .partition_id = TFM_SP_IPC_SERVICE_TEST_ID, |
| 1047 | .partition_flags = SPM_PART_FLAG_IPC |
| 1048 | | SPM_PART_FLAG_PSA_ROT | SPM_PART_FLAG_APP_ROT |
| 1049 | , |
| 1050 | .partition_priority = TFM_PRIORITY(HIGH), |
| 1051 | .partition_init = ipc_service_test_main, |
| 1052 | }, |
| 1053 | |
| 1054 | /* Runtime data */ |
| 1055 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1056 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1057 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 1058 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 1059 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 1060 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1061 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1062 | .lr = 0, |
| 1063 | .iovec_api = TFM_SFN_API_IOVEC, |
| 1064 | .iovec_args = |
| 1065 | { |
| 1066 | .in_vec = {{0}}, |
| 1067 | .in_len = 0, |
| 1068 | .out_vec = {{0}}, |
| 1069 | .out_len = 0, |
| 1070 | }, |
| 1071 | .orig_outvec = NULL, |
| 1072 | .ctx_stack_ptr = ctx_stack_TFM_SP_IPC_SERVICE_TEST, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1073 | #else /* !defined(TFM_PSA_API) */ |
| 1074 | .signal_evnt = |
| 1075 | { |
| 1076 | .magic = 0, |
| 1077 | .owner = NULL, |
| 1078 | }, |
| 1079 | .signals = 0, |
| 1080 | .service_list = |
| 1081 | { |
| 1082 | .prev = NULL, |
| 1083 | .next = NULL, |
| 1084 | }, |
| 1085 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1086 | .signal_mask = 0, |
| 1087 | }, |
| 1088 | |
| 1089 | .platform_data = NULL, |
| 1090 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 1091 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1092 | /* memory_data */ |
| 1093 | .memory_data = { |
| 1094 | .code_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, $$Base), |
| 1095 | .code_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, $$Limit), |
| 1096 | .ro_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, $$RO$$Base), |
| 1097 | .ro_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, $$RO$$Limit), |
| 1098 | .rw_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _DATA$$RW$$Base), |
| 1099 | .rw_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _DATA$$RW$$Limit), |
| 1100 | .zi_start = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _DATA$$ZI$$Base), |
| 1101 | .zi_limit = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _DATA$$ZI$$Limit), |
| 1102 | .stack_bottom = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _STACK$$ZI$$Base), |
| 1103 | .stack_top = PART_REGION_ADDR(TFM_SP_IPC_SERVICE_TEST, _STACK$$ZI$$Limit), |
| 1104 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1105 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1106 | /* sp_thrd */ |
| 1107 | .sp_thrd = { |
| 1108 | .pfn = NULL, |
| 1109 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 1110 | .sp_btm = 0, |
| 1111 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1112 | .prior = THRD_PRIOR_LOWEST, |
| 1113 | .status = THRD_STAT_INVALID, |
| 1114 | .state_ctx = |
| 1115 | { |
| 1116 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 1117 | }, |
| 1118 | .next = NULL, |
| 1119 | }, |
| 1120 | #endif /* defined(TFM_PSA_API) */ |
| 1121 | }, |
| 1122 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 1123 | |
| 1124 | /* -----------------------------------------------------------------------*/ |
| 1125 | /* - Partition DB record for TFM_SP_IPC_CLIENT_TEST */ |
| 1126 | /* -----------------------------------------------------------------------*/ |
| 1127 | #ifdef TFM_PARTITION_TEST_CORE_IPC |
| 1128 | { |
| 1129 | /* Static data */ |
| 1130 | { |
| 1131 | .partition_id = TFM_SP_IPC_CLIENT_TEST_ID, |
| 1132 | .partition_flags = SPM_PART_FLAG_IPC |
| 1133 | | SPM_PART_FLAG_APP_ROT |
| 1134 | , |
| 1135 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 1136 | .partition_init = ipc_client_test_main, |
| 1137 | }, |
| 1138 | |
| 1139 | /* Runtime data */ |
| 1140 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1141 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1142 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 1143 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 1144 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 1145 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1146 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1147 | .lr = 0, |
| 1148 | .iovec_api = TFM_SFN_API_IOVEC, |
| 1149 | .iovec_args = |
| 1150 | { |
| 1151 | .in_vec = {{0}}, |
| 1152 | .in_len = 0, |
| 1153 | .out_vec = {{0}}, |
| 1154 | .out_len = 0, |
| 1155 | }, |
| 1156 | .orig_outvec = NULL, |
| 1157 | .ctx_stack_ptr = ctx_stack_TFM_SP_IPC_CLIENT_TEST, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1158 | #else /* !defined(TFM_PSA_API) */ |
| 1159 | .signal_evnt = |
| 1160 | { |
| 1161 | .magic = 0, |
| 1162 | .owner = NULL, |
| 1163 | }, |
| 1164 | .signals = 0, |
| 1165 | .service_list = |
| 1166 | { |
| 1167 | .prev = NULL, |
| 1168 | .next = NULL, |
| 1169 | }, |
| 1170 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1171 | .signal_mask = 0, |
| 1172 | }, |
| 1173 | |
| 1174 | .platform_data = NULL, |
| 1175 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 1176 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1177 | /* memory_data */ |
| 1178 | .memory_data = { |
| 1179 | .code_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, $$Base), |
| 1180 | .code_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, $$Limit), |
| 1181 | .ro_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, $$RO$$Base), |
| 1182 | .ro_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, $$RO$$Limit), |
| 1183 | .rw_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _DATA$$RW$$Base), |
| 1184 | .rw_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _DATA$$RW$$Limit), |
| 1185 | .zi_start = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _DATA$$ZI$$Base), |
| 1186 | .zi_limit = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _DATA$$ZI$$Limit), |
| 1187 | .stack_bottom = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _STACK$$ZI$$Base), |
| 1188 | .stack_top = PART_REGION_ADDR(TFM_SP_IPC_CLIENT_TEST, _STACK$$ZI$$Limit), |
| 1189 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1190 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1191 | /* sp_thrd */ |
| 1192 | .sp_thrd = { |
| 1193 | .pfn = NULL, |
| 1194 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 1195 | .sp_btm = 0, |
| 1196 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1197 | .prior = THRD_PRIOR_LOWEST, |
| 1198 | .status = THRD_STAT_INVALID, |
| 1199 | .state_ctx = |
| 1200 | { |
| 1201 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 1202 | }, |
| 1203 | .next = NULL, |
| 1204 | }, |
| 1205 | #endif /* defined(TFM_PSA_API) */ |
| 1206 | }, |
| 1207 | #endif /* TFM_PARTITION_TEST_CORE_IPC */ |
| 1208 | |
| 1209 | /* -----------------------------------------------------------------------*/ |
| 1210 | /* - Partition DB record for TFM_IRQ_TEST_1 */ |
| 1211 | /* -----------------------------------------------------------------------*/ |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 1212 | #ifdef TFM_ENABLE_IRQ_TEST |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1213 | { |
| 1214 | /* Static data */ |
| 1215 | { |
| 1216 | .partition_id = TFM_IRQ_TEST_1_ID, |
| 1217 | .partition_flags = SPM_PART_FLAG_IPC |
| 1218 | | SPM_PART_FLAG_APP_ROT |
| 1219 | , |
| 1220 | .partition_priority = TFM_PRIORITY(NORMAL), |
| 1221 | .partition_init = tfm_irq_test_1_init, |
| 1222 | }, |
| 1223 | |
| 1224 | /* Runtime data */ |
| 1225 | { |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1226 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1227 | .partition_state = SPM_PARTITION_STATE_UNINIT, |
| 1228 | .caller_partition_idx = SPM_INVALID_PARTITION_IDX, |
| 1229 | .caller_client_id = TFM_INVALID_CLIENT_ID, |
| 1230 | .share = TFM_BUFFER_SHARE_DISABLE, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1231 | .stack_ptr = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1232 | .lr = 0, |
| 1233 | .iovec_api = TFM_SFN_API_IOVEC, |
| 1234 | .iovec_args = |
| 1235 | { |
| 1236 | .in_vec = {{0}}, |
| 1237 | .in_len = 0, |
| 1238 | .out_vec = {{0}}, |
| 1239 | .out_len = 0, |
| 1240 | }, |
| 1241 | .orig_outvec = NULL, |
| 1242 | .ctx_stack_ptr = ctx_stack_TFM_IRQ_TEST_1, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1243 | #else /* !defined(TFM_PSA_API) */ |
| 1244 | .signal_evnt = |
| 1245 | { |
| 1246 | .magic = 0, |
| 1247 | .owner = NULL, |
| 1248 | }, |
| 1249 | .signals = 0, |
| 1250 | .service_list = |
| 1251 | { |
| 1252 | .prev = NULL, |
| 1253 | .next = NULL, |
| 1254 | }, |
| 1255 | #endif /* !defined(TFM_PSA_API) */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1256 | .signal_mask = 0, |
| 1257 | }, |
| 1258 | |
| 1259 | /* platform data */ |
| 1260 | /* FIXME: Only adding the first mmio region */ |
| 1261 | .platform_data = TFM_PERIPHERAL_TIMER0, |
| 1262 | |
Edison Ai | 7aff9e8 | 2019-07-11 14:56:46 +0800 | [diff] [blame] | 1263 | #ifdef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1264 | /* memory_data */ |
| 1265 | .memory_data = { |
| 1266 | .code_start = PART_REGION_ADDR(TFM_IRQ_TEST_1, $$Base), |
| 1267 | .code_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1, $$Limit), |
| 1268 | .ro_start = PART_REGION_ADDR(TFM_IRQ_TEST_1, $$RO$$Base), |
| 1269 | .ro_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1, $$RO$$Limit), |
| 1270 | .rw_start = PART_REGION_ADDR(TFM_IRQ_TEST_1, _DATA$$RW$$Base), |
| 1271 | .rw_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1, _DATA$$RW$$Limit), |
| 1272 | .zi_start = PART_REGION_ADDR(TFM_IRQ_TEST_1, _DATA$$ZI$$Base), |
| 1273 | .zi_limit = PART_REGION_ADDR(TFM_IRQ_TEST_1, _DATA$$ZI$$Limit), |
| 1274 | .stack_bottom = PART_REGION_ADDR(TFM_IRQ_TEST_1, _STACK$$ZI$$Base), |
| 1275 | .stack_top = PART_REGION_ADDR(TFM_IRQ_TEST_1, _STACK$$ZI$$Limit), |
| 1276 | }, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1277 | |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1278 | /* sp_thrd */ |
| 1279 | .sp_thrd = { |
| 1280 | .pfn = NULL, |
| 1281 | .param = NULL, |
Ken Liu | 5a2b905 | 2019-08-15 19:03:29 +0800 | [diff] [blame] | 1282 | .sp_btm = 0, |
| 1283 | .sp_top = 0, |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1284 | .prior = THRD_PRIOR_LOWEST, |
| 1285 | .status = THRD_STAT_INVALID, |
| 1286 | .state_ctx = |
| 1287 | { |
| 1288 | .ctxb = {0}, /* Fields are not detailed as they are architecture dependent*/ |
| 1289 | }, |
| 1290 | .next = NULL, |
| 1291 | }, |
| 1292 | #endif /* defined(TFM_PSA_API) */ |
| 1293 | }, |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 1294 | #endif /* TFM_ENABLE_IRQ_TEST */ |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1295 | |
| 1296 | }; |
| 1297 | |
| 1298 | struct spm_partition_db_t g_spm_partition_db = { |
| 1299 | .is_init = 0, |
| 1300 | .partition_count = sizeof(partition_list) / sizeof(partition_list[0]), |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1301 | #ifndef TFM_PSA_API |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1302 | .running_partition_idx = 0, |
Edison Ai | 66fbdf1 | 2019-07-08 16:05:07 +0800 | [diff] [blame] | 1303 | #endif |
Mate Toth-Pal | 3ad2e3e | 2019-07-11 21:43:37 +0200 | [diff] [blame] | 1304 | .partitions = partition_list, |
| 1305 | }; |
| 1306 | |
| 1307 | #endif /* __TFM_SPM_DB_INC__ */ |