blob: 6a8e11c90f9a4681ba4f4f1e3d0bc8faab4127f3 [file] [log] [blame]
Konstantin Porotchkind973c032018-10-02 17:45:15 +03001/*
2 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Konstantin Porotchkind973c032018-10-02 17:45:15 +03007#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 <marvell_def.h>
12#include <plat/common/platform.h>
Konstantin Porotchkind973c032018-10-02 17:45:15 +030013
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 ******************************************************************************/
22static bl_mem_params_node_t bl2_mem_params_descs[] = {
23#ifdef SCP_BL2_BASE
24 /* Fill SCP_BL2 related information if it exists */
25 {
26 .image_id = SCP_BL2_IMAGE_ID,
27
28 SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
29 VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE),
30
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,
35
36 .next_handoff_image_id = INVALID_IMAGE_ID,
37 },
38#endif /* SCP_BL2_BASE */
39
40#ifdef EL3_PAYLOAD_BASE
41 /* Fill EL3 payload related information (BL31 is EL3 payload)*/
42 {
43 .image_id = BL31_IMAGE_ID,
44
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),
51
52 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
53 VERSION_2, image_info_t,
54 IMAGE_ATTRIB_PLAT_SETUP | IMAGE_ATTRIB_SKIP_LOADING),
55
56 .next_handoff_image_id = INVALID_IMAGE_ID,
57 },
58
59#else /* EL3_PAYLOAD_BASE */
60
61 /* Fill BL31 related information */
62 {
63 .image_id = BL31_IMAGE_ID,
64
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),
71#if DEBUG
72 .ep_info.args.arg3 = MARVELL_BL31_PLAT_PARAM_VAL,
73#endif
74
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,
79
80# ifdef BL32_BASE
81 .next_handoff_image_id = BL32_IMAGE_ID,
82# else
83 .next_handoff_image_id = BL33_IMAGE_ID,
84# endif
85 },
86
87# ifdef BL32_BASE
88 /* Fill BL32 related information */
89 {
90 .image_id = BL32_IMAGE_ID,
91
92 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
93 VERSION_2, entry_point_info_t, SECURE | EXECUTABLE),
94 .ep_info.pc = BL32_BASE,
95
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,
100
101 .next_handoff_image_id = BL33_IMAGE_ID,
102 },
103# endif /* BL32_BASE */
104
105 /* Fill BL33 related information */
106 {
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,
112
113 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
114 VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
115# else
116 .ep_info.pc = MARVELL_DRAM_BASE,
117
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 */
123
124 .next_handoff_image_id = INVALID_IMAGE_ID,
125 }
126#endif /* EL3_PAYLOAD_BASE */
127};
128
129REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)