[4354] in linux-scsi channel archive
Re: 4 Adaptec 1542 eisa scsi controllers and one of them wants DMA 0
daemon@ATHENA.MIT.EDU (Bjorn Ludvik Thordarson)
Mon Jul 13 13:12:50 1998
Date: Mon, 13 Jul 1998 17:07:53 +0000
From: Bjorn Ludvik Thordarson <blth@rhi.hi.is>
To: linux-scsi@vger.rutgers.edu
In-Reply-To: <19980713091944.40383@rhi.hi.is>; from Bjorn Ludvik Thordarson on Mon, Jul 13, 1998 at 09:19:44AM +0000
Well good folks,
After a little bit of hacking it (and learning) we came up
with the following patch and now the kernel happily accecpts
the controller. The question is why didn´t the
original authors allow DMA 0 from the controller?
Thanks for the assistance,
Björn
--- linux/drivers/scsi/aha1542.c.orig Fri Feb 28 23:14:18 1997
+++ linux/drivers/scsi/aha1542.c Mon Jul 13 13:33:57 1998
@@ -16,6 +16,8 @@
* Modified by Mike McLagan <mike.mclagan@linux.org>
* Recognise extended mode on AHA1542CP, different bit than 1542CF
* 1-Jan-97
+ * Modified by Bjorn L. Thordarson and Einar Einarssor
+ * Recognize that DMA0 is valid DMA channel -- 13-Jul-98
*/
#include <linux/module.h>
@@ -89,13 +91,6 @@
* Factory default is 5 MB/s.
*/
-
-/* The DMA-Controller. We need to fool with this because we want to
- be able to use the aha1542 without having to have the bios enabled */
-#define DMA_MODE_REG 0xd6
-#define DMA_MASK_REG 0xd4
-#define CASCADE 0xc0
-
#define BIOS_TRANSLATION_1632 0 /* Used by some old 1542A boards */
#define BIOS_TRANSLATION_6432 1 /* Default case these days */
#define BIOS_TRANSLATION_25563 2 /* Big disk case */
@@ -748,8 +743,8 @@
*dma_chan = 5;
break;
case 0x01:
- printk("DMA priority 0 not available for Adaptec driver\n");
- return -1;
+ *dma_chan = 0;
+ break;
case 0:
/* This means that the adapter, although Adaptec 1542 compatible, doesn't use a DMA channel.
Currently only aware of the BusLogic BT-445S VL-Bus adapter which needs this. */
@@ -1019,9 +1014,9 @@
goto unregister;
}
- if (dma_chan >= 5) {
- outb((dma_chan - 4) | CASCADE, DMA_MODE_REG);
- outb(dma_chan - 4, DMA_MASK_REG);
+ if (dma_chan == 0 || dma_chan >= 5) {
+ set_dma_mode(dma_chan, DMA_MODE_CASCADE);
+ enable_dma(dma_chan);
}
}
aha_host[irq_level - 9] = shpnt;
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu