sq_spm.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <platform_def.h>
  8. #include <bl31/ehf.h>
  9. #include <lib/xlat_tables/xlat_tables_v2.h>
  10. #include <services/spm_mm_partition.h>
  11. static const mmap_region_t plat_arm_secure_partition_mmap[] = {
  12. PLAT_SQ_FLASH_MMAP,
  13. PLAT_SQ_UART1_MMAP,
  14. PLAT_SQ_PERIPH_MMAP,
  15. PLAT_SQ_SP_IMAGE_MMAP,
  16. PLAT_SP_IMAGE_NS_BUF_MMAP,
  17. PLAT_SQ_SP_IMAGE_RW_MMAP,
  18. PLAT_SPM_SPM_BUF_EL0_MMAP,
  19. {0}
  20. };
  21. /*
  22. * Boot information passed to a secure partition during initialisation. Linear
  23. * indices in MP information will be filled at runtime.
  24. */
  25. static spm_mm_mp_info_t sp_mp_info[] = {
  26. {0x80000000, 0}, {0x80000001, 0}, {0x80000100, 0}, {0x80000101, 0},
  27. {0x80000200, 0}, {0x80000201, 0}, {0x80000300, 0}, {0x80000301, 0},
  28. {0x80000400, 0}, {0x80000401, 0}, {0x80000500, 0}, {0x80000501, 0},
  29. {0x80000600, 0}, {0x80000601, 0}, {0x80000700, 0}, {0x80000701, 0},
  30. {0x80000800, 0}, {0x80000801, 0}, {0x80000900, 0}, {0x80000901, 0},
  31. {0x80000a00, 0}, {0x80000a01, 0}, {0x80000b00, 0}, {0x80000b01, 0},
  32. };
  33. const spm_mm_boot_info_t plat_arm_secure_partition_boot_info = {
  34. .h.type = PARAM_SP_IMAGE_BOOT_INFO,
  35. .h.version = VERSION_1,
  36. .h.size = sizeof(spm_mm_boot_info_t),
  37. .h.attr = 0,
  38. .sp_mem_base = BL32_BASE,
  39. .sp_mem_limit = BL32_LIMIT,
  40. .sp_image_base = BL32_BASE,
  41. .sp_stack_base = PLAT_SP_IMAGE_STACK_BASE,
  42. .sp_heap_base = PLAT_SQ_SP_HEAP_BASE,
  43. .sp_ns_comm_buf_base = PLAT_SP_IMAGE_NS_BUF_BASE,
  44. .sp_shared_buf_base = PLAT_SPM_BUF_BASE,
  45. .sp_image_size = PLAT_SQ_SP_IMAGE_SIZE,
  46. .sp_pcpu_stack_size = PLAT_SP_IMAGE_STACK_PCPU_SIZE,
  47. .sp_heap_size = PLAT_SQ_SP_HEAP_SIZE,
  48. .sp_ns_comm_buf_size = PLAT_SP_IMAGE_NS_BUF_SIZE,
  49. .sp_shared_buf_size = PLAT_SPM_BUF_SIZE,
  50. .num_sp_mem_regions = PLAT_SP_IMAGE_NUM_MEM_REGIONS,
  51. .num_cpus = PLATFORM_CORE_COUNT,
  52. .mp_info = sp_mp_info,
  53. };
  54. const struct mmap_region *plat_get_secure_partition_mmap(void *cookie)
  55. {
  56. return plat_arm_secure_partition_mmap;
  57. }
  58. const struct spm_mm_boot_info *plat_get_secure_partition_boot_info(
  59. void *cookie)
  60. {
  61. return &plat_arm_secure_partition_boot_info;
  62. }
  63. static ehf_pri_desc_t sq_exceptions[] = {
  64. EHF_PRI_DESC(PLAT_PRI_BITS, PLAT_SP_PRI),
  65. };
  66. EHF_REGISTER_PRIORITIES(sq_exceptions, ARRAY_SIZE(sq_exceptions), PLAT_PRI_BITS);