blob: e42785a973f7698a72391834bb4d5f2c835643d3 [file] [log] [blame]
Victor Chong2d9a42d2017-08-17 15:21:10 +09001/*
Lukas Hanel8a4de612022-03-01 14:18:22 +01002 * Copyright (c) 2016-2022, ARM Limited and Contributors. All rights reserved.
Victor Chong2d9a42d2017-08-17 15:21:10 +09003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Victor Chong2d9a42d2017-08-17 15:21:10 +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 Chong2d9a42d2017-08-17 15:21:10 +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 */
Jorge Troncoso890e02b2022-08-29 15:58:07 -070024 {
25 .image_id = SCP_BL2_IMAGE_ID,
Victor Chong2d9a42d2017-08-17 15:21:10 +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 Chong2d9a42d2017-08-17 15:21:10 +090029
Jorge Troncoso890e02b2022-08-29 15:58:07 -070030 SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
31 VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
32 .image_info.image_base = SCP_BL2_BASE,
33 .image_info.image_max_size = SCP_BL2_SIZE,
Victor Chong2d9a42d2017-08-17 15:21:10 +090034
Jorge Troncoso890e02b2022-08-29 15:58:07 -070035 .next_handoff_image_id = INVALID_IMAGE_ID,
36 },
Victor Chong2d9a42d2017-08-17 15:21:10 +090037#endif /* SCP_BL2_BASE */
38
39#ifdef EL3_PAYLOAD_BASE
40 /* Fill EL3 payload related information (BL31 is EL3 payload)*/
Jorge Troncoso890e02b2022-08-29 15:58:07 -070041 {
42 .image_id = BL31_IMAGE_ID,
Victor Chong2d9a42d2017-08-17 15:21:10 +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 Chong2d9a42d2017-08-17 15:21:10 +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 Chong2d9a42d2017-08-17 15:21:10 +090054
Jorge Troncoso890e02b2022-08-29 15:58:07 -070055 .next_handoff_image_id = INVALID_IMAGE_ID,
56 },
Victor Chong2d9a42d2017-08-17 15:21:10 +090057
58#else /* EL3_PAYLOAD_BASE */
59
60 /* Fill BL31 related information */
Jorge Troncoso890e02b2022-08-29 15:58:07 -070061 {
62 .image_id = BL31_IMAGE_ID,
Victor Chong2d9a42d2017-08-17 15:21:10 +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 Chong2d9a42d2017-08-17 15:21:10 +090070#if DEBUG
Jorge Troncoso890e02b2022-08-29 15:58:07 -070071 .ep_info.args.arg1 = HIKEY960_BL31_PLAT_PARAM_VAL,
Victor Chong2d9a42d2017-08-17 15:21:10 +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 Chong2d9a42d2017-08-17 15:21:10 +090078
79# ifdef BL32_BASE
Jorge Troncoso890e02b2022-08-29 15:58:07 -070080 .next_handoff_image_id = BL32_IMAGE_ID,
Victor Chong2d9a42d2017-08-17 15:21:10 +090081# else
Jorge Troncoso890e02b2022-08-29 15:58:07 -070082 .next_handoff_image_id = BL33_IMAGE_ID,
Victor Chong2d9a42d2017-08-17 15:21:10 +090083# endif
Jorge Troncoso890e02b2022-08-29 15:58:07 -070084 },
Victor Chong2d9a42d2017-08-17 15:21:10 +090085
86# ifdef BL32_BASE
87 /* Fill BL32 related information */
Jorge Troncoso890e02b2022-08-29 15:58:07 -070088 {
89 .image_id = BL32_IMAGE_ID,
Victor Chong2d9a42d2017-08-17 15:21:10 +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 Chong2d9a42d2017-08-17 15:21:10 +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 Chong2d9a42d2017-08-17 15:21:10 +090099
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700100 .next_handoff_image_id = BL33_IMAGE_ID,
101 },
Victor Chong7d787f52017-08-16 13:53:56 +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 Chong7d787f52017-08-16 13:53:56 +0900107 */
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700108 {
109 .image_id = BL32_EXTRA1_IMAGE_ID,
Victor Chong7d787f52017-08-16 13:53:56 +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 Chong7d787f52017-08-16 13:53:56 +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 Chong7d787f52017-08-16 13:53:56 +0900118
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700119 .next_handoff_image_id = INVALID_IMAGE_ID,
120 },
Victor Chong7d787f52017-08-16 13:53:56 +0900121
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 Chong7d787f52017-08-16 13:53:56 +0900126 */
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700127 {
128 .image_id = BL32_EXTRA2_IMAGE_ID,
Victor Chong7d787f52017-08-16 13:53:56 +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 Chong7d787f52017-08-16 13:53:56 +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 Chong7d787f52017-08-16 13:53:56 +0900135#ifdef SPD_opteed
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700136 .image_info.image_base = HIKEY960_OPTEE_PAGEABLE_LOAD_BASE,
137 .image_info.image_max_size = HIKEY960_OPTEE_PAGEABLE_LOAD_SIZE,
Victor Chong7d787f52017-08-16 13:53:56 +0900138#endif
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700139 .next_handoff_image_id = INVALID_IMAGE_ID,
140 },
Lukas Hanel8a4de612022-03-01 14:18:22 +0100141
142#ifdef SPD_spmd
143 /* Fill TOS_FW_CONFIG related information */
144 {
145 .image_id = TOS_FW_CONFIG_ID,
146 SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
147 VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE),
148 SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
149 VERSION_2, image_info_t, 0),
150 .image_info.image_base = DDR_SEC_CONFIG_BASE,
151 .image_info.image_max_size = DDR_SEC_CONFIG_SIZE,
152
153 .next_handoff_image_id = INVALID_IMAGE_ID,
154 },
155#endif
156
Victor Chong2d9a42d2017-08-17 15:21:10 +0900157# endif /* BL32_BASE */
158
159 /* Fill BL33 related information */
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700160 {
161 .image_id = BL33_IMAGE_ID,
162 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
163 VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE),
Victor Chong2d9a42d2017-08-17 15:21:10 +0900164# ifdef PRELOADED_BL33_BASE
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700165 .ep_info.pc = PRELOADED_BL33_BASE,
Victor Chong2d9a42d2017-08-17 15:21:10 +0900166
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700167 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
168 VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
Victor Chong2d9a42d2017-08-17 15:21:10 +0900169# else
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700170 .ep_info.pc = NS_BL1U_BASE,
Victor Chong2d9a42d2017-08-17 15:21:10 +0900171
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700172 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
173 VERSION_2, image_info_t, 0),
174 .image_info.image_base = NS_BL1U_BASE,
175 .image_info.image_max_size = 0x200000 /* 2MB */,
Victor Chong2d9a42d2017-08-17 15:21:10 +0900176# endif /* PRELOADED_BL33_BASE */
177
Jorge Troncoso890e02b2022-08-29 15:58:07 -0700178 .next_handoff_image_id = INVALID_IMAGE_ID,
179 }
Victor Chong2d9a42d2017-08-17 15:21:10 +0900180#endif /* EL3_PAYLOAD_BASE */
181};
182
183REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)