Home | History | Annotate | Line # | Download | only in eisa
eisavar.h revision 1.14.4.1
      1  1.14.4.1  thorpej /*	$NetBSD: eisavar.h,v 1.14.4.1 2000/08/11 18:00:09 thorpej Exp $	*/
      2  1.14.4.1  thorpej 
      3  1.14.4.1  thorpej /*-
      4  1.14.4.1  thorpej  * Copyright (c) 2000 The NetBSD Foundation, Inc.
      5  1.14.4.1  thorpej  * All rights reserved.
      6  1.14.4.1  thorpej  *
      7  1.14.4.1  thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8  1.14.4.1  thorpej  * by Jason R. Thorpe.
      9  1.14.4.1  thorpej  *
     10  1.14.4.1  thorpej  * Redistribution and use in source and binary forms, with or without
     11  1.14.4.1  thorpej  * modification, are permitted provided that the following conditions
     12  1.14.4.1  thorpej  * are met:
     13  1.14.4.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     14  1.14.4.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     15  1.14.4.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.14.4.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     17  1.14.4.1  thorpej  *    documentation and/or other materials provided with the distribution.
     18  1.14.4.1  thorpej  * 3. All advertising materials mentioning features or use of this software
     19  1.14.4.1  thorpej  *    must display the following acknowledgement:
     20  1.14.4.1  thorpej  *	This product includes software developed by the NetBSD
     21  1.14.4.1  thorpej  *	Foundation, Inc. and its contributors.
     22  1.14.4.1  thorpej  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.14.4.1  thorpej  *    contributors may be used to endorse or promote products derived
     24  1.14.4.1  thorpej  *    from this software without specific prior written permission.
     25  1.14.4.1  thorpej  *
     26  1.14.4.1  thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.14.4.1  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.14.4.1  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.14.4.1  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.14.4.1  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.14.4.1  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.14.4.1  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.14.4.1  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.14.4.1  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.14.4.1  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.14.4.1  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     37  1.14.4.1  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.3      cgd 
     81  1.14.4.1  thorpej struct eisa_cfg_mem;
     82  1.14.4.1  thorpej struct eisa_cfg_irq;
     83  1.14.4.1  thorpej struct eisa_cfg_dma;
     84  1.14.4.1  thorpej struct eisa_cfg_io;
     85  1.14.4.1  thorpej 
     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.14  thorpej 	const char *eba_busname;	/* XXX should be common */
    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.12      jtk #include "locators.h"
    128      1.12      jtk 
    129       1.3      cgd /*
    130       1.7      cgd  * Locators for EISA devices, as specified to config.
    131       1.3      cgd  */
    132      1.12      jtk #define	eisacf_slot		cf_loc[EISACF_SLOT]
    133      1.12      jtk #define	EISA_UNKNOWN_SLOT	EISACF_SLOT_DEFAULT	/* wildcarded 'slot' */
    134  1.14.4.1  thorpej 
    135  1.14.4.1  thorpej /*
    136  1.14.4.1  thorpej  * EISA Configuration entries, set up by an EISA Configuration Utility.
    137  1.14.4.1  thorpej  */
    138  1.14.4.1  thorpej 
    139  1.14.4.1  thorpej struct eisa_cfg_mem {
    140  1.14.4.1  thorpej 	bus_addr_t ecm_addr;
    141  1.14.4.1  thorpej 	bus_size_t ecm_size;
    142  1.14.4.1  thorpej 	int ecm_isram;
    143  1.14.4.1  thorpej 	int ecm_decode;
    144  1.14.4.1  thorpej 	int ecm_unitsize;
    145  1.14.4.1  thorpej };
    146  1.14.4.1  thorpej 
    147  1.14.4.1  thorpej struct eisa_cfg_irq {
    148  1.14.4.1  thorpej 	int eci_irq;
    149  1.14.4.1  thorpej 	int eci_ist;
    150  1.14.4.1  thorpej 	int eci_shared;
    151  1.14.4.1  thorpej };
    152  1.14.4.1  thorpej 
    153  1.14.4.1  thorpej struct eisa_cfg_dma {
    154  1.14.4.1  thorpej 	int ecd_drq;
    155  1.14.4.1  thorpej 	int ecd_shared;
    156  1.14.4.1  thorpej 	int ecd_size;
    157  1.14.4.1  thorpej #define	ECD_SIZE_8BIT		0
    158  1.14.4.1  thorpej #define	ECD_SIZE_16BIT		1
    159  1.14.4.1  thorpej #define	ECD_SIZE_32BIT		2
    160  1.14.4.1  thorpej #define	ECD_SIZE_RESERVED	3
    161  1.14.4.1  thorpej 	int ecd_timing;
    162  1.14.4.1  thorpej #define	ECD_TIMING_ISA		0
    163  1.14.4.1  thorpej #define	ECD_TIMING_TYPEA	1
    164  1.14.4.1  thorpej #define	ECD_TIMING_TYPEB	2
    165  1.14.4.1  thorpej #define	ECD_TIMING_TYPEC	3
    166  1.14.4.1  thorpej };
    167  1.14.4.1  thorpej 
    168  1.14.4.1  thorpej struct eisa_cfg_io {
    169  1.14.4.1  thorpej 	bus_addr_t ecio_addr;
    170  1.14.4.1  thorpej 	bus_size_t ecio_size;
    171  1.14.4.1  thorpej 	int ecio_shared;
    172  1.14.4.1  thorpej };
    173       1.3      cgd 
    174       1.7      cgd #endif /* _DEV_EISA_EISAVAR_H_ */
    175