blob: 334f76107500227391efcbbfcbba9b5543a86962 [file] [log] [blame]
Antonio Nino Diazc41f2062017-10-24 10:07:35 +01001/*
2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3 *
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
14/* Linker symbols */
15extern uintptr_t __SP_IMAGE_XLAT_TABLES_START__;
16extern uintptr_t __SP_IMAGE_XLAT_TABLES_END__;
17
18/* Definitions */
19#define SP_IMAGE_XLAT_TABLES_START \
20 (uintptr_t)(&__SP_IMAGE_XLAT_TABLES_START__)
21#define SP_IMAGE_XLAT_TABLES_END \
22 (uintptr_t)(&__SP_IMAGE_XLAT_TABLES_END__)
23#define SP_IMAGE_XLAT_TABLES_SIZE \
24 (SP_IMAGE_XLAT_TABLES_END - SP_IMAGE_XLAT_TABLES_START)
25
26/*
27 * Flags used by the secure_partition_mp_info structure to describe the
28 * characteristics of a cpu. Only a single flag is defined at the moment to
29 * indicate the primary cpu.
30 */
31#define MP_INFO_FLAG_PRIMARY_CPU U(0x00000001)
32
33/*
34 * This structure is used to provide information required to initialise a S-EL0
35 * partition.
36 */
37typedef struct secure_partition_mp_info {
38 u_register_t mpidr;
39 unsigned int linear_id;
40 unsigned int flags;
41} secure_partition_mp_info_t;
42
43typedef struct secure_partition_boot_info {
44 param_header_t h;
45 uintptr_t sp_mem_base;
46 uintptr_t sp_mem_limit;
47 uintptr_t sp_image_base;
48 uintptr_t sp_stack_base;
49 uintptr_t sp_heap_base;
50 uintptr_t sp_ns_comm_buf_base;
51 uintptr_t sp_shared_buf_base;
52 size_t sp_image_size;
53 size_t sp_pcpu_stack_size;
54 size_t sp_heap_size;
55 size_t sp_ns_comm_buf_size;
56 size_t sp_shared_buf_size;
57 unsigned int num_sp_mem_regions;
58 unsigned int num_cpus;
59 secure_partition_mp_info_t *mp_info;
60} secure_partition_boot_info_t;
61
62/* Setup function for secure partitions context. */
63
64void secure_partition_setup(void);
65
66#endif /* __SECURE_PARTITION_H__ */