aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2015-04-07 16:34:00 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-04-08 17:52:32 -0400
commit36fe97635826d54d07c51a5953148235b7dd6a04 (patch)
tree0c73ddd2fcb135be088be7b1bd2a4a88f911c008 /arch/mips/include/asm
parent87842661a315618dfdeeede188257e4011164023 (diff)
MIPS: BMIPS: Move post DMA flush implementation to common header
arch/mips/include/asm/mach-bmips/dma-coherence.h contains the plat_post_dma_flush implementation which is not specific to mach-bmips, but required for all BMIPS-based systems. Move plat_post_dma_flush to arch/mips/include/asm/bmips.h, rename it to bmips_post_dma_flush such that other platforms like bcm63xx can utilize it. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Cc: linux-mips@linux-mips.org Cc: cernekee@gmail.com Cc: jogo@openwrt.org Patchwork: https://patchwork.linux-mips.org/patch/9724/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm')
-rw-r--r--arch/mips/include/asm/bmips.h16
-rw-r--r--arch/mips/include/asm/mach-bmips/dma-coherence.h16
2 files changed, 17 insertions, 15 deletions
diff --git a/arch/mips/include/asm/bmips.h b/arch/mips/include/asm/bmips.h
index 30939b02e3ff..6d25ad33ec78 100644
--- a/arch/mips/include/asm/bmips.h
+++ b/arch/mips/include/asm/bmips.h
@@ -122,6 +122,22 @@ static inline void bmips_write_zscm_reg(unsigned int offset, unsigned long data)
122 barrier(); 122 barrier();
123} 123}
124 124
125static inline void bmips_post_dma_flush(struct device *dev)
126{
127 void __iomem *cbr = BMIPS_GET_CBR();
128 u32 cfg;
129
130 if (boot_cpu_type() != CPU_BMIPS3300 &&
131 boot_cpu_type() != CPU_BMIPS4350 &&
132 boot_cpu_type() != CPU_BMIPS4380)
133 return;
134
135 /* Flush stale data out of the readahead cache */
136 cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
137 __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
138 __raw_readl(cbr + BMIPS_RAC_CONFIG);
139}
140
125#endif /* !defined(__ASSEMBLY__) */ 141#endif /* !defined(__ASSEMBLY__) */
126 142
127#endif /* _ASM_BMIPS_H */ 143#endif /* _ASM_BMIPS_H */
diff --git a/arch/mips/include/asm/mach-bmips/dma-coherence.h b/arch/mips/include/asm/mach-bmips/dma-coherence.h
index ee3c713d642e..d29781f02285 100644
--- a/arch/mips/include/asm/mach-bmips/dma-coherence.h
+++ b/arch/mips/include/asm/mach-bmips/dma-coherence.h
@@ -49,20 +49,6 @@ static inline int plat_device_is_coherent(struct device *dev)
49 return 0; 49 return 0;
50} 50}
51 51
52static inline void plat_post_dma_flush(struct device *dev) 52#define plat_post_dma_flush bmips_post_dma_flush
53{
54 void __iomem *cbr = BMIPS_GET_CBR();
55 u32 cfg;
56
57 if (boot_cpu_type() != CPU_BMIPS3300 &&
58 boot_cpu_type() != CPU_BMIPS4350 &&
59 boot_cpu_type() != CPU_BMIPS4380)
60 return;
61
62 /* Flush stale data out of the readahead cache */
63 cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
64 __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
65 __raw_readl(cbr + BMIPS_RAC_CONFIG);
66}
67 53
68#endif /* __ASM_MACH_BMIPS_DMA_COHERENCE_H */ 54#endif /* __ASM_MACH_BMIPS_DMA_COHERENCE_H */