Yatharth Kochar | a5f77d3 | 2016-07-04 11:26:14 +0100 | [diff] [blame] | 1 | /* |
Zelalem | 87675d4 | 2020-02-03 14:56:42 -0600 | [diff] [blame] | 2 | * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved. |
Yatharth Kochar | a5f77d3 | 2016-07-04 11:26:14 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Yatharth Kochar | a5f77d3 | 2016-07-04 11:26:14 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Yatharth Kochar | a5f77d3 | 2016-07-04 11:26:14 +0100 | [diff] [blame] | 7 | #include <platform_def.h> |
| 8 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <common/bl_common.h> |
| 10 | #include <common/desc_image_load.h> |
Yatharth Kochar | a5f77d3 | 2016-07-04 11:26:14 +0100 | [diff] [blame] | 11 | |
| 12 | /******************************************************************************* |
| 13 | * Following descriptor provides BL image/ep information that gets used |
| 14 | * by BL2 to load the images and also subset of this information is |
| 15 | * passed to next BL image. The image loading sequence is managed by |
| 16 | * populating the images in required loading order. The image execution |
| 17 | * sequence is managed by populating the `next_handoff_image_id` with |
| 18 | * the next executable image id. |
| 19 | ******************************************************************************/ |
| 20 | static bl_mem_params_node_t bl2_mem_params_descs[] = { |
| 21 | #ifdef SCP_BL2_BASE |
| 22 | /* Fill SCP_BL2 related information if it exists */ |
| 23 | { |
| 24 | .image_id = SCP_BL2_IMAGE_ID, |
| 25 | |
| 26 | SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY, |
| 27 | VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE), |
| 28 | |
| 29 | SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY, |
| 30 | VERSION_2, image_info_t, 0), |
| 31 | .image_info.image_base = SCP_BL2_BASE, |
| 32 | .image_info.image_max_size = PLAT_CSS_MAX_SCP_BL2_SIZE, |
| 33 | |
| 34 | .next_handoff_image_id = INVALID_IMAGE_ID, |
| 35 | }, |
| 36 | #endif /* SCP_BL2_BASE */ |
| 37 | |
| 38 | /* Fill BL32 related information */ |
| 39 | { |
| 40 | .image_id = BL32_IMAGE_ID, |
| 41 | |
| 42 | SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, |
| 43 | VERSION_2, entry_point_info_t, |
| 44 | SECURE | EXECUTABLE | EP_FIRST_EXE), |
| 45 | .ep_info.pc = BL32_BASE, |
| 46 | .ep_info.spsr = SPSR_MODE32(MODE32_mon, SPSR_T_ARM, |
| 47 | SPSR_E_LITTLE, DISABLE_ALL_EXCEPTIONS), |
| 48 | |
| 49 | SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, |
| 50 | VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP), |
| 51 | .image_info.image_base = BL32_BASE, |
| 52 | .image_info.image_max_size = BL32_LIMIT - BL32_BASE, |
| 53 | |
| 54 | .next_handoff_image_id = BL33_IMAGE_ID, |
| 55 | }, |
Soby Mathew | 96a1c6b | 2018-01-15 14:45:33 +0000 | [diff] [blame] | 56 | /* Fill HW_CONFIG related information if it exists */ |
| 57 | { |
| 58 | .image_id = HW_CONFIG_ID, |
| 59 | SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY, |
| 60 | VERSION_2, entry_point_info_t, NON_SECURE | NON_EXECUTABLE), |
| 61 | SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY, |
| 62 | VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING), |
| 63 | .next_handoff_image_id = INVALID_IMAGE_ID, |
| 64 | }, |
Yatharth Kochar | a5f77d3 | 2016-07-04 11:26:14 +0100 | [diff] [blame] | 65 | /* Fill BL33 related information */ |
| 66 | { |
| 67 | .image_id = BL33_IMAGE_ID, |
| 68 | |
| 69 | SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, |
| 70 | VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE), |
| 71 | #ifdef PRELOADED_BL33_BASE |
| 72 | .ep_info.pc = PRELOADED_BL33_BASE, |
| 73 | |
| 74 | SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, |
| 75 | VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING), |
| 76 | #else |
Sandrine Bailleux | afa91db | 2019-01-31 15:01:32 +0100 | [diff] [blame] | 77 | .ep_info.pc = PLAT_ARM_NS_IMAGE_BASE, |
Yatharth Kochar | a5f77d3 | 2016-07-04 11:26:14 +0100 | [diff] [blame] | 78 | |
| 79 | SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, |
| 80 | VERSION_2, image_info_t, 0), |
Sandrine Bailleux | afa91db | 2019-01-31 15:01:32 +0100 | [diff] [blame] | 81 | .image_info.image_base = PLAT_ARM_NS_IMAGE_BASE, |
Sandrine Bailleux | e7509c8 | 2019-01-31 15:06:21 +0100 | [diff] [blame] | 82 | .image_info.image_max_size = ARM_DRAM1_BASE + ARM_DRAM1_SIZE |
| 83 | - PLAT_ARM_NS_IMAGE_BASE, |
Yatharth Kochar | a5f77d3 | 2016-07-04 11:26:14 +0100 | [diff] [blame] | 84 | #endif /* PRELOADED_BL33_BASE */ |
| 85 | |
| 86 | .next_handoff_image_id = INVALID_IMAGE_ID, |
| 87 | } |
| 88 | }; |
| 89 | |
| 90 | REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs) |