blob: 9bda02e4bbafea3bfca40509b63d541b9b6a25c0 [file] [log] [blame]
Victor Chong175dd8a2018-02-01 00:35:22 +09001/*
2 * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Victor Chong175dd8a2018-02-01 00:35:22 +09007#include <platform_def.h>
8
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00009#include <common/bl_common.h>
10#include <common/desc_image_load.h>
11#include <plat/common/platform.h>
Victor Chong175dd8a2018-02-01 00:35:22 +090012
13/*******************************************************************************
14 * Following descriptor provides BL image/ep information that gets used
15 * by BL2 to load the images and also subset of this information is
16 * passed to next BL image. The image loading sequence is managed by
17 * populating the images in required loading order. The image execution
18 * sequence is managed by populating the `next_handoff_image_id` with
19 * the next executable image id.
20 ******************************************************************************/
21static bl_mem_params_node_t bl2_mem_params_descs[] = {
22#ifdef SCP_BL2_BASE
23 /* Fill SCP_BL2 related information if it exists */
24 {
Jorge Troncoso890e02b2022-08-29 15:58:07 -070025 .image_id = SCP_BL2_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +090026
Jorge Troncoso890e02b2022-08-29 15:58:07 -070027 SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
28 VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE),
Victor Chong175dd8a2018-02-01 00:35:22 +090029
Jorge Troncoso890e02b2022-08-29 15:58:07 -070030 SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
31 VERSION_2, image_info_t, 0),
32 .image_info.image_base = SCP_BL2_BASE,
33 .image_info.image_max_size = SCP_BL2_SIZE,
Victor Chong175dd8a2018-02-01 00:35:22 +090034
Jorge Troncoso890e02b2022-08-29 15:58:07 -070035 .next_handoff_image_id = INVALID_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +090036 },
37#endif /* SCP_BL2_BASE */
38
39#ifdef EL3_PAYLOAD_BASE
40 /* Fill EL3 payload related information (BL31 is EL3 payload)*/
41 {
Jorge Troncoso890e02b2022-08-29 15:58:07 -070042 .image_id = BL31_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +090043
Jorge Troncoso890e02b2022-08-29 15:58:07 -070044 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
45 VERSION_2, entry_point_info_t,
46 SECURE | EXECUTABLE | EP_FIRST_EXE),
47 .ep_info.pc = EL3_PAYLOAD_BASE,
48 .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
49 DISABLE_ALL_EXCEPTIONS),
Victor Chong175dd8a2018-02-01 00:35:22 +090050
Jorge Troncoso890e02b2022-08-29 15:58:07 -070051 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
52 VERSION_2, image_info_t,
53 IMAGE_ATTRIB_PLAT_SETUP | IMAGE_ATTRIB_SKIP_LOADING),
Victor Chong175dd8a2018-02-01 00:35:22 +090054
Jorge Troncoso890e02b2022-08-29 15:58:07 -070055 .next_handoff_image_id = INVALID_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +090056 },
57
58#else /* EL3_PAYLOAD_BASE */
59
60 /* Fill BL31 related information */
61 {
Jorge Troncoso890e02b2022-08-29 15:58:07 -070062 .image_id = BL31_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +090063
Jorge Troncoso890e02b2022-08-29 15:58:07 -070064 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
65 VERSION_2, entry_point_info_t,
66 SECURE | EXECUTABLE | EP_FIRST_EXE),
67 .ep_info.pc = BL31_BASE,
68 .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
69 DISABLE_ALL_EXCEPTIONS),
Victor Chong175dd8a2018-02-01 00:35:22 +090070#if DEBUG
Jorge Troncoso890e02b2022-08-29 15:58:07 -070071 .ep_info.args.arg1 = POPLAR_BL31_PLAT_PARAM_VAL,
Victor Chong175dd8a2018-02-01 00:35:22 +090072#endif
73
Jorge Troncoso890e02b2022-08-29 15:58:07 -070074 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
75 VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
76 .image_info.image_base = BL31_BASE,
77 .image_info.image_max_size = BL31_LIMIT - BL31_BASE,
Victor Chong175dd8a2018-02-01 00:35:22 +090078
79# ifdef BL32_BASE
Jorge Troncoso890e02b2022-08-29 15:58:07 -070080 .next_handoff_image_id = BL32_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +090081# else
Jorge Troncoso890e02b2022-08-29 15:58:07 -070082 .next_handoff_image_id = BL33_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +090083# endif
84 },
85
86# ifdef BL32_BASE
87 /* Fill BL32 related information */
88 {
Jorge Troncoso890e02b2022-08-29 15:58:07 -070089 .image_id = BL32_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +090090
Jorge Troncoso890e02b2022-08-29 15:58:07 -070091 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
92 VERSION_2, entry_point_info_t, SECURE | EXECUTABLE),
93 .ep_info.pc = BL32_BASE,
Victor Chong175dd8a2018-02-01 00:35:22 +090094
Jorge Troncoso890e02b2022-08-29 15:58:07 -070095 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
96 VERSION_2, image_info_t, 0),
97 .image_info.image_base = BL32_BASE,
98 .image_info.image_max_size = BL32_LIMIT - BL32_BASE,
Victor Chong175dd8a2018-02-01 00:35:22 +090099
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700100 .next_handoff_image_id = BL33_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +0900101 },
Victor Chongaa033472018-02-01 00:35:39 +0900102
103 /*
104 * Fill BL32 external 1 related information.
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700105 * A typical use for extra1 image is with OP-TEE where it is the pager
106 * image.
Victor Chongaa033472018-02-01 00:35:39 +0900107 */
108 {
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700109 .image_id = BL32_EXTRA1_IMAGE_ID,
Victor Chongaa033472018-02-01 00:35:39 +0900110
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700111 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
112 VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE),
Victor Chongaa033472018-02-01 00:35:39 +0900113
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700114 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
115 VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
116 .image_info.image_base = BL32_BASE,
117 .image_info.image_max_size = BL32_LIMIT - BL32_BASE,
Victor Chongaa033472018-02-01 00:35:39 +0900118
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700119 .next_handoff_image_id = INVALID_IMAGE_ID,
Victor Chongaa033472018-02-01 00:35:39 +0900120 },
121
122 /*
123 * Fill BL32 external 2 related information.
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700124 * A typical use for extra2 image is with OP-TEE where it is the paged
125 * image.
Victor Chongaa033472018-02-01 00:35:39 +0900126 */
127 {
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700128 .image_id = BL32_EXTRA2_IMAGE_ID,
Victor Chongaa033472018-02-01 00:35:39 +0900129
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700130 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
131 VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE),
Victor Chongaa033472018-02-01 00:35:39 +0900132
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700133 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
134 VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
Victor Chongaa033472018-02-01 00:35:39 +0900135#ifdef SPD_opteed
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700136 .image_info.image_base = POPLAR_OPTEE_PAGEABLE_LOAD_BASE,
137 .image_info.image_max_size = POPLAR_OPTEE_PAGEABLE_LOAD_SIZE,
Victor Chongaa033472018-02-01 00:35:39 +0900138#endif
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700139 .next_handoff_image_id = INVALID_IMAGE_ID,
Victor Chongaa033472018-02-01 00:35:39 +0900140 },
Victor Chong175dd8a2018-02-01 00:35:22 +0900141# endif /* BL32_BASE */
142
143 /* Fill BL33 related information */
144 {
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700145 .image_id = BL33_IMAGE_ID,
146 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
147 VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE),
Victor Chong175dd8a2018-02-01 00:35:22 +0900148# ifdef PRELOADED_BL33_BASE
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700149 .ep_info.pc = PRELOADED_BL33_BASE,
Victor Chong175dd8a2018-02-01 00:35:22 +0900150
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700151 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
152 VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
Victor Chong175dd8a2018-02-01 00:35:22 +0900153# else
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700154 .ep_info.pc = PLAT_POPLAR_NS_IMAGE_OFFSET,
Victor Chong175dd8a2018-02-01 00:35:22 +0900155
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700156 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
157 VERSION_2, image_info_t, 0),
158 .image_info.image_base = PLAT_POPLAR_NS_IMAGE_OFFSET,
159 .image_info.image_max_size = DDR_BASE + DDR_SIZE -
Victor Chong175dd8a2018-02-01 00:35:22 +0900160 PLAT_POPLAR_NS_IMAGE_OFFSET,
161# endif /* PRELOADED_BL33_BASE */
162
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700163 .next_handoff_image_id = INVALID_IMAGE_ID,
Victor Chong175dd8a2018-02-01 00:35:22 +0900164 }
165#endif /* EL3_PAYLOAD_BASE */
166};
167
168REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)