Commit d3f26246 authored by Sandrine Bailleux's avatar Sandrine Bailleux
Browse files

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 2f5dcfef.

Change-Id: I0de10dbe2db8d22855bf1f60f1e48540a4861cb6
parent dbc6eb23
...@@ -85,27 +85,6 @@ void enable_mmu() ...@@ -85,27 +85,6 @@ void enable_mmu()
return; 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[] = { static const mmap_region_t juno_mmap[] = {
{ TZROM_BASE, TZROM_SIZE, MT_MEMORY | MT_RO | MT_SECURE }, { TZROM_BASE, TZROM_SIZE, MT_MEMORY | MT_RO | MT_SECURE },
{ MHU_SECURE_BASE, MHU_SECURE_SIZE, (MHU_PAYLOAD_CACHED ? MT_MEMORY : MT_DEVICE) { MHU_SECURE_BASE, MHU_SECURE_SIZE, (MHU_PAYLOAD_CACHED ? MT_MEMORY : MT_DEVICE)
......
...@@ -340,7 +340,6 @@ extern void bl2_plat_arch_setup(void); ...@@ -340,7 +340,6 @@ extern void bl2_plat_arch_setup(void);
extern void bl31_plat_arch_setup(void); extern void bl31_plat_arch_setup(void);
extern int platform_setup_pm(const struct plat_pm_ops **); extern int platform_setup_pm(const struct plat_pm_ops **);
extern unsigned int platform_get_core_pos(unsigned long mpidr); extern unsigned int platform_get_core_pos(unsigned long mpidr);
extern void disable_mmu(void);
extern void enable_mmu(void); extern void enable_mmu(void);
extern void configure_mmu(struct meminfo *, extern void configure_mmu(struct meminfo *,
unsigned long, unsigned long,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment