feat(fake_host): add stub for xlat_enable_mmu_el2
This patch adds a stub for xlat_enable_mmu_el2 for the
for fake_host architecture.
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I7bf846bb02ca65b292a33254574f420409735799
diff --git a/plat/host/common/src/host_utils.c b/plat/host/common/src/host_utils.c
index 99fc708..8b0b08e 100644
--- a/plat/host/common/src/host_utils.c
+++ b/plat/host/common/src/host_utils.c
@@ -173,6 +173,9 @@
/* SCTLR_EL2 is reset to zero */
ret = host_util_set_default_sysreg_cb("sctlr_el2", 0UL);
+ /* HCR_EL2 is reset to zero */
+ ret = host_util_set_default_sysreg_cb("hcr_el2", 0UL);
+
/* TPIDR_EL2 is reset to zero */
ret = host_util_set_default_sysreg_cb("tpidr_el2", 0UL);
diff --git a/plat/host/host_test/src/test_helpers.c b/plat/host/host_test/src/test_helpers.c
index fb8ecbd..97e24e4 100644
--- a/plat/host/host_test/src/test_helpers.c
+++ b/plat/host/host_test/src/test_helpers.c
@@ -14,6 +14,7 @@
#include <string.h>
#include <test_private.h>
#include <utest_exit.h>
+#include <xlat_tables.h>
/* Implemented in init.c and needed here */
void rmm_warmboot_main(void);
@@ -35,14 +36,6 @@
static uintptr_t callbacks[CB_IDS];
-/*
- * Function to emulate the turn on of the MMU for the fake_host architecture.
- */
-static void enable_fake_mmu(void)
-{
- write_sctlr_el2(SCTLR_EL2_WXN | SCTLR_EL2_M);
-}
-
static void start_primary_pe(void)
{
host_util_set_cpuid(0U);
@@ -59,7 +52,7 @@
* Enable the MMU. This is needed as some initialization code
* called by rmm_main() asserts that the mmu is enabled.
*/
- enable_fake_mmu();
+ xlat_enable_mmu_el2();
/*
* rmm_main() finishhes the warmboot path.
@@ -87,7 +80,7 @@
* Enable the MMU. This is needed to avoid assertions during boot up
* that would otherwise occur if the MMU is disabled.
*/
- enable_fake_mmu();
+ xlat_enable_mmu_el2();
/*
* Finalize the warmboot path.