arm_bl2_mem_params_desc.c 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <platform_def.h>
  7. #include <common/bl_common.h>
  8. #include <common/desc_image_load.h>
  9. /*******************************************************************************
  10. * Following descriptor provides BL image/ep information that gets used
  11. * by BL2 to load the images and also subset of this information is
  12. * passed to next BL image. The image loading sequence is managed by
  13. * populating the images in required loading order. The image execution
  14. * sequence is managed by populating the `next_handoff_image_id` with
  15. * the next executable image id.
  16. ******************************************************************************/
  17. static bl_mem_params_node_t bl2_mem_params_descs[] = {
  18. #ifdef SCP_BL2_BASE
  19. /* Fill SCP_BL2 related information if it exists */
  20. {
  21. .image_id = SCP_BL2_IMAGE_ID,
  22. SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
  23. VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE),
  24. SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
  25. VERSION_2, image_info_t, 0),
  26. .image_info.image_base = SCP_BL2_BASE,
  27. .image_info.image_max_size = PLAT_CSS_MAX_SCP_BL2_SIZE,
  28. .next_handoff_image_id = INVALID_IMAGE_ID,
  29. },
  30. #endif /* SCP_BL2_BASE */
  31. /* Fill BL32 related information */
  32. {
  33. .image_id = BL32_IMAGE_ID,
  34. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  35. VERSION_2, entry_point_info_t,
  36. SECURE | EXECUTABLE | EP_FIRST_EXE),
  37. .ep_info.pc = BL32_BASE,
  38. .ep_info.spsr = SPSR_MODE32(MODE32_mon, SPSR_T_ARM,
  39. SPSR_E_LITTLE, DISABLE_ALL_EXCEPTIONS),
  40. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  41. VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
  42. .image_info.image_base = BL32_BASE,
  43. .image_info.image_max_size = BL32_LIMIT - BL32_BASE,
  44. .next_handoff_image_id = BL33_IMAGE_ID,
  45. },
  46. /* Fill HW_CONFIG related information if it exists */
  47. {
  48. .image_id = HW_CONFIG_ID,
  49. SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
  50. VERSION_2, entry_point_info_t,
  51. NON_SECURE | NON_EXECUTABLE),
  52. SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
  53. VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
  54. .next_handoff_image_id = INVALID_IMAGE_ID,
  55. },
  56. /* Fill BL33 related information */
  57. {
  58. .image_id = BL33_IMAGE_ID,
  59. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  60. VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE),
  61. #ifdef PRELOADED_BL33_BASE
  62. .ep_info.pc = PRELOADED_BL33_BASE,
  63. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  64. VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
  65. #else
  66. .ep_info.pc = PLAT_ARM_NS_IMAGE_BASE,
  67. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  68. VERSION_2, image_info_t, 0),
  69. .image_info.image_base = PLAT_ARM_NS_IMAGE_BASE,
  70. .image_info.image_max_size = ARM_DRAM1_BASE + ARM_DRAM1_SIZE
  71. - PLAT_ARM_NS_IMAGE_BASE,
  72. #endif /* PRELOADED_BL33_BASE */
  73. .next_handoff_image_id = INVALID_IMAGE_ID,
  74. }
  75. };
  76. REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)