diff --git a/plat/socionext/uniphier/platform.mk b/plat/socionext/uniphier/platform.mk index 0fcef1d..3f8a1f8 100644 --- a/plat/socionext/uniphier/platform.mk +++ b/plat/socionext/uniphier/platform.mk @@ -14,6 +14,13 @@ # UNIPHIER_MEM_BASE so that all TF images are loaded at their link addresses. override ENABLE_PIE := 1 +ALLOW_RO_XLAT_TABLES := 1 + +ifeq ($(ALLOW_RO_XLAT_TABLES),1) +BL31_CFLAGS += -DPLAT_RO_XLAT_TABLES=1 +BL32_CFLAGS += -DPLAT_RO_XLAT_TABLES=1 +endif + # Cortex-A53 revision r0p4-51rel0 # needed for LD20, unneeded for LD11, PXs3 (no ACE) ERRATA_A53_855873 := 1 diff --git a/plat/socionext/uniphier/uniphier_xlat_setup.c b/plat/socionext/uniphier/uniphier_xlat_setup.c index c2ac7a2..5043f4b 100644 --- a/plat/socionext/uniphier/uniphier_xlat_setup.c +++ b/plat/socionext/uniphier/uniphier_xlat_setup.c @@ -10,6 +10,7 @@ #include #include +#include #include "uniphier.h" @@ -65,4 +66,16 @@ init_xlat_tables(); enable_mmu(0); + +#if PLAT_RO_XLAT_TABLES + { + int ret; + + ret = xlat_make_tables_readonly(); + if (ret) { + ERROR("Failed to make translation tables read-only."); + plat_error_handler(ret); + } + } +#endif }