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