sq_image_desc.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2022, Socionext Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <arch.h>
  8. #include <common/desc_image_load.h>
  9. #include <platform_def.h>
  10. static struct bl_mem_params_node sq_image_descs[] = {
  11. {
  12. .image_id = BL31_IMAGE_ID,
  13. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  14. VERSION_2, image_info_t, 0),
  15. .image_info.image_base = BL31_BASE,
  16. .image_info.image_max_size = BL31_SIZE,
  17. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  18. VERSION_2, entry_point_info_t,
  19. SECURE | EXECUTABLE | EP_FIRST_EXE),
  20. .ep_info.pc = BL31_BASE,
  21. .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
  22. DISABLE_ALL_EXCEPTIONS),
  23. .next_handoff_image_id = BL32_IMAGE_ID,
  24. },
  25. {
  26. .image_id = BL32_IMAGE_ID,
  27. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  28. VERSION_2, image_info_t, 0),
  29. .image_info.image_base = BL32_BASE,
  30. .image_info.image_max_size = BL32_SIZE,
  31. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  32. VERSION_2, entry_point_info_t,
  33. SECURE | EXECUTABLE),
  34. .ep_info.pc = BL32_BASE,
  35. .ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
  36. DISABLE_ALL_EXCEPTIONS),
  37. .next_handoff_image_id = BL33_IMAGE_ID,
  38. },
  39. {
  40. .image_id = BL33_IMAGE_ID,
  41. SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
  42. VERSION_2, image_info_t, 0),
  43. .image_info.image_base = PLAT_SQ_BL33_BASE,
  44. .image_info.image_max_size = PLAT_SQ_BL33_SIZE,
  45. SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
  46. VERSION_2, entry_point_info_t,
  47. NON_SECURE | EXECUTABLE),
  48. .ep_info.pc = PLAT_SQ_BL33_BASE,
  49. .ep_info.spsr = SPSR_64(MODE_EL2, MODE_SP_ELX,
  50. DISABLE_ALL_EXCEPTIONS),
  51. .next_handoff_image_id = INVALID_IMAGE_ID,
  52. },
  53. };
  54. REGISTER_BL_IMAGE_DESCS(sq_image_descs)
  55. struct image_info *sq_get_image_info(unsigned int image_id)
  56. {
  57. struct bl_mem_params_node *desc;
  58. desc = get_bl_mem_params_node(image_id);
  59. assert(desc);
  60. return &desc->image_info;
  61. }