2 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
8 #include <desc_image_load.h>
9 #include <marvell_def.h>
11 #include <platform_def.h>
14 /*******************************************************************************
15 * Following descriptor provides BL image/ep information that gets used
16 * by BL2 to load the images and also subset of this information is
17 * passed to next BL image. The image loading sequence is managed by
18 * populating the images in required loading order. The image execution
19 * sequence is managed by populating the `next_handoff_image_id` with
20 * the next executable image id.
21 ******************************************************************************/
22 static bl_mem_params_node_t bl2_mem_params_descs
[] = {
24 /* Fill SCP_BL2 related information if it exists */
26 .image_id
= SCP_BL2_IMAGE_ID
,
28 SET_STATIC_PARAM_HEAD(ep_info
, PARAM_IMAGE_BINARY
,
29 VERSION_2
, entry_point_info_t
, SECURE
| NON_EXECUTABLE
),
31 SET_STATIC_PARAM_HEAD(image_info
, PARAM_IMAGE_BINARY
,
32 VERSION_2
, image_info_t
, 0),
33 .image_info
.image_base
= SCP_BL2_BASE
,
34 .image_info
.image_max_size
= SCP_BL2_SIZE
,
36 .next_handoff_image_id
= INVALID_IMAGE_ID
,
38 #endif /* SCP_BL2_BASE */
40 #ifdef EL3_PAYLOAD_BASE
41 /* Fill EL3 payload related information (BL31 is EL3 payload)*/
43 .image_id
= BL31_IMAGE_ID
,
45 SET_STATIC_PARAM_HEAD(ep_info
, PARAM_EP
,
46 VERSION_2
, entry_point_info_t
,
47 SECURE
| EXECUTABLE
| EP_FIRST_EXE
),
48 .ep_info
.pc
= EL3_PAYLOAD_BASE
,
49 .ep_info
.spsr
= SPSR_64(MODE_EL3
, MODE_SP_ELX
,
50 DISABLE_ALL_EXCEPTIONS
),
52 SET_STATIC_PARAM_HEAD(image_info
, PARAM_EP
,
53 VERSION_2
, image_info_t
,
54 IMAGE_ATTRIB_PLAT_SETUP
| IMAGE_ATTRIB_SKIP_LOADING
),
56 .next_handoff_image_id
= INVALID_IMAGE_ID
,
59 #else /* EL3_PAYLOAD_BASE */
61 /* Fill BL31 related information */
63 .image_id
= BL31_IMAGE_ID
,
65 SET_STATIC_PARAM_HEAD(ep_info
, PARAM_EP
,
66 VERSION_2
, entry_point_info_t
,
67 SECURE
| EXECUTABLE
| EP_FIRST_EXE
),
68 .ep_info
.pc
= BL31_BASE
,
69 .ep_info
.spsr
= SPSR_64(MODE_EL3
, MODE_SP_ELX
,
70 DISABLE_ALL_EXCEPTIONS
),
72 .ep_info
.args
.arg3
= MARVELL_BL31_PLAT_PARAM_VAL
,
75 SET_STATIC_PARAM_HEAD(image_info
, PARAM_EP
,
76 VERSION_2
, image_info_t
, IMAGE_ATTRIB_PLAT_SETUP
),
77 .image_info
.image_base
= BL31_BASE
,
78 .image_info
.image_max_size
= BL31_LIMIT
- BL31_BASE
,
81 .next_handoff_image_id
= BL32_IMAGE_ID
,
83 .next_handoff_image_id
= BL33_IMAGE_ID
,
88 /* Fill BL32 related information */
90 .image_id
= BL32_IMAGE_ID
,
92 SET_STATIC_PARAM_HEAD(ep_info
, PARAM_EP
,
93 VERSION_2
, entry_point_info_t
, SECURE
| EXECUTABLE
),
94 .ep_info
.pc
= BL32_BASE
,
96 SET_STATIC_PARAM_HEAD(image_info
, PARAM_EP
,
97 VERSION_2
, image_info_t
, 0),
98 .image_info
.image_base
= BL32_BASE
,
99 .image_info
.image_max_size
= BL32_LIMIT
- BL32_BASE
,
101 .next_handoff_image_id
= BL33_IMAGE_ID
,
103 # endif /* BL32_BASE */
105 /* Fill BL33 related information */
107 .image_id
= BL33_IMAGE_ID
,
108 SET_STATIC_PARAM_HEAD(ep_info
, PARAM_EP
,
109 VERSION_2
, entry_point_info_t
, NON_SECURE
| EXECUTABLE
),
110 # ifdef PRELOADED_BL33_BASE
111 .ep_info
.pc
= PRELOADED_BL33_BASE
,
113 SET_STATIC_PARAM_HEAD(image_info
, PARAM_EP
,
114 VERSION_2
, image_info_t
, IMAGE_ATTRIB_SKIP_LOADING
),
116 .ep_info
.pc
= MARVELL_DRAM_BASE
,
118 SET_STATIC_PARAM_HEAD(image_info
, PARAM_EP
,
119 VERSION_2
, image_info_t
, 0),
120 .image_info
.image_base
= MARVELL_DRAM_BASE
,
121 .image_info
.image_max_size
= MARVELL_DRAM_SIZE
,
122 # endif /* PRELOADED_BL33_BASE */
124 .next_handoff_image_id
= INVALID_IMAGE_ID
,
126 #endif /* EL3_PAYLOAD_BASE */
129 REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs
)