27 #define ISA_DMA_MASK 0
28 #define ISA_DMA_MODE 1
29 #define ISA_DMA_CLRFF 2
30 #define ISA_DMA_PGHI 3
31 #define ISA_DMA_PGLO 4
32 #define ISA_DMA_ADDR 5
33 #define ISA_DMA_COUNT 6
35 static unsigned int isa_dma_port[8][7] = {
37 { 0x0a, 0x0b, 0x0c, 0x487, 0x087, 0x00, 0x01 },
38 { 0x0a, 0x0b, 0x0c, 0x483, 0x083, 0x02, 0x03 },
39 { 0x0a, 0x0b, 0x0c, 0x481, 0x081, 0x04, 0x05 },
40 { 0x0a, 0x0b, 0x0c, 0x482, 0x082, 0x06, 0x07 },
41 { 0xd4, 0xd6, 0xd8, 0x000, 0x000, 0xc0, 0xc2 },
42 { 0xd4, 0xd6, 0xd8, 0x48b, 0x08b, 0xc4, 0xc6 },
43 { 0xd4, 0xd6, 0xd8, 0x489, 0x089, 0xc8, 0xca },
44 { 0xd4, 0xd6, 0xd8, 0x48a, 0x08a, 0xcc, 0xce }
47 static int isa_get_dma_residue(
unsigned int chan,
dma_t *
dma)
52 count = 1 +
inb(io_port);
53 count |=
inb(io_port) << 8;
55 return chan < 4 ? count : (count << 1);
58 static void isa_enable_dma(
unsigned int chan,
dma_t *
dma)
66 switch (dma->
dma_mode & DMA_MODE_MASK) {
97 address = dma->
buf.dma_address;
98 length = dma->
buf.length - 1;
122 static void isa_disable_dma(
unsigned int chan,
dma_t *dma)
127 static struct dma_ops isa_dma_ops = {
129 .enable = isa_enable_dma,
130 .disable = isa_disable_dma,
131 .residue = isa_get_dma_residue,
134 static struct resource dma_resources[] = { {
139 .name =
"dma low page",
147 .name =
"dma high page",
152 static dma_t isa_dma[8];
174 if (
inb(0) == 0x55 &&
inb(0) == 0xaa) {
175 unsigned int chan,
i;
177 for (chan = 0; chan < 8; chan++) {
178 isa_dma[chan].
d_ops = &isa_dma_ops;
179 isa_disable_dma(chan,
NULL);
210 for (i = 0; i <
ARRAY_SIZE(dma_resources); i++)
213 for (chan = 0; chan < 8; chan++) {