blob: 1ed2b15de5bb397f72ae28a466eba6b09531bf14 [file] [log] [blame]
Yatharth Kochar3345a8d2016-09-12 16:08:41 +01001/*
Roberto Vargas2ca18d92018-02-12 12:36:17 +00002 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
Yatharth Kochar3345a8d2016-09-12 16:08:41 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Yatharth Kochar3345a8d2016-09-12 16:08:41 +01005 */
6#ifndef __DESC_IMAGE_LOAD_H__
7#define __DESC_IMAGE_LOAD_H__
8
9#include <bl_common.h>
10
Yatharth Kochar3345a8d2016-09-12 16:08:41 +010011/* Following structure is used to store BL ep/image info. */
12typedef struct bl_mem_params_node {
13 unsigned int image_id;
14 image_info_t image_info;
15 entry_point_info_t ep_info;
16 unsigned int next_handoff_image_id;
17 bl_load_info_node_t load_node_mem;
18 bl_params_node_t params_node_mem;
19} bl_mem_params_node_t;
20
Roberto Vargas2ca18d92018-02-12 12:36:17 +000021extern bl_mem_params_node_t *bl_mem_params_desc_ptr;
22extern unsigned int bl_mem_params_desc_num;
23
Yatharth Kochar3345a8d2016-09-12 16:08:41 +010024/*
25 * Macro to register list of BL image descriptors,
26 * defined as an array of bl_mem_params_node_t.
27 */
28#define REGISTER_BL_IMAGE_DESCS(_img_desc) \
29 bl_mem_params_node_t *bl_mem_params_desc_ptr = &_img_desc[0]; \
30 unsigned int bl_mem_params_desc_num = ARRAY_SIZE(_img_desc);
31
32/* BL image loading utility functions */
33void flush_bl_params_desc(void);
34int get_bl_params_node_index(unsigned int image_id);
35bl_mem_params_node_t *get_bl_mem_params_node(unsigned int image_id);
36bl_load_info_t *get_bl_load_info_from_mem_params_desc(void);
37bl_params_t *get_next_bl_params_from_mem_params_desc(void);
Soby Mathew96a1c6b2018-01-15 14:45:33 +000038void populate_next_bl_params_config(bl_params_t *bl2_to_next_bl_params);
Yatharth Kochar3345a8d2016-09-12 16:08:41 +010039
Yatharth Kochar3345a8d2016-09-12 16:08:41 +010040#endif /* __DESC_IMAGE_LOAD_H__ */