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