Skip to contentSkip to conversation

MIPS: Rework BMIPS dma-coherence header

PATCH New Florian Fainelli 1 participant 1 message Apr 7, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Rework BMIPS dma-coherence header

Commits 0c8741360c6 ("MIPS: BMIPS: Create bmips-dma-coherence.h") and 6fb7566baa01 ("MIPS: BCM63xx: Utilize bmips-dma-coherence.h") have put a tad too much into bmips-dma-coherence.h. mach-bmips overrides some of the platform DMA operations to deal with a configurable translation window address, whereas BCM63xx can use the default implementation from asm/mach-generic/dma-coherence.c.

The only thing that is truly shareable by nature is the post DMA flush hook, which is now renamed to bmips_post_dma_flush() and utilized by both machines.

This fixes build failures on BCM63xx since we did not provide valid plat_dma_* helper functions.

Fixes 0c8741360c6 ("MIPS: BMIPS: Create bmips-dma-coherence.h")
Fixes 6fb7566baa01 ("MIPS: BCM63xx: Utilize bmips-dma-coherence.h")

---
Hi Ralf,

This applies on top of mips-for-linux-next, and fixes build failures reported on linux-next.

Thanks!

 arch/mips/include/asm/bmips-dma-coherence.h        | 32 +--------------
 arch/mips/include/asm/mach-bcm63xx/dma-coherence.h | 45 ++++++++++++++++++++++
 arch/mips/include/asm/mach-bmips/dma-coherence.h   | 32 +++++++++++++++
 3 files changed, 78 insertions(+), 31 deletions(-)
arch/mips/include/asm/bmips-dma-coherence.h +1 -31
index bd4aac47b832..7ae0ea45fa70 100644
@@ -19,37 +19,7 @@
 #include <asm/cpu-type.h>
 #include <asm/cpu.h>
 
-struct device;
-
-extern dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size);
-extern dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page);
-extern unsigned long plat_dma_addr_to_phys(struct device *dev,
-	dma_addr_t dma_addr);
-
-static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
-	size_t size, enum dma_data_direction direction)
-{
-}
-
-static inline int plat_dma_supported(struct device *dev, u64 mask)
-{
-	/*
-	 * we fall back to GFP_DMA when the mask isn't all 1s,
-	 * so we can't guarantee allocations that must be
-	 * within a tighter range than GFP_DMA..
-	 */
-	if (mask < DMA_BIT_MASK(24))
-		return 0;
-
-	return 1;
-}
-
-static inline int plat_device_is_coherent(struct device *dev)
-{
-	return 0;
-}
-
-static inline void plat_post_dma_flush(struct device *dev)
+static inline void bmips_post_dma_flush(struct device *dev)
 {
 	void __iomem *cbr = BMIPS_GET_CBR();
 	u32 cfg;
arch/mips/include/asm/mach-bcm63xx/dma-coherence.h +45 -0

51 lines not on this page · raw message

arch/mips/include/asm/mach-bmips/dma-coherence.h +32 -0
index 4d88233a82fd..18b24064f469 100644
@@ -3,4 +3,36 @@
 
 #include <asm/bmips-dma-coherence.h>
 
+struct device;
+
+extern dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size);
+extern dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page);
+extern unsigned long plat_dma_addr_to_phys(struct device *dev,
+	dma_addr_t dma_addr);
+
+static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
+	size_t size, enum dma_data_direction direction)
+{
+}
+
+static inline int plat_dma_supported(struct device *dev, u64 mask)
+{
+	/*
+	 * we fall back to GFP_DMA when the mask isn't all 1s,
+	 * so we can't guarantee allocations that must be
+	 * within a tighter range than GFP_DMA..
+	 */
+	if (mask < DMA_BIT_MASK(24))
+		return 0;
+
+	return 1;
+}
+
+static inline int plat_device_is_coherent(struct device *dev)
+{
+	return 0;
+}
+
+#define plat_post_dma_flush	bmips_post_dma_flush
+
 #endif /* __ASM_MACH_BMIPS_DMA_COHERENCE_H */
Signature · 1 line
2.1.0