diff options
-rw-r--r-- | arch/mips/include/asm/bmips.h | 16 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-bmips/dma-coherence.h | 16 |
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 | ||
125 | static 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 | ||
52 | static 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 */ |