summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/sysreg.h
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2015-07-21 15:23:27 +0300
committerWill Deacon <will.deacon@arm.com>2015-07-27 13:08:41 +0300
commit870828e57b141eff76a5325f20e4691dd2a599b1 (patch)
tree68b660c89ce5b145a726fb674662024936e7a870 /arch/arm64/include/asm/sysreg.h
parentfc032421ef4a825660fcc4d11672bc2dea202893 (diff)
downloadlinux-870828e57b141eff76a5325f20e4691dd2a599b1.tar.xz
arm64: kernel: Move config_sctlr_el1
Later patches need config_sctlr_el1 to set/clear bits in the sctlr_el1 register. This patch moves this function into header a file. Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/sysreg.h')
-rw-r--r--arch/arm64/include/asm/sysreg.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 5c89df0acbcb..56391fbae1e1 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -20,6 +20,9 @@
#ifndef __ASM_SYSREG_H
#define __ASM_SYSREG_H
+#define SCTLR_EL1_CP15BEN (0x1 << 5)
+#define SCTLR_EL1_SED (0x1 << 8)
+
#define sys_reg(op0, op1, crn, crm, op2) \
((((op0)-2)<<19)|((op1)<<16)|((crn)<<12)|((crm)<<8)|((op2)<<5))
@@ -55,6 +58,15 @@ asm(
" .endm\n"
);
+static inline void config_sctlr_el1(u32 clear, u32 set)
+{
+ u32 val;
+
+ asm volatile("mrs %0, sctlr_el1" : "=r" (val));
+ val &= ~clear;
+ val |= set;
+ asm volatile("msr sctlr_el1, %0" : : "r" (val));
+}
#endif
#endif /* __ASM_SYSREG_H */