Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / amiga / dev / device.h
blob242ea2d37dbbc83401612c2c951de19071579639
1 /*
2 * Copyright (c) 1982, 1990 The Regents of the University of California.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
33 * @(#)device.h 7.3 (Berkeley) 5/7/91
34 * $Id: device.h,v 1.13 2007/03/04 05:59:18 christos Exp $
37 struct driver {
38 int (*d_init) (void *); /* amiga_device or amiga_ctrl */
39 char *d_name;
40 int (*d_start) (int unit);
41 int (*d_go) (int unit, ...);
42 int (*d_intr) (int unit, int stat);
43 int (*d_done) (int unit);
44 int (*d_ustart) (int unit);
45 int (*d_req) ();
46 void (*d_free) ();
47 void (*d_reset) (int unit);
48 void (*d_delay) (int delay);
49 int (*d_tur) (int ctlr, int slave, int unit);
50 int (*d_ssu) (int ctlr, int slave, int unit, int start);
51 int (*d_rqs) ();
52 int (*d_immcmd) ();
53 int (*d_immcmd_nd) ();
54 int (*d_ttread) ();
55 int (*d_ttwrite) ();
56 int (*d_ttoddio) ();
59 struct amiga_ctlr {
60 struct driver *amiga_driver;
61 int amiga_unit;
62 int amiga_alive;
63 char *amiga_addr;
64 int amiga_flags;
65 int amiga_ipl;
68 struct amiga_device {
69 struct driver *amiga_driver;
70 struct driver *amiga_cdriver;
71 int amiga_unit;
72 int amiga_ctlr;
73 int amiga_slave;
74 char *amiga_addr;
75 int amiga_dk;
76 int amiga_flags;
77 int amiga_alive;
78 int amiga_ipl;
79 int amiga_serno;
80 int amiga_size;
83 struct devqueue {
84 struct devqueue *dq_forw;
85 struct devqueue *dq_back;
86 int dq_ctlr;
87 int dq_unit;
88 int dq_slave;
89 struct driver *dq_driver;
92 #define MAXCTLRS 16 /* Size of HW table (arbitrary) */
93 #define MAXSLAVES 8 /* Slaves per controller (SCSI limit) */
95 struct amiga_hw {
96 void * hw_pa; /* physical address of control space */
97 int hw_size; /* size of control space */
98 void * hw_kva; /* kernel virtual address of control space */
99 int hw_manufacturer;
100 int hw_product; /* autoconfig® parameters */
101 int hw_serno; /* serial number, needed by ethernet boards */
102 int hw_type;
106 /* some I know, some I defined.. PLEASE ADD!! */
107 #define MANUF_BUILTIN 1
108 #define PROD_BUILTIN_SCSI 1
109 #define PROD_BUILTIN_FLOPPY 2
110 #define PROD_BUILTIN_RS232 3
111 #define PROD_BUILTIN_CLOCK 4
112 #define PROD_BUILTIN_KEYBOARD 5
113 #define PROD_BUILTIN_PPORT 6
114 #define PROD_BUILTIN_DISPLAY 7
115 #define PROD_BUILTIN_MOUSE 8
116 #define PROD_BUILTIN_CLOCK2 9
117 #define PROD_BUILTIN_FLOP 10
119 /* They have more than one manuf-id */
120 #define MANUF_CBM_1 513
121 #define PROD_CBM_1_A2088 1
122 #define MANUF_CBM_2 514
123 #define PROD_CBM_2_A2091 3
124 #define PROD_CBM_2_A2065 0x70
126 /* Ameristar Ethernet board is the same as commo's A2065 (dunno exact boardname) */
127 #define MANUF_AMERISTAR 1053
128 #define PROD_AMERISTAR_ETHER 1
130 /* Unilowell tiga-board */
131 #define MANUF_UNILOWELL 1030
132 #define PROD_UNILOWELL_A2410 0
134 /* MacroSystem Retina board */
135 #define MANUF_MACROSYSTEM 0x4754
136 #define PROD_MACROSYSTEM_RETINA 6
138 /* GVP */
139 #define MANUF_GVP 2017
140 #define PROD_GVP_SERIES_I 9 /* Impact Series-I SCSI? */
141 #define PROD_GVP_SERIES_II 11 /* !!!! many things !!! */
142 #define PROD_GVP_X_GF40 0x20 /* G-Force 040 w/o SCSI */
143 #define PROD_GVP_X_GF40_SCSI 0x30 /* G-Force 040 SCSI */
144 #define PROD_GVP_X_COMBO4 0x60 /* Combo 030 Rev 4 w/o SCSI */
145 #define PROD_GVP_X_COMBO4_SCSI 0x70 /* Combo 030 Rev 4 SCSI */
146 #define PROD_GVP_X_IOEXTEND 0x98 /* I/O Extender */
147 #define PROD_GVP_X_GF30 0xa0 /* G-Force 030 w/o SCSI */
148 #define PROD_GVP_X_GF30_SCSI 0xb0 /* G-Force 030 SCSI */
149 #define PROD_GVP_X_COMBO3 0xe0 /* Combo 030 Rev 3 w/o SCSI */
150 #define PROD_GVP_X_COMBO3_SCSI 0xf0 /* Combo 030 Rev 3 SCSI */
151 #define PROD_GVP_X_SCSI_II 0xf8 /* Impact Series-II SCSI */
152 #define PROD_GVP_IV24 32
154 /* Progressive Peripherals Inc. */
155 #define MANUF_PPI 2026
156 #define PROD_PPI_ZEUS 150
157 #define PROD_PPI_A500_040 187
158 #define PROD_PPI_A2000_040 105
159 #define PROD_PPI_A3000_040 1
160 #define PROD_PPI_MERCURY 0
162 /* CSA */
163 #define MANUF_CSA 1058
164 #define PROD_CSA_MAGNUM 17
165 #define PROD_CSA_12G 21
167 /* MicroBotics */
168 #define MANUF_MICROBOTICS 1010
169 #define PROD_MICROBOTICS_VXL30 69
171 /* Supra */
172 #define MANUF_SUPRA 1056
173 #define PROD_SUPRA_WORDSYNC_2 12
175 /* IVS */
176 #define MANUF_IVS 2112
177 #define PROD_IVS_TRUMPCARD 52
178 #define PROD_IVS_VECTOR_ACC 242
179 #define PROD_IVS_VECTOR 243
181 /* Hacker */
182 #define MANUF_HACKER 2011
183 #define PROD_HACKER_MLH 1 /* XXXX Michael's scsi */
185 /* bus types */
186 #define B_MASK 0xE000
187 #define B_BUILTIN 0x2000
188 #define B_ZORROII 0x4000
189 #define B_ZORROIII 0x6000
190 /* controller types */
191 #define C_MASK 0x8F
192 #define C_FLAG 0x80
193 #define C_FLOPPY 0x81
194 #define C_SCSI 0x82
195 /* device types (controllers with no slaves) */
196 #define D_MASK 0x8F
197 #define D_BITMAP 0x01
198 #define D_LAN 0x02
199 #define D_FPA 0x03
200 #define D_KEYBOARD 0x04
201 #define D_COMMSER 0x05
202 #define D_PPORT 0x06
203 #define D_CLOCK 0x07
204 #define D_FLOP 0x0a
205 #define D_MISC 0x7F
207 #define HW_ISCTLR(hw) ((hw)->hw_type & C_FLAG)
208 #define HW_ISFLOPPY(hw) (((hw)->hw_type & C_MASK) == C_FLOPPY)
209 #define HW_ISSCSI(hw) (((hw)->hw_type & C_MASK) == C_SCSI)
210 #define HW_ISDEV(hw,d) (((hw)->hw_type & D_MASK) == (d))
212 /* doesn't belong here... */
214 * Pseudo-device attach information (function + number of pseudo-devs).
216 struct pdevinit {
217 void (*pdev_attach) __P((int));
218 int pdev_count;
221 #ifdef KERNEL
222 extern struct amiga_hw sc_table[];
223 extern struct amiga_ctlr amiga_cinit[];
224 extern struct amiga_device amiga_dinit[];
225 extern void *sctova(), sctopa(), iomap();
226 #endif