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