brcm_bl2_mem_params_desc.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (c) 2019-2020, 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. #ifdef SCP_BL2_BASE
  20. /* Fill SCP_BL2 related information if it exists */
  21. {
  22. .image_id = SCP_BL2_IMAGE_ID,
  23. SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
  24. VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE),
  25. SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
  26. VERSION_2, image_info_t, 0),
  27. .image_info.image_base = SCP_BL2_BASE,
  28. .image_info.image_max_size = PLAT_MAX_SCP_BL2_SIZE,
  29. .next_handoff_image_id = INVALID_IMAGE_ID,
  30. },
  31. #endif /* SCP_BL2_BASE */
  32. /* Fill BL31 related information */
  33. {
  34. .image_id = BL31_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.pc = BL31_BASE,
  39. .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
  40. DISABLE_ALL_EXCEPTIONS),
  41. #if DEBUG
  42. .ep_info.args.arg3 = BRCM_BL31_PLAT_PARAM_VAL,
  43. #endif
  44. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  45. VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
  46. .image_info.image_base = BL31_BASE,
  47. .image_info.image_max_size = BL31_LIMIT - BL31_BASE,
  48. #ifdef BL32_BASE
  49. .next_handoff_image_id = BL32_IMAGE_ID,
  50. #else
  51. .next_handoff_image_id = BL33_IMAGE_ID,
  52. #endif
  53. },
  54. #ifdef BL32_BASE
  55. /* Fill BL32 related information */
  56. {
  57. .image_id = BL32_IMAGE_ID,
  58. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  59. VERSION_2, entry_point_info_t, SECURE | EXECUTABLE),
  60. .ep_info.pc = BL32_BASE,
  61. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  62. VERSION_2, image_info_t, 0),
  63. .image_info.image_base = BL32_BASE,
  64. .image_info.image_max_size = BL32_LIMIT - BL32_BASE,
  65. .next_handoff_image_id = BL33_IMAGE_ID,
  66. },
  67. #endif /* BL32_BASE */
  68. /* Fill BL33 related information */
  69. {
  70. .image_id = BL33_IMAGE_ID,
  71. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  72. VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE),
  73. #ifdef PRELOADED_BL33_BASE
  74. .ep_info.pc = PRELOADED_BL33_BASE,
  75. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  76. VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
  77. #else
  78. .ep_info.pc = PLAT_BRCM_NS_IMAGE_OFFSET,
  79. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  80. VERSION_2, image_info_t, 0),
  81. .image_info.image_base = PLAT_BRCM_NS_IMAGE_OFFSET,
  82. .image_info.image_max_size = BRCM_DRAM1_SIZE,
  83. #endif /* PRELOADED_BL33_BASE */
  84. .next_handoff_image_id = INVALID_IMAGE_ID,
  85. }
  86. };
  87. REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)