bl2_plat_mem_params_desc.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright (c) 2016-2019, 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. #include <lib/xlat_tables/xlat_tables_defs.h>
  10. #include <plat/common/platform.h>
  11. #if (RCAR_BL33_EXECUTION_EL != 0) && (RCAR_BL33_EXECUTION_EL != 1)
  12. #error
  13. #endif
  14. #if (RCAR_BL33_EXECUTION_EL == 0)
  15. #define BL33_MODE MODE_EL1
  16. #else
  17. #define BL33_MODE MODE_EL2
  18. #endif
  19. extern uint64_t fdt_blob[PAGE_SIZE_4KB / sizeof(uint64_t)];
  20. static bl_mem_params_node_t bl2_mem_params_descs[] = {
  21. {
  22. .image_id = BL31_IMAGE_ID,
  23. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
  24. entry_point_info_t, SECURE | EXECUTABLE | EP_FIRST_EXE),
  25. .ep_info.spsr = SPSR_64(MODE_EL3,
  26. MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS),
  27. .ep_info.pc = BL31_BASE,
  28. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
  29. image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
  30. .image_info.image_max_size = BL31_LIMIT - BL31_BASE,
  31. .image_info.image_base = BL31_BASE,
  32. # ifdef BL32_BASE
  33. .next_handoff_image_id = BL32_IMAGE_ID,
  34. # else
  35. .next_handoff_image_id = BL33_IMAGE_ID,
  36. # endif
  37. },
  38. # ifdef BL32_BASE
  39. {
  40. .image_id = BL32_IMAGE_ID,
  41. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
  42. entry_point_info_t, SECURE | EXECUTABLE),
  43. .ep_info.pc = BL32_BASE,
  44. .ep_info.spsr = 0,
  45. .ep_info.args.arg3 = (uintptr_t)fdt_blob,
  46. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
  47. image_info_t, 0),
  48. .image_info.image_max_size = BL32_LIMIT - BL32_BASE,
  49. .image_info.image_base = BL32_BASE,
  50. .next_handoff_image_id = BL33_IMAGE_ID,
  51. },
  52. #endif
  53. {
  54. .image_id = BL33_IMAGE_ID,
  55. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2,
  56. entry_point_info_t, NON_SECURE | EXECUTABLE),
  57. .ep_info.spsr = SPSR_64(BL33_MODE, MODE_SP_ELX,
  58. DISABLE_ALL_EXCEPTIONS),
  59. .ep_info.pc = BL33_BASE,
  60. #ifdef RCAR_BL33_ARG0
  61. .ep_info.args.arg0 = RCAR_BL33_ARG0,
  62. #endif
  63. .ep_info.args.arg1 = (uintptr_t)fdt_blob,
  64. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2,
  65. image_info_t, 0),
  66. .image_info.image_max_size =
  67. (uint32_t) (DRAM_LIMIT - BL33_BASE),
  68. .image_info.image_base = BL33_BASE,
  69. .next_handoff_image_id = INVALID_IMAGE_ID,
  70. }
  71. };
  72. REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)