TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_spm_db_func.inc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2020, 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_FUNC_INC__
11 #define __TFM_SPM_DB_FUNC_INC__
12 
13 #include "psa_manifest/sid.h"
14 
15 /**************************************************************************/
17 /**************************************************************************/
18 #ifdef TFM_PARTITION_PROTECTED_STORAGE
19 #define TFM_PARTITION_TFM_SP_PS_IRQ_COUNT 0
20 #endif /* TFM_PARTITION_PROTECTED_STORAGE */
21 
22 #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
23 #define TFM_PARTITION_TFM_SP_ITS_IRQ_COUNT 0
24 #endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
25 
26 #ifdef TFM_PARTITION_AUDIT_LOG
27 #define TFM_PARTITION_TFM_SP_AUDIT_LOG_IRQ_COUNT 0
28 #endif /* TFM_PARTITION_AUDIT_LOG */
29 
30 #ifdef TFM_PARTITION_CRYPTO
31 #define TFM_PARTITION_TFM_SP_CRYPTO_IRQ_COUNT 0
32 #endif /* TFM_PARTITION_CRYPTO */
33 
34 #ifdef TFM_PARTITION_PLATFORM
35 #define TFM_PARTITION_TFM_SP_PLATFORM_IRQ_COUNT 0
36 #endif /* TFM_PARTITION_PLATFORM */
37 
38 #ifdef TFM_PARTITION_INITIAL_ATTESTATION
39 #define TFM_PARTITION_TFM_SP_INITIAL_ATTESTATION_IRQ_COUNT 0
40 #endif /* TFM_PARTITION_INITIAL_ATTESTATION */
41 
42 #ifdef TFM_PARTITION_TEST_CORE
43 #define TFM_PARTITION_TFM_SP_CORE_TEST_IRQ_COUNT 0
44 #endif /* TFM_PARTITION_TEST_CORE */
45 
46 #ifdef TFM_PARTITION_TEST_CORE
47 #define TFM_PARTITION_TFM_SP_CORE_TEST_2_IRQ_COUNT 0
48 #endif /* TFM_PARTITION_TEST_CORE */
49 
50 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
51 #define TFM_PARTITION_TFM_SP_SECURE_TEST_PARTITION_IRQ_COUNT 0
52 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
53 
54 #ifdef TFM_PARTITION_TEST_CORE_IPC
55 #define TFM_PARTITION_TFM_SP_IPC_SERVICE_TEST_IRQ_COUNT 0
56 #endif /* TFM_PARTITION_TEST_CORE_IPC */
57 
58 #ifdef TFM_PARTITION_TEST_CORE_IPC
59 #define TFM_PARTITION_TFM_SP_IPC_CLIENT_TEST_IRQ_COUNT 0
60 #endif /* TFM_PARTITION_TEST_CORE_IPC */
61 
62 #ifdef TFM_ENABLE_IRQ_TEST
63 #define TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT 1
64 #endif /* TFM_ENABLE_IRQ_TEST */
65 
66 #ifdef TFM_PARTITION_TEST_PS
67 #define TFM_PARTITION_TFM_SP_PS_TEST_IRQ_COUNT 0
68 #endif /* TFM_PARTITION_TEST_PS */
69 
70 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
71 #define TFM_PARTITION_TFM_SP_SECURE_CLIENT_2_IRQ_COUNT 0
72 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
73 
74 /**************************************************************************/
76 /**************************************************************************/
77 #ifdef TFM_PARTITION_PROTECTED_STORAGE
78 extern void tfm_ps_req_mngr_init(void);
79 #endif /* TFM_PARTITION_PROTECTED_STORAGE */
80 
81 #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
82 extern void tfm_its_req_mngr_init(void);
83 #endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
84 
85 #ifdef TFM_PARTITION_AUDIT_LOG
86 extern void audit_core_init(void);
87 #endif /* TFM_PARTITION_AUDIT_LOG */
88 
89 #ifdef TFM_PARTITION_CRYPTO
90 extern void tfm_crypto_init(void);
91 #endif /* TFM_PARTITION_CRYPTO */
92 
93 #ifdef TFM_PARTITION_PLATFORM
94 extern void platform_sp_init(void);
95 #endif /* TFM_PARTITION_PLATFORM */
96 
97 #ifdef TFM_PARTITION_INITIAL_ATTESTATION
98 extern void attest_partition_init(void);
99 #endif /* TFM_PARTITION_INITIAL_ATTESTATION */
100 
101 #ifdef TFM_PARTITION_TEST_CORE
102 extern void core_test_init(void);
103 #endif /* TFM_PARTITION_TEST_CORE */
104 
105 #ifdef TFM_PARTITION_TEST_CORE
106 extern void core_test_2_init(void);
107 #endif /* TFM_PARTITION_TEST_CORE */
108 
109 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
110 extern void tfm_secure_client_service_init(void);
111 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
112 
113 #ifdef TFM_PARTITION_TEST_CORE_IPC
114 extern void ipc_service_test_main(void);
115 #endif /* TFM_PARTITION_TEST_CORE_IPC */
116 
117 #ifdef TFM_PARTITION_TEST_CORE_IPC
118 extern void ipc_client_test_main(void);
119 #endif /* TFM_PARTITION_TEST_CORE_IPC */
120 
121 #ifdef TFM_ENABLE_IRQ_TEST
122 extern void tfm_irq_test_1_init(void);
123 #endif /* TFM_ENABLE_IRQ_TEST */
124 
125 #ifdef TFM_PARTITION_TEST_PS
126 extern void tfm_ps_test_init(void);
127 #endif /* TFM_PARTITION_TEST_PS */
128 
129 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
130 extern void tfm_secure_client_2_init(void);
131 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
132 
133 /**************************************************************************/
135 /**************************************************************************/
136 /* The max size of the context stack can be calculated as a function of the IRQ
137  * count of the secure partition:
138  *
139  * max_stack_size = intr_ctx_size + (IRQ_CNT * (intr_ctx_size + hndl_ctx_size))
140  *
141  * where:
142  * intr_ctx: Frame pushed when the partition is interrupted
143  * hndl_ctx: Frame pushed when the partition is handling an interrupt
144  */
145 static uint32_t ns_interrupt_ctx_stack[
146  sizeof(struct interrupted_ctx_stack_frame_t) / sizeof(uint32_t)];
147 
148 static uint32_t tfm_core_interrupt_ctx_stack[
149  sizeof(struct interrupted_ctx_stack_frame_t) / sizeof(uint32_t)];
150 
151 #ifdef TFM_PARTITION_PROTECTED_STORAGE
152 static uint32_t ctx_stack_TFM_SP_PS[
153  (sizeof(struct interrupted_ctx_stack_frame_t) +
154  (TFM_PARTITION_TFM_SP_PS_IRQ_COUNT) * (
155  sizeof(struct interrupted_ctx_stack_frame_t) +
156  sizeof(struct handler_ctx_stack_frame_t)
157  )) / sizeof(uint32_t)];
158 #endif /* TFM_PARTITION_PROTECTED_STORAGE */
159 
160 #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
161 static uint32_t ctx_stack_TFM_SP_ITS[
162  (sizeof(struct interrupted_ctx_stack_frame_t) +
163  (TFM_PARTITION_TFM_SP_ITS_IRQ_COUNT) * (
164  sizeof(struct interrupted_ctx_stack_frame_t) +
165  sizeof(struct handler_ctx_stack_frame_t)
166  )) / sizeof(uint32_t)];
167 #endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
168 
169 #ifdef TFM_PARTITION_AUDIT_LOG
170 static uint32_t ctx_stack_TFM_SP_AUDIT_LOG[
171  (sizeof(struct interrupted_ctx_stack_frame_t) +
172  (TFM_PARTITION_TFM_SP_AUDIT_LOG_IRQ_COUNT) * (
173  sizeof(struct interrupted_ctx_stack_frame_t) +
174  sizeof(struct handler_ctx_stack_frame_t)
175  )) / sizeof(uint32_t)];
176 #endif /* TFM_PARTITION_AUDIT_LOG */
177 
178 #ifdef TFM_PARTITION_CRYPTO
179 static uint32_t ctx_stack_TFM_SP_CRYPTO[
180  (sizeof(struct interrupted_ctx_stack_frame_t) +
181  (TFM_PARTITION_TFM_SP_CRYPTO_IRQ_COUNT) * (
182  sizeof(struct interrupted_ctx_stack_frame_t) +
183  sizeof(struct handler_ctx_stack_frame_t)
184  )) / sizeof(uint32_t)];
185 #endif /* TFM_PARTITION_CRYPTO */
186 
187 #ifdef TFM_PARTITION_PLATFORM
188 static uint32_t ctx_stack_TFM_SP_PLATFORM[
189  (sizeof(struct interrupted_ctx_stack_frame_t) +
190  (TFM_PARTITION_TFM_SP_PLATFORM_IRQ_COUNT) * (
191  sizeof(struct interrupted_ctx_stack_frame_t) +
192  sizeof(struct handler_ctx_stack_frame_t)
193  )) / sizeof(uint32_t)];
194 #endif /* TFM_PARTITION_PLATFORM */
195 
196 #ifdef TFM_PARTITION_INITIAL_ATTESTATION
197 static uint32_t ctx_stack_TFM_SP_INITIAL_ATTESTATION[
198  (sizeof(struct interrupted_ctx_stack_frame_t) +
199  (TFM_PARTITION_TFM_SP_INITIAL_ATTESTATION_IRQ_COUNT) * (
200  sizeof(struct interrupted_ctx_stack_frame_t) +
201  sizeof(struct handler_ctx_stack_frame_t)
202  )) / sizeof(uint32_t)];
203 #endif /* TFM_PARTITION_INITIAL_ATTESTATION */
204 
205 #ifdef TFM_PARTITION_TEST_CORE
206 static uint32_t ctx_stack_TFM_SP_CORE_TEST[
207  (sizeof(struct interrupted_ctx_stack_frame_t) +
208  (TFM_PARTITION_TFM_SP_CORE_TEST_IRQ_COUNT) * (
209  sizeof(struct interrupted_ctx_stack_frame_t) +
210  sizeof(struct handler_ctx_stack_frame_t)
211  )) / sizeof(uint32_t)];
212 #endif /* TFM_PARTITION_TEST_CORE */
213 
214 #ifdef TFM_PARTITION_TEST_CORE
215 static uint32_t ctx_stack_TFM_SP_CORE_TEST_2[
216  (sizeof(struct interrupted_ctx_stack_frame_t) +
217  (TFM_PARTITION_TFM_SP_CORE_TEST_2_IRQ_COUNT) * (
218  sizeof(struct interrupted_ctx_stack_frame_t) +
219  sizeof(struct handler_ctx_stack_frame_t)
220  )) / sizeof(uint32_t)];
221 #endif /* TFM_PARTITION_TEST_CORE */
222 
223 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
224 static uint32_t ctx_stack_TFM_SP_SECURE_TEST_PARTITION[
225  (sizeof(struct interrupted_ctx_stack_frame_t) +
226  (TFM_PARTITION_TFM_SP_SECURE_TEST_PARTITION_IRQ_COUNT) * (
227  sizeof(struct interrupted_ctx_stack_frame_t) +
228  sizeof(struct handler_ctx_stack_frame_t)
229  )) / sizeof(uint32_t)];
230 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
231 
232 #ifdef TFM_PARTITION_TEST_CORE_IPC
233 static uint32_t ctx_stack_TFM_SP_IPC_SERVICE_TEST[
234  (sizeof(struct interrupted_ctx_stack_frame_t) +
235  (TFM_PARTITION_TFM_SP_IPC_SERVICE_TEST_IRQ_COUNT) * (
236  sizeof(struct interrupted_ctx_stack_frame_t) +
237  sizeof(struct handler_ctx_stack_frame_t)
238  )) / sizeof(uint32_t)];
239 #endif /* TFM_PARTITION_TEST_CORE_IPC */
240 
241 #ifdef TFM_PARTITION_TEST_CORE_IPC
242 static uint32_t ctx_stack_TFM_SP_IPC_CLIENT_TEST[
243  (sizeof(struct interrupted_ctx_stack_frame_t) +
244  (TFM_PARTITION_TFM_SP_IPC_CLIENT_TEST_IRQ_COUNT) * (
245  sizeof(struct interrupted_ctx_stack_frame_t) +
246  sizeof(struct handler_ctx_stack_frame_t)
247  )) / sizeof(uint32_t)];
248 #endif /* TFM_PARTITION_TEST_CORE_IPC */
249 
250 #ifdef TFM_ENABLE_IRQ_TEST
251 static uint32_t ctx_stack_TFM_IRQ_TEST_1[
252  (sizeof(struct interrupted_ctx_stack_frame_t) +
253  (TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT) * (
254  sizeof(struct interrupted_ctx_stack_frame_t) +
255  sizeof(struct handler_ctx_stack_frame_t)
256  )) / sizeof(uint32_t)];
257 #endif /* TFM_ENABLE_IRQ_TEST */
258 
259 #ifdef TFM_PARTITION_TEST_PS
260 static uint32_t ctx_stack_TFM_SP_PS_TEST[
261  (sizeof(struct interrupted_ctx_stack_frame_t) +
262  (TFM_PARTITION_TFM_SP_PS_TEST_IRQ_COUNT) * (
263  sizeof(struct interrupted_ctx_stack_frame_t) +
264  sizeof(struct handler_ctx_stack_frame_t)
265  )) / sizeof(uint32_t)];
266 #endif /* TFM_PARTITION_TEST_PS */
267 
268 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
269 static uint32_t ctx_stack_TFM_SP_SECURE_CLIENT_2[
270  (sizeof(struct interrupted_ctx_stack_frame_t) +
271  (TFM_PARTITION_TFM_SP_SECURE_CLIENT_2_IRQ_COUNT) * (
272  sizeof(struct interrupted_ctx_stack_frame_t) +
273  sizeof(struct handler_ctx_stack_frame_t)
274  )) / sizeof(uint32_t)];
275 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
276 
277 uint32_t *ctx_stack_list[] =
278 {
279  ns_interrupt_ctx_stack,
280  tfm_core_interrupt_ctx_stack,
281 #ifdef TFM_PARTITION_PROTECTED_STORAGE
282  ctx_stack_TFM_SP_PS,
283 #endif /* TFM_PARTITION_PROTECTED_STORAGE */
284 #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
285  ctx_stack_TFM_SP_ITS,
286 #endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
287 #ifdef TFM_PARTITION_AUDIT_LOG
288  ctx_stack_TFM_SP_AUDIT_LOG,
289 #endif /* TFM_PARTITION_AUDIT_LOG */
290 #ifdef TFM_PARTITION_CRYPTO
291  ctx_stack_TFM_SP_CRYPTO,
292 #endif /* TFM_PARTITION_CRYPTO */
293 #ifdef TFM_PARTITION_PLATFORM
294  ctx_stack_TFM_SP_PLATFORM,
295 #endif /* TFM_PARTITION_PLATFORM */
296 #ifdef TFM_PARTITION_INITIAL_ATTESTATION
297  ctx_stack_TFM_SP_INITIAL_ATTESTATION,
298 #endif /* TFM_PARTITION_INITIAL_ATTESTATION */
299 #ifdef TFM_PARTITION_TEST_CORE
300  ctx_stack_TFM_SP_CORE_TEST,
301 #endif /* TFM_PARTITION_TEST_CORE */
302 #ifdef TFM_PARTITION_TEST_CORE
303  ctx_stack_TFM_SP_CORE_TEST_2,
304 #endif /* TFM_PARTITION_TEST_CORE */
305 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
306  ctx_stack_TFM_SP_SECURE_TEST_PARTITION,
307 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
308 #ifdef TFM_PARTITION_TEST_CORE_IPC
309  ctx_stack_TFM_SP_IPC_SERVICE_TEST,
310 #endif /* TFM_PARTITION_TEST_CORE_IPC */
311 #ifdef TFM_PARTITION_TEST_CORE_IPC
312  ctx_stack_TFM_SP_IPC_CLIENT_TEST,
313 #endif /* TFM_PARTITION_TEST_CORE_IPC */
314 #ifdef TFM_ENABLE_IRQ_TEST
315  ctx_stack_TFM_IRQ_TEST_1,
316 #endif /* TFM_ENABLE_IRQ_TEST */
317 #ifdef TFM_PARTITION_TEST_PS
318  ctx_stack_TFM_SP_PS_TEST,
319 #endif /* TFM_PARTITION_TEST_PS */
320 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
321  ctx_stack_TFM_SP_SECURE_CLIENT_2,
322 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
323 };
324 
325 /**************************************************************************/
327 /**************************************************************************/
328 #ifdef TFM_PARTITION_PROTECTED_STORAGE
329 static int32_t dependencies_TFM_SP_PS[] =
330 {
337 };
338 #endif /* TFM_PARTITION_PROTECTED_STORAGE */
339 
340 #ifdef TFM_PARTITION_CRYPTO
341 static int32_t dependencies_TFM_SP_CRYPTO[] =
342 {
347 };
348 #endif /* TFM_PARTITION_CRYPTO */
349 
350 #ifdef TFM_PARTITION_INITIAL_ATTESTATION
351 static int32_t dependencies_TFM_SP_INITIAL_ATTESTATION[] =
352 {
354 };
355 #endif /* TFM_PARTITION_INITIAL_ATTESTATION */
356 
357 #ifdef TFM_PARTITION_TEST_CORE
358 static int32_t dependencies_TFM_SP_CORE_TEST[] =
359 {
363 };
364 #endif /* TFM_PARTITION_TEST_CORE */
365 
366 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
367 static int32_t dependencies_TFM_SP_SECURE_TEST_PARTITION[] =
368 {
386 };
387 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
388 
389 #ifdef TFM_PARTITION_TEST_CORE_IPC
390 static int32_t dependencies_TFM_SP_IPC_CLIENT_TEST[] =
391 {
396 };
397 #endif /* TFM_PARTITION_TEST_CORE_IPC */
398 
399 #ifdef TFM_PARTITION_TEST_PS
400 static int32_t dependencies_TFM_SP_PS_TEST[] =
401 {
405 };
406 #endif /* TFM_PARTITION_TEST_PS */
407 
408 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
409 static int32_t dependencies_TFM_SP_SECURE_CLIENT_2[] =
410 {
413 };
414 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
415 
416 /**************************************************************************/
418 /**************************************************************************/
420 {
421  {
423  .partition_flags = 0,
424  },
425 
426  {
427  .partition_id = TFM_SP_CORE_ID,
428  .partition_flags = SPM_PART_FLAG_APP_ROT | SPM_PART_FLAG_PSA_ROT,
429  },
430 
431 #ifdef TFM_PARTITION_PROTECTED_STORAGE
432  {
433  .partition_id = TFM_SP_PS,
434  .partition_flags = SPM_PART_FLAG_IPC
436  ,
437  .partition_priority = TFM_PRIORITY(NORMAL),
438  .partition_init = tfm_ps_req_mngr_init,
439  .dependencies_num = 6,
440  .p_dependencies = dependencies_TFM_SP_PS,
441  },
442 #endif /* TFM_PARTITION_PROTECTED_STORAGE */
443 
444 #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
445  {
446  .partition_id = TFM_SP_ITS,
447  .partition_flags = SPM_PART_FLAG_IPC
449  ,
450  .partition_priority = TFM_PRIORITY(NORMAL),
451  .partition_init = tfm_its_req_mngr_init,
452  .dependencies_num = 0,
453  .p_dependencies = NULL,
454  },
455 #endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
456 
457 #ifdef TFM_PARTITION_AUDIT_LOG
458  {
459  .partition_id = TFM_SP_AUDIT_LOG,
460  .partition_flags = 0
462  ,
463  .partition_priority = TFM_PRIORITY(NORMAL),
464  .partition_init = audit_core_init,
465  .dependencies_num = 0,
466  .p_dependencies = NULL,
467  },
468 #endif /* TFM_PARTITION_AUDIT_LOG */
469 
470 #ifdef TFM_PARTITION_CRYPTO
471  {
472  .partition_id = TFM_SP_CRYPTO,
473  .partition_flags = SPM_PART_FLAG_IPC
475  ,
476  .partition_priority = TFM_PRIORITY(NORMAL),
477  .partition_init = tfm_crypto_init,
478  .dependencies_num = 4,
479  .p_dependencies = dependencies_TFM_SP_CRYPTO,
480  },
481 #endif /* TFM_PARTITION_CRYPTO */
482 
483 #ifdef TFM_PARTITION_PLATFORM
484  {
485  .partition_id = TFM_SP_PLATFORM,
486  .partition_flags = SPM_PART_FLAG_IPC
488  ,
489  .partition_priority = TFM_PRIORITY(NORMAL),
490  .partition_init = platform_sp_init,
491  .dependencies_num = 0,
492  .p_dependencies = NULL,
493  },
494 #endif /* TFM_PARTITION_PLATFORM */
495 
496 #ifdef TFM_PARTITION_INITIAL_ATTESTATION
497  {
498  .partition_id = TFM_SP_INITIAL_ATTESTATION,
499  .partition_flags = SPM_PART_FLAG_IPC
501  ,
502  .partition_priority = TFM_PRIORITY(NORMAL),
503  .partition_init = attest_partition_init,
504  .dependencies_num = 1,
505  .p_dependencies = dependencies_TFM_SP_INITIAL_ATTESTATION,
506  },
507 #endif /* TFM_PARTITION_INITIAL_ATTESTATION */
508 
509 #ifdef TFM_PARTITION_TEST_CORE
510  {
511  .partition_id = TFM_SP_CORE_TEST,
512  .partition_flags = SPM_PART_FLAG_IPC
514  ,
515  .partition_priority = TFM_PRIORITY(NORMAL),
516  .partition_init = core_test_init,
517  .dependencies_num = 3,
518  .p_dependencies = dependencies_TFM_SP_CORE_TEST,
519  },
520 #endif /* TFM_PARTITION_TEST_CORE */
521 
522 #ifdef TFM_PARTITION_TEST_CORE
523  {
524  .partition_id = TFM_SP_CORE_TEST_2,
525  .partition_flags = SPM_PART_FLAG_IPC
527  ,
528  .partition_priority = TFM_PRIORITY(NORMAL),
529  .partition_init = core_test_2_init,
530  .dependencies_num = 0,
531  .p_dependencies = NULL,
532  },
533 #endif /* TFM_PARTITION_TEST_CORE */
534 
535 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
536  {
537  .partition_id = TFM_SP_SECURE_TEST_PARTITION,
538  .partition_flags = SPM_PART_FLAG_IPC
540  ,
541  .partition_priority = TFM_PRIORITY(NORMAL),
542  .partition_init = tfm_secure_client_service_init,
543  .dependencies_num = 17,
544  .p_dependencies = dependencies_TFM_SP_SECURE_TEST_PARTITION,
545  },
546 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
547 
548 #ifdef TFM_PARTITION_TEST_CORE_IPC
549  {
550  .partition_id = TFM_SP_IPC_SERVICE_TEST,
551  .partition_flags = SPM_PART_FLAG_IPC
553  ,
554  .partition_priority = TFM_PRIORITY(HIGH),
555  .partition_init = ipc_service_test_main,
556  .dependencies_num = 0,
557  .p_dependencies = NULL,
558  },
559 #endif /* TFM_PARTITION_TEST_CORE_IPC */
560 
561 #ifdef TFM_PARTITION_TEST_CORE_IPC
562  {
563  .partition_id = TFM_SP_IPC_CLIENT_TEST,
564  .partition_flags = SPM_PART_FLAG_IPC
566  ,
567  .partition_priority = TFM_PRIORITY(NORMAL),
568  .partition_init = ipc_client_test_main,
569  .dependencies_num = 4,
570  .p_dependencies = dependencies_TFM_SP_IPC_CLIENT_TEST,
571  },
572 #endif /* TFM_PARTITION_TEST_CORE_IPC */
573 
574 #ifdef TFM_ENABLE_IRQ_TEST
575  {
576  .partition_id = TFM_IRQ_TEST_1,
577  .partition_flags = SPM_PART_FLAG_IPC
579  ,
580  .partition_priority = TFM_PRIORITY(NORMAL),
581  .partition_init = tfm_irq_test_1_init,
582  .dependencies_num = 0,
583  .p_dependencies = NULL,
584  },
585 #endif /* TFM_ENABLE_IRQ_TEST */
586 
587 #ifdef TFM_PARTITION_TEST_PS
588  {
589  .partition_id = TFM_SP_PS_TEST,
590  .partition_flags = SPM_PART_FLAG_IPC
592  ,
593  .partition_priority = TFM_PRIORITY(NORMAL),
594  .partition_init = tfm_ps_test_init,
595  .dependencies_num = 3,
596  .p_dependencies = dependencies_TFM_SP_PS_TEST,
597  },
598 #endif /* TFM_PARTITION_TEST_PS */
599 
600 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
601  {
602  .partition_id = TFM_SP_SECURE_CLIENT_2,
603  .partition_flags = SPM_PART_FLAG_IPC
605  ,
606  .partition_priority = TFM_PRIORITY(NORMAL),
607  .partition_init = tfm_secure_client_2_init,
608  .dependencies_num = 2,
609  .p_dependencies = dependencies_TFM_SP_SECURE_CLIENT_2,
610  },
611 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
612 
613 };
614 
615 /**************************************************************************/
617 /**************************************************************************/
618 #ifdef TFM_PARTITION_AUDIT_LOG
619 const struct tfm_spm_partition_platform_data_t *
620  platform_data_list_TFM_SP_AUDIT_LOG[] =
621 {
622 #ifdef AUDIT_UART_REDIRECTION
623  TFM_PERIPHERAL_UART1,
624 #endif /* AUDIT_UART_REDIRECTION */
625  NULL
626 };
627 #endif /* TFM_PARTITION_AUDIT_LOG */
628 
629 #ifdef TFM_PARTITION_TEST_CORE
630 const struct tfm_spm_partition_platform_data_t *
631  platform_data_list_TFM_SP_CORE_TEST[] =
632 {
633  TFM_PERIPHERAL_FPGA_IO,
634  NULL
635 };
636 #endif /* TFM_PARTITION_TEST_CORE */
637 
638 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
639 const struct tfm_spm_partition_platform_data_t *
640  platform_data_list_TFM_SP_SECURE_TEST_PARTITION[] =
641 {
642  TFM_PERIPHERAL_STD_UART,
643  NULL
644 };
645 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
646 
647 #ifdef TFM_ENABLE_IRQ_TEST
648 const struct tfm_spm_partition_platform_data_t *
649  platform_data_list_TFM_IRQ_TEST_1[] =
650 {
651  TFM_PERIPHERAL_TIMER0,
652  NULL
653 };
654 #endif /* TFM_ENABLE_IRQ_TEST */
655 
656 const struct tfm_spm_partition_platform_data_t **platform_data_list_list[] =
657 {
658  NULL,
659  NULL,
660 
661 #ifdef TFM_PARTITION_PROTECTED_STORAGE
662  NULL,
663 #endif /* TFM_PARTITION_PROTECTED_STORAGE */
664 
665 #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
666  NULL,
667 #endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
668 
669 #ifdef TFM_PARTITION_AUDIT_LOG
670  platform_data_list_TFM_SP_AUDIT_LOG,
671 #endif /* TFM_PARTITION_AUDIT_LOG */
672 
673 #ifdef TFM_PARTITION_CRYPTO
674  NULL,
675 #endif /* TFM_PARTITION_CRYPTO */
676 
677 #ifdef TFM_PARTITION_PLATFORM
678  NULL,
679 #endif /* TFM_PARTITION_PLATFORM */
680 
681 #ifdef TFM_PARTITION_INITIAL_ATTESTATION
682  NULL,
683 #endif /* TFM_PARTITION_INITIAL_ATTESTATION */
684 
685 #ifdef TFM_PARTITION_TEST_CORE
686  platform_data_list_TFM_SP_CORE_TEST,
687 #endif /* TFM_PARTITION_TEST_CORE */
688 
689 #ifdef TFM_PARTITION_TEST_CORE
690  NULL,
691 #endif /* TFM_PARTITION_TEST_CORE */
692 
693 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
694  platform_data_list_TFM_SP_SECURE_TEST_PARTITION,
695 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
696 
697 #ifdef TFM_PARTITION_TEST_CORE_IPC
698  NULL,
699 #endif /* TFM_PARTITION_TEST_CORE_IPC */
700 
701 #ifdef TFM_PARTITION_TEST_CORE_IPC
702  NULL,
703 #endif /* TFM_PARTITION_TEST_CORE_IPC */
704 
705 #ifdef TFM_ENABLE_IRQ_TEST
706  platform_data_list_TFM_IRQ_TEST_1,
707 #endif /* TFM_ENABLE_IRQ_TEST */
708 
709 #ifdef TFM_PARTITION_TEST_PS
710  NULL,
711 #endif /* TFM_PARTITION_TEST_PS */
712 
713 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
714  NULL,
715 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
716 
717 };
718 
719 /**************************************************************************/
721 /**************************************************************************/
722 static struct spm_partition_desc_t partition_list [] =
723 {
724  {{0}}, /* placeholder for Non-secure internal partition */
725  {{0}}, /* placeholder for TF-M Core internal partition */
726 
727  /* -----------------------------------------------------------------------*/
728  /* - Partition DB record for TFM_SP_PS */
729  /* -----------------------------------------------------------------------*/
730 #ifdef TFM_PARTITION_PROTECTED_STORAGE
731  {
732  /* Runtime data */
733  .runtime_data = {0},
734  .static_data = NULL,
735  .platform_data_list = NULL,
736  },
737 #endif /* TFM_PARTITION_PROTECTED_STORAGE */
738 
739  /* -----------------------------------------------------------------------*/
740  /* - Partition DB record for TFM_SP_ITS */
741  /* -----------------------------------------------------------------------*/
742 #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
743  {
744  /* Runtime data */
745  .runtime_data = {0},
746  .static_data = NULL,
747  .platform_data_list = NULL,
748  },
749 #endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
750 
751  /* -----------------------------------------------------------------------*/
752  /* - Partition DB record for TFM_SP_AUDIT_LOG */
753  /* -----------------------------------------------------------------------*/
754 #ifdef TFM_PARTITION_AUDIT_LOG
755  {
756  /* Runtime data */
757  .runtime_data = {0},
758  .static_data = NULL,
759  .platform_data_list = NULL,
760  },
761 #endif /* TFM_PARTITION_AUDIT_LOG */
762 
763  /* -----------------------------------------------------------------------*/
764  /* - Partition DB record for TFM_SP_CRYPTO */
765  /* -----------------------------------------------------------------------*/
766 #ifdef TFM_PARTITION_CRYPTO
767  {
768  /* Runtime data */
769  .runtime_data = {0},
770  .static_data = NULL,
771  .platform_data_list = NULL,
772  },
773 #endif /* TFM_PARTITION_CRYPTO */
774 
775  /* -----------------------------------------------------------------------*/
776  /* - Partition DB record for TFM_SP_PLATFORM */
777  /* -----------------------------------------------------------------------*/
778 #ifdef TFM_PARTITION_PLATFORM
779  {
780  /* Runtime data */
781  .runtime_data = {0},
782  .static_data = NULL,
783  .platform_data_list = NULL,
784  },
785 #endif /* TFM_PARTITION_PLATFORM */
786 
787  /* -----------------------------------------------------------------------*/
788  /* - Partition DB record for TFM_SP_INITIAL_ATTESTATION */
789  /* -----------------------------------------------------------------------*/
790 #ifdef TFM_PARTITION_INITIAL_ATTESTATION
791  {
792  /* Runtime data */
793  .runtime_data = {0},
794  .static_data = NULL,
795  .platform_data_list = NULL,
796  },
797 #endif /* TFM_PARTITION_INITIAL_ATTESTATION */
798 
799  /* -----------------------------------------------------------------------*/
800  /* - Partition DB record for TFM_SP_CORE_TEST */
801  /* -----------------------------------------------------------------------*/
802 #ifdef TFM_PARTITION_TEST_CORE
803  {
804  /* Runtime data */
805  .runtime_data = {0},
806  .static_data = NULL,
807  .platform_data_list = NULL,
808  },
809 #endif /* TFM_PARTITION_TEST_CORE */
810 
811  /* -----------------------------------------------------------------------*/
812  /* - Partition DB record for TFM_SP_CORE_TEST_2 */
813  /* -----------------------------------------------------------------------*/
814 #ifdef TFM_PARTITION_TEST_CORE
815  {
816  /* Runtime data */
817  .runtime_data = {0},
818  .static_data = NULL,
819  .platform_data_list = NULL,
820  },
821 #endif /* TFM_PARTITION_TEST_CORE */
822 
823  /* -----------------------------------------------------------------------*/
824  /* - Partition DB record for TFM_SP_SECURE_TEST_PARTITION */
825  /* -----------------------------------------------------------------------*/
826 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
827  {
828  /* Runtime data */
829  .runtime_data = {0},
830  .static_data = NULL,
831  .platform_data_list = NULL,
832  },
833 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
834 
835  /* -----------------------------------------------------------------------*/
836  /* - Partition DB record for TFM_SP_IPC_SERVICE_TEST */
837  /* -----------------------------------------------------------------------*/
838 #ifdef TFM_PARTITION_TEST_CORE_IPC
839  {
840  /* Runtime data */
841  .runtime_data = {0},
842  .static_data = NULL,
843  .platform_data_list = NULL,
844  },
845 #endif /* TFM_PARTITION_TEST_CORE_IPC */
846 
847  /* -----------------------------------------------------------------------*/
848  /* - Partition DB record for TFM_SP_IPC_CLIENT_TEST */
849  /* -----------------------------------------------------------------------*/
850 #ifdef TFM_PARTITION_TEST_CORE_IPC
851  {
852  /* Runtime data */
853  .runtime_data = {0},
854  .static_data = NULL,
855  .platform_data_list = NULL,
856  },
857 #endif /* TFM_PARTITION_TEST_CORE_IPC */
858 
859  /* -----------------------------------------------------------------------*/
860  /* - Partition DB record for TFM_IRQ_TEST_1 */
861  /* -----------------------------------------------------------------------*/
862 #ifdef TFM_ENABLE_IRQ_TEST
863  {
864  /* Runtime data */
865  .runtime_data = {0},
866  .static_data = NULL,
867  .platform_data_list = NULL,
868  },
869 #endif /* TFM_ENABLE_IRQ_TEST */
870 
871  /* -----------------------------------------------------------------------*/
872  /* - Partition DB record for TFM_SP_PS_TEST */
873  /* -----------------------------------------------------------------------*/
874 #ifdef TFM_PARTITION_TEST_PS
875  {
876  /* Runtime data */
877  .runtime_data = {0},
878  .static_data = NULL,
879  .platform_data_list = NULL,
880  },
881 #endif /* TFM_PARTITION_TEST_PS */
882 
883  /* -----------------------------------------------------------------------*/
884  /* - Partition DB record for TFM_SP_SECURE_CLIENT_2 */
885  /* -----------------------------------------------------------------------*/
886 #ifdef TFM_PARTITION_TEST_SECURE_SERVICES
887  {
888  /* Runtime data */
889  .runtime_data = {0},
890  .static_data = NULL,
891  .platform_data_list = NULL,
892  },
893 #endif /* TFM_PARTITION_TEST_SECURE_SERVICES */
894 
895 };
896 
898  .is_init = 0,
899  .partition_count = sizeof(partition_list) / sizeof(partition_list[0]),
900  .running_partition_idx = 0,
901  .partitions = partition_list,
902 };
903 
904 #endif /* __TFM_SPM_DB_FUNC_INC__ */
#define TFM_PRIORITY(LEVEL)
Definition: spm_func.h:42
int32_t tfm_secure_client_service_init(void)
Service initialisation function. No special initialisation is required.
psa_status_t tfm_crypto_init(void)
Initialise the service.
Definition: crypto_init.c:330
#define SPM_CORE_TEST_2_INVERT_SID
Definition: sid.h:88
#define TFM_PS_REMOVE_SID
Definition: sid.h:24
#define TFM_SP_PLATFORM_IOCTL_SID
Definition: sid.h:46
#define IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SID
Definition: sid.h:104
#define TFM_SP_SECURE_CLIENT_2
Definition: pid.h:30
const struct tfm_spm_partition_platform_data_t ** platform_data_list_list[]
#define TFM_SP_CORE_TEST
Definition: pid.h:23
#define TFM_PS_SET_SID
Definition: sid.h:18
#define TFM_ITS_REMOVE_SID
Definition: sid.h:36
psa_status_t tfm_ps_req_mngr_init(void)
int32_t tfm_irq_test_1_init(void)
#define TFM_SP_ITS
Definition: pid.h:18
#define TFM_SP_PLATFORM
Definition: pid.h:21
#define TFM_ITS_GET_SID
Definition: sid.h:32
struct spm_partition_runtime_data_t runtime_data
Definition: spm_func.h:119
#define IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_SID
Definition: sid.h:106
#define TFM_PS_GET_SUPPORT_SID
Definition: sid.h:26
psa_status_t tfm_ps_test_init(void)
#define TFM_SP_INITIAL_ATTESTATION
Definition: pid.h:22
#define TFM_CRYPTO_SID
Definition: sid.h:40
#define TFM_SP_CORE_TEST_2
Definition: pid.h:24
#define IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_SID
Definition: sid.h:102
#define TFM_ATTEST_GET_TOKEN_SIZE_SID
Definition: sid.h:54
const struct spm_partition_static_data_t static_data_list[]
#define TFM_SP_IPC_SERVICE_TEST
Definition: pid.h:26
#define TFM_SP_PS
Definition: pid.h:17
#define TFM_ITS_GET_INFO_SID
Definition: sid.h:34
psa_status_t tfm_its_req_mngr_init(void)
psa_status_t attest_partition_init(void)
psa_status_t core_test_init(void)
#define SPM_PART_FLAG_PSA_ROT
Definition: spm_func.h:36
void ipc_service_test_main(void *param)
#define TFM_SP_PS_TEST
Definition: pid.h:29
#define TFM_ITS_SET_SID
Definition: sid.h:30
#define SPM_PART_FLAG_APP_ROT
Definition: spm_func.h:35
#define TFM_SP_IPC_CLIENT_TEST
Definition: pid.h:27
struct spm_partition_db_t g_spm_partition_db
#define TFM_PS_GET_SID
Definition: sid.h:20
#define TFM_SECURE_CLIENT_2_SID
Definition: sid.h:134
enum tfm_platform_err_t platform_sp_init(void)
Initializes the secure partition.
Definition: platform_sp.c:340
#define SPM_CORE_TEST_2_SLAVE_SERVICE_SID
Definition: sid.h:82
psa_status_t tfm_secure_client_2_init(void)
#define SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID
Definition: sid.h:86
#define TFM_SP_AUDIT_LOG
Definition: pid.h:19
#define TFM_SP_CORE_ID
#define TFM_PS_GET_INFO_SID
Definition: sid.h:22
psa_status_t audit_core_init(void)
Initializes the Audit logging service during the TFM boot up process.
Definition: audit_core.c:465
#define TFM_SP_SECURE_TEST_PARTITION
Definition: pid.h:25
#define IPC_SERVICE_TEST_BASIC_SID
Definition: sid.h:100
#define TFM_PS_TEST_PREPARE_SID
Definition: sid.h:130
#define SPM_PART_FLAG_IPC
Definition: spm_func.h:37
#define TFM_SP_NON_SECURE_ID
#define TFM_ATTEST_GET_PUBLIC_KEY_SID
Definition: sid.h:56
#define TFM_ATTEST_GET_TOKEN_SID
Definition: sid.h:52
uint32_t is_init
Definition: spm_func.h:126
#define TFM_SP_PLATFORM_SYSTEM_RESET_SID
Definition: sid.h:44
psa_status_t core_test_2_init(void)
#define TFM_SP_CRYPTO
Definition: pid.h:20
uint32_t * ctx_stack_list[]
#define TFM_SP_PLATFORM_NV_COUNTER_SID
Definition: sid.h:48
void ipc_client_test_main(void)
#define TFM_IRQ_TEST_1
Definition: pid.h:28