blob: a5c327990f6a4f05e8d8dec767333f99478dbaa4 [file] [log] [blame]
Hadi Asyrafi616da772019-06-27 11:34:03 +08001/*
2 * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <common/desc_image_load.h>
8
9/*******************************************************************************
10 * This function flushes the data structures so that they are visible
11 * in memory for the next BL image.
12 ******************************************************************************/
13void plat_flush_next_bl_params(void)
14{
15 flush_bl_params_desc();
16}
17
18/*******************************************************************************
19 * This function returns the list of loadable images.
20 ******************************************************************************/
21bl_load_info_t *plat_get_bl_image_load_info(void)
22{
23 return get_bl_load_info_from_mem_params_desc();
24}
25
26/*******************************************************************************
27 * This function returns the list of executable images.
28 ******************************************************************************/
29bl_params_t *plat_get_next_bl_params(void)
30{
Hadi Asyrafi5fae68f2019-10-22 14:23:57 +080031 unsigned int count;
32 unsigned int img_id = 0U;
33 unsigned int link_index = 0U;
34 bl_params_node_t *bl_exec_node = NULL;
35 bl_mem_params_node_t *desc_ptr;
36
37 /* If there is no image to start with, return NULL */
38 if (bl_mem_params_desc_num == 0U)
39 return NULL;
40
41 /* Clean next_params_info in BL image node */
42 for (count = 0U; count < bl_mem_params_desc_num; count++) {
43
44 desc_ptr = &bl_mem_params_desc_ptr[link_index];
45 bl_exec_node = &desc_ptr->params_node_mem;
46 bl_exec_node->next_params_info = NULL;
47
48 /* If no next hand-off image then break out */
49 img_id = desc_ptr->next_handoff_image_id;
50 if (img_id == INVALID_IMAGE_ID)
51 break;
52
53 /* Get the index for the next hand-off image */
54 link_index = get_bl_params_node_index(img_id);
55 }
56
Hadi Asyrafi616da772019-06-27 11:34:03 +080057 return get_next_bl_params_from_mem_params_desc();
58}