1 /*
2  * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <assert.h>
8 #include <common/bl_common.h>
9 #include <common/desc_image_load.h>
10 #include <plat/common/platform.h>
11 
12 /*******************************************************************************
13  * This function flushes the data structures so that they are visible
14  * in memory for the next BL image.
15  ******************************************************************************/
plat_flush_next_bl_params(void)16 void plat_flush_next_bl_params(void)
17 {
18 	flush_bl_params_desc();
19 }
20 
21 /*******************************************************************************
22  * This function returns the list of loadable images.
23  ******************************************************************************/
plat_get_bl_image_load_info(void)24 bl_load_info_t *plat_get_bl_image_load_info(void)
25 {
26 	return get_bl_load_info_from_mem_params_desc();
27 }
28 
29 
30 /*******************************************************************************
31  * ARM helper function to return the list of executable images. Since the default
32  * descriptors are allocated within BL2 RW memory, this prevents BL31/BL32
33  * overlay of BL2 memory. Hence this function also copies the descriptors to a
34  * pre-allocated memory indicated by ARM_BL2_MEM_DESC_BASE.
35  ******************************************************************************/
hikey960_get_next_bl_params(void)36 struct bl_params *hikey960_get_next_bl_params(void)
37 {
38 	bl_params_t *next_bl_params;
39 
40 	next_bl_params = get_next_bl_params_from_mem_params_desc();
41 	assert(next_bl_params != NULL);
42 
43 	populate_next_bl_params_config(next_bl_params);
44 
45 	return next_bl_params;
46 }
47 
48 
49 /*******************************************************************************
50  * This function returns the list of executable images.
51  ******************************************************************************/
plat_get_next_bl_params(void)52 bl_params_t *plat_get_next_bl_params(void)
53 {
54 	return hikey960_get_next_bl_params();
55 }
56