Skip to content

Commit f45913f

Browse files
Nicolas Pitreolofj
authored andcommitted
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: Nicolas Pitre <nico@linaro.org> Signed-off-by: Olof Johansson <olof@lixom.net>
1 parent bc34eb5 commit f45913f

7 files changed

Lines changed: 7 additions & 14 deletions

File tree

‎arch/arm/mach-exynos/platsmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ static void write_pen_release(int val)
6464
{
6565
pen_release = val;
6666
smp_wmb();
67-
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
68-
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
67+
sync_cache_w(&pen_release);
6968
}
7069

7170
static void __iomem *scu_base_addr(void)

‎arch/arm/mach-imx/platsmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ static void __init imx_smp_prepare_cpus(unsigned int max_cpus)
9292
* secondary cores when booting them.
9393
*/
9494
asm("mrc p15, 0, %0, c15, c0, 1" : "=r" (g_diag_reg) : : "cc");
95-
__cpuc_flush_dcache_area(&g_diag_reg, sizeof(g_diag_reg));
96-
outer_clean_range(__pa(&g_diag_reg), __pa(&g_diag_reg + 1));
95+
sync_cache_w(&g_diag_reg);
9796
}
9897

9998
struct smp_operations imx_smp_ops __initdata = {

‎arch/arm/mach-msm/platsmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
9999
* "cpu" is Linux's internal ID.
100100
*/
101101
pen_release = cpu_logical_map(cpu);
102-
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
103-
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
102+
sync_cache_w(&pen_release);
104103

105104
/*
106105
* Send the secondary CPU a soft interrupt, thereby causing

‎arch/arm/mach-prima2/platsmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle)
106106
* "cpu" is Linux's internal ID.
107107
*/
108108
pen_release = cpu_logical_map(cpu);
109-
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
110-
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
109+
sync_cache_w(&pen_release);
111110

112111
/*
113112
* Send the secondary CPU SEV, thereby causing the boot monitor to read

‎arch/arm/mach-sti/platsmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ static void write_pen_release(int val)
3131
{
3232
pen_release = val;
3333
smp_wmb();
34-
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
35-
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
34+
sync_cache_w(&pen_release);
3635
}
3736

3837
static DEFINE_SPINLOCK(boot_lock);

‎arch/arm/mach-ux500/platsmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ static void write_pen_release(int val)
3838
{
3939
pen_release = val;
4040
smp_wmb();
41-
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
42-
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
41+
sync_cache_w(&pen_release);
4342
}
4443

4544
static void __iomem *scu_base_addr(void)

‎arch/arm/plat-versatile/platsmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ static void write_pen_release(int val)
2727
{
2828
pen_release = val;
2929
smp_wmb();
30-
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
31-
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
30+
sync_cache_w(&pen_release);
3231
}
3332

3433
static DEFINE_SPINLOCK(boot_lock);

0 commit comments

Comments
 (0)