aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2012-05-26 09:56:03 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-28 02:52:53 -0400
commit87e677c4122e732dd1f7142ba7b2d4823576a199 (patch)
treece5f6494a1e2030518a8077ee3da48b670dc369f /arch
parent556626adf1dc1ee88183b7ba267912b87b063a57 (diff)
sparc32,leon: always support leon in ioport
Unconditially define pci32_dma_ops as this is used for leon. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Konrad Eisele <konrad@gaisler.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/dma-mapping.h9
-rw-r--r--arch/sparc/kernel/ioport.c11
2 files changed, 9 insertions, 11 deletions
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h
index 48a7c65731d2..8493fd3c7ba5 100644
--- a/arch/sparc/include/asm/dma-mapping.h
+++ b/arch/sparc/include/asm/dma-mapping.h
@@ -12,13 +12,18 @@ extern int dma_supported(struct device *dev, u64 mask);
12#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 12#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
13#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 13#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
14 14
15extern struct dma_map_ops *dma_ops, pci32_dma_ops; 15extern struct dma_map_ops *dma_ops;
16extern struct dma_map_ops *leon_dma_ops;
17extern struct dma_map_ops pci32_dma_ops;
18
16extern struct bus_type pci_bus_type; 19extern struct bus_type pci_bus_type;
17 20
18static inline struct dma_map_ops *get_dma_ops(struct device *dev) 21static inline struct dma_map_ops *get_dma_ops(struct device *dev)
19{ 22{
20#if defined(CONFIG_SPARC32) && defined(CONFIG_PCI) 23#if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
21 if (dev->bus == &pci_bus_type) 24 if (sparc_cpu_model == sparc_leon)
25 return leon_dma_ops;
26 else if (dev->bus == &pci_bus_type)
22 return &pci32_dma_ops; 27 return &pci32_dma_ops;
23#endif 28#endif
24 return dma_ops; 29 return dma_ops;
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index a2846f5e32d8..8bc4db01af32 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -427,9 +427,6 @@ arch_initcall(sparc_register_ioport);
427#endif /* CONFIG_SBUS */ 427#endif /* CONFIG_SBUS */
428 428
429 429
430/* LEON reuses PCI DMA ops */
431#if defined(CONFIG_PCI) || defined(CONFIG_SPARC_LEON)
432
433/* Allocate and map kernel buffer using consistent mode DMA for a device. 430/* Allocate and map kernel buffer using consistent mode DMA for a device.
434 * hwdev should be valid struct pci_dev pointer for PCI devices. 431 * hwdev should be valid struct pci_dev pointer for PCI devices.
435 */ 432 */
@@ -657,13 +654,9 @@ struct dma_map_ops pci32_dma_ops = {
657}; 654};
658EXPORT_SYMBOL(pci32_dma_ops); 655EXPORT_SYMBOL(pci32_dma_ops);
659 656
660#endif /* CONFIG_PCI || CONFIG_SPARC_LEON */ 657/* leon re-uses pci32_dma_ops */
661 658struct dma_map_ops *leon_dma_ops = &pci32_dma_ops;
662#ifdef CONFIG_SPARC_LEON
663struct dma_map_ops *dma_ops = &pci32_dma_ops;
664#elif defined(CONFIG_SBUS)
665struct dma_map_ops *dma_ops = &sbus_dma_ops; 659struct dma_map_ops *dma_ops = &sbus_dma_ops;
666#endif
667 660
668EXPORT_SYMBOL(dma_ops); 661EXPORT_SYMBOL(dma_ops);
669 662