Skip to content

Commit

Permalink
plat-mediatek: add support to extend MAX_XLAT_TABLE
Browse files Browse the repository at this point in the history
When using the reserved virtual memory space, it is necessary to
increase MAX_XLAT_TABLE based on its size.

Signed-off-by: Gavin Liu <gavin.liu@mediatek.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
  • Loading branch information
gavin-liu106 authored and jforissier committed Jun 20, 2024
1 parent 7ae1573 commit 1677a7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions core/arch/arm/plat-mediatek/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ CFG_DRAM_BASE ?= 0x40000000
# default DRAM size 1 GiB
CFG_DRAM_SIZE ?= 0x40000000

# When need to create a virtual memory pool for mapping other
# physical address, enable the config to increase MAX_XLAT_TABLES.
CFG_MTK_RESERVED_VA ?= n

ifeq ($(PLATFORM_FLAVOR),mt8173)
# 2**1 = 2 cores per cluster
$(call force,CFG_TEE_CORE_NB_CORE,4)
Expand Down
5 changes: 3 additions & 2 deletions core/arch/arm/plat-mediatek/platform_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@
#error "Unknown platform flavor"
#endif

#ifdef CFG_WITH_LPAE
#define MAX_XLAT_TABLES 5
#ifdef CFG_MTK_RESERVED_VA
#define MAX_XLAT_TABLES (30 + (CFG_RESERVED_VASPACE_SIZE) / \
(CORE_MMU_PGDIR_SIZE) + 1)
#endif

#endif /*PLATFORM_CONFIG_H*/

0 comments on commit 1677a7f

Please sign in to comment.