From d3f262465b732930d482153a7ed059cf6e613d4b Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux <sandrine.bailleux@arm.com> Date: Thu, 15 May 2014 17:34:35 +0100 Subject: [PATCH] juno: Remove unused disable_mmu() function disable_mmu() cannot work as a C function as there is no control over data accesses generated by the compiler between disabling and cleaning the data cache. This results in reading stale data from main memory. This patch removes the C version of this function in juno code. An assembly version has been introduced in commit 2f5dcfef1db4. Change-Id: I0de10dbe2db8d22855bf1f60f1e48540a4861cb6 --- plat/juno/aarch64/plat_common.c | 21 --------------------- plat/juno/platform.h | 1 - 2 files changed, 22 deletions(-) diff --git a/plat/juno/aarch64/plat_common.c b/plat/juno/aarch64/plat_common.c index 3cd9d8974..f8532f6e4 100644 --- a/plat/juno/aarch64/plat_common.c +++ b/plat/juno/aarch64/plat_common.c @@ -85,27 +85,6 @@ void enable_mmu() return; } -void disable_mmu(void) -{ - unsigned long sctlr; - unsigned long current_el = read_current_el(); - - if (GET_EL(current_el) == MODE_EL3) { - sctlr = read_sctlr_el3(); - sctlr = sctlr & ~(SCTLR_M_BIT | SCTLR_C_BIT); - write_sctlr_el3(sctlr); - } else { - sctlr = read_sctlr_el1(); - sctlr = sctlr & ~(SCTLR_M_BIT | SCTLR_C_BIT); - write_sctlr_el1(sctlr); - } - - /* Flush the caches */ - dcsw_op_all(DCCISW); - - return; -} - static const mmap_region_t juno_mmap[] = { { TZROM_BASE, TZROM_SIZE, MT_MEMORY | MT_RO | MT_SECURE }, { MHU_SECURE_BASE, MHU_SECURE_SIZE, (MHU_PAYLOAD_CACHED ? MT_MEMORY : MT_DEVICE) diff --git a/plat/juno/platform.h b/plat/juno/platform.h index 3738a285b..fd2f94fa5 100644 --- a/plat/juno/platform.h +++ b/plat/juno/platform.h @@ -340,7 +340,6 @@ extern void bl2_plat_arch_setup(void); extern void bl31_plat_arch_setup(void); extern int platform_setup_pm(const struct plat_pm_ops **); extern unsigned int platform_get_core_pos(unsigned long mpidr); -extern void disable_mmu(void); extern void enable_mmu(void); extern void configure_mmu(struct meminfo *, unsigned long, -- GitLab