drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / arch / mips / bmips / dma.c
blob2bc9c0d4402fdc8b0be618348e66a21ac672e841
1 // SPDX-License-Identifier: GPL-2.0+
3 #include <linux/types.h>
4 #include <linux/dma-map-ops.h>
5 #include <asm/bmips.h>
6 #include <asm/io.h>
8 bool bmips_rac_flush_disable;
10 void arch_sync_dma_for_cpu_all(void)
12 void __iomem *cbr = bmips_cbr_addr;
13 u32 cfg;
15 if (boot_cpu_type() != CPU_BMIPS3300 &&
16 boot_cpu_type() != CPU_BMIPS4350 &&
17 boot_cpu_type() != CPU_BMIPS4380)
18 return;
20 if (unlikely(bmips_rac_flush_disable))
21 return;
23 /* Flush stale data out of the readahead cache */
24 cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
25 __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
26 __raw_readl(cbr + BMIPS_RAC_CONFIG);