aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2012-09-10 17:43:51 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2012-09-14 14:53:00 +0100
commit27e49c830891c6903cbd1bfdd898c62de7b20a14 (patch)
treeb718e69fb9deef26c44d268b2f5bf2c096533db5
parent5e09c24cd639a387a9a23ea2a475d7997f24fd5c (diff)
downloadlinux-aarch64-27e49c830891c6903cbd1bfdd898c62de7b20a14.tar.gz
arm64: Implement cpu_cache_off()
This function disables the D-cache during setup_restart(). The patch also removes the empty cpu_cache_init() function. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r--arch/arm64/include/asm/proc-fns.h3
-rw-r--r--arch/arm64/kernel/process.c4
-rw-r--r--arch/arm64/kernel/setup.c2
-rw-r--r--arch/arm64/mm/proc.S17
4 files changed, 14 insertions, 12 deletions
diff --git a/arch/arm64/include/asm/proc-fns.h b/arch/arm64/include/asm/proc-fns.h
index 520331b48de..7cdf466fd0c 100644
--- a/arch/arm64/include/asm/proc-fns.h
+++ b/arch/arm64/include/asm/proc-fns.h
@@ -27,8 +27,7 @@
struct mm_struct;
-extern void cpu_proc_init(void);
-extern void cpu_proc_fin(void);
+extern void cpu_cache_off(void);
extern void cpu_do_idle(void);
extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 635310ec444..f22965ea1cf 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -61,8 +61,8 @@ static void setup_restart(void)
/* Clean and invalidate caches */
flush_cache_all();
- /* Turn off caching */
- cpu_proc_fin();
+ /* Turn D-cache off */
+ cpu_cache_off();
/* Push out any further dirty data, and ensure cache is empty */
flush_cache_all();
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 0c273a0bc04..48ffb9fb3fe 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -116,8 +116,6 @@ static void __init setup_processor(void)
sprintf(init_utsname()->machine, "aarch64");
elf_hwcap = 0;
-
- cpu_proc_init();
}
static void __init setup_machine_fdt(phys_addr_t dt_phys)
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 674cd746bd0..720aa0b3bee 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -38,13 +38,18 @@
#define MAIR(attr, mt) ((attr) << ((mt) * 8))
-ENTRY(cpu_proc_init)
- ret
-ENDPROC(cpu_proc_init)
-
-ENTRY(cpu_proc_fin)
+/*
+ * cpu_cache_off()
+ *
+ * Turn the CPU D-cache off.
+ */
+ENTRY(cpu_cache_off)
+ mrs x0, sctlr_el1
+ bic x0, x0, #1 << 2 // clear SCTLR.C
+ msr sctlr_el1, x0
+ isb
ret
-ENDPROC(cpu_proc_fin)
+ENDPROC(cpu_cache_off)
/*
* cpu_reset(loc)