blob: c535f9cb75ec86572e7e34c42b3bad50d33b318e [file] [log] [blame]
Jim Quinland552dde2021-12-09 15:47:24 -05001// SPDX-License-Identifier: GPL-2.0+
Kevin Cernekeed666cd02014-10-20 21:28:05 -07002
Kevin Cernekeed666cd02014-10-20 21:28:05 -07003#include <linux/types.h>
Christoph Hellwigd59098a2018-06-15 13:08:52 +02004#include <asm/bmips.h>
Jim Quinland552dde2021-12-09 15:47:24 -05005#include <asm/io.h>
Kevin Cernekeed666cd02014-10-20 21:28:05 -07006
Christoph Hellwig56e35f92019-11-07 18:03:11 +01007void arch_sync_dma_for_cpu_all(void)
Christoph Hellwigd59098a2018-06-15 13:08:52 +02008{
9 void __iomem *cbr = BMIPS_GET_CBR();
10 u32 cfg;
11
12 if (boot_cpu_type() != CPU_BMIPS3300 &&
13 boot_cpu_type() != CPU_BMIPS4350 &&
14 boot_cpu_type() != CPU_BMIPS4380)
15 return;
16
17 /* Flush stale data out of the readahead cache */
18 cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
19 __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
20 __raw_readl(cbr + BMIPS_RAC_CONFIG);
21}