blob: d267f6d886bedce11d26facf4416b175014c5e61 [file] [log] [blame]
Miklos Balint386b8b52017-11-29 13:12:32 +00001/*
Mate Toth-Pal65291f32018-02-23 14:35:22 +01002 * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
Miklos Balint386b8b52017-11-29 13:12:32 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
Mate Toth-Pal52674ab2018-02-26 09:47:56 +01008#ifndef __SPM_DB_H__
9#define __SPM_DB_H__
Miklos Balint386b8b52017-11-29 13:12:32 +000010
Mate Toth-Pal349714a2018-02-23 15:30:24 +010011typedef int32_t(*sp_init_function)(void);
Miklos Balint386b8b52017-11-29 13:12:32 +000012
Mate Toth-Pale1475332018-04-09 17:28:49 +020013/**
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-Pal18b83922018-02-26 17:58:18 +010018struct spm_partition_static_data_t {
Mate Toth-Pal349714a2018-02-23 15:30:24 +010019 uint32_t partition_id;
Mate Toth-Pal59398712018-02-28 17:06:40 +010020 uint32_t partition_flags;
Mate Toth-Pal18b83922018-02-26 17:58:18 +010021#if TFM_LVL != 1
Miklos Balint386b8b52017-11-29 13:12:32 +000022 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-Pal18b83922018-02-26 17:58:18 +010032#endif
Mate Toth-Pal349714a2018-02-23 15:30:24 +010033 sp_init_function partition_init;
Miklos Balint386b8b52017-11-29 13:12:32 +000034};
Mate Toth-Pal18b83922018-02-26 17:58:18 +010035
Mate Toth-Pale1475332018-04-09 17:28:49 +020036/**
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 */
40struct tfm_spm_partition_desc_t {
Mate Toth-Pal18b83922018-02-26 17:58:18 +010041 struct spm_partition_static_data_t static_data;
42 struct spm_partition_runtime_data_t runtime_data;
Mate Toth-Pale1475332018-04-09 17:28:49 +020043 struct tfm_spm_partition_platform_data_t platform_data;
Mate Toth-Pal18b83922018-02-26 17:58:18 +010044};
Miklos Balint386b8b52017-11-29 13:12:32 +000045
Mate Toth-Pal52674ab2018-02-26 09:47:56 +010046#endif /* __SPM_DB_H__ */