Linux Audio

Check our new training course

Loading...
v6.8
 1// SPDX-License-Identifier: GPL-2.0+
 2
 3#include <linux/types.h>
 4#include <linux/dma-map-ops.h>
 5#include <asm/bmips.h>
 6#include <asm/io.h>
 7
 8bool bmips_rac_flush_disable;
 9
10void arch_sync_dma_for_cpu_all(void)
11{
12	void __iomem *cbr = BMIPS_GET_CBR();
13	u32 cfg;
14
15	if (boot_cpu_type() != CPU_BMIPS3300 &&
16	    boot_cpu_type() != CPU_BMIPS4350 &&
17	    boot_cpu_type() != CPU_BMIPS4380)
18		return;
19
20	if (unlikely(bmips_rac_flush_disable))
21		return;
22
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);
27}
v6.2
 1// SPDX-License-Identifier: GPL-2.0+
 2
 3#include <linux/types.h>
 4#include <linux/dma-map-ops.h>
 5#include <asm/bmips.h>
 6#include <asm/io.h>
 7
 
 
 8void arch_sync_dma_for_cpu_all(void)
 9{
10	void __iomem *cbr = BMIPS_GET_CBR();
11	u32 cfg;
12
13	if (boot_cpu_type() != CPU_BMIPS3300 &&
14	    boot_cpu_type() != CPU_BMIPS4350 &&
15	    boot_cpu_type() != CPU_BMIPS4380)
 
 
 
16		return;
17
18	/* Flush stale data out of the readahead cache */
19	cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
20	__raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
21	__raw_readl(cbr + BMIPS_RAC_CONFIG);
22}