2021-12-10 04:47:24 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2014-10-21 12:28:05 +08:00
|
|
|
|
|
|
|
#include <linux/types.h>
|
2022-05-23 20:16:39 +08:00
|
|
|
#include <linux/dma-map-ops.h>
|
2018-06-15 19:08:52 +08:00
|
|
|
#include <asm/bmips.h>
|
2021-12-10 04:47:24 +08:00
|
|
|
#include <asm/io.h>
|
2014-10-21 12:28:05 +08:00
|
|
|
|
2019-11-08 01:03:11 +08:00
|
|
|
void arch_sync_dma_for_cpu_all(void)
|
2018-06-15 19:08:52 +08:00
|
|
|
{
|
|
|
|
void __iomem *cbr = BMIPS_GET_CBR();
|
|
|
|
u32 cfg;
|
|
|
|
|
|
|
|
if (boot_cpu_type() != CPU_BMIPS3300 &&
|
|
|
|
boot_cpu_type() != CPU_BMIPS4350 &&
|
|
|
|
boot_cpu_type() != CPU_BMIPS4380)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Flush stale data out of the readahead cache */
|
|
|
|
cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
|
|
|
|
__raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
|
|
|
|
__raw_readl(cbr + BMIPS_RAC_CONFIG);
|
|
|
|
}
|