[PATCH] Aha1542 - Fixes problems with dma0

=?ISO-8859-1?Q? (bjornt@bok.hi.is)
Wed, 5 Aug 1998 09:32:26 -0000


------ =_NextPart_000_01BDC053.F628CED0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

The following patch is necesary to allow AHA-1542 to use dma0. The
driver wouldn=B4t for historical reasons use it (dram-refresh). It also =
clears
out two unneeded defines. It has been tested.

Bjoern L. Thordarson


------ =_NextPart_000_01BDC053.F628CED0
Content-Type: text/plain; name="aha1542-dma0.txt"
Content-Transfer-Encoding: quoted-printable

--- linux/drivers/scsi/aha1542.c.orig Fri Feb 28 23:14:18 1997=0A=
+++ linux/drivers/scsi/aha1542.c Mon Jul 13 13:33:57 1998=0A=
@@ -16,6 +16,8 @@=0A=
* Modified by Mike McLagan <mike.mclagan@linux.org>=0A=
* Recognise extended mode on AHA1542CP, different bit than =
1542CF=0A=
* 1-Jan-97=0A=
+ * Modified by Bjorn L. Thordarson and Einar Thor Einarsson=0A=
+ * Recognize that DMA0 is valid DMA channel -- 13-Jul-98=0A=
*/=0A=
=0A=
#include <linux/module.h>=0A=
@@ -89,13 +91,6 @@=0A=
* Factory default is 5 MB/s.=0A=
*/=0A=
=0A=
-=0A=
-/* The DMA-Controller. We need to fool with this because we want to =
=0A=
- be able to use the aha1542 without having to have the bios enabled =
*/=0A=
-#define DMA_MODE_REG 0xd6=0A=
-#define DMA_MASK_REG 0xd4=0A=
-#define CASCADE 0xc0=0A=
-=0A=
#define BIOS_TRANSLATION_1632 0 /* Used by some old 1542A boards */=0A=
#define BIOS_TRANSLATION_6432 1 /* Default case these days */=0A=
#define BIOS_TRANSLATION_25563 2 /* Big disk case */=0A=
@@ -748,8 +743,8 @@=0A=
*dma_chan =3D 5;=0A=
break;=0A=
case 0x01:=0A=
- printk("DMA priority 0 not available for Adaptec driver\n");=0A=
- return -1;=0A=
+ *dma_chan =3D 0;=0A=
+ break;=0A=
case 0:=0A=
/* This means that the adapter, although Adaptec 1542 compatible, =
doesn't use a DMA channel.=0A=
Currently only aware of the BusLogic BT-445S VL-Bus adapter =
which needs this. */=0A=
@@ -1019,9 +1014,9 @@=0A=
goto unregister;=0A=
}=0A=
=0A=
- if (dma_chan >=3D 5) {=0A=
- outb((dma_chan - 4) | CASCADE, DMA_MODE_REG);=0A=
- outb(dma_chan - 4, DMA_MASK_REG);=0A=
+ if (dma_chan =3D=3D 0 || dma_chan >=3D 5) {=0A=
+ set_dma_mode(dma_chan, DMA_MODE_CASCADE);=0A=
+ enable_dma(dma_chan);=0A=
}=0A=
}=0A=
aha_host[irq_level - 9] =3D shpnt;=0A=

------ =_NextPart_000_01BDC053.F628CED0--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html