Home | History | Annotate | Line # | Download | only in iomd
iomd_dma.h revision 1.1.6.3
      1  1.1.6.3  jdolecek /*	$NetBSD: iomd_dma.h,v 1.1.6.3 2002/03/16 15:56:11 jdolecek Exp $	*/
      2  1.1.6.2   thorpej 
      3  1.1.6.2   thorpej /*
      4  1.1.6.2   thorpej  * Copyright (c) 1997 Scott Stevens
      5  1.1.6.2   thorpej  *
      6  1.1.6.2   thorpej  * Redistribution and use in source and binary forms, with or without
      7  1.1.6.2   thorpej  * modification, are permitted provided that the following conditions
      8  1.1.6.2   thorpej  * are met:
      9  1.1.6.2   thorpej  * 1. Redistributions of source code must retain the above copyright
     10  1.1.6.2   thorpej  *    notice, this list of conditions and the following disclaimer.
     11  1.1.6.2   thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.1.6.2   thorpej  *    notice, this list of conditions and the following disclaimer in the
     13  1.1.6.2   thorpej  *    documentation and/or other materials provided with the distribution.
     14  1.1.6.2   thorpej  * 3. All advertising materials mentioning features or use of this software
     15  1.1.6.2   thorpej  *    must display the following acknowledgement:
     16  1.1.6.2   thorpej  *      This product includes software developed by Scott Stevens.
     17  1.1.6.2   thorpej  * 4. Neither the name of the University nor the names of its contributors
     18  1.1.6.2   thorpej  *    may be used to endorse or promote products derived from this software
     19  1.1.6.2   thorpej  *    without specific prior written permission.
     20  1.1.6.2   thorpej  *
     21  1.1.6.2   thorpej  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     22  1.1.6.2   thorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23  1.1.6.2   thorpej  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24  1.1.6.2   thorpej  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
     25  1.1.6.2   thorpej  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26  1.1.6.2   thorpej  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27  1.1.6.2   thorpej  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28  1.1.6.2   thorpej  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29  1.1.6.2   thorpej  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30  1.1.6.2   thorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31  1.1.6.2   thorpej  * SUCH DAMAGE.
     32  1.1.6.2   thorpej  *
     33  1.1.6.2   thorpej  *      @(#)dmavar.h
     34  1.1.6.2   thorpej  */
     35  1.1.6.2   thorpej 
     36  1.1.6.2   thorpej /*
     37  1.1.6.2   thorpej  * dma structures
     38  1.1.6.2   thorpej  */
     39  1.1.6.2   thorpej 
     40  1.1.6.2   thorpej struct dma_ctrl {
     41  1.1.6.2   thorpej 	int			dc_flags;
     42  1.1.6.2   thorpej 	int			dc_channel;
     43  1.1.6.2   thorpej 	int			dc_dmasize;
     44  1.1.6.2   thorpej 	volatile u_int		*dc_cura;
     45  1.1.6.2   thorpej 	volatile u_int		*dc_enda;
     46  1.1.6.2   thorpej 	volatile u_int		*dc_curb;
     47  1.1.6.2   thorpej 	volatile u_int		*dc_endb;
     48  1.1.6.2   thorpej 	volatile u_char		*dc_cr;
     49  1.1.6.2   thorpej 	volatile u_char		*dc_st;
     50  1.1.6.2   thorpej 
     51  1.1.6.2   thorpej 	u_char			*dc_nextaddr;
     52  1.1.6.2   thorpej 	int			dc_len;
     53  1.1.6.2   thorpej 
     54  1.1.6.2   thorpej 	irqhandler_t		dc_ih;
     55  1.1.6.2   thorpej };
     56  1.1.6.2   thorpej 
     57  1.1.6.2   thorpej #define DMA_FL_ACTIVE	0x01
     58  1.1.6.2   thorpej #define DMA_FL_READY	0x02
     59  1.1.6.2   thorpej 
     60  1.1.6.2   thorpej #define DMA_CR_CLEAR	0x80
     61  1.1.6.2   thorpej #define DMA_CR_DIR	0x40
     62  1.1.6.2   thorpej #define DMA_CR_ENABLE	0x20
     63  1.1.6.2   thorpej #define DMA_CR_INC	0x1f
     64  1.1.6.2   thorpej 
     65  1.1.6.2   thorpej #define DMA_ST_CHAN	0x01
     66  1.1.6.2   thorpej #define DMA_ST_INT	0x02
     67  1.1.6.2   thorpej #define DMA_ST_OVER	0x04
     68  1.1.6.2   thorpej #define DMA_ST_MASK	(DMA_ST_CHAN | DMA_ST_INT | DMA_ST_OVER)
     69  1.1.6.2   thorpej 
     70  1.1.6.2   thorpej #define DMA_END_STOP	0x80000000
     71  1.1.6.2   thorpej #define DMA_END_LAST	0x40000000
     72  1.1.6.2   thorpej 
     73  1.1.6.2   thorpej /* Prototypes */
     74  1.1.6.2   thorpej struct dma_ctrl *dma_init __P((int, int, int, int));
     75  1.1.6.3  jdolecek void dma_go	__P((struct dma_ctrl *));
     76  1.1.6.3  jdolecek int dma_reset	__P((struct dma_ctrl *));
     77  1.1.6.3  jdolecek int dma_setup	__P((struct dma_ctrl *, u_char *, int, int));
     78  1.1.6.3  jdolecek int dma_isactive __P((struct dma_ctrl *));
     79  1.1.6.3  jdolecek int dma_isintr	__P((struct dma_ctrl *));
     80  1.1.6.3  jdolecek int dma_intr	__P((void *));
     81