Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 1 | /* |
Julius Werner | a057484 | 2019-05-29 17:01:46 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016-2019, 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 | */ |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 6 | #ifndef DESC_IMAGE_LOAD_H |
| 7 | #define DESC_IMAGE_LOAD_H |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 8 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <common/bl_common.h> |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 10 | |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 11 | /* Following structure is used to store BL ep/image info. */ |
| 12 | typedef 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 Vargas | 2ca18d9 | 2018-02-12 12:36:17 +0000 | [diff] [blame] | 21 | extern bl_mem_params_node_t *bl_mem_params_desc_ptr; |
| 22 | extern unsigned int bl_mem_params_desc_num; |
| 23 | |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 24 | /* |
| 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 */ |
| 33 | void flush_bl_params_desc(void); |
Sathees Balya | 9095009 | 2018-11-15 14:22:30 +0000 | [diff] [blame] | 34 | void flush_bl_params_desc_args(bl_mem_params_node_t *mem_params_desc_ptr, |
| 35 | unsigned int mem_params_desc_num, |
| 36 | bl_params_t *next_bl_params_ptr); |
Yatharth Kochar | 3345a8d | 2016-09-12 16:08:41 +0100 | [diff] [blame] | 37 | int get_bl_params_node_index(unsigned int image_id); |
| 38 | bl_mem_params_node_t *get_bl_mem_params_node(unsigned int image_id); |
| 39 | bl_load_info_t *get_bl_load_info_from_mem_params_desc(void); |
| 40 | bl_params_t *get_next_bl_params_from_mem_params_desc(void); |
Soby Mathew | 96a1c6b | 2018-01-15 14:45:33 +0000 | [diff] [blame] | 41 | 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] | 42 | |
Julius Werner | a057484 | 2019-05-29 17:01:46 -0700 | [diff] [blame] | 43 | /* Helper to extract BL32/BL33 entry point info from arg0 passed to BL31. */ |
| 44 | void bl31_params_parse_helper(u_register_t param, |
| 45 | entry_point_info_t *bl32_ep_info_out, |
| 46 | entry_point_info_t *bl33_ep_info_out); |
| 47 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 48 | #endif /* DESC_IMAGE_LOAD_H */ |