xref: /rk3399_ARM-atf/plat/arm/board/automotive_rd/platform/rd1ae/rd1ae_bl2_mem_params_desc.c (revision 3df50a069918c5b3f33c5dda683c0809619fc911)
1 /*
2  * Copyright (c) 2024, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <common/bl_common.h>
8 #include <common/desc_image_load.h>
9 #include <platform_def.h>
10 
11 /*******************************************************************************
12  * Following descriptor provides BL image/ep information that gets used
13  * by BL2 to load the images and also subset of this information is
14  * passed to next BL image. The image loading sequence is managed by
15  * populating the images in required loading order. The image execution
16  * sequence is managed by populating the `next_handoff_image_id` with
17  * the next executable image id.
18  ******************************************************************************/
19 static bl_mem_params_node_t bl2_mem_params_descs[] = {
20 	/* Fill BL31 related information */
21 	{
22 		.image_id = BL31_IMAGE_ID,
23 
24 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
25 			VERSION_2, entry_point_info_t,
26 			SECURE | EXECUTABLE | EP_FIRST_EXE),
27 		.ep_info.pc = BL31_BASE,
28 		.ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
29 			DISABLE_ALL_EXCEPTIONS),
30 #if DEBUG
31 		.ep_info.args.arg3 = ARM_BL31_PLAT_PARAM_VAL,
32 #endif
33 
34 		SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
35 			VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
36 		.image_info.image_base = BL31_BASE,
37 		.image_info.image_max_size = BL31_LIMIT - BL31_BASE,
38 
39 		.next_handoff_image_id = BL32_IMAGE_ID,
40 	},
41 	/* Fill HW_CONFIG related information */
42 	{
43 		.image_id = HW_CONFIG_ID,
44 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
45 			VERSION_2, entry_point_info_t,
46 			NON_SECURE | NON_EXECUTABLE),
47 		SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
48 			VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
49 		.next_handoff_image_id = INVALID_IMAGE_ID,
50 	},
51 	/* Fill BL32 related information */
52 	{
53 		.image_id = BL32_IMAGE_ID,
54 
55 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
56 			VERSION_2, entry_point_info_t, SECURE | EXECUTABLE),
57 		.ep_info.pc = BL32_BASE,
58 
59 		SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
60 			VERSION_2, image_info_t, 0),
61 		.image_info.image_base = BL32_BASE,
62 		.image_info.image_max_size = BL32_LIMIT - BL32_BASE,
63 
64 		.next_handoff_image_id = BL33_IMAGE_ID,
65 	},
66 	/* Fill TOS_FW_CONFIG related information */
67 	{
68 		.image_id = TOS_FW_CONFIG_ID,
69 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
70 			VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE),
71 		SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
72 			VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
73 		.next_handoff_image_id = INVALID_IMAGE_ID,
74 	},
75 	/* Fill BL33 related information */
76 	{
77 		.image_id = BL33_IMAGE_ID,
78 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
79 			VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE),
80 		.ep_info.pc = PLAT_ARM_NS_IMAGE_BASE,
81 
82 		SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
83 			VERSION_2, image_info_t, 0),
84 		.image_info.image_base = PLAT_ARM_NS_IMAGE_BASE,
85 		.image_info.image_max_size = ARM_DRAM1_BASE + ARM_DRAM1_SIZE
86 			- PLAT_ARM_NS_IMAGE_BASE,
87 		.next_handoff_image_id = INVALID_IMAGE_ID,
88 	},
89 };
90 
91 REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)
92