aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Dykes <mardyk01@review.trustedfirmware.org>2020-03-31 19:56:31 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-03-31 19:56:31 +0000
commit787d848a1ec05acfdb74605647bc91f4c4d95919 (patch)
treef333407750a79ad44afc6ebd463647487c1eeb5f
parent614be75df67af7ca37d6b4ae4bf40729403e2838 (diff)
parentf554773520602d146acb5370242c4c62dafc5080 (diff)
downloadplatform_external_arm-trusted-firmware-787d848a1ec05acfdb74605647bc91f4c4d95919.tar.gz
platform_external_arm-trusted-firmware-787d848a1ec05acfdb74605647bc91f4c4d95919.tar.bz2
platform_external_arm-trusted-firmware-787d848a1ec05acfdb74605647bc91f4c4d95919.zip
Merge "xlat_tables_v2: add enable_mmu()" into integration
-rw-r--r--include/lib/xlat_tables/xlat_mmu_helpers.h3
-rw-r--r--lib/xlat_tables_v2/xlat_tables_context.c17
2 files changed, 20 insertions, 0 deletions
diff --git a/include/lib/xlat_tables/xlat_mmu_helpers.h b/include/lib/xlat_tables/xlat_mmu_helpers.h
index abdf1b6d0..269afd287 100644
--- a/include/lib/xlat_tables/xlat_mmu_helpers.h
+++ b/include/lib/xlat_tables/xlat_mmu_helpers.h
@@ -56,6 +56,8 @@
#include <stdint.h>
#include <string.h>
+#include <arch_helpers.h>
+
/*
* Return the values that the MMU configuration registers must contain for the
* specified translation context. `params` must be a pointer to array of size
@@ -70,6 +72,7 @@ void setup_mmu_cfg(uint64_t *params, unsigned int flags,
void enable_mmu_el1(unsigned int flags);
void enable_mmu_el2(unsigned int flags);
void enable_mmu_el3(unsigned int flags);
+void enable_mmu(unsigned int flags);
void enable_mmu_direct_el1(unsigned int flags);
void enable_mmu_direct_el2(unsigned int flags);
diff --git a/lib/xlat_tables_v2/xlat_tables_context.c b/lib/xlat_tables_v2/xlat_tables_context.c
index a1c974ec0..032e1424f 100644
--- a/lib/xlat_tables_v2/xlat_tables_context.c
+++ b/lib/xlat_tables_v2/xlat_tables_context.c
@@ -239,6 +239,23 @@ void enable_mmu_el3(unsigned int flags)
enable_mmu_direct_el3(flags);
}
+void enable_mmu(unsigned int flags)
+{
+ switch (get_current_el_maybe_constant()) {
+ case 1:
+ enable_mmu_el1(flags);
+ break;
+ case 2:
+ enable_mmu_el2(flags);
+ break;
+ case 3:
+ enable_mmu_el3(flags);
+ break;
+ default:
+ panic();
+ }
+}
+
#else /* !__aarch64__ */
void enable_mmu_svc_mon(unsigned int flags)