blob: f68f711be9e226720e7f2ca93799151ad24067c1 [file] [log] [blame]
Antonio Nino Diazc41f2062017-10-24 10:07:35 +01001/*
Joel Hutton5cc3bc82018-03-21 11:40:57 +00002 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
Antonio Nino Diazc41f2062017-10-24 10:07:35 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef __SECURE_PARTITION_H__
8#define __SECURE_PARTITION_H__
9
10#include <bl_common.h>
11#include <types.h>
12#include <utils_def.h>
13
Joel Hutton5cc3bc82018-03-21 11:40:57 +000014/* Import linker symbols */
15IMPORT_SYM(uintptr_t, __SP_IMAGE_XLAT_TABLES_START__, SP_IMAGE_XLAT_TABLES_START);
16IMPORT_SYM(uintptr_t, __SP_IMAGE_XLAT_TABLES_END__, SP_IMAGE_XLAT_TABLES_END);
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010017
18/* Definitions */
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010019#define SP_IMAGE_XLAT_TABLES_SIZE \
20 (SP_IMAGE_XLAT_TABLES_END - SP_IMAGE_XLAT_TABLES_START)
21
22/*
23 * Flags used by the secure_partition_mp_info structure to describe the
24 * characteristics of a cpu. Only a single flag is defined at the moment to
25 * indicate the primary cpu.
26 */
27#define MP_INFO_FLAG_PRIMARY_CPU U(0x00000001)
28
29/*
30 * This structure is used to provide information required to initialise a S-EL0
31 * partition.
32 */
33typedef struct secure_partition_mp_info {
Sughosh Ganu8539aa32017-12-11 19:03:19 +053034 uint64_t mpidr;
35 uint32_t linear_id;
36 uint32_t flags;
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010037} secure_partition_mp_info_t;
38
39typedef struct secure_partition_boot_info {
40 param_header_t h;
Sughosh Ganu8539aa32017-12-11 19:03:19 +053041 uint64_t sp_mem_base;
42 uint64_t sp_mem_limit;
43 uint64_t sp_image_base;
44 uint64_t sp_stack_base;
45 uint64_t sp_heap_base;
46 uint64_t sp_ns_comm_buf_base;
47 uint64_t sp_shared_buf_base;
48 uint64_t sp_image_size;
49 uint64_t sp_pcpu_stack_size;
50 uint64_t sp_heap_size;
51 uint64_t sp_ns_comm_buf_size;
52 uint64_t sp_shared_buf_size;
53 uint32_t num_sp_mem_regions;
54 uint32_t num_cpus;
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010055 secure_partition_mp_info_t *mp_info;
56} secure_partition_boot_info_t;
57
58/* Setup function for secure partitions context. */
59
60void secure_partition_setup(void);
61
62#endif /* __SECURE_PARTITION_H__ */