Home | History | Annotate | Line # | Download | only in ic
siopvar.h revision 1.4
      1 /*	$NetBSD: siopvar.h,v 1.4 2000/05/02 19:03:03 bouyer Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2000 Manuel Bouyer.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  * 3. All advertising materials mentioning features or use of this software
     15  *    must display the following acknowledgement:
     16  *	This product includes software developed by Manuel Bouyer
     17  * 4. The name of the author may not be used to endorse or promote products
     18  *    derived from this software without specific prior written permission.
     19  *
     20  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
     21  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
     22  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
     23  * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
     24  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  * POSSIBILITY OF SUCH DAMAGE.
     30  *
     31  */
     32 
     33 /* structure and definitions for the siop driver */
     34 
     35 TAILQ_HEAD(cmd_list, siop_cmd);
     36 
     37 /* Driver internal state */
     38 struct siop_softc {
     39 	struct device sc_dev;
     40 	struct scsipi_link sc_link;	/* link to upper level */
     41 	int features;			/* chip's features */
     42 	int maxburst;
     43 	int maxoff;
     44 	int clock_div;			/* async. clock divider (scntl3) */
     45 	int clock_period;		/* clock period (ns * 10) */
     46 	int minsync;			/* min and max sync period, */
     47 	int maxsync;			/* as sent in SDTR message */
     48 	bus_space_tag_t sc_rt;		/* bus_space registers tag */
     49 	bus_space_handle_t sc_rh;	/* bus_space registers handle */
     50 	bus_addr_t sc_raddr;		/* register adresses */
     51 	bus_dma_tag_t sc_dmat;		/* bus DMA tag */
     52 	bus_dmamap_t  sc_scriptdma;	/* DMA map for script */
     53 	u_int32_t *sc_script;		/* script location in memory */
     54 	int sc_nshedslots;		/* number of sheduler slots */
     55 	int sc_currshedslot;		/* current sheduler slot */
     56 	struct siop_cmd *cmds;		/* commands array */
     57 	struct cmd_list free_list;	/* cmd descr free list */
     58 	struct siop_target *targets[16]; /* per-target states */
     59 	u_int32_t sc_flags;
     60 };
     61 /* defs for sc_flags */
     62 /* none for now */
     63 
     64 /* features */
     65 #define SF_BUS_WIDE	0x00000001 /* wide bus */
     66 #define SF_BUS_ULTRA	0x00000002 /* Ultra (20Mhz) bus */
     67 #define SF_BUS_ULTRA2	0x00000004 /* Ultra2 (40Mhz) bus */
     68 #define SF_BUS_DIFF	0x00000008 /* differential bus */
     69 
     70 #define SF_CHIP_LED0	0x00000100 /* led on GPIO0 */
     71 #define SF_CHIP_DBLR	0x00000200 /* clock doubler */
     72 #define SF_CHIP_QUAD	0x00000400 /* clock quadrupler */
     73 #define SF_CHIP_FIFO	0x00000800 /* large fifo */
     74 #define SF_CHIP_PF	0x00001000 /* Intructions prefetch */
     75 #define SF_CHIP_RAM	0x00002000 /* on-board RAM */
     76 
     77 #define SF_PCI_RL	0x01000000 /* PCI read line */
     78 #define SF_PCI_RM	0x02000000 /* PCI read multiple */
     79 #define SF_PCI_BOF	0x04000000 /* PCI burst opcode fetch */
     80 #define SF_PCI_CLS	0x08000000 /* PCI cache line size */
     81 #define SF_PCI_WRI	0x10000000 /* PCI write and invalidate */
     82 
     83 void    siop_attach __P((struct siop_softc *));
     84 int	siop_intr __P((void *));
     85