OSDN Git Service

ARM: clean up cache handling in platform code
authorNicolas Pitre <nicolas.pitre@linaro.org>
Thu, 5 Dec 2013 19:26:16 +0000 (14:26 -0500)
committerOlof Johansson <olof@lixom.net>
Thu, 12 Dec 2013 00:24:34 +0000 (16:24 -0800)
We have a handy macro to replace open coded __cpuc_flush_dcache_area(()
and outer_clean_range() sequences. Let's use it. No functional change.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/mach-exynos/platsmp.c
arch/arm/mach-imx/platsmp.c
arch/arm/mach-msm/platsmp.c
arch/arm/mach-prima2/platsmp.c
arch/arm/mach-sti/platsmp.c
arch/arm/mach-ux500/platsmp.c
arch/arm/plat-versatile/platsmp.c

index 58b43e6..ddf73bd 100644 (file)
@@ -64,8 +64,7 @@ static void write_pen_release(int val)
 {
        pen_release = val;
        smp_wmb();
-       __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
-       outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
+       sync_cache_w(&pen_release);
 }
 
 static void __iomem *scu_base_addr(void)
index 1f24c1f..5b57c17 100644 (file)
@@ -92,8 +92,7 @@ static void __init imx_smp_prepare_cpus(unsigned int max_cpus)
         * secondary cores when booting them.
         */
        asm("mrc p15, 0, %0, c15, c0, 1" : "=r" (g_diag_reg) : : "cc");
-       __cpuc_flush_dcache_area(&g_diag_reg, sizeof(g_diag_reg));
-       outer_clean_range(__pa(&g_diag_reg), __pa(&g_diag_reg + 1));
+       sync_cache_w(&g_diag_reg);
 }
 
 struct smp_operations  imx_smp_ops __initdata = {
index 3f06edc..f10a1f5 100644 (file)
@@ -99,8 +99,7 @@ static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
         * "cpu" is Linux's internal ID.
         */
        pen_release = cpu_logical_map(cpu);
-       __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
-       outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
+       sync_cache_w(&pen_release);
 
        /*
         * Send the secondary CPU a soft interrupt, thereby causing
index 3dbcb1a..e358b07 100644 (file)
@@ -106,8 +106,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle)
         * "cpu" is Linux's internal ID.
         */
        pen_release = cpu_logical_map(cpu);
-       __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
-       outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
+       sync_cache_w(&pen_release);
 
        /*
         * Send the secondary CPU SEV, thereby causing the boot monitor to read
index dce50d9..fa2c33f 100644 (file)
@@ -31,8 +31,7 @@ static void write_pen_release(int val)
 {
        pen_release = val;
        smp_wmb();
-       __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
-       outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
+       sync_cache_w(&pen_release);
 }
 
 static DEFINE_SPINLOCK(boot_lock);
index 1f296e7..a44967f 100644 (file)
@@ -38,8 +38,7 @@ static void write_pen_release(int val)
 {
        pen_release = val;
        smp_wmb();
-       __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
-       outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
+       sync_cache_w(&pen_release);
 }
 
 static void __iomem *scu_base_addr(void)
index 39895d8..53feb90 100644 (file)
@@ -27,8 +27,7 @@ static void write_pen_release(int val)
 {
        pen_release = val;
        smp_wmb();
-       __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
-       outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
+       sync_cache_w(&pen_release);
 }
 
 static DEFINE_SPINLOCK(boot_lock);