blob: a96e3901b23e4c019b87f081762a88ed5e7256f2 [file] [log] [blame]
Jiafei Pan46367ad2018-03-02 07:23:30 +00001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <bl_common.h>
8#include <desc_image_load.h>
9#include <platform.h>
10#include <platform_def.h>
11#include <debug.h>
12#include <ls_def.h>
13
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 EL3_PAYLOAD_BASE
24 /* Fill EL3 payload related information (BL31 is EL3 payload)*/
25 {
26 .image_id = BL31_IMAGE_ID,
27
28 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
29 VERSION_2, entry_point_info_t,
30 SECURE | EXECUTABLE | EP_FIRST_EXE),
31 .ep_info.pc = EL3_PAYLOAD_BASE,
32 .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
33 DISABLE_ALL_EXCEPTIONS),
34
35 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
36 VERSION_2, image_info_t,
37 IMAGE_ATTRIB_PLAT_SETUP |
38 IMAGE_ATTRIB_SKIP_LOADING),
39
40 .next_handoff_image_id = INVALID_IMAGE_ID,
41 },
42
43#else /* EL3_PAYLOAD_BASE */
44
45 /* Fill BL31 related information */
46 {
47 .image_id = BL31_IMAGE_ID,
48
49 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
50 VERSION_2, entry_point_info_t,
51 SECURE | EXECUTABLE | EP_FIRST_EXE),
52 .ep_info.pc = BL31_BASE,
53 .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
54 DISABLE_ALL_EXCEPTIONS),
55#if DEBUG
56 .ep_info.args.arg1 = LS_BL31_PLAT_PARAM_VAL,
57#endif
58
59 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
60 VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
61 .image_info.image_base = BL31_BASE,
62 .image_info.image_max_size = (BL31_LIMIT - BL31_BASE),
63
64# ifdef BL32_BASE
65 .next_handoff_image_id = BL32_IMAGE_ID,
66# else
67 .next_handoff_image_id = BL33_IMAGE_ID,
68# endif
69 },
70# ifdef BL32_BASE
71 /* Fill BL32 related information */
72 {
73 .image_id = BL32_IMAGE_ID,
74
75 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
76 VERSION_2, entry_point_info_t, SECURE | EXECUTABLE),
77 .ep_info.pc = BL32_BASE,
78
79 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
80 VERSION_2, image_info_t, 0),
81 .image_info.image_base = BL32_BASE,
82 .image_info.image_max_size = (BL32_LIMIT - BL32_BASE),
83
84 .next_handoff_image_id = BL33_IMAGE_ID,
85 },
86# endif /* BL32_BASE */
87
88 /* Fill BL33 related information */
89 {
90 .image_id = BL33_IMAGE_ID,
91 SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
92 VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE),
93# ifdef PRELOADED_BL33_BASE
94 .ep_info.pc = PRELOADED_BL33_BASE,
95
96 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
97 VERSION_2, image_info_t,
98 IMAGE_ATTRIB_SKIP_LOADING),
99# else
100 .ep_info.pc = BL33_BASE,
101
102 SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
103 VERSION_2, image_info_t, 0),
104 .image_info.image_base = BL33_BASE,
105 .image_info.image_max_size = LS_NS_DRAM_SIZE,
106# endif /* PRELOADED_BL33_BASE */
107
108 .next_handoff_image_id = INVALID_IMAGE_ID,
109 }
110#endif /* EL3_PAYLOAD_BASE */
111};
112
113REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)