aboutsummaryrefslogtreecommitdiffstats
path: root/lib/aarch64/misc_helpers.S
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2017-10-20 17:17:09 +0100
committerGitHub <noreply@github.com>2017-10-20 17:17:09 +0100
commit8b9f419e3e175bc4243118b5c9fc2586a365fe24 (patch)
treebb1d9e47deeb7a76133e52003dc1b625490d8f30 /lib/aarch64/misc_helpers.S
parent37b5614ffef15a09fd602e4842493548777b8b55 (diff)
parentec0c8fdacf410b8d33891d569f0c4df6bcb41823 (diff)
downloadplatform_external_arm-trusted-firmware-8b9f419e3e175bc4243118b5c9fc2586a365fe24.tar.gz
platform_external_arm-trusted-firmware-8b9f419e3e175bc4243118b5c9fc2586a365fe24.tar.bz2
platform_external_arm-trusted-firmware-8b9f419e3e175bc4243118b5c9fc2586a365fe24.zip
Merge pull request #1136 from antonio-nino-diaz-arm/an/xlat-get-set-attr
Add APIs to get and modify attributes of memory regions
Diffstat (limited to 'lib/aarch64/misc_helpers.S')
-rw-r--r--lib/aarch64/misc_helpers.S30
1 files changed, 27 insertions, 3 deletions
diff --git a/lib/aarch64/misc_helpers.S b/lib/aarch64/misc_helpers.S
index 78153bfba..9dfe46a2f 100644
--- a/lib/aarch64/misc_helpers.S
+++ b/lib/aarch64/misc_helpers.S
@@ -18,7 +18,9 @@
.globl zeromem16
.globl memcpy16
+ .globl disable_mmu_el1
.globl disable_mmu_el3
+ .globl disable_mmu_icache_el1
.globl disable_mmu_icache_el3
#if SUPPORT_VFP
@@ -451,11 +453,11 @@ endfunc memcpy16
func disable_mmu_el3
mov x1, #(SCTLR_M_BIT | SCTLR_C_BIT)
-do_disable_mmu:
+do_disable_mmu_el3:
mrs x0, sctlr_el3
bic x0, x0, x1
msr sctlr_el3, x0
- isb // ensure MMU is off
+ isb /* ensure MMU is off */
dsb sy
ret
endfunc disable_mmu_el3
@@ -463,10 +465,32 @@ endfunc disable_mmu_el3
func disable_mmu_icache_el3
mov x1, #(SCTLR_M_BIT | SCTLR_C_BIT | SCTLR_I_BIT)
- b do_disable_mmu
+ b do_disable_mmu_el3
endfunc disable_mmu_icache_el3
/* ---------------------------------------------------------------------------
+ * Disable the MMU at EL1
+ * ---------------------------------------------------------------------------
+ */
+
+func disable_mmu_el1
+ mov x1, #(SCTLR_M_BIT | SCTLR_C_BIT)
+do_disable_mmu_el1:
+ mrs x0, sctlr_el1
+ bic x0, x0, x1
+ msr sctlr_el1, x0
+ isb /* ensure MMU is off */
+ dsb sy
+ ret
+endfunc disable_mmu_el1
+
+
+func disable_mmu_icache_el1
+ mov x1, #(SCTLR_M_BIT | SCTLR_C_BIT | SCTLR_I_BIT)
+ b do_disable_mmu_el1
+endfunc disable_mmu_icache_el1
+
+/* ---------------------------------------------------------------------------
* Enable the use of VFP at EL3
* ---------------------------------------------------------------------------
*/