1 /*
2  * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <platform_def.h>
8 
9 #include <common/bl_common.h>
10 #include <common/desc_image_load.h>
11 #include <plat/common/platform.h>
12 
13 static bl_mem_params_node_t bl2_mem_params_descs[] = {
14 	{
15 		.image_id = BL32_IMAGE_ID,
16 
17 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
18 				      entry_point_info_t,
19 				      SECURE | EXECUTABLE | EP_FIRST_EXE),
20 		.ep_info.pc = BL32_BASE,
21 
22 		SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
23 				      image_info_t, 0),
24 
25 		.image_info.image_base = IMX7_OPTEE_BASE,
26 		.image_info.image_max_size = IMX7_OPTEE_SIZE,
27 
28 		.next_handoff_image_id = BL33_IMAGE_ID,
29 	},
30 	{
31 		.image_id = BL32_EXTRA1_IMAGE_ID,
32 
33 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
34 				      entry_point_info_t,
35 				      SECURE | NON_EXECUTABLE),
36 
37 		SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
38 				      image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
39 		.image_info.image_base = IMX7_OPTEE_BASE,
40 		.image_info.image_max_size = IMX7_OPTEE_SIZE,
41 
42 		.next_handoff_image_id = INVALID_IMAGE_ID,
43 	},
44 	{
45 		/* This is a zero sized image so we don't set base or size */
46 		.image_id = BL32_EXTRA2_IMAGE_ID,
47 
48 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
49 				      VERSION_2, entry_point_info_t,
50 				      SECURE | NON_EXECUTABLE),
51 
52 		SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
53 				      VERSION_2, image_info_t,
54 				      IMAGE_ATTRIB_SKIP_LOADING),
55 		.next_handoff_image_id = INVALID_IMAGE_ID,
56 	},
57 	{
58 		.image_id = BL33_IMAGE_ID,
59 		SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
60 				      entry_point_info_t,
61 				      NON_SECURE | EXECUTABLE),
62 		# ifdef PRELOADED_BL33_BASE
63 			.ep_info.pc = PRELOADED_BL33_BASE,
64 
65 			SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
66 					      VERSION_2, image_info_t,
67 					      IMAGE_ATTRIB_SKIP_LOADING),
68 		# else
69 			.ep_info.pc = BL33_BASE,
70 
71 			SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
72 					      VERSION_2, image_info_t, 0),
73 			.image_info.image_base = IMX7_UBOOT_BASE,
74 			.image_info.image_max_size = IMX7_UBOOT_SIZE,
75 		# endif /* PRELOADED_BL33_BASE */
76 
77 		.next_handoff_image_id = INVALID_IMAGE_ID,
78 	}
79 };
80 
81 REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs);
82