Miklos Balint | 386b8b5 | 2017-11-29 13:12:32 +0000 | [diff] [blame] | 1 | /* |
Mate Toth-Pal | 65291f3 | 2018-02-23 14:35:22 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, Arm Limited. All rights reserved. |
Miklos Balint | 386b8b5 | 2017-11-29 13:12:32 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
Mate Toth-Pal | 52674ab | 2018-02-26 09:47:56 +0100 | [diff] [blame] | 8 | #ifndef __SPM_DB_H__ |
| 9 | #define __SPM_DB_H__ |
Miklos Balint | 386b8b5 | 2017-11-29 13:12:32 +0000 | [diff] [blame] | 10 | |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 11 | typedef int32_t(*sp_init_function)(void); |
Miklos Balint | 386b8b5 | 2017-11-29 13:12:32 +0000 | [diff] [blame] | 12 | |
Mate Toth-Pal | e147533 | 2018-04-09 17:28:49 +0200 | [diff] [blame^] | 13 | /** |
| 14 | * Holds the fields of the partition DB used by the SPM code. The values of |
| 15 | * these fields are calculated at compile time, and set during initialisation |
| 16 | * phase. |
| 17 | */ |
Mate Toth-Pal | 18b8392 | 2018-02-26 17:58:18 +0100 | [diff] [blame] | 18 | struct spm_partition_static_data_t { |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 19 | uint32_t partition_id; |
Mate Toth-Pal | 5939871 | 2018-02-28 17:06:40 +0100 | [diff] [blame] | 20 | uint32_t partition_flags; |
Mate Toth-Pal | 18b8392 | 2018-02-26 17:58:18 +0100 | [diff] [blame] | 21 | #if TFM_LVL != 1 |
Miklos Balint | 386b8b5 | 2017-11-29 13:12:32 +0000 | [diff] [blame] | 22 | uint32_t code_start; |
| 23 | uint32_t code_limit; |
| 24 | uint32_t ro_start; |
| 25 | uint32_t ro_limit; |
| 26 | uint32_t rw_start; |
| 27 | uint32_t rw_limit; |
| 28 | uint32_t zi_start; |
| 29 | uint32_t zi_limit; |
| 30 | uint32_t stack_bottom; |
| 31 | uint32_t stack_top; |
Mate Toth-Pal | 18b8392 | 2018-02-26 17:58:18 +0100 | [diff] [blame] | 32 | #endif |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 33 | sp_init_function partition_init; |
Miklos Balint | 386b8b5 | 2017-11-29 13:12:32 +0000 | [diff] [blame] | 34 | }; |
Mate Toth-Pal | 18b8392 | 2018-02-26 17:58:18 +0100 | [diff] [blame] | 35 | |
Mate Toth-Pal | e147533 | 2018-04-09 17:28:49 +0200 | [diff] [blame^] | 36 | /** |
| 37 | * Holds the fields that define a partition for SPM. The fields are further |
| 38 | * divided to structures, to keep the related fields close to each other. |
| 39 | */ |
| 40 | struct tfm_spm_partition_desc_t { |
Mate Toth-Pal | 18b8392 | 2018-02-26 17:58:18 +0100 | [diff] [blame] | 41 | struct spm_partition_static_data_t static_data; |
| 42 | struct spm_partition_runtime_data_t runtime_data; |
Mate Toth-Pal | e147533 | 2018-04-09 17:28:49 +0200 | [diff] [blame^] | 43 | struct tfm_spm_partition_platform_data_t platform_data; |
Mate Toth-Pal | 18b8392 | 2018-02-26 17:58:18 +0100 | [diff] [blame] | 44 | }; |
Miklos Balint | 386b8b5 | 2017-11-29 13:12:32 +0000 | [diff] [blame] | 45 | |
Mate Toth-Pal | 52674ab | 2018-02-26 09:47:56 +0100 | [diff] [blame] | 46 | #endif /* __SPM_DB_H__ */ |