diff mbox

[10/11] armv7: Adding cpu specific cache managmenent

Message ID 1340037344-2497-11-git-send-email-mathieu.poirier@linaro.org
State New
Headers show

Commit Message

Mathieu Poirier June 18, 2012, 4:35 p.m. UTC
From: "Mathieu J. Poirier" <mathieu.poirier@linaro.org>

Some CPU (i.e u8500) need more cache management before launching
the Linux kernel.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: John Rigby <john.rigby@linaro.org>
---
 arch/arm/cpu/armv7/cpu.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Comments

Tom Rini June 18, 2012, 5:56 p.m. UTC | #1
On Mon, Jun 18, 2012 at 10:35:43AM -0600, mathieu.poirier@linaro.org wrote:

> diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
> index c6fa8ef..53c8baf 100644
> --- a/arch/arm/cpu/armv7/cpu.c
> +++ b/arch/arm/cpu/armv7/cpu.c
> @@ -44,6 +44,10 @@ void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3)
>  void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3)
>  	__attribute__((weak, alias("save_boot_params_default")));
>  
> +void __cpu_cache_management(void){}
> +void cpu_cache_management(void) __attribute__((weak,
> +				alias("__cpu_cache_management")));
> +

Use <linux/compiler.h> and void __weak cpu_cache_management(void) {}
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
index c6fa8ef..53c8baf 100644
--- a/arch/arm/cpu/armv7/cpu.c
+++ b/arch/arm/cpu/armv7/cpu.c
@@ -44,6 +44,10 @@  void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3)
 void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3)
 	__attribute__((weak, alias("save_boot_params_default")));
 
+void __cpu_cache_management(void){}
+void cpu_cache_management(void) __attribute__((weak,
+				alias("__cpu_cache_management")));
+
 int cleanup_before_linux(void)
 {
 	/*
@@ -81,5 +85,10 @@  int cleanup_before_linux(void)
 	 */
 	invalidate_dcache_all();
 
+	/*
+	 * Some CPU need more cache attention before starting the kernel.
+	 */
+	cpu_cache_management();
+
 	return 0;
 }