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