patch-2.2.18 linux/arch/arm/kernel/dma-rpc.c
Next file: linux/arch/arm/kernel/dma-vnc.c
Previous file: linux/arch/arm/kernel/dma-isa.h
Back to the patch index
Back to the overall index
- Lines: 91
- Date:
Fri Sep 15 23:28:37 2000
- Orig file:
v2.2.17/arch/arm/kernel/dma-rpc.c
- Orig date:
Fri Apr 21 12:45:45 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/arch/arm/kernel/dma-rpc.c linux/arch/arm/kernel/dma-rpc.c
@@ -11,10 +11,10 @@
#include <linux/init.h>
#include <asm/page.h>
-#include <asm/pgtable.h>
#include <asm/dma.h>
#include <asm/fiq.h>
#include <asm/io.h>
+#include <asm/iomd.h>
#include <asm/hardware.h>
#include <asm/uaccess.h>
@@ -223,8 +223,9 @@
break;
case DMA_VIRTUAL_FLOPPY: {
- extern int floppy_fiqresidual(void);
- residue = floppy_fiqresidual();
+ struct pt_regs regs;
+ get_fiq_regs(®s);
+ return regs.ARM_r9;
}
break;
}
@@ -286,7 +287,6 @@
set_fiq_handler(fiqhandler_start, fiqhandler_length);
set_fiq_regs(®s);
enable_irq(dma->dma_irq);
-
}
break;
@@ -319,14 +319,56 @@
}
}
-__initfunc(void arch_dma_init(dma_t *dma))
+int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
+{
+ int tcr, speed;
+
+ if (cycle < 188)
+ speed = 3;
+ else if (cycle <= 250)
+ speed = 2;
+ else if (cycle < 438)
+ speed = 1;
+ else
+ speed = 0;
+
+ tcr = inb(IOMD_DMATCR);
+ speed &= 3;
+
+ switch (channel) {
+ case DMA_0:
+ tcr = (tcr & ~0x03) | speed;
+ break;
+
+ case DMA_1:
+ tcr = (tcr & ~0x0c) | (speed << 2);
+ break;
+
+ case DMA_2:
+ tcr = (tcr & ~0x30) | (speed << 4);
+ break;
+
+ case DMA_3:
+ tcr = (tcr & ~0xc0) | (speed << 6);
+ break;
+
+ default:
+ break;
+ }
+
+ outb(tcr, IOMD_DMATCR);
+
+ return speed;
+}
+
+void __init arch_dma_init(dma_t *dma)
{
outb(0, IOMD_IO0CR);
outb(0, IOMD_IO1CR);
outb(0, IOMD_IO2CR);
outb(0, IOMD_IO3CR);
-// outb(0xf0, IOMD_DMATCR);
+ outb(0xa0, IOMD_DMATCR);
dma[0].dma_base = ioaddr(IOMD_IO0CURA);
dma[0].dma_irq = IRQ_DMA0;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)