plat_bl2_mem_params_desc.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * Copyright (c) 2016-2022, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <common/bl_common.h>
  7. #include <common/desc_image_load.h>
  8. #include <plat/common/platform.h>
  9. #include <platform_def.h>
  10. /*******************************************************************************
  11. * Following descriptor provides BL image/ep information that gets used
  12. * by BL2 to load the images and also subset of this information is
  13. * passed to next BL image. The image loading sequence is managed by
  14. * populating the images in required loading order. The image execution
  15. * sequence is managed by populating the `next_handoff_image_id` with
  16. * the next executable image id.
  17. ******************************************************************************/
  18. static bl_mem_params_node_t bl2_mem_params_descs[] = {
  19. /* Fill FW_CONFIG related information if it exists */
  20. {
  21. .image_id = FW_CONFIG_ID,
  22. SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
  23. VERSION_2, entry_point_info_t,
  24. SECURE | NON_EXECUTABLE),
  25. SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
  26. VERSION_2, image_info_t,
  27. IMAGE_ATTRIB_PLAT_SETUP),
  28. .image_info.image_base = STM32MP_FW_CONFIG_BASE,
  29. .image_info.image_max_size = STM32MP_FW_CONFIG_MAX_SIZE,
  30. .next_handoff_image_id = INVALID_IMAGE_ID,
  31. },
  32. /* Fill BL32 related information */
  33. {
  34. .image_id = BL32_IMAGE_ID,
  35. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  36. VERSION_2, entry_point_info_t,
  37. SECURE | EXECUTABLE | EP_FIRST_EXE),
  38. .ep_info.spsr = SPSR_MODE32(MODE32_svc, SPSR_T_ARM,
  39. SPSR_E_LITTLE,
  40. DISABLE_ALL_EXCEPTIONS),
  41. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  42. VERSION_2, image_info_t,
  43. IMAGE_ATTRIB_SKIP_LOADING),
  44. .next_handoff_image_id = BL33_IMAGE_ID,
  45. },
  46. /* Fill BL32 external 1 image related information */
  47. {
  48. .image_id = BL32_EXTRA1_IMAGE_ID,
  49. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  50. VERSION_2, entry_point_info_t,
  51. SECURE | NON_EXECUTABLE),
  52. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  53. VERSION_2, image_info_t,
  54. IMAGE_ATTRIB_SKIP_LOADING),
  55. .next_handoff_image_id = INVALID_IMAGE_ID,
  56. },
  57. #if STM32MP15
  58. /* Fill BL32 external 2 image related information */
  59. {
  60. .image_id = BL32_EXTRA2_IMAGE_ID,
  61. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  62. VERSION_2, entry_point_info_t,
  63. SECURE | NON_EXECUTABLE),
  64. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  65. VERSION_2, image_info_t,
  66. IMAGE_ATTRIB_SKIP_LOADING),
  67. .next_handoff_image_id = INVALID_IMAGE_ID,
  68. },
  69. #endif
  70. /* Fill HW_CONFIG related information if it exists */
  71. {
  72. .image_id = HW_CONFIG_ID,
  73. SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
  74. VERSION_2, entry_point_info_t,
  75. NON_SECURE | NON_EXECUTABLE),
  76. SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
  77. VERSION_2, image_info_t,
  78. IMAGE_ATTRIB_SKIP_LOADING),
  79. .next_handoff_image_id = INVALID_IMAGE_ID,
  80. },
  81. /* Fill TOS_FW_CONFIG related information if it exists */
  82. {
  83. .image_id = TOS_FW_CONFIG_ID,
  84. SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
  85. VERSION_2, entry_point_info_t,
  86. SECURE | NON_EXECUTABLE),
  87. SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
  88. VERSION_2, image_info_t,
  89. IMAGE_ATTRIB_SKIP_LOADING),
  90. .next_handoff_image_id = INVALID_IMAGE_ID,
  91. },
  92. /* Fill BL33 related information */
  93. {
  94. .image_id = BL33_IMAGE_ID,
  95. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  96. VERSION_2, entry_point_info_t,
  97. NON_SECURE | EXECUTABLE),
  98. .ep_info.spsr = SPSR_MODE32(MODE32_svc, SPSR_T_ARM,
  99. SPSR_E_LITTLE,
  100. DISABLE_ALL_EXCEPTIONS),
  101. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  102. VERSION_2, image_info_t,
  103. IMAGE_ATTRIB_SKIP_LOADING),
  104. .next_handoff_image_id = INVALID_IMAGE_ID,
  105. }
  106. };
  107. REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)