Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0+
0002 
0003 #include <linux/types.h>
0004 #include <linux/dma-map-ops.h>
0005 #include <asm/bmips.h>
0006 #include <asm/io.h>
0007 
0008 void arch_sync_dma_for_cpu_all(void)
0009 {
0010     void __iomem *cbr = BMIPS_GET_CBR();
0011     u32 cfg;
0012 
0013     if (boot_cpu_type() != CPU_BMIPS3300 &&
0014         boot_cpu_type() != CPU_BMIPS4350 &&
0015         boot_cpu_type() != CPU_BMIPS4380)
0016         return;
0017 
0018     /* Flush stale data out of the readahead cache */
0019     cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
0020     __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
0021     __raw_readl(cbr + BMIPS_RAC_CONFIG);
0022 }