Commit f45913fd authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Olof Johansson

ARM: clean up cache handling in platform code

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: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parent bc34eb53
...@@ -64,8 +64,7 @@ static void write_pen_release(int val) ...@@ -64,8 +64,7 @@ static void write_pen_release(int val)
{ {
pen_release = val; pen_release = val;
smp_wmb(); smp_wmb();
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); sync_cache_w(&pen_release);
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
} }
static void __iomem *scu_base_addr(void) static void __iomem *scu_base_addr(void)
......
...@@ -92,8 +92,7 @@ static void __init imx_smp_prepare_cpus(unsigned int max_cpus) ...@@ -92,8 +92,7 @@ static void __init imx_smp_prepare_cpus(unsigned int max_cpus)
* secondary cores when booting them. * secondary cores when booting them.
*/ */
asm("mrc p15, 0, %0, c15, c0, 1" : "=r" (g_diag_reg) : : "cc"); asm("mrc p15, 0, %0, c15, c0, 1" : "=r" (g_diag_reg) : : "cc");
__cpuc_flush_dcache_area(&g_diag_reg, sizeof(g_diag_reg)); sync_cache_w(&g_diag_reg);
outer_clean_range(__pa(&g_diag_reg), __pa(&g_diag_reg + 1));
} }
struct smp_operations imx_smp_ops __initdata = { struct smp_operations imx_smp_ops __initdata = {
......
...@@ -99,8 +99,7 @@ static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle) ...@@ -99,8 +99,7 @@ static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
* "cpu" is Linux's internal ID. * "cpu" is Linux's internal ID.
*/ */
pen_release = cpu_logical_map(cpu); pen_release = cpu_logical_map(cpu);
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); sync_cache_w(&pen_release);
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
/* /*
* Send the secondary CPU a soft interrupt, thereby causing * Send the secondary CPU a soft interrupt, thereby causing
......
...@@ -106,8 +106,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) ...@@ -106,8 +106,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle)
* "cpu" is Linux's internal ID. * "cpu" is Linux's internal ID.
*/ */
pen_release = cpu_logical_map(cpu); pen_release = cpu_logical_map(cpu);
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); sync_cache_w(&pen_release);
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
/* /*
* Send the secondary CPU SEV, thereby causing the boot monitor to read * Send the secondary CPU SEV, thereby causing the boot monitor to read
......
...@@ -31,8 +31,7 @@ static void write_pen_release(int val) ...@@ -31,8 +31,7 @@ static void write_pen_release(int val)
{ {
pen_release = val; pen_release = val;
smp_wmb(); smp_wmb();
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); sync_cache_w(&pen_release);
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
} }
static DEFINE_SPINLOCK(boot_lock); static DEFINE_SPINLOCK(boot_lock);
......
...@@ -38,8 +38,7 @@ static void write_pen_release(int val) ...@@ -38,8 +38,7 @@ static void write_pen_release(int val)
{ {
pen_release = val; pen_release = val;
smp_wmb(); smp_wmb();
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); sync_cache_w(&pen_release);
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
} }
static void __iomem *scu_base_addr(void) static void __iomem *scu_base_addr(void)
......
...@@ -27,8 +27,7 @@ static void write_pen_release(int val) ...@@ -27,8 +27,7 @@ static void write_pen_release(int val)
{ {
pen_release = val; pen_release = val;
smp_wmb(); smp_wmb();
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); sync_cache_w(&pen_release);
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
} }
static DEFINE_SPINLOCK(boot_lock); static DEFINE_SPINLOCK(boot_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment