patch-2.2.18 linux/arch/arm/kernel/dma-arc.c
Next file: linux/arch/arm/kernel/dma-dummy.c
Previous file: linux/arch/arm/kernel/dma-a5k.c
Back to the patch index
Back to the overall index
- Lines: 98
- Date:
Fri Sep 15 23:28:37 2000
- Orig file:
v2.2.17/arch/arm/kernel/dma-arc.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-arc.c linux/arch/arm/kernel/dma-arc.c
@@ -1,10 +1,11 @@
/*
* arch/arm/kernel/dma-arc.c
*
- * Copyright (C) 1998 Dave Gilbert / Russell King
+ * Copyright (C) 1998-1999 Dave Gilbert / Russell King
*
* DMA functions specific to Archimedes architecture
*/
+#include <linux/config.h>
#include <linux/sched.h>
#include <linux/init.h>
@@ -14,8 +15,11 @@
#include "dma.h"
-int arch_request_dma(dmach_t channel, dma_t *dma)
+#define DEBUG
+
+int arch_request_dma(dmach_t channel, dma_t *dma, const char * dev_id)
{
+ printk("arch_request_dma channel=%d F0=%d F1=%d\n",channel,DMA_VIRTUAL_FLOPPY0,DMA_VIRTUAL_FLOPPY1);
if (channel == DMA_VIRTUAL_FLOPPY0 ||
channel == DMA_VIRTUAL_FLOPPY1)
return 0;
@@ -25,16 +29,13 @@
void arch_free_dma(dmach_t channel, dma_t *dma)
{
- if (channel != DMA_VIRTUAL_FLOPPY0 &&
- channel != DMA_VIRTUAL_FLOPPY1)
- return 0;
- else
- return -EINVAL;
}
void arch_enable_dma(dmach_t channel, dma_t *dma)
{
+ printk("arch_enable_dma channel=%d F0=%d F1=%d\n",channel,DMA_VIRTUAL_FLOPPY0,DMA_VIRTUAL_FLOPPY1);
switch (channel) {
+#ifdef CONFIG_BLK_DEV_FD1772
case DMA_VIRTUAL_FLOPPY0: { /* Data DMA */
switch (dma->dma_mode) {
case DMA_MODE_READ: /* read */
@@ -96,9 +97,38 @@
restore_flags(flags);
}
break;
+#endif
}
}
+int arch_get_dma_residue(dmach_t channel, dma_t *dma)
+{
+ switch (channel) {
+#ifdef CONFIG_BLK_DEV_FD1772
+ case DMA_VIRTUAL_FLOPPY0: { /* Data DMA */
+ extern unsigned int fdc1772_bytestogo;
+
+ /* 10/1/1999 DAG - I presume its the number of bytes left? */
+ return fdc1772_bytestogo;
+ };
+ break;
+
+ case DMA_VIRTUAL_FLOPPY1: { /* Command completed */
+ /* 10/1/1999 DAG - Presume whether there is an outstanding command? */
+ extern unsigned int fdc1772_fdc_int_done;
+
+ return (fdc1772_fdc_int_done==0)?1:0; /* Explicit! If the int done is 0 then 1 int to go */
+ };
+ break;
+
+#endif
+
+ default:
+ printk("dma-arc.c:arch_get_dma_residue called with unknown/unconfigured DMA channel\n");
+ return 0;
+ };
+}
+
void arch_disable_dma(dmach_t channel, dma_t *dma)
{
if (channel != DMA_VIRTUAL_FLOPPY0 &&
@@ -108,7 +138,12 @@
disable_irq(dma->dma_irq);
}
-__initfunc(void arch_dma_init(dma_t *dma))
+int arch_set_dma_speed(dmach_t channel, dma_t *dma, int cycle_ns)
+{
+ return 0;
+}
+
+void __init arch_dma_init(dma_t *dma)
{
dma[DMA_VIRTUAL_FLOPPY0].dma_irq = 64;
dma[DMA_VIRTUAL_FLOPPY1].dma_irq = 65;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)