summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-11-01 17:26:50 +0000
committerache <ache@FreeBSD.org>1994-11-01 17:26:50 +0000
commite68980a176a3e8ef0f202ce44858b92d669201dc (patch)
tree2db7d640d999819b6f98e06237c0738b36fd9805 /sys
parent1521a7e83a3ae849baa17ec3532cf9caa95d4ffd (diff)
downloadFreeBSD-src-e68980a176a3e8ef0f202ce44858b92d669201dc.zip
FreeBSD-src-e68980a176a3e8ef0f202ce44858b92d669201dc.tar.gz
DMA automode patch, fix SB16 clicks
Submitted by: tim@cs.city.ac.uk
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/isa/isa.c20
-rw-r--r--sys/dev/ic/i8237.h3
-rw-r--r--sys/i386/isa/ic/i8237.h3
-rw-r--r--sys/i386/isa/isa.c20
-rw-r--r--sys/i386/isa/sound/dmabuf.c6
-rw-r--r--sys/i386/isa/sound/local.h3
6 files changed, 45 insertions, 10 deletions
diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c
index f0fee05..89dd774 100644
--- a/sys/amd64/isa/isa.c
+++ b/sys/amd64/isa/isa.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: isa.c,v 1.33 1994/10/25 23:06:15 se Exp $
+ * $Id: isa.c,v 1.34 1994/10/26 00:16:20 phk Exp $
*/
/*
@@ -691,6 +691,15 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan)
* byte mode channels.
*/
/* set dma channel mode, and reset address ff */
+
+ /* If B_RAW flag is set, then use autoinitialise mode */
+ if (flags & B_RAW) {
+ if (flags & B_READ)
+ outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_WRITE|chan);
+ else
+ outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_READ|chan);
+ }
+ else
if (flags & B_READ)
outb(DMA1_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|chan);
else
@@ -715,6 +724,15 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan)
* word mode channels.
*/
/* set dma channel mode, and reset address ff */
+
+ /* If B_RAW flag is set, then use autoinitialise mode */
+ if (flags & B_RAW) {
+ if (flags & B_READ)
+ outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_WRITE|(chan&3));
+ else
+ outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_READ|(chan&3));
+ }
+ else
if (flags & B_READ)
outb(DMA2_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|(chan&3));
else
diff --git a/sys/dev/ic/i8237.h b/sys/dev/ic/i8237.h
index 2199e73..722194c 100644
--- a/sys/dev/ic/i8237.h
+++ b/sys/dev/ic/i8237.h
@@ -1,11 +1,12 @@
/*
* Intel 8237 DMA Controller
*
- * $Id$
+ * $Id: i8237.h,v 1.2 1993/10/16 13:48:48 rgrimes Exp $
*/
#define DMA37MD_SINGLE 0x40 /* single pass mode */
#define DMA37MD_CASCADE 0xc0 /* cascade mode */
+#define DMA37MD_AUTO 0x50 /* autoinitialise single pass mode */
#define DMA37MD_WRITE 0x04 /* read the device, write memory operation */
#define DMA37MD_READ 0x08 /* write the device, read memory operation */
diff --git a/sys/i386/isa/ic/i8237.h b/sys/i386/isa/ic/i8237.h
index 2199e73..722194c 100644
--- a/sys/i386/isa/ic/i8237.h
+++ b/sys/i386/isa/ic/i8237.h
@@ -1,11 +1,12 @@
/*
* Intel 8237 DMA Controller
*
- * $Id$
+ * $Id: i8237.h,v 1.2 1993/10/16 13:48:48 rgrimes Exp $
*/
#define DMA37MD_SINGLE 0x40 /* single pass mode */
#define DMA37MD_CASCADE 0xc0 /* cascade mode */
+#define DMA37MD_AUTO 0x50 /* autoinitialise single pass mode */
#define DMA37MD_WRITE 0x04 /* read the device, write memory operation */
#define DMA37MD_READ 0x08 /* write the device, read memory operation */
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index f0fee05..89dd774 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: isa.c,v 1.33 1994/10/25 23:06:15 se Exp $
+ * $Id: isa.c,v 1.34 1994/10/26 00:16:20 phk Exp $
*/
/*
@@ -691,6 +691,15 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan)
* byte mode channels.
*/
/* set dma channel mode, and reset address ff */
+
+ /* If B_RAW flag is set, then use autoinitialise mode */
+ if (flags & B_RAW) {
+ if (flags & B_READ)
+ outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_WRITE|chan);
+ else
+ outb(DMA1_MODE, DMA37MD_AUTO|DMA37MD_READ|chan);
+ }
+ else
if (flags & B_READ)
outb(DMA1_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|chan);
else
@@ -715,6 +724,15 @@ void isa_dmastart(int flags, caddr_t addr, unsigned nbytes, unsigned chan)
* word mode channels.
*/
/* set dma channel mode, and reset address ff */
+
+ /* If B_RAW flag is set, then use autoinitialise mode */
+ if (flags & B_RAW) {
+ if (flags & B_READ)
+ outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_WRITE|(chan&3));
+ else
+ outb(DMA2_MODE, DMA37MD_AUTO|DMA37MD_READ|(chan&3));
+ }
+ else
if (flags & B_READ)
outb(DMA2_MODE, DMA37MD_SINGLE|DMA37MD_WRITE|(chan&3));
else
diff --git a/sys/i386/isa/sound/dmabuf.c b/sys/i386/isa/sound/dmabuf.c
index 1a736b5..aefeaf4 100644
--- a/sys/i386/isa/sound/dmabuf.c
+++ b/sys/i386/isa/sound/dmabuf.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: dmabuf.c,v 1.8 1994/08/02 07:39:49 davidg Exp $
+ * $Id: dmabuf.c,v 1.9 1994/10/01 02:16:35 swallace Exp $
*/
#include "sound_config.h"
@@ -659,9 +659,7 @@ DMAbuf_start_dma (int dev, unsigned long physaddr, int count, int dma_mode)
RESTORE_INTR (flags);
#else /* linux */
#ifdef __FreeBSD__
- printk ("sound: Invalid DMA mode for device %d\n", dev);
-
- isa_dmastart ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE,
+ isa_dmastart (B_RAW + ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE),
(caddr_t)dmap->raw_buf_phys[0],
dmap->bytes_in_use,
chan);
diff --git a/sys/i386/isa/sound/local.h b/sys/i386/isa/sound/local.h
index 72e0d6b..b7fba6d 100644
--- a/sys/i386/isa/sound/local.h
+++ b/sys/i386/isa/sound/local.h
@@ -1,6 +1,6 @@
/* for FreeBSD */
/*
- * $Id: local.h,v 1.9 1994/09/27 17:58:19 davidg Exp $
+ * $Id: local.h,v 1.10 1994/10/01 02:16:44 swallace Exp $
*/
#include "snd.h"
@@ -21,7 +21,6 @@
#endif
#define DSP_BUFFSIZE 65536
-#define NO_AUTODMA /* still */
#define SELECTED_SOUND_OPTIONS 0xffffffff
#define SOUND_VERSION_STRING "2.90-2"
#define SOUND_CONFIG_DATE "Thu Sep 29 15:33:39 PDT 1994"
OpenPOWER on IntegriCloud