Home | History | Annotate | Line # | Download | only in eisa
eisavar.h revision 1.17.24.3
      1  1.17.24.3    skrll /*	$NetBSD: eisavar.h,v 1.17.24.3 2004/09/21 13:27:37 skrll Exp $	*/
      2       1.17  thorpej 
      3       1.17  thorpej /*-
      4       1.17  thorpej  * Copyright (c) 2000 The NetBSD Foundation, Inc.
      5       1.17  thorpej  * All rights reserved.
      6       1.17  thorpej  *
      7       1.17  thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8       1.17  thorpej  * by Jason R. Thorpe.
      9       1.17  thorpej  *
     10       1.17  thorpej  * Redistribution and use in source and binary forms, with or without
     11       1.17  thorpej  * modification, are permitted provided that the following conditions
     12       1.17  thorpej  * are met:
     13       1.17  thorpej  * 1. Redistributions of source code must retain the above copyright
     14       1.17  thorpej  *    notice, this list of conditions and the following disclaimer.
     15       1.17  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.17  thorpej  *    notice, this list of conditions and the following disclaimer in the
     17       1.17  thorpej  *    documentation and/or other materials provided with the distribution.
     18       1.17  thorpej  * 3. All advertising materials mentioning features or use of this software
     19       1.17  thorpej  *    must display the following acknowledgement:
     20       1.17  thorpej  *	This product includes software developed by the NetBSD
     21       1.17  thorpej  *	Foundation, Inc. and its contributors.
     22       1.17  thorpej  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23       1.17  thorpej  *    contributors may be used to endorse or promote products derived
     24       1.17  thorpej  *    from this software without specific prior written permission.
     25       1.17  thorpej  *
     26       1.17  thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27       1.17  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28       1.17  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29       1.17  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30       1.17  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31       1.17  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32       1.17  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33       1.17  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34       1.17  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35       1.17  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36       1.17  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     37       1.17  thorpej  */
     38        1.1      cgd 
     39        1.1      cgd /*
     40        1.3      cgd  * Copyright (c) 1995, 1996 Christopher G. Demetriou
     41        1.1      cgd  * All rights reserved.
     42        1.1      cgd  *
     43        1.1      cgd  * Redistribution and use in source and binary forms, with or without
     44        1.1      cgd  * modification, are permitted provided that the following conditions
     45        1.1      cgd  * are met:
     46        1.1      cgd  * 1. Redistributions of source code must retain the above copyright
     47        1.1      cgd  *    notice, this list of conditions and the following disclaimer.
     48        1.1      cgd  * 2. Redistributions in binary form must reproduce the above copyright
     49        1.1      cgd  *    notice, this list of conditions and the following disclaimer in the
     50        1.1      cgd  *    documentation and/or other materials provided with the distribution.
     51        1.1      cgd  * 3. All advertising materials mentioning features or use of this software
     52        1.1      cgd  *    must display the following acknowledgement:
     53        1.1      cgd  *      This product includes software developed by Christopher G. Demetriou
     54        1.1      cgd  *      for the NetBSD Project.
     55        1.1      cgd  * 4. The name of the author may not be used to endorse or promote products
     56        1.1      cgd  *    derived from this software without specific prior written permission
     57        1.1      cgd  *
     58        1.1      cgd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     59        1.1      cgd  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     60        1.1      cgd  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     61        1.1      cgd  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     62        1.1      cgd  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     63        1.1      cgd  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     64        1.1      cgd  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     65        1.1      cgd  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     66        1.1      cgd  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     67        1.1      cgd  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     68        1.1      cgd  */
     69        1.1      cgd 
     70        1.7      cgd #ifndef _DEV_EISA_EISAVAR_H_
     71        1.7      cgd #define	_DEV_EISA_EISAVAR_H_
     72        1.3      cgd 
     73        1.3      cgd /*
     74        1.3      cgd  * Definitions for EISA autoconfiguration.
     75        1.3      cgd  *
     76        1.7      cgd  * This file describes types and functions which are used for EISA
     77        1.8      cgd  * configuration.  Some of this information is machine-specific, and is
     78        1.8      cgd  * separated into eisa_machdep.h.
     79        1.3      cgd  */
     80       1.16  thorpej 
     81       1.16  thorpej struct eisa_cfg_mem;
     82       1.16  thorpej struct eisa_cfg_irq;
     83       1.16  thorpej struct eisa_cfg_dma;
     84       1.16  thorpej struct eisa_cfg_io;
     85        1.3      cgd 
     86        1.4      cgd #include <machine/bus.h>
     87        1.3      cgd #include <dev/eisa/eisareg.h>		/* For ID register & string info. */
     88        1.3      cgd 
     89        1.8      cgd /*
     90        1.8      cgd  * Structures and definitions needed by the machine-dependent header.
     91        1.8      cgd  */
     92        1.8      cgd struct eisabus_attach_args;
     93        1.8      cgd 
     94        1.8      cgd /*
     95        1.8      cgd  * Machine-dependent definitions.
     96        1.8      cgd  */
     97       1.13      cgd #include <machine/eisa_machdep.h>
     98        1.8      cgd 
     99        1.3      cgd typedef int	eisa_slot_t;		/* really only needs to be 4 bits */
    100        1.3      cgd 
    101        1.1      cgd /*
    102        1.3      cgd  * EISA bus attach arguments.
    103        1.1      cgd  */
    104        1.3      cgd struct eisabus_attach_args {
    105  1.17.24.1    skrll 	const char *_eba_busname;	/* XXX placeholder */
    106       1.10  thorpej 	bus_space_tag_t eba_iot;	/* eisa i/o space tag */
    107       1.10  thorpej 	bus_space_tag_t eba_memt;	/* eisa mem space tag */
    108       1.11  thorpej 	bus_dma_tag_t eba_dmat;		/* DMA tag */
    109        1.8      cgd 	eisa_chipset_tag_t eba_ec;
    110        1.3      cgd };
    111        1.1      cgd 
    112        1.1      cgd /*
    113        1.3      cgd  * EISA device attach arguments.
    114        1.1      cgd  */
    115        1.3      cgd struct eisa_attach_args {
    116       1.10  thorpej 	bus_space_tag_t ea_iot;		/* eisa i/o space tag */
    117       1.10  thorpej 	bus_space_tag_t ea_memt;	/* eisa mem space tag */
    118       1.11  thorpej 	bus_dma_tag_t ea_dmat;		/* DMA tag */
    119        1.8      cgd 	eisa_chipset_tag_t ea_ec;
    120        1.4      cgd 
    121        1.3      cgd 	eisa_slot_t	ea_slot;
    122        1.3      cgd 	u_int8_t	ea_vid[EISA_NVIDREGS];
    123        1.3      cgd 	u_int8_t	ea_pid[EISA_NPIDREGS];
    124        1.3      cgd 	char		ea_idstring[EISA_IDSTRINGLEN];
    125        1.3      cgd };
    126        1.3      cgd 
    127  1.17.24.1    skrll int	eisabusprint(void *, const char *);
    128       1.15  thorpej 
    129       1.15  thorpej /*
    130       1.15  thorpej  * EISA Configuration entries, set up by an EISA Configuration Utility.
    131       1.15  thorpej  */
    132       1.15  thorpej 
    133       1.15  thorpej struct eisa_cfg_mem {
    134       1.15  thorpej 	bus_addr_t ecm_addr;
    135       1.15  thorpej 	bus_size_t ecm_size;
    136       1.15  thorpej 	int ecm_isram;
    137       1.15  thorpej 	int ecm_decode;
    138       1.15  thorpej 	int ecm_unitsize;
    139       1.15  thorpej };
    140       1.15  thorpej 
    141       1.15  thorpej struct eisa_cfg_irq {
    142       1.15  thorpej 	int eci_irq;
    143       1.15  thorpej 	int eci_ist;
    144       1.15  thorpej 	int eci_shared;
    145       1.15  thorpej };
    146       1.15  thorpej 
    147       1.15  thorpej struct eisa_cfg_dma {
    148       1.15  thorpej 	int ecd_drq;
    149       1.15  thorpej 	int ecd_shared;
    150       1.15  thorpej 	int ecd_size;
    151       1.15  thorpej #define	ECD_SIZE_8BIT		0
    152       1.15  thorpej #define	ECD_SIZE_16BIT		1
    153       1.15  thorpej #define	ECD_SIZE_32BIT		2
    154       1.15  thorpej #define	ECD_SIZE_RESERVED	3
    155       1.15  thorpej 	int ecd_timing;
    156       1.15  thorpej #define	ECD_TIMING_ISA		0
    157       1.15  thorpej #define	ECD_TIMING_TYPEA	1
    158       1.15  thorpej #define	ECD_TIMING_TYPEB	2
    159       1.15  thorpej #define	ECD_TIMING_TYPEC	3
    160       1.15  thorpej };
    161       1.15  thorpej 
    162       1.15  thorpej struct eisa_cfg_io {
    163       1.15  thorpej 	bus_addr_t ecio_addr;
    164       1.15  thorpej 	bus_size_t ecio_size;
    165       1.15  thorpej 	int ecio_shared;
    166       1.15  thorpej };
    167        1.3      cgd 
    168        1.7      cgd #endif /* _DEV_EISA_EISAVAR_H_ */
    169