Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137170
b: refs/heads/master
c: bc6447b
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jan 2, 2009
1 parent 0e68477 commit ef423a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5369bea7d7db1d95f63907f3470e23d32930be98
refs/heads/master: bc6447b8e4fdb3306ee6381df9650a1a8aa57c5b
13 changes: 8 additions & 5 deletions trunk/arch/arm/include/asm/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
*/
typedef unsigned int dmamode_t;

#define DMA_MODE_MASK 3
/*
* The DMA modes reflect the settings for the ISA DMA controller
*/
#define DMA_MODE_MASK 0xcc

#define DMA_MODE_READ 0
#define DMA_MODE_WRITE 1
#define DMA_MODE_CASCADE 2
#define DMA_AUTOINIT 4
#define DMA_MODE_READ 0x44
#define DMA_MODE_WRITE 0x48
#define DMA_MODE_CASCADE 0xc0
#define DMA_AUTOINIT 0x10

extern spinlock_t dma_spin_lock;

Expand Down
13 changes: 1 addition & 12 deletions trunk/arch/arm/kernel/dma-isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
#include <asm/dma.h>
#include <asm/mach/dma.h>

#define ISA_DMA_MODE_READ 0x44
#define ISA_DMA_MODE_WRITE 0x48
#define ISA_DMA_MODE_CASCADE 0xc0
#define ISA_DMA_AUTOINIT 0x10

#define ISA_DMA_MASK 0
#define ISA_DMA_MODE 1
#define ISA_DMA_CLRFF 2
Expand Down Expand Up @@ -67,20 +62,17 @@ static void isa_enable_dma(unsigned int chan, dma_t *dma)
unsigned int mode;
enum dma_data_direction direction;

mode = chan & 3;
mode = (chan & 3) | dma->dma_mode;
switch (dma->dma_mode & DMA_MODE_MASK) {
case DMA_MODE_READ:
mode |= ISA_DMA_MODE_READ;
direction = DMA_FROM_DEVICE;
break;

case DMA_MODE_WRITE:
mode |= ISA_DMA_MODE_WRITE;
direction = DMA_TO_DEVICE;
break;

case DMA_MODE_CASCADE:
mode |= ISA_DMA_MODE_CASCADE;
direction = DMA_BIDIRECTIONAL;
break;

Expand Down Expand Up @@ -121,9 +113,6 @@ static void isa_enable_dma(unsigned int chan, dma_t *dma)
outb(length, isa_dma_port[chan][ISA_DMA_COUNT]);
outb(length >> 8, isa_dma_port[chan][ISA_DMA_COUNT]);

if (dma->dma_mode & DMA_AUTOINIT)
mode |= ISA_DMA_AUTOINIT;

outb(mode, isa_dma_port[chan][ISA_DMA_MODE]);
dma->invalid = 0;
}
Expand Down

0 comments on commit ef423a3

Please sign in to comment.