Skip to content

Commit aa4db77

Browse files
Christoph Hellwigpaulburton
authored andcommitted
MIPS: move coherentio setup to setup.c
We want to be able to use it even when not building dma-default.c in the near future. Signed-off-by: Christoph Hellwig <hch@lst.de> Patchwork: https://patchwork.linux-mips.org/patch/19543/ 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 54aed4d commit aa4db77

2 files changed

Lines changed: 24 additions & 23 deletions

File tree

‎arch/mips/kernel/setup.c‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <asm/cdmm.h>
3737
#include <asm/cpu.h>
3838
#include <asm/debug.h>
39+
#include <asm/dma-coherence.h>
3940
#include <asm/sections.h>
4041
#include <asm/setup.h>
4142
#include <asm/smp-ops.h>
@@ -1055,3 +1056,26 @@ static int __init debugfs_mips(void)
10551056
}
10561057
arch_initcall(debugfs_mips);
10571058
#endif
1059+
1060+
#if defined(CONFIG_DMA_MAYBE_COHERENT) && !defined(CONFIG_DMA_PERDEV_COHERENT)
1061+
/* User defined DMA coherency from command line. */
1062+
enum coherent_io_user_state coherentio = IO_COHERENCE_DEFAULT;
1063+
EXPORT_SYMBOL_GPL(coherentio);
1064+
int hw_coherentio = 0; /* Actual hardware supported DMA coherency setting. */
1065+
1066+
static int __init setcoherentio(char *str)
1067+
{
1068+
coherentio = IO_COHERENCE_ENABLED;
1069+
pr_info("Hardware DMA cache coherency (command line)\n");
1070+
return 0;
1071+
}
1072+
early_param("coherentio", setcoherentio);
1073+
1074+
static int __init setnocoherentio(char *str)
1075+
{
1076+
coherentio = IO_COHERENCE_DISABLED;
1077+
pr_info("Software DMA cache coherency (command line)\n");
1078+
return 0;
1079+
}
1080+
early_param("nocoherentio", setnocoherentio);
1081+
#endif

‎arch/mips/mm/dma-default.c‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,6 @@
2424

2525
#include <dma-coherence.h>
2626

27-
#if defined(CONFIG_DMA_MAYBE_COHERENT) && !defined(CONFIG_DMA_PERDEV_COHERENT)
28-
/* User defined DMA coherency from command line. */
29-
enum coherent_io_user_state coherentio = IO_COHERENCE_DEFAULT;
30-
EXPORT_SYMBOL_GPL(coherentio);
31-
int hw_coherentio = 0; /* Actual hardware supported DMA coherency setting. */
32-
33-
static int __init setcoherentio(char *str)
34-
{
35-
coherentio = IO_COHERENCE_ENABLED;
36-
pr_info("Hardware DMA cache coherency (command line)\n");
37-
return 0;
38-
}
39-
early_param("coherentio", setcoherentio);
40-
41-
static int __init setnocoherentio(char *str)
42-
{
43-
coherentio = IO_COHERENCE_DISABLED;
44-
pr_info("Software DMA cache coherency (command line)\n");
45-
return 0;
46-
}
47-
early_param("nocoherentio", setnocoherentio);
48-
#endif
49-
5027
static inline struct page *dma_addr_to_page(struct device *dev,
5128
dma_addr_t dma_addr)
5229
{

0 commit comments

Comments
 (0)