Home | History | Annotate | Line # | Download | only in dev
dmareg.h revision 1.3
      1  1.3     gwr /*	$NetBSD: dmareg.h,v 1.3 1999/04/08 04:46:41 gwr Exp $ */
      2  1.1  jeremy 
      3  1.1  jeremy /*
      4  1.1  jeremy  * Copyright (c) 1994 Peter Galbavy.  All rights reserved.
      5  1.1  jeremy  * Redistribution and use in source and binary forms, with or without
      6  1.1  jeremy  * modification, are permitted provided that the following conditions
      7  1.1  jeremy  * are met:
      8  1.1  jeremy  * 1. Redistributions of source code must retain the above copyright
      9  1.1  jeremy  *    notice, this list of conditions and the following disclaimer.
     10  1.1  jeremy  * 2. Redistributions in binary form must reproduce the above copyright
     11  1.1  jeremy  *    notice, this list of conditions and the following disclaimer in the
     12  1.1  jeremy  *    documentation and/or other materials provided with the distribution.
     13  1.1  jeremy  * 3. All advertising materials mentioning features or use of this software
     14  1.1  jeremy  *    must display the following acknowledgement:
     15  1.1  jeremy  *	This product includes software developed by Peter Galbavy.
     16  1.1  jeremy  * 4. The name of the author may not be used to endorse or promote products
     17  1.1  jeremy  *    derived from this software without specific prior written permission.
     18  1.1  jeremy  *
     19  1.1  jeremy  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     20  1.1  jeremy  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     21  1.1  jeremy  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     22  1.1  jeremy  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     23  1.1  jeremy  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     24  1.1  jeremy  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     25  1.1  jeremy  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     26  1.1  jeremy  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     27  1.1  jeremy  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     28  1.1  jeremy  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29  1.1  jeremy  */
     30  1.1  jeremy 
     31  1.1  jeremy #define DMACSRBITS "\020\01INT\02ERR\03DR1\04DR2\05IEN\011WRITE\016ENCNT\017TC\032DMAON"
     32  1.1  jeremy 
     33  1.1  jeremy struct dma_regs {
     34  1.3     gwr 	u_int32_t	csr;		/* DMA CSR */
     35  1.3     gwr 	/* bits common to all revs. */
     36  1.3     gwr #define  D_INT_PEND	0x00000001	/* interrupt pending */
     37  1.3     gwr #define  D_ERR_PEND	0x00000002	/* error pending */
     38  1.3     gwr #define  D_PACKCNT	0x0000000c	/* byte pack count */
     39  1.3     gwr #define  D_INT_EN	0x00000010	/* interrupt enable */
     40  1.3     gwr #define  D_FLUSH	0x00000020	/* invalidate fifo */
     41  1.3     gwr #define  D_DRAIN	0x00000040	/* drain fifo */
     42  1.3     gwr #define  D_RESET	0x00000080	/* reset scsi */
     43  1.3     gwr #define  D_WRITE	0x00000100	/* device -> mem */
     44  1.3     gwr #define  D_EN_DMA	0x00000200	/* enable DMA requests */
     45  1.3     gwr #define  D_R_PEND	0x00000400	/* REV1,ESC: request pending */
     46  1.3     gwr #define  D_BYTEADR	0x00001800	/* REV1: next byte address */
     47  1.3     gwr #define  D_EN_CNT	0x00002000	/* REV1: enable byte counter */
     48  1.3     gwr #define  D_TC		0x00004000	/* REV1,2: terminal count */
     49  1.3     gwr 
     50  1.3     gwr #define  D_BURST_SIZE	0x000c0000	/* read/write burst size */
     51  1.3     gwr #define   D_BURST_16	0x00000000	/*   16-byte bursts */
     52  1.3     gwr #define   D_BURST_32    0x00040000	/*   32-byte bursts */
     53  1.3     gwr #define   D_BURST_0	0x00080000	/*   no bursts (SCSI-only) */
     54  1.3     gwr 
     55  1.3     gwr #define  D_TWO_CYCLE	0x00200000	/* REV3: 2 clocks per transfer */
     56  1.3     gwr #define  D_FASTER	0x00400000	/* 3 clocks per transfer */
     57  1.3     gwr #define  D_TCI_DIS	0x00800000	/* disable intr on D_TC */
     58  1.3     gwr 
     59  1.3     gwr #define  D_EN_NEXT	0x01000000	/* enable auto next address */
     60  1.3     gwr #define  D_DMA_ON	0x02000000	/* enable dma from scsi */
     61  1.3     gwr #define  D_A_LOADED	0x04000000	/* address loaded */
     62  1.3     gwr #define  D_NA_LOADED	0x08000000	/* next address loaded */
     63  1.3     gwr 
     64  1.3     gwr #define  D_DEV_ID	0xf0000000	/* device ID */
     65  1.3     gwr #define   DMAREV_0	0x00000000	/* Sunray DMA */
     66  1.3     gwr #define   DMAREV_ESC	0x40000000	/*  DMA ESC array */
     67  1.3     gwr #define   DMAREV_1	0x80000000	/* 'DMA' */
     68  1.3     gwr #define   DMAREV_PLUS	0x90000000	/* 'DMA+' */
     69  1.3     gwr #define   DMAREV_2	0xa0000000	/* 'DMA2' */
     70  1.1  jeremy 
     71  1.3     gwr 	u_int32_t	addr;
     72  1.3     gwr #define DMA_D_ADDR		0x01		/* DMA ADDR (in longs) */
     73  1.1  jeremy 
     74  1.3     gwr 	u_int32_t	bcnt;		/* DMA COUNT (in longs) */
     75  1.1  jeremy #define  D_BCNT_MASK		0x00ffffff	/* only 24 bits */
     76  1.1  jeremy 
     77  1.3     gwr 	u_int32_t	test;		/* DMA TEST (in longs) */
     78  1.1  jeremy #define en_testcsr	addr			/* enet registers overlap */
     79  1.1  jeremy #define en_cachev	bcnt
     80  1.1  jeremy #define en_bar		test
     81  1.1  jeremy };
     82