desc_image_load.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef DESC_IMAGE_LOAD_H
  7. #define DESC_IMAGE_LOAD_H
  8. #include <common/bl_common.h>
  9. /* Following structure is used to store BL ep/image info. */
  10. typedef struct bl_mem_params_node {
  11. unsigned int image_id;
  12. image_info_t image_info;
  13. entry_point_info_t ep_info;
  14. unsigned int next_handoff_image_id;
  15. bl_load_info_node_t load_node_mem;
  16. bl_params_node_t params_node_mem;
  17. } bl_mem_params_node_t;
  18. extern bl_mem_params_node_t *bl_mem_params_desc_ptr;
  19. extern unsigned int bl_mem_params_desc_num;
  20. /*
  21. * Macro to register list of BL image descriptors,
  22. * defined as an array of bl_mem_params_node_t.
  23. */
  24. #define REGISTER_BL_IMAGE_DESCS(_img_desc) \
  25. bl_mem_params_node_t *bl_mem_params_desc_ptr = &_img_desc[0]; \
  26. unsigned int bl_mem_params_desc_num = ARRAY_SIZE(_img_desc);
  27. /* BL image loading utility functions */
  28. void flush_bl_params_desc(void);
  29. void flush_bl_params_desc_args(bl_mem_params_node_t *mem_params_desc_ptr,
  30. unsigned int mem_params_desc_num,
  31. bl_params_t *next_bl_params_ptr);
  32. int get_bl_params_node_index(unsigned int image_id);
  33. bl_mem_params_node_t *get_bl_mem_params_node(unsigned int image_id);
  34. bl_load_info_t *get_bl_load_info_from_mem_params_desc(void);
  35. bl_params_t *get_next_bl_params_from_mem_params_desc(void);
  36. void populate_next_bl_params_config(bl_params_t *bl2_to_next_bl_params);
  37. /* Helper to extract BL32/BL33 entry point info from arg0 passed to BL31. */
  38. void bl31_params_parse_helper(u_register_t param,
  39. entry_point_info_t *bl32_ep_info_out,
  40. entry_point_info_t *bl33_ep_info_out);
  41. #endif /* DESC_IMAGE_LOAD_H */