Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 1 | /* |
Roberto Vargas | 2ca18d9 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 2 | * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved. |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 5 | */ |
| 6 | #ifndef __DESC_IMAGE_LOAD_H__ |
| 7 | #define __DESC_IMAGE_LOAD_H__ |
| 8 | |
| 9 | #include <bl_common.h> |
| 10 | |
| 11 | #if LOAD_IMAGE_V2 |
| 12 | /* Following structure is used to store BL ep/image info. */ |
| 13 | typedef struct bl_mem_params_node { |
| 14 | unsigned int image_id; |
| 15 | image_info_t image_info; |
| 16 | entry_point_info_t ep_info; |
| 17 | unsigned int next_handoff_image_id; |
| 18 | bl_load_info_node_t load_node_mem; |
| 19 | bl_params_node_t params_node_mem; |
| 20 | } bl_mem_params_node_t; |
| 21 | |
Roberto Vargas | 2ca18d9 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 22 | extern bl_mem_params_node_t *bl_mem_params_desc_ptr; |
| 23 | extern unsigned int bl_mem_params_desc_num; |
| 24 | |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 25 | /* |
| 26 | * Macro to register list of BL image descriptors, |
| 27 | * defined as an array of bl_mem_params_node_t. |
| 28 | */ |
| 29 | #define REGISTER_BL_IMAGE_DESCS(_img_desc) \ |
| 30 | bl_mem_params_node_t *bl_mem_params_desc_ptr = &_img_desc[0]; \ |
| 31 | unsigned int bl_mem_params_desc_num = ARRAY_SIZE(_img_desc); |
| 32 | |
| 33 | /* BL image loading utility functions */ |
| 34 | void flush_bl_params_desc(void); |
| 35 | int get_bl_params_node_index(unsigned int image_id); |
| 36 | bl_mem_params_node_t *get_bl_mem_params_node(unsigned int image_id); |
| 37 | bl_load_info_t *get_bl_load_info_from_mem_params_desc(void); |
| 38 | bl_params_t *get_next_bl_params_from_mem_params_desc(void); |
Soby Mathew | 96a1c6b | 2018-01-15 14:45:33 +0000 | [diff] [blame] | 39 | void populate_next_bl_params_config(bl_params_t *bl2_to_next_bl_params); |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 40 | |
| 41 | #endif /* LOAD_IMAGE_V2 */ |
| 42 | #endif /* __DESC_IMAGE_LOAD_H__ */ |