Home | History | Annotate | Line # | Download | only in ic
lsi64854reg.h revision 1.1
      1 /*	$NetBSD: lsi64854reg.h,v 1.1 1998/08/29 21:42:04 pk Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Paul Kranenburg.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *        This product includes software developed by the NetBSD
     21  *        Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 
     39 /*
     40  * LSI 64854 DMA engine. Contains three independent channels
     41  * designed to interface with (a) a NCR539X SCSI controller,
     42  * (b) a AM7990 Ethernet controller, (c) Parallel port hardware..
     43  */
     44 
     45 /*
     46  * Register offsets to bus handle.
     47  */
     48 #define L64854_REG_CSR		0		/* Control bits */
     49 #define L64854_REG_ADDR		4		/* DMA Address */
     50 #define L64854_REG_CNT		8		/* DMA count */
     51 #define L64854_REG_CNT_MASK	0x00ffffff	/*   only 24 bits */
     52 #define L64854_REG_ENBAR	12		/* ENET Base register */
     53 #define L64854_REG_TEST		12		/* SCSI Test register */
     54 
     55 
     56 /*
     57  * Control bits common to all three channels.
     58  */
     59 #define L64854_INT_PEND	0x00000001	/* Interrupt pending */
     60 #define L64854_ERR_PEND	0x00000002	/* Error pending */
     61 #define L64854_DRAINING	0x0000000c	/* FIFO draining */
     62 #define L64854_INT_EN	0x00000010	/* Interrupt enable */
     63 #define L64854_INVALIDATE	0x00000020	/* Invalidate FIFO */
     64 #define L64854_SLAVE_ERR	0x00000040	/* Slave access size error */
     65 #define L64854_RESET	0x00000080	/* Reset device */
     66 #define L64854_WRITE	0x00000100	/* 1: xfer to memory */
     67 #define L64854_EN_DMA	0x00000200	/* enable DMA transfers */
     68 
     69 #define L64854_BURST_SIZE	0x000c0000	/* Read/write burst size */
     70 #define  L64854_BURST_0	0x00080000	/*   no bursts (SCSI-only) */
     71 #define  L64854_BURST_16	0x00000000	/*   16-byte bursts */
     72 #define  L64854_BURST_32    	0x00040000	/*   32-byte bursts */
     73 
     74 #define L64854_DEVID		0xc0000000	/* device ID bits */
     75 
     76 /*
     77  * SCSI DMA control bits.
     78  */
     79 #define D_INT_PEND	L64854_INT_PEND	/* interrupt pending */
     80 #define D_ERR_PEND	L64854_ERR_PEND	/* error pending */
     81 #define D_DRAINING	L64854_DRAINING	/* fifo draining */
     82 #define D_INT_EN	L64854_INT_EN	/* interrupt enable */
     83 #define D_INVALIDATE	L64854_INVALIDATE/* invalidate fifo */
     84 #define D_SLAVE_ERR	L64854_SLAVE_ERR/* slave access size error */
     85 #define D_RESET		L64854_RESET	/* reset scsi */
     86 #define D_WRITE		L64854_WRITE	/* 1 = dev -> mem */
     87 #define D_EN_DMA	L64854_EN_DMA	/* enable DMA requests */
     88 #define D_EN_CNT	0x00002000	/* enable byte counter */
     89 #define D_TC		0x00004000	/* terminal count */
     90 #define D_DSBL_CSR_DRN	0x00010000	/* disable fifo drain on csr */
     91 #define D_DSBL_SCSI_DRN	0x00020000	/* disable fifo drain on reg */
     92 
     93 #define D_DIAG		0x00100000	/* disable fifo drain on addr */
     94 #define D_TWO_CYCLE	0x00200000	/* 2 clocks per transfer */
     95 #define D_FASTER	0x00400000	/* 3 clocks per transfer */
     96 #define D_TCI_DIS	0x00800000	/* disable intr on D_TC */
     97 #define D_EN_NEXT	0x01000000	/* enable auto next address */
     98 #define D_DMA_ON	0x02000000	/* enable dma from scsi */
     99 #define D_A_LOADED	0x04000000	/* address loaded */
    100 #define D_NA_LOADED	0x08000000	/* next address loaded */
    101 #define D_DEV_ID	L64854_DEVID	/* device ID */
    102 #define  DMAREV_0	0x00000000	/* Sunray DMA */
    103 #define  DMAREV_ESC	0x40000000	/*  DMA ESC array */
    104 #define  DMAREV_1	0x80000000	/* 'DMA' */
    105 #define  DMAREV_PLUS	0x90000000	/* 'DMA+' */
    106 #define  DMAREV_2	0xa0000000	/* 'DMA2' */
    107 
    108 /*
    109  * revisions 0,1 and ESC have different bits.
    110  */
    111 #define D_ESC_DRAIN	0x00000040	/* rev0,1,esc: drain fifo */
    112 #define D_ESC_R_PEND	0x00000400	/* rev0,1: request pending */
    113 #define D_ESC_BURST	0x00000800	/* DMA ESC: 16 byte bursts */
    114 #define D_ESC_AUTODRAIN	0x00040000	/* DMA ESC: Auto-drain */
    115 
    116 #define DMACSRBITS "\020\01INT\02ERR\03DR1\04DR2\05IEN\011WRITE\016ENCNT\017TC\032DMAON"
    117 
    118 
    119 /*
    120  * ENET DMA control bits.
    121  */
    122 #define E_INT_PEND	L64854_INT_PEND	/* interrupt pending */
    123 #define E_ERR_PEND	L64854_ERR_PEND	/* error pending */
    124 #define E_DRAINING	L64854_DRAINING	/* fifo draining */
    125 #define E_INT_EN	L64854_INT_EN	/* interrupt enable */
    126 #define E_INVALIDATE	L64854_INVALIDATE/* invalidate fifo */
    127 #define E_SLAVE_ERR	L64854_SLAVE_ERR/* slave access size error */
    128 #define E_RESET		L64854_RESET	/* reset ENET */
    129 #define E_reserved1	0x00000300	/* */
    130 #define E_DRAIN		0x00000400	/* force Ecache drain */
    131 #define E_DSBL_WR_DRN	0x00000800	/* disable Ecache drain on .. */
    132 #define E_DSBL_RD_DRN	0x00001000	/* disable Ecache drain on .. */
    133 #define E_reserved2	0x00006000	/* */
    134 #define E_ILACC		0x00008000	/* ... */
    135 #define E_DSBL_BUF_WR	0x00010000	/* no buffering of slave writes */
    136 #define E_DSBL_WR_INVAL	0x00020000	/* no Ecache invalidate on slave writes */
    137 
    138 #define E_reserved3	0x00100000	/* */
    139 #define E_LOOP_TEST	0x00200000	/* loopback mode */
    140 #define E_TP_AUI	0x00400000	/* 1 for TP, 0 for AUI */
    141 #define E_reserved4	0x0c800000	/* */
    142 #define E_DEV_ID	L64854_DEVID	/* ID bits */
    143 
    144 
    145 /*
    146  * PP DMA control bits.
    147  */
    148 #define P_INT_PEND	L64854_INT_PEND	/* interrupt pending */
    149 #define P_ERR_PEND	L64854_ERR_PEND	/* error pending */
    150 #define P_DRAINING	L64854_DRAINING	/* fifo draining */
    151 #define P_INT_EN	L64854_INT_EN	/* interrupt enable */
    152 #define P_INVALIDATE	L64854_INVALIDATE/* invalidate fifo */
    153 #define P_SLAVE_ERR	L64854_SLAVE_ERR/* slave access size error */
    154 #define P_RESET		L64854_RESET	/* reset PP */
    155 #define P_WRITE		L64854_WRITE	/* 1: xfer to memory */
    156 #define P_EN_DMA	L64854_EN_DMA	/* enable DMA transfers */
    157 #define P_reserved1	0x00001c00	/* */
    158 #define P_EN_CNT	0x00002000	/* enable counter */
    159 #define P_TC		0x00004000	/* terminal count */
    160 #define P_reserved2	0x00038000	/* */
    161 
    162 #define P_DIAG		0x00100000	/* ... */
    163 #define P_reserved3	0x00600000	/* */
    164 #define P_TCI_DIS	0x00800000	/* no interrupt on terminal count */
    165 #define P_EN_NEXT	0x01000000	/* enable DMA chaining */
    166 #define P_DMA_ON	0x02000000	/* DMA xfers enabled */
    167 #define P_A_LOADED	0x04000000	/* addr and byte count valid */
    168 #define P_NA_LOADED	0x08000000	/* next addr & count valid but not used */
    169 #define P_DEV_ID	L64854_DEVID	/* ID bits */
    170