imx8mm_bl2_mem_params_desc.c 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <common/desc_image_load.h>
  8. #include <plat/common/platform.h>
  9. #include <platform_def.h>
  10. static bl_mem_params_node_t bl2_mem_params_descs[] = {
  11. {
  12. .image_id = BL31_IMAGE_ID,
  13. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
  14. entry_point_info_t,
  15. SECURE | EXECUTABLE | EP_FIRST_EXE),
  16. .ep_info.pc = BL31_BASE,
  17. .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
  18. DISABLE_ALL_EXCEPTIONS),
  19. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2, image_info_t,
  20. IMAGE_ATTRIB_PLAT_SETUP),
  21. .image_info.image_base = BL31_BASE,
  22. .image_info.image_max_size = BL31_LIMIT - BL31_BASE,
  23. .next_handoff_image_id = INVALID_IMAGE_ID,
  24. },
  25. {
  26. .image_id = BL32_IMAGE_ID,
  27. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
  28. entry_point_info_t,
  29. SECURE | EXECUTABLE),
  30. .ep_info.pc = BL32_BASE,
  31. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
  32. image_info_t, 0),
  33. .image_info.image_base = BL32_BASE,
  34. .image_info.image_max_size = BL32_SIZE,
  35. .next_handoff_image_id = BL33_IMAGE_ID,
  36. },
  37. {
  38. .image_id = BL32_EXTRA1_IMAGE_ID,
  39. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
  40. entry_point_info_t,
  41. SECURE | NON_EXECUTABLE),
  42. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
  43. image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
  44. .image_info.image_base = BL32_BASE,
  45. .image_info.image_max_size = BL32_SIZE,
  46. .next_handoff_image_id = INVALID_IMAGE_ID,
  47. },
  48. {
  49. /* This is a zero sized image so we don't set base or size */
  50. .image_id = BL32_EXTRA2_IMAGE_ID,
  51. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  52. VERSION_2, entry_point_info_t,
  53. SECURE | NON_EXECUTABLE),
  54. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  55. VERSION_2, image_info_t,
  56. IMAGE_ATTRIB_SKIP_LOADING),
  57. .next_handoff_image_id = INVALID_IMAGE_ID,
  58. },
  59. {
  60. .image_id = BL33_IMAGE_ID,
  61. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
  62. entry_point_info_t,
  63. NON_SECURE | EXECUTABLE),
  64. # ifdef PRELOADED_BL33_BASE
  65. .ep_info.pc = PLAT_NS_IMAGE_OFFSET,
  66. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  67. VERSION_2, image_info_t,
  68. IMAGE_ATTRIB_SKIP_LOADING),
  69. # else
  70. .ep_info.pc = PLAT_NS_IMAGE_OFFSET,
  71. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  72. VERSION_2, image_info_t, 0),
  73. .image_info.image_base = PLAT_NS_IMAGE_OFFSET,
  74. .image_info.image_max_size = PLAT_NS_IMAGE_SIZE,
  75. # endif /* PRELOADED_BL33_BASE */
  76. .next_handoff_image_id = INVALID_IMAGE_ID,
  77. }
  78. };
  79. REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs);