Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 1 | /* |
| 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 */ |
| 15 | extern uintptr_t __SP_IMAGE_XLAT_TABLES_START__; |
| 16 | extern 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 | */ |
| 37 | typedef struct secure_partition_mp_info { |
Sughosh Ganu | 8539aa3 | 2017-12-11 19:03:19 +0530 | [diff] [blame] | 38 | uint64_t mpidr; |
| 39 | uint32_t linear_id; |
| 40 | uint32_t flags; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 41 | } secure_partition_mp_info_t; |
| 42 | |
| 43 | typedef struct secure_partition_boot_info { |
| 44 | param_header_t h; |
Sughosh Ganu | 8539aa3 | 2017-12-11 19:03:19 +0530 | [diff] [blame] | 45 | uint64_t sp_mem_base; |
| 46 | uint64_t sp_mem_limit; |
| 47 | uint64_t sp_image_base; |
| 48 | uint64_t sp_stack_base; |
| 49 | uint64_t sp_heap_base; |
| 50 | uint64_t sp_ns_comm_buf_base; |
| 51 | uint64_t sp_shared_buf_base; |
| 52 | uint64_t sp_image_size; |
| 53 | uint64_t sp_pcpu_stack_size; |
| 54 | uint64_t sp_heap_size; |
| 55 | uint64_t sp_ns_comm_buf_size; |
| 56 | uint64_t sp_shared_buf_size; |
| 57 | uint32_t num_sp_mem_regions; |
| 58 | uint32_t num_cpus; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 59 | secure_partition_mp_info_t *mp_info; |
| 60 | } secure_partition_boot_info_t; |
| 61 | |
| 62 | /* Setup function for secure partitions context. */ |
| 63 | |
| 64 | void secure_partition_setup(void); |
| 65 | |
| 66 | #endif /* __SECURE_PARTITION_H__ */ |