Skip to content

Commit d7e64bf

Browse files
Christoph Hellwigpaulburton
authored andcommitted
MIPS: loongson: remove loongson-3 handling from dma-coherence.h
Loongson3 is dma coherent and uses swiotlb, so it will never used any of these helpers. Signed-off-by: Christoph Hellwig <hch@lst.de> Patchwork: https://patchwork.linux-mips.org/patch/19541/ Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: David Daney <david.daney@cavium.com> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Tom Bogendoerfer <tsbogend@alpha.franken.de> Cc: Huacai Chen <chenhc@lemote.com> Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org
1 parent d3bc81b commit d7e64bf

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

arch/mips/include/asm/mach-loongson64/dma-coherence.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,19 @@ struct device;
2020
static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
2121
size_t size)
2222
{
23-
#ifdef CONFIG_CPU_LOONGSON3
24-
return __phys_to_dma(dev, virt_to_phys(addr));
25-
#else
2623
return virt_to_phys(addr) | 0x80000000;
27-
#endif
2824
}
2925

3026
static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
3127
struct page *page)
3228
{
33-
#ifdef CONFIG_CPU_LOONGSON3
34-
return __phys_to_dma(dev, page_to_phys(page));
35-
#else
3629
return page_to_phys(page) | 0x80000000;
37-
#endif
3830
}
3931

4032
static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
4133
dma_addr_t dma_addr)
4234
{
43-
#if defined(CONFIG_CPU_LOONGSON3) && defined(CONFIG_64BIT)
44-
return __dma_to_phys(dev, dma_addr);
45-
#elif defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT)
35+
#if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT)
4636
return (dma_addr > 0x8fffffff) ? dma_addr : (dma_addr & 0x0fffffff);
4737
#else
4838
return dma_addr & 0x7fffffff;
@@ -69,11 +59,7 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
6959

7060
static inline int plat_device_is_coherent(struct device *dev)
7161
{
72-
#ifdef CONFIG_DMA_NONCOHERENT
7362
return 0;
74-
#else
75-
return 1;
76-
#endif /* CONFIG_DMA_NONCOHERENT */
7763
}
7864

7965
static inline void plat_post_dma_flush(struct device *dev)

0 commit comments

Comments
 (0)