diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-01-04 10:08:30 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-04 10:08:30 -0500 |
commit | 7cdad482974792419cfe4b0affca689170116f49 (patch) | |
tree | f9ee204f8848274ffb3323f425ad039cf4807de6 /arch/arm/mach-rpc/dma.c | |
parent | 333c9624b728a9e83b741ea75836aa114ec35272 (diff) |
[ARM] Remove '__address' from scatterlist and convert to DMA API
The old __address element in struct scatterlist remained from older
kernels because the ARM DMA emulation code made use of it. Move
this field into struct dma_struct, and convert DMA emulation code
to setup a SG entry as required.
Also, convert DMA emulation code to use the new DMA API rather
than the PCI DMA API.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-rpc/dma.c')
-rw-r--r-- | arch/arm/mach-rpc/dma.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index bc0747439fb3..bd86ffba8810 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/mman.h> | 13 | #include <linux/mman.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
16 | #include <linux/pci.h> | 16 | #include <linux/dma-mapping.h> |
17 | 17 | ||
18 | #include <asm/page.h> | 18 | #include <asm/page.h> |
19 | #include <asm/dma.h> | 19 | #include <asm/dma.h> |
@@ -148,11 +148,14 @@ static void iomd_enable_dma(dmach_t channel, dma_t *dma) | |||
148 | * Cope with ISA-style drivers which expect cache | 148 | * Cope with ISA-style drivers which expect cache |
149 | * coherence. | 149 | * coherence. |
150 | */ | 150 | */ |
151 | if (!dma->using_sg) { | 151 | if (!dma->sg) { |
152 | dma->buf.dma_address = pci_map_single(NULL, | 152 | dma->sg = &dma->buf; |
153 | dma->buf.__address, dma->buf.length, | 153 | dma->sgcount = 1; |
154 | dma->buf.length = dma->count; | ||
155 | dma->buf.dma_address = dma_map_single(NULL, | ||
156 | dma->addr, dma->count, | ||
154 | dma->dma_mode == DMA_MODE_READ ? | 157 | dma->dma_mode == DMA_MODE_READ ? |
155 | PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE); | 158 | DMA_FROM_DEVICE : DMA_TO_DEVICE); |
156 | } | 159 | } |
157 | 160 | ||
158 | iomd_writeb(DMA_CR_C, dma_base + CR); | 161 | iomd_writeb(DMA_CR_C, dma_base + CR); |
@@ -239,7 +242,7 @@ static void floppy_enable_dma(dmach_t channel, dma_t *dma) | |||
239 | unsigned int fiqhandler_length; | 242 | unsigned int fiqhandler_length; |
240 | struct pt_regs regs; | 243 | struct pt_regs regs; |
241 | 244 | ||
242 | if (dma->using_sg) | 245 | if (dma->sg) |
243 | BUG(); | 246 | BUG(); |
244 | 247 | ||
245 | if (dma->dma_mode == DMA_MODE_READ) { | 248 | if (dma->dma_mode == DMA_MODE_READ) { |
@@ -252,8 +255,8 @@ static void floppy_enable_dma(dmach_t channel, dma_t *dma) | |||
252 | fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start; | 255 | fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start; |
253 | } | 256 | } |
254 | 257 | ||
255 | regs.ARM_r9 = dma->buf.length; | 258 | regs.ARM_r9 = dma->count; |
256 | regs.ARM_r10 = (unsigned long)dma->buf.__address; | 259 | regs.ARM_r10 = (unsigned long)dma->addr; |
257 | regs.ARM_fp = (unsigned long)FLOPPYDMA_BASE; | 260 | regs.ARM_fp = (unsigned long)FLOPPYDMA_BASE; |
258 | 261 | ||
259 | if (claim_fiq(&fh)) { | 262 | if (claim_fiq(&fh)) { |