ls_bl2_mem_params_desc.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright 2018-2020 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #include <common/bl_common.h>
  8. #include <common/desc_image_load.h>
  9. #ifdef CSF_HEADER_PREPENDED
  10. #include <csf_hdr.h>
  11. #endif
  12. #include <plat/common/platform.h>
  13. #include <platform_def.h>
  14. /*******************************************************************************
  15. * Following descriptor provides BL image/ep information that gets used
  16. * by BL2 to load the images and also subset of this information is
  17. * passed to next BL image. The image loading sequence is managed by
  18. * populating the images in required loading order. The image execution
  19. * sequence is managed by populating the `next_handoff_image_id` with
  20. * the next executable image id.
  21. ******************************************************************************/
  22. static bl_mem_params_node_t bl2_mem_params_descs[] = {
  23. /* Fill BL31 related information */
  24. {
  25. .image_id = BL31_IMAGE_ID,
  26. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  27. VERSION_2, entry_point_info_t,
  28. SECURE | EXECUTABLE | EP_FIRST_EXE),
  29. .ep_info.pc = BL31_BASE,
  30. .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
  31. DISABLE_ALL_EXCEPTIONS),
  32. #if DEBUG
  33. .ep_info.args.arg1 = LS_BL31_PLAT_PARAM_VAL,
  34. #endif
  35. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  36. VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
  37. #ifdef CSF_HEADER_PREPENDED
  38. .image_info.image_base = BL31_BASE - CSF_HDR_SZ,
  39. .image_info.image_max_size = (BL31_LIMIT - BL31_BASE) +
  40. CSF_HDR_SZ,
  41. #else
  42. .image_info.image_base = BL31_BASE,
  43. .image_info.image_max_size = (BL31_LIMIT - BL31_BASE),
  44. #endif
  45. # ifdef NXP_LOAD_BL32
  46. .next_handoff_image_id = BL32_IMAGE_ID,
  47. # else
  48. .next_handoff_image_id = BL33_IMAGE_ID,
  49. # endif
  50. },
  51. # ifdef NXP_LOAD_BL32
  52. /* Fill BL32 related information */
  53. {
  54. .image_id = BL32_IMAGE_ID,
  55. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  56. VERSION_2, entry_point_info_t, SECURE | EXECUTABLE),
  57. .ep_info.pc = BL32_BASE,
  58. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  59. VERSION_2, image_info_t, 0),
  60. #ifdef CSF_HEADER_PREPENDED
  61. .image_info.image_base = BL32_BASE - CSF_HDR_SZ,
  62. .image_info.image_max_size = (BL32_LIMIT - BL32_BASE) +
  63. CSF_HDR_SZ,
  64. #else
  65. .image_info.image_base = BL32_BASE,
  66. .image_info.image_max_size = (BL32_LIMIT - BL32_BASE),
  67. #endif
  68. .next_handoff_image_id = BL33_IMAGE_ID,
  69. },
  70. # endif /* BL32_BASE */
  71. /* Fill BL33 related information */
  72. {
  73. .image_id = BL33_IMAGE_ID,
  74. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  75. VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE),
  76. .ep_info.pc = BL33_BASE,
  77. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  78. VERSION_2, image_info_t, 0),
  79. #ifdef CSF_HEADER_PREPENDED
  80. .image_info.image_base = BL33_BASE - CSF_HDR_SZ,
  81. .image_info.image_max_size = (BL33_LIMIT - BL33_BASE) +
  82. CSF_HDR_SZ,
  83. #else
  84. .image_info.image_base = BL33_BASE,
  85. .image_info.image_max_size = BL33_LIMIT - BL33_BASE,
  86. #endif
  87. .ep_info.spsr = SPSR_64(MODE_EL1, MODE_SP_ELX,
  88. DISABLE_ALL_EXCEPTIONS),
  89. .next_handoff_image_id = INVALID_IMAGE_ID,
  90. }
  91. };
  92. REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)