xref: /rk3399_ARM-atf/plat/st/stm32mp2/plat_bl2_mem_params_desc.c (revision 79629b1a79bd1ee254077d4e76fea05ba73b9bab)
1 /*
2  * Copyright (c) 2023-2024, STMicroelectronics - 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 <plat/common/platform.h>
10 
11 #include <platform_def.h>
12 
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  ******************************************************************************/
21 static bl_mem_params_node_t bl2_mem_params_descs[] = {
22 #if STM32MP_DDR_FIP_IO_STORAGE
23 	/* Fill FW_DDR related information if it exists */
24 	{
25 		.image_id = DDR_FW_ID,
26 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
27 				      VERSION_2, entry_point_info_t,
28 				      SECURE | NON_EXECUTABLE),
29 		SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
30 				      VERSION_2, image_info_t,
31 				      0),
32 
33 		.image_info.image_base = STM32MP_DDR_FW_BASE,
34 		.image_info.image_max_size = STM32MP_DDR_FW_MAX_SIZE,
35 
36 		.next_handoff_image_id = INVALID_IMAGE_ID,
37 	},
38 #endif
39 
40 	/* Fill FW_CONFIG related information if it exists */
41 	{
42 		.image_id = FW_CONFIG_ID,
43 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
44 				      VERSION_2, entry_point_info_t,
45 				      SECURE | NON_EXECUTABLE),
46 		SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
47 				      VERSION_2, image_info_t,
48 				      IMAGE_ATTRIB_PLAT_SETUP),
49 
50 		.image_info.image_base = STM32MP_FW_CONFIG_BASE,
51 		.image_info.image_max_size = STM32MP_FW_CONFIG_MAX_SIZE,
52 
53 		.next_handoff_image_id = INVALID_IMAGE_ID,
54 	},
55 
56 	/* Fill BL31 related information */
57 	{
58 		.image_id = BL31_IMAGE_ID,
59 
60 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
61 				      VERSION_2, entry_point_info_t,
62 				      SECURE | EXECUTABLE | EP_FIRST_EXE),
63 
64 		.ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS),
65 
66 		SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
67 				      VERSION_2, image_info_t,
68 				      IMAGE_ATTRIB_SKIP_LOADING),
69 
70 		.next_handoff_image_id = INVALID_IMAGE_ID,
71 	},
72 };
73 
74 REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)
75