aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@gmail.com>2014-02-20 08:59:22 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-03-26 18:09:20 -0400
commit8005711c8d80e452748e9572bead54493818f042 (patch)
tree193f76f8296c996e44e8c2bf18b74e3c28aaaf4c
parentbfc3c5a6c71ea17b79ad524c5627333bd46834a2 (diff)
MIPS: Extend DMA_MAYBE_COHERENT logic to DMA_NONCOHERENT use
Setting DMA_MAYBE_COHERENT gives a platform the opportunity to select use of cache ops at boot. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: Linux-MIPS <linux-mips@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/6575/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/io.h4
-rw-r--r--arch/mips/mm/c-r4k.c6
-rw-r--r--arch/mips/mm/cache.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 3321dd5a8872..e221d1de32f3 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -584,7 +584,7 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
584 * 584 *
585 * This API used to be exported; it now is for arch code internal use only. 585 * This API used to be exported; it now is for arch code internal use only.
586 */ 586 */
587#ifdef CONFIG_DMA_NONCOHERENT 587#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT)
588 588
589extern void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size); 589extern void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size);
590extern void (*_dma_cache_wback)(unsigned long start, unsigned long size); 590extern void (*_dma_cache_wback)(unsigned long start, unsigned long size);
@@ -603,7 +603,7 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
603#define dma_cache_inv(start,size) \ 603#define dma_cache_inv(start,size) \
604 do { (void) (start); (void) (size); } while (0) 604 do { (void) (start); (void) (size); } while (0)
605 605
606#endif /* CONFIG_DMA_NONCOHERENT */ 606#endif /* CONFIG_DMA_NONCOHERENT || CONFIG_DMA_MAYBE_COHERENT */
607 607
608/* 608/*
609 * Read a 32-bit register that requires a 64-bit read cycle on the bus. 609 * Read a 32-bit register that requires a 64-bit read cycle on the bus.
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 8fc713f1d139..a62b6379b6ae 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -673,7 +673,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end)
673 instruction_hazard(); 673 instruction_hazard();
674} 674}
675 675
676#ifdef CONFIG_DMA_NONCOHERENT 676#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT)
677 677
678static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) 678static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
679{ 679{
@@ -744,7 +744,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
744 bc_inv(addr, size); 744 bc_inv(addr, size);
745 __sync(); 745 __sync();
746} 746}
747#endif /* CONFIG_DMA_NONCOHERENT */ 747#endif /* CONFIG_DMA_NONCOHERENT || CONFIG_DMA_MAYBE_COHERENT */
748 748
749/* 749/*
750 * While we're protected against bad userland addresses we don't care 750 * While we're protected against bad userland addresses we don't care
@@ -1559,7 +1559,7 @@ void r4k_cache_init(void)
1559 flush_icache_range = r4k_flush_icache_range; 1559 flush_icache_range = r4k_flush_icache_range;
1560 local_flush_icache_range = local_r4k_flush_icache_range; 1560 local_flush_icache_range = local_r4k_flush_icache_range;
1561 1561
1562#if defined(CONFIG_DMA_NONCOHERENT) 1562#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT)
1563 if (coherentio) { 1563 if (coherentio) {
1564 _dma_cache_wback_inv = (void *)cache_noop; 1564 _dma_cache_wback_inv = (void *)cache_noop;
1565 _dma_cache_wback = (void *)cache_noop; 1565 _dma_cache_wback = (void *)cache_noop;
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index fde7e56d13fe..e422b38d3113 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -49,7 +49,7 @@ EXPORT_SYMBOL_GPL(local_flush_data_cache_page);
49EXPORT_SYMBOL(flush_data_cache_page); 49EXPORT_SYMBOL(flush_data_cache_page);
50EXPORT_SYMBOL(flush_icache_all); 50EXPORT_SYMBOL(flush_icache_all);
51 51
52#ifdef CONFIG_DMA_NONCOHERENT 52#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT)
53 53
54/* DMA cache operations. */ 54/* DMA cache operations. */
55void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size); 55void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size);
@@ -58,7 +58,7 @@ void (*_dma_cache_inv)(unsigned long start, unsigned long size);
58 58
59EXPORT_SYMBOL(_dma_cache_wback_inv); 59EXPORT_SYMBOL(_dma_cache_wback_inv);
60 60
61#endif /* CONFIG_DMA_NONCOHERENT */ 61#endif /* CONFIG_DMA_NONCOHERENT || CONFIG_DMA_MAYBE_COHERENT */
62 62
63/* 63/*
64 * We could optimize the case where the cache argument is not BCACHE but 64 * We could optimize the case where the cache argument is not BCACHE but