aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 21:09:11 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:13:15 -0400
commit738f2b7b813913e651f39387d007dd961755dee2 (patch)
tree022ca4d144cba51495e6f26a8f55d3046d16c2e3 /arch/sparc/include
parent944c67dff7a88f0a775e5b604937f9e30d2de555 (diff)
sparc: Convert all SBUS drivers to dma_*() interfaces.
And all the SBUS dma interfaces are deleted. A private implementation remains inside of the 32-bit sparc port which exists only for the sake of the implementation of dma_*(). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include')
-rw-r--r--arch/sparc/include/asm/sbus_32.h17
-rw-r--r--arch/sparc/include/asm/sbus_64.h63
2 files changed, 0 insertions, 80 deletions
diff --git a/arch/sparc/include/asm/sbus_32.h b/arch/sparc/include/asm/sbus_32.h
index 61d99f1bb23c..b09284b5ee06 100644
--- a/arch/sparc/include/asm/sbus_32.h
+++ b/arch/sparc/include/asm/sbus_32.h
@@ -109,26 +109,9 @@ extern void sbus_set_sbus64(struct sbus_dev *, int);
109extern void sbus_fill_device_irq(struct sbus_dev *); 109extern void sbus_fill_device_irq(struct sbus_dev *);
110 110
111/* These yield IOMMU mappings in consistent mode. */ 111/* These yield IOMMU mappings in consistent mode. */
112extern void *sbus_alloc_consistent(struct device *, long, u32 *dma_addrp);
113extern void sbus_free_consistent(struct device *, long, void *, u32);
114void prom_adjust_ranges(struct linux_prom_ranges *, int, 112void prom_adjust_ranges(struct linux_prom_ranges *, int,
115 struct linux_prom_ranges *, int); 113 struct linux_prom_ranges *, int);
116 114
117#define SBUS_DMA_BIDIRECTIONAL DMA_BIDIRECTIONAL
118#define SBUS_DMA_TODEVICE DMA_TO_DEVICE
119#define SBUS_DMA_FROMDEVICE DMA_FROM_DEVICE
120#define SBUS_DMA_NONE DMA_NONE
121
122/* All the rest use streaming mode mappings. */
123extern dma_addr_t sbus_map_single(struct device *, void *, size_t, int);
124extern void sbus_unmap_single(struct device *, dma_addr_t, size_t, int);
125extern int sbus_map_sg(struct device *, struct scatterlist *, int, int);
126extern void sbus_unmap_sg(struct device *, struct scatterlist *, int, int);
127
128/* Finally, allow explicit synchronization of streamable mappings. */
129extern void sbus_dma_sync_single_for_cpu(struct device *, dma_addr_t, size_t, int);
130extern void sbus_dma_sync_single_for_device(struct device *, dma_addr_t, size_t, int);
131
132/* Eric Brower (ebrower@usa.net) 115/* Eric Brower (ebrower@usa.net)
133 * Translate SBus interrupt levels to ino values-- 116 * Translate SBus interrupt levels to ino values--
134 * this is used when converting sbus "interrupts" OBP 117 * this is used when converting sbus "interrupts" OBP
diff --git a/arch/sparc/include/asm/sbus_64.h b/arch/sparc/include/asm/sbus_64.h
index b22e99da49d8..9a2f27188f6a 100644
--- a/arch/sparc/include/asm/sbus_64.h
+++ b/arch/sparc/include/asm/sbus_64.h
@@ -100,69 +100,6 @@ extern struct sbus_bus *sbus_root;
100extern void sbus_set_sbus64(struct sbus_dev *, int); 100extern void sbus_set_sbus64(struct sbus_dev *, int);
101extern void sbus_fill_device_irq(struct sbus_dev *); 101extern void sbus_fill_device_irq(struct sbus_dev *);
102 102
103static inline void *sbus_alloc_consistent(struct device *dev , size_t size,
104 dma_addr_t *dma_handle)
105{
106 return dma_alloc_coherent(dev, size, dma_handle, GFP_ATOMIC);
107}
108
109static inline void sbus_free_consistent(struct device *dev, size_t size,
110 void *vaddr, dma_addr_t dma_handle)
111{
112 return dma_free_coherent(dev, size, vaddr, dma_handle);
113}
114
115#define SBUS_DMA_BIDIRECTIONAL DMA_BIDIRECTIONAL
116#define SBUS_DMA_TODEVICE DMA_TO_DEVICE
117#define SBUS_DMA_FROMDEVICE DMA_FROM_DEVICE
118#define SBUS_DMA_NONE DMA_NONE
119
120/* All the rest use streaming mode mappings. */
121static inline dma_addr_t sbus_map_single(struct device *dev, void *ptr,
122 size_t size, int direction)
123{
124 return dma_map_single(dev, ptr, size,
125 (enum dma_data_direction) direction);
126}
127
128static inline void sbus_unmap_single(struct device *dev,
129 dma_addr_t dma_addr, size_t size,
130 int direction)
131{
132 dma_unmap_single(dev, dma_addr, size,
133 (enum dma_data_direction) direction);
134}
135
136static inline int sbus_map_sg(struct device *dev, struct scatterlist *sg,
137 int nents, int direction)
138{
139 return dma_map_sg(dev, sg, nents,
140 (enum dma_data_direction) direction);
141}
142
143static inline void sbus_unmap_sg(struct device *dev, struct scatterlist *sg,
144 int nents, int direction)
145{
146 dma_unmap_sg(dev, sg, nents,
147 (enum dma_data_direction) direction);
148}
149
150/* Finally, allow explicit synchronization of streamable mappings. */
151static inline void sbus_dma_sync_single_for_cpu(struct device *dev,
152 dma_addr_t dma_handle,
153 size_t size, int direction)
154{
155 dma_sync_single_for_cpu(dev, dma_handle, size,
156 (enum dma_data_direction) direction);
157}
158
159static inline void sbus_dma_sync_single_for_device(struct device *dev,
160 dma_addr_t dma_handle,
161 size_t size, int direction)
162{
163 /* No flushing needed to sync cpu writes to the device. */
164}
165
166extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); 103extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *);
167extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); 104extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *);
168extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *); 105extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *);