Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 1 | /* |
Joel Hutton | 5cc3bc8 | 2018-03-21 11:40:57 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 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 | |
Joel Hutton | 5cc3bc8 | 2018-03-21 11:40:57 +0000 | [diff] [blame] | 14 | /* Import linker symbols */ |
| 15 | IMPORT_SYM(uintptr_t, __SP_IMAGE_XLAT_TABLES_START__, SP_IMAGE_XLAT_TABLES_START); |
| 16 | IMPORT_SYM(uintptr_t, __SP_IMAGE_XLAT_TABLES_END__, SP_IMAGE_XLAT_TABLES_END); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 17 | |
| 18 | /* Definitions */ |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 19 | #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 | */ |
| 33 | typedef struct secure_partition_mp_info { |
Sughosh Ganu | 8539aa3 | 2017-12-11 19:03:19 +0530 | [diff] [blame] | 34 | uint64_t mpidr; |
| 35 | uint32_t linear_id; |
| 36 | uint32_t flags; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 37 | } secure_partition_mp_info_t; |
| 38 | |
| 39 | typedef struct secure_partition_boot_info { |
| 40 | param_header_t h; |
Sughosh Ganu | 8539aa3 | 2017-12-11 19:03:19 +0530 | [diff] [blame] | 41 | 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 Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 55 | secure_partition_mp_info_t *mp_info; |
| 56 | } secure_partition_boot_info_t; |
| 57 | |
| 58 | /* Setup function for secure partitions context. */ |
| 59 | |
| 60 | void secure_partition_setup(void); |
| 61 | |
| 62 | #endif /* __SECURE_PARTITION_H__ */ |