bl_common_exp.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef ARM_TRUSTED_FIRMWARE_EXPORT_COMMON_BL_COMMON_EXP_H
  7. #define ARM_TRUSTED_FIRMWARE_EXPORT_COMMON_BL_COMMON_EXP_H
  8. /* EXPORT HEADER -- See include/export/README for details! -- EXPORT HEADER */
  9. #include "ep_info_exp.h"
  10. #include "tbbr/tbbr_img_def_exp.h"
  11. /*
  12. * The following are used for image state attributes.
  13. * Image can only be in one of the following state.
  14. */
  15. #define IMAGE_STATE_RESET U(0)
  16. #define IMAGE_STATE_COPIED U(1)
  17. #define IMAGE_STATE_COPYING U(2)
  18. #define IMAGE_STATE_AUTHENTICATED U(3)
  19. #define IMAGE_STATE_EXECUTED U(4)
  20. #define IMAGE_STATE_INTERRUPTED U(5)
  21. #define IMAGE_ATTRIB_SKIP_LOADING U(0x02)
  22. #define IMAGE_ATTRIB_PLAT_SETUP U(0x04)
  23. #define INVALID_IMAGE_ID U(0xFFFFFFFF)
  24. #ifndef __ASSEMBLER__
  25. /*****************************************************************************
  26. * Image info binary provides information from the image loader that
  27. * can be used by the firmware to manage available trusted RAM.
  28. * More advanced firmware image formats can provide additional
  29. * information that enables optimization or greater flexibility in the
  30. * common firmware code
  31. *****************************************************************************/
  32. typedef struct image_info {
  33. param_header_t h;
  34. uintptr_t image_base; /* physical address of base of image */
  35. uint32_t image_size; /* bytes read from image file */
  36. uint32_t image_max_size;
  37. } image_info_t;
  38. /* BL image node in the BL image execution sequence */
  39. typedef struct bl_params_node {
  40. unsigned int image_id;
  41. image_info_t *image_info;
  42. entry_point_info_t *ep_info;
  43. struct bl_params_node *next_params_info;
  44. } bl_params_node_t;
  45. /*
  46. * BL image head node in the BL image execution sequence
  47. * It is also used to pass information to next BL image.
  48. */
  49. typedef struct bl_params {
  50. param_header_t h;
  51. bl_params_node_t *head;
  52. } bl_params_t;
  53. /*****************************************************************************
  54. * The image descriptor struct definition.
  55. *****************************************************************************/
  56. typedef struct image_desc {
  57. /* Contains unique image id for the image. */
  58. unsigned int image_id;
  59. /*
  60. * This member contains Image state information.
  61. * Refer IMAGE_STATE_XXX defined above.
  62. */
  63. unsigned int state;
  64. uint32_t copied_size; /* image size copied in blocks */
  65. image_info_t image_info;
  66. entry_point_info_t ep_info;
  67. } image_desc_t;
  68. /* BL image node in the BL image loading sequence */
  69. typedef struct bl_load_info_node {
  70. unsigned int image_id;
  71. image_info_t *image_info;
  72. struct bl_load_info_node *next_load_info;
  73. } bl_load_info_node_t;
  74. /* BL image head node in the BL image loading sequence */
  75. typedef struct bl_load_info {
  76. param_header_t h;
  77. bl_load_info_node_t *head;
  78. } bl_load_info_t;
  79. #endif /* __ASSEMBLER__ */
  80. #endif /* ARM_TRUSTED_FIRMWARE_EXPORT_COMMON_BL_COMMON_EXP_H */