spm_xlat_common.c 959 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2023, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <lib/xlat_tables/xlat_tables_v2.h>
  7. #include <platform_def.h>
  8. /* Place translation tables by default along with the ones used by BL31. */
  9. #ifndef PLAT_SP_IMAGE_XLAT_SECTION_NAME
  10. #define PLAT_SP_IMAGE_XLAT_SECTION_NAME ".xlat_table"
  11. #endif
  12. #ifndef PLAT_SP_IMAGE_BASE_XLAT_SECTION_NAME
  13. #define PLAT_SP_IMAGE_BASE_XLAT_SECTION_NAME ".bss"
  14. #endif
  15. /* Allocate and initialise the translation context for the secure partitions. */
  16. REGISTER_XLAT_CONTEXT2(sp,
  17. PLAT_SP_IMAGE_MMAP_REGIONS,
  18. PLAT_SP_IMAGE_MAX_XLAT_TABLES,
  19. PLAT_VIRT_ADDR_SPACE_SIZE, PLAT_PHY_ADDR_SPACE_SIZE,
  20. EL1_EL0_REGIME, PLAT_SP_IMAGE_XLAT_SECTION_NAME,
  21. PLAT_SP_IMAGE_BASE_XLAT_SECTION_NAME);
  22. /* Get handle of Secure Partition translation context */
  23. xlat_ctx_t *spm_get_sp_xlat_context(void)
  24. {
  25. return &sp_xlat_ctx;
  26. };