Fri Jun 9 17:55:18 2017 UTC ()
Make VAXstation 4000 TURBOchannel adaptor work.
PIO and IRQ tested on VS4000/60 and /96 with TC-USB (slhci) and PMAD-AA (le).
DMA is untested.
vax needs space to be mapped out, so memory space is pre-mapped for TC option
drivers not bus_space'ified yet, also providing custom bus_space methods for
this kludge.


(flxd)
diff -r1.45 -r1.46 src/sys/arch/alpha/tc/tcasic.c
diff -r1.32 -r1.33 src/sys/arch/pmax/tc/tcbus.c
diff -r1.120 -r1.121 src/sys/arch/vax/conf/files.vax
diff -r1.7 -r1.8 src/sys/arch/vax/vsa/tc_vsbus.c
diff -r1.54 -r1.55 src/sys/dev/tc/tc.c
diff -r1.26 -r1.27 src/sys/dev/tc/tcvar.h

cvs diff -r1.45 -r1.46 src/sys/arch/alpha/tc/tcasic.c (switch to unified diff)

--- src/sys/arch/alpha/tc/tcasic.c 2016/12/12 17:03:40 1.45
+++ src/sys/arch/alpha/tc/tcasic.c 2017/06/09 17:55:18 1.46
@@ -1,238 +1,238 @@ @@ -1,238 +1,238 @@
1/* $NetBSD: tcasic.c,v 1.45 2016/12/12 17:03:40 flxd Exp $ */ 1/* $NetBSD: tcasic.c,v 1.46 2017/06/09 17:55:18 flxd Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. 4 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Author: Chris G. Demetriou 7 * Author: Chris G. Demetriou
8 * 8 *
9 * Permission to use, copy, modify and distribute this software and 9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright 10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the 11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions 12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation. 13 * thereof, and that both notices appear in supporting documentation.
14 * 14 *
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 * 18 *
19 * Carnegie Mellon requests users of this software to return to 19 * Carnegie Mellon requests users of this software to return to
20 * 20 *
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science 22 * School of Computer Science
23 * Carnegie Mellon University 23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890 24 * Pittsburgh PA 15213-3890
25 * 25 *
26 * any improvements or extensions that they make and grant Carnegie the 26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes. 27 * rights to redistribute these changes.
28 */ 28 */
29 29
30#include "opt_dec_3000_300.h" 30#include "opt_dec_3000_300.h"
31#include "opt_dec_3000_500.h" 31#include "opt_dec_3000_500.h"
32 32
33#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ 33#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
34 34
35__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.45 2016/12/12 17:03:40 flxd Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: tcasic.c,v 1.46 2017/06/09 17:55:18 flxd Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/device.h> 39#include <sys/device.h>
40 40
41#include <machine/autoconf.h> 41#include <machine/autoconf.h>
42#include <machine/rpb.h> 42#include <machine/rpb.h>
43#include <machine/alpha.h> 43#include <machine/alpha.h>
44 44
45#include <dev/tc/tcvar.h> 45#include <dev/tc/tcvar.h>
46#include <alpha/tc/tc_conf.h> 46#include <alpha/tc/tc_conf.h>
47 47
48/* Definition of the driver for autoconfig. */ 48/* Definition of the driver for autoconfig. */
49int tcasicmatch(device_t, cfdata_t, void *); 49int tcasicmatch(device_t, cfdata_t, void *);
50void tcasicattach(device_t, device_t, void *); 50void tcasicattach(device_t, device_t, void *);
51 51
52CFATTACH_DECL_NEW(tcasic, 0, 52CFATTACH_DECL_NEW(tcasic, 0,
53 tcasicmatch, tcasicattach, NULL, NULL); 53 tcasicmatch, tcasicattach, NULL, NULL);
54 54
55extern struct cfdriver tcasic_cd; 55extern struct cfdriver tcasic_cd;
56 56
57int tcasicprint(void *, const char *); 57int tcasicprint(void *, const char *);
58 58
59/* There can be only one. */ 59/* There can be only one. */
60int tcasicfound; 60int tcasicfound;
61 61
62int 62int
63tcasicmatch(device_t parent, cfdata_t cf, void *aux) 63tcasicmatch(device_t parent, cfdata_t cf, void *aux)
64{ 64{
65 struct mainbus_attach_args *ma = aux; 65 struct mainbus_attach_args *ma = aux;
66 66
67 /* Make sure that we're looking for a TurboChannel ASIC. */ 67 /* Make sure that we're looking for a TurboChannel ASIC. */
68 if (strcmp(ma->ma_name, tcasic_cd.cd_name)) 68 if (strcmp(ma->ma_name, tcasic_cd.cd_name))
69 return (0); 69 return (0);
70 70
71 /* Make sure that the system supports a TurboChannel ASIC. */ 71 /* Make sure that the system supports a TurboChannel ASIC. */
72 if ((cputype != ST_DEC_3000_500) && (cputype != ST_DEC_3000_300)) 72 if ((cputype != ST_DEC_3000_500) && (cputype != ST_DEC_3000_300))
73 return (0); 73 return (0);
74 74
75 if (tcasicfound) 75 if (tcasicfound)
76 return (0); 76 return (0);
77 77
78 return (1); 78 return (1);
79} 79}
80 80
81void 81void
82tcasicattach(device_t parent, device_t self, void *aux) 82tcasicattach(device_t parent, device_t self, void *aux)
83{ 83{
84 struct tcbus_attach_args tba; 84 struct tcbus_attach_args tba;
85 void (*intr_setup)(void); 85 void (*intr_setup)(void);
86 void (*iointr)(void *, unsigned long); 86 void (*iointr)(void *, unsigned long);
87 87
88 printf("\n"); 88 printf("\n");
89 tcasicfound = 1; 89 tcasicfound = 1;
90 90
91 switch (cputype) { 91 switch (cputype) {
92#ifdef DEC_3000_500 92#ifdef DEC_3000_500
93 case ST_DEC_3000_500: 93 case ST_DEC_3000_500:
94 94
95 intr_setup = tc_3000_500_intr_setup; 95 intr_setup = tc_3000_500_intr_setup;
96 iointr = tc_3000_500_iointr; 96 iointr = tc_3000_500_iointr;
97 97
98 tba.tba_speed = TC_SPEED_25_MHZ; 98 tba.tba_speed = TC_SPEED_25_MHZ;
99 tba.tba_nslots = tc_3000_500_nslots; 99 tba.tba_nslots = tc_3000_500_nslots;
100 tba.tba_slots = tc_3000_500_slots; 100 tba.tba_slots = tc_3000_500_slots;
101 if (hwrpb->rpb_variation & SV_GRAPHICS) { 101 if (hwrpb->rpb_variation & SV_GRAPHICS) {
102 tba.tba_nbuiltins = tc_3000_500_graphics_nbuiltins; 102 tba.tba_nbuiltins = tc_3000_500_graphics_nbuiltins;
103 tba.tba_builtins = tc_3000_500_graphics_builtins; 103 tba.tba_builtins = tc_3000_500_graphics_builtins;
104 } else { 104 } else {
105 tba.tba_nbuiltins = tc_3000_500_nographics_nbuiltins; 105 tba.tba_nbuiltins = tc_3000_500_nographics_nbuiltins;
106 tba.tba_builtins = tc_3000_500_nographics_builtins; 106 tba.tba_builtins = tc_3000_500_nographics_builtins;
107 } 107 }
108 tba.tba_intr_evcnt = tc_3000_500_intr_evcnt; 108 tba.tba_intr_evcnt = tc_3000_500_intr_evcnt;
109 tba.tba_intr_establish = tc_3000_500_intr_establish; 109 tba.tba_intr_establish = tc_3000_500_intr_establish;
110 tba.tba_intr_disestablish = tc_3000_500_intr_disestablish; 110 tba.tba_intr_disestablish = tc_3000_500_intr_disestablish;
111 tba.tba_get_dma_tag = tc_dma_get_tag_3000_500; 111 tba.tba_get_dma_tag = tc_dma_get_tag_3000_500;
112 112
113 /* Do 3000/500-specific DMA setup now. */ 113 /* Do 3000/500-specific DMA setup now. */
114 tc_dma_init_3000_500(tc_3000_500_nslots); 114 tc_dma_init_3000_500(tc_3000_500_nslots);
115 break; 115 break;
116#endif /* DEC_3000_500 */ 116#endif /* DEC_3000_500 */
117 117
118#ifdef DEC_3000_300 118#ifdef DEC_3000_300
119 case ST_DEC_3000_300: 119 case ST_DEC_3000_300:
120 120
121 intr_setup = tc_3000_300_intr_setup; 121 intr_setup = tc_3000_300_intr_setup;
122 iointr = tc_3000_300_iointr; 122 iointr = tc_3000_300_iointr;
123 123
124 tba.tba_speed = TC_SPEED_12_5_MHZ; 124 tba.tba_speed = TC_SPEED_12_5_MHZ;
125 tba.tba_nslots = tc_3000_300_nslots; 125 tba.tba_nslots = tc_3000_300_nslots;
126 tba.tba_slots = tc_3000_300_slots; 126 tba.tba_slots = tc_3000_300_slots;
127 tba.tba_nbuiltins = tc_3000_300_nbuiltins; 127 tba.tba_nbuiltins = tc_3000_300_nbuiltins;
128 tba.tba_builtins = tc_3000_300_builtins; 128 tba.tba_builtins = tc_3000_300_builtins;
129 tba.tba_intr_evcnt = tc_3000_300_intr_evcnt; 129 tba.tba_intr_evcnt = tc_3000_300_intr_evcnt;
130 tba.tba_intr_establish = tc_3000_300_intr_establish; 130 tba.tba_intr_establish = tc_3000_300_intr_establish;
131 tba.tba_intr_disestablish = tc_3000_300_intr_disestablish; 131 tba.tba_intr_disestablish = tc_3000_300_intr_disestablish;
132 tba.tba_get_dma_tag = tc_dma_get_tag_3000_300; 132 tba.tba_get_dma_tag = tc_dma_get_tag_3000_300;
133 break; 133 break;
134#endif /* DEC_3000_300 */ 134#endif /* DEC_3000_300 */
135 135
136 default: 136 default:
137 panic("tcasicattach: bad cputype"); 137 panic("tcasicattach: bad cputype");
138 } 138 }
139 139
140 tba.tba_busname = "tc"; 140 tba.tba_busname = "tc";
141 tba.tba_memt = tc_bus_mem_init(NULL); 141 tba.tba_memt = tc_bus_mem_init(NULL);
142  142
143 tc_dma_init(); 143 tc_dma_init();
144 144
145 (*intr_setup)(); 145 (*intr_setup)();
146 146
147 /* They all come in at 0x800. */ 147 /* They all come in at 0x800. */
148 scb_set(0x800, iointr, NULL, IPL_VM); 148 scb_set(0x800, iointr, NULL, IPL_VM);
149 149
150 config_found(self, &tba, tcasicprint); 150 config_found(self, &tba, tcasicprint);
151} 151}
152 152
153int 153int
154tcasicprint(void *aux, const char *pnp) 154tcasicprint(void *aux, const char *pnp)
155{ 155{
156 156
157 /* only TCs can attach to tcasics; easy. */ 157 /* only TCs can attach to tcasics; easy. */
158 if (pnp) 158 if (pnp)
159 aprint_normal("tc at %s", pnp); 159 aprint_normal("tc at %s", pnp);
160 return (UNCONF); 160 return (UNCONF);
161} 161}
162 162
163#include "wsdisplay.h" 163#include "wsdisplay.h"
164 164
165#if NWSDISPLAY > 0 165#if NWSDISPLAY > 0
166 166
167#include "sfb.h" 167#include "sfb.h"
168#include "sfbp.h" 168#include "sfbp.h"
169#include "cfb.h" 169#include "cfb.h"
170#include "mfb.h" 170#include "mfb.h"
171#include "tfb.h" 171#include "tfb.h"
172#include "px.h" 172#include "px.h"
173#include "pxg.h" 173#include "pxg.h"
174 174
175extern void sfb_cnattach(tc_addr_t); 175extern void sfb_cnattach(tc_addr_t);
176extern void sfbp_cnattach(tc_addr_t); 176extern void sfbp_cnattach(tc_addr_t);
177extern void cfb_cnattach(tc_addr_t); 177extern void cfb_cnattach(tc_addr_t);
178extern void mfb_cnattach(tc_addr_t); 178extern void mfb_cnattach(tc_addr_t);
179extern void tfb_cnattach(tc_addr_t); 179extern void tfb_cnattach(tc_addr_t);
180extern void px_cnattach(tc_addr_t); 180extern void px_cnattach(tc_addr_t);
181extern void pxg_cnattach(tc_addr_t); 181extern void pxg_cnattach(tc_addr_t);
182 182
183struct cnboards { 183struct cnboards {
184 const char *cb_tcname; 184 const char *cb_tcname;
185 void (*cb_cnattach)(tc_addr_t); 185 void (*cb_cnattach)(tc_addr_t);
186} static const cnboards[] = { 186} static const cnboards[] = {
187#if NSFB > 0 187#if NSFB > 0
188 { "PMAGB-BA", sfb_cnattach }, 188 { "PMAGB-BA", sfb_cnattach },
189#endif 189#endif
190#if NSFBP > 0 190#if NSFBP > 0
191 { "PMAGD ", sfbp_cnattach }, 191 { "PMAGD ", sfbp_cnattach },
192#endif 192#endif
193#if NCFB > 0 193#if NCFB > 0
194 { "PMAG-BA ", cfb_cnattach }, 194 { "PMAG-BA ", cfb_cnattach },
195#endif 195#endif
196#if NMFB > 0 196#if NMFB > 0
197 { "PMAG-AA ", mfb_cnattach }, 197 { "PMAG-AA ", mfb_cnattach },
198#endif 198#endif
199#if NTFB > 0 199#if NTFB > 0
200 { "PMAG-JA ", tfb_cnattach }, 200 { "PMAG-JA ", tfb_cnattach },
201#endif 201#endif
202#if NPX > 0 202#if NPX > 0
203 { "PMAG-CA ", px_cnattach }, 203 { "PMAG-CA ", px_cnattach },
204#endif 204#endif
205#if NPXG > 0 205#if NPXG > 0
206 { "PMAG-DA ", pxg_cnattach }, 206 { "PMAG-DA ", pxg_cnattach },
207 { "PMAG-FA ", pxg_cnattach }, 207 { "PMAG-FA ", pxg_cnattach },
208 { "PMAG-FB ", pxg_cnattach }, 208 { "PMAG-FB ", pxg_cnattach },
209 { "PMAGB-FA", pxg_cnattach }, 209 { "PMAGB-FA", pxg_cnattach },
210 { "PMAGB-FB", pxg_cnattach }, 210 { "PMAGB-FB", pxg_cnattach },
211#endif 211#endif
212}; 212};
213 213
214/* 214/*
215 * tc_fb_cnattach -- 215 * tc_fb_cnattach --
216 * Attempt to attach the appropriate display driver to the 216 * Attempt to attach the appropriate display driver to the
217 * output console. 217 * output console.
218 */ 218 */
219int 219int
220tc_fb_cnattach(tc_addr_t tcaddr) 220tc_fb_cnattach(tc_addr_t tcaddr)
221{ 221{
222 char tcname[TC_ROM_LLEN]; 222 char tcname[TC_ROM_LLEN];
223 int i; 223 int i;
224 224
225 if (tc_badaddr(tcaddr) || (tc_checkslot(tcaddr, tcname) == 0)) 225 if (tc_badaddr(tcaddr) || (tc_checkslot(tcaddr, tcname, NULL) == 0))
226 return (EINVAL); 226 return (EINVAL);
227 227
228 for (i = 0; i < sizeof(cnboards) / sizeof(cnboards[0]); i++) 228 for (i = 0; i < sizeof(cnboards) / sizeof(cnboards[0]); i++)
229 if (strncmp(tcname, cnboards[i].cb_tcname, TC_ROM_LLEN) == 0) 229 if (strncmp(tcname, cnboards[i].cb_tcname, TC_ROM_LLEN) == 0)
230 break; 230 break;
231 231
232 if (i == sizeof(cnboards) / sizeof(cnboards[0])) 232 if (i == sizeof(cnboards) / sizeof(cnboards[0]))
233 return (ENXIO); 233 return (ENXIO);
234 234
235 (cnboards[i].cb_cnattach)(tcaddr); 235 (cnboards[i].cb_cnattach)(tcaddr);
236 return (0); 236 return (0);
237} 237}
238#endif /* if NWSDISPLAY > 0 */ 238#endif /* if NWSDISPLAY > 0 */

cvs diff -r1.32 -r1.33 src/sys/arch/pmax/tc/tcbus.c (switch to unified diff)

--- src/sys/arch/pmax/tc/tcbus.c 2016/12/12 17:03:41 1.32
+++ src/sys/arch/pmax/tc/tcbus.c 2017/06/09 17:55:18 1.33
@@ -1,239 +1,239 @@ @@ -1,239 +1,239 @@
1/* $NetBSD: tcbus.c,v 1.32 2016/12/12 17:03:41 flxd Exp $ */ 1/* $NetBSD: tcbus.c,v 1.33 2017/06/09 17:55:18 flxd Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Tohru Nishimura. 8 * by Tohru Nishimura.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.32 2016/12/12 17:03:41 flxd Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: tcbus.c,v 1.33 2017/06/09 17:55:18 flxd Exp $");
34 34
35#define _PMAX_BUS_DMA_PRIVATE 35#define _PMAX_BUS_DMA_PRIVATE
36/* 36/*
37 * Which system models were configured? 37 * Which system models were configured?
38 */ 38 */
39#include "opt_dec_3max.h" 39#include "opt_dec_3max.h"
40#include "opt_dec_3min.h" 40#include "opt_dec_3min.h"
41#include "opt_dec_maxine.h" 41#include "opt_dec_maxine.h"
42#include "opt_dec_3maxplus.h" 42#include "opt_dec_3maxplus.h"
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/bus.h> 45#include <sys/bus.h>
46#include <sys/cpu.h> 46#include <sys/cpu.h>
47#include <sys/device.h> 47#include <sys/device.h>
48#include <sys/systm.h> 48#include <sys/systm.h>
49 49
50#include <pmax/autoconf.h> 50#include <pmax/autoconf.h>
51#include <pmax/sysconf.h> 51#include <pmax/sysconf.h>
52 52
53#include <dev/tc/tcvar.h> 53#include <dev/tc/tcvar.h>
54#include <pmax/pmax/pmaxtype.h> 54#include <pmax/pmax/pmaxtype.h>
55 55
56static const struct evcnt *tc_ds_intr_evcnt(device_t, void *); 56static const struct evcnt *tc_ds_intr_evcnt(device_t, void *);
57static void tc_ds_intr_establish(device_t, void *, 57static void tc_ds_intr_establish(device_t, void *,
58 int, int (*)(void *), void *); 58 int, int (*)(void *), void *);
59static void tc_ds_intr_disestablish(device_t, void *); 59static void tc_ds_intr_disestablish(device_t, void *);
60static bus_dma_tag_t tc_ds_get_dma_tag(int); 60static bus_dma_tag_t tc_ds_get_dma_tag(int);
61 61
62extern struct tcbus_attach_args kn02_tc_desc[]; /* XXX */ 62extern struct tcbus_attach_args kn02_tc_desc[]; /* XXX */
63extern struct tcbus_attach_args kmin_tc_desc[]; /* XXX */ 63extern struct tcbus_attach_args kmin_tc_desc[]; /* XXX */
64extern struct tcbus_attach_args xine_tc_desc[]; /* XXX */ 64extern struct tcbus_attach_args xine_tc_desc[]; /* XXX */
65extern struct tcbus_attach_args kn03_tc_desc[]; /* XXX */ 65extern struct tcbus_attach_args kn03_tc_desc[]; /* XXX */
66 66
67static int tcbus_match(device_t, cfdata_t, void *); 67static int tcbus_match(device_t, cfdata_t, void *);
68static void tcbus_attach(device_t, device_t, void *); 68static void tcbus_attach(device_t, device_t, void *);
69 69
70CFATTACH_DECL_NEW(tcbus, sizeof(struct tc_softc), 70CFATTACH_DECL_NEW(tcbus, sizeof(struct tc_softc),
71 tcbus_match, tcbus_attach, NULL, NULL); 71 tcbus_match, tcbus_attach, NULL, NULL);
72 72
73static int tcbus_found; 73static int tcbus_found;
74 74
75static int 75static int
76tcbus_match(device_t parent, cfdata_t cf, void *aux) 76tcbus_match(device_t parent, cfdata_t cf, void *aux)
77{ 77{
78 struct mainbus_attach_args *ma = aux; 78 struct mainbus_attach_args *ma = aux;
79 79
80 if (tcbus_found || strcmp(ma->ma_name, "tcbus")) 80 if (tcbus_found || strcmp(ma->ma_name, "tcbus"))
81 return 0; 81 return 0;
82 82
83 return 1; 83 return 1;
84} 84}
85 85
86static void 86static void
87tcbus_attach(device_t parent, device_t self, void *aux) 87tcbus_attach(device_t parent, device_t self, void *aux)
88{ 88{
89 struct tcbus_attach_args *tba; 89 struct tcbus_attach_args *tba;
90 90
91 tcbus_found = 1; 91 tcbus_found = 1;
92 92
93 switch (systype) { 93 switch (systype) {
94#ifdef DEC_3MAX 94#ifdef DEC_3MAX
95 case DS_3MAX: 95 case DS_3MAX:
96 tba = &kn02_tc_desc[0]; break; 96 tba = &kn02_tc_desc[0]; break;
97#endif 97#endif
98#ifdef DEC_3MIN 98#ifdef DEC_3MIN
99 case DS_3MIN: 99 case DS_3MIN:
100 tba = &kmin_tc_desc[0]; break; 100 tba = &kmin_tc_desc[0]; break;
101#endif 101#endif
102#ifdef DEC_MAXINE 102#ifdef DEC_MAXINE
103 case DS_MAXINE: 103 case DS_MAXINE:
104 tba = &xine_tc_desc[0]; break; 104 tba = &xine_tc_desc[0]; break;
105#endif 105#endif
106#ifdef DEC_3MAXPLUS 106#ifdef DEC_3MAXPLUS
107 case DS_3MAXPLUS: 107 case DS_3MAXPLUS:
108 tba = &kn03_tc_desc[0]; break; 108 tba = &kn03_tc_desc[0]; break;
109#endif 109#endif
110 default: 110 default:
111 panic("tcbus_attach: no TURBOchannel configured for systype = %d", systype); 111 panic("tcbus_attach: no TURBOchannel configured for systype = %d", systype);
112 } 112 }
113 113
114 tba->tba_busname = "tc"; 114 tba->tba_busname = "tc";
115 tba->tba_memt = normal_memt; 115 tba->tba_memt = normal_memt;
116 tba->tba_intr_evcnt = tc_ds_intr_evcnt; 116 tba->tba_intr_evcnt = tc_ds_intr_evcnt;
117 tba->tba_intr_establish = tc_ds_intr_establish; 117 tba->tba_intr_establish = tc_ds_intr_establish;
118 tba->tba_intr_disestablish = tc_ds_intr_disestablish; 118 tba->tba_intr_disestablish = tc_ds_intr_disestablish;
119 tba->tba_get_dma_tag = tc_ds_get_dma_tag; 119 tba->tba_get_dma_tag = tc_ds_get_dma_tag;
120 120
121 /* XXX why not config_found(9)? */ 121 /* XXX why not config_found(9)? */
122 tcattach(parent, self, tba); 122 tcattach(parent, self, tba);
123} 123}
124 124
125/* 125/*
126 * Dispatch to model specific interrupt line evcnt fetch rontine 126 * Dispatch to model specific interrupt line evcnt fetch rontine
127 */ 127 */
128static const struct evcnt * 128static const struct evcnt *
129tc_ds_intr_evcnt(device_t dev, void *cookie) 129tc_ds_intr_evcnt(device_t dev, void *cookie)
130{ 130{
131 131
132 /* XXX for now, no evcnt parent reported */ 132 /* XXX for now, no evcnt parent reported */
133 return NULL; 133 return NULL;
134} 134}
135 135
136/* 136/*
137 * Dispatch to model specific interrupt establishing routine 137 * Dispatch to model specific interrupt establishing routine
138 */ 138 */
139static void 139static void
140tc_ds_intr_establish(device_t dev, void *cookie, int level, 140tc_ds_intr_establish(device_t dev, void *cookie, int level,
141 int (*handler)(void *), void *val) 141 int (*handler)(void *), void *val)
142{ 142{
143 143
144 (*platform.intr_establish)(dev, cookie, level, handler, val); 144 (*platform.intr_establish)(dev, cookie, level, handler, val);
145} 145}
146 146
147static void 147static void
148tc_ds_intr_disestablish(device_t dev, void *arg) 148tc_ds_intr_disestablish(device_t dev, void *arg)
149{ 149{
150 150
151 printf("cannot disestablish TC interrupts\n"); 151 printf("cannot disestablish TC interrupts\n");
152} 152}
153 153
154/* 154/*
155 * Return the DMA tag for use by the specified TURBOchannel slot. 155 * Return the DMA tag for use by the specified TURBOchannel slot.
156 */ 156 */
157static bus_dma_tag_t 157static bus_dma_tag_t
158tc_ds_get_dma_tag(int slot) 158tc_ds_get_dma_tag(int slot)
159{ 159{
160 /* 160 /*
161 * All DECstations use the default DMA tag. 161 * All DECstations use the default DMA tag.
162 */ 162 */
163 return (&pmax_default_bus_dma_tag); 163 return (&pmax_default_bus_dma_tag);
164} 164}
165 165
166#include "wsdisplay.h" 166#include "wsdisplay.h"
167 167
168#if NWSDISPLAY > 0 168#if NWSDISPLAY > 0
169 169
170#include "sfb.h" 170#include "sfb.h"
171/* #include "sfbp.h" */ 171/* #include "sfbp.h" */
172#include "cfb.h" 172#include "cfb.h"
173#include "mfb.h" 173#include "mfb.h"
174#include "tfb.h" 174#include "tfb.h"
175#include "xcfb.h" 175#include "xcfb.h"
176#include "px.h" 176#include "px.h"
177#include "pxg.h" 177#include "pxg.h"
178 178
179#include <pmax/pmax/cons.h> 179#include <pmax/pmax/cons.h>
180#include <pmax/dec_prom.h> 180#include <pmax/dec_prom.h>
181 181
182struct cnboards { 182struct cnboards {
183 const char *cb_tcname; 183 const char *cb_tcname;
184 void (*cb_cnattach)(tc_addr_t); 184 void (*cb_cnattach)(tc_addr_t);
185} static const cnboards[] = { 185} static const cnboards[] = {
186#if NXCFB > 0 186#if NXCFB > 0
187 { "PMAG-DV ", xcfb_cnattach }, 187 { "PMAG-DV ", xcfb_cnattach },
188#endif 188#endif
189#if NSFB > 0 189#if NSFB > 0
190 { "PMAGB-BA", sfb_cnattach }, 190 { "PMAGB-BA", sfb_cnattach },
191#endif 191#endif
192#if NSFBP > 0 192#if NSFBP > 0
193 { "PMAGD ", sfbp_cnattach }, 193 { "PMAGD ", sfbp_cnattach },
194#endif 194#endif
195#if NCFB > 0 195#if NCFB > 0
196 { "PMAG-BA ", cfb_cnattach }, 196 { "PMAG-BA ", cfb_cnattach },
197#endif 197#endif
198#if NMFB > 0 198#if NMFB > 0
199 { "PMAG-AA ", mfb_cnattach }, 199 { "PMAG-AA ", mfb_cnattach },
200#endif 200#endif
201#if NTFB > 0 201#if NTFB > 0
202 { "PMAG-JA ", tfb_cnattach }, 202 { "PMAG-JA ", tfb_cnattach },
203#endif 203#endif
204#if NPX > 0 204#if NPX > 0
205 { "PMAG-CA ", px_cnattach }, 205 { "PMAG-CA ", px_cnattach },
206#endif 206#endif
207#if NPXG > 0 207#if NPXG > 0
208 { "PMAG-DA ", pxg_cnattach }, 208 { "PMAG-DA ", pxg_cnattach },
209 { "PMAG-FA ", pxg_cnattach }, 209 { "PMAG-FA ", pxg_cnattach },
210 { "PMAG-FB ", pxg_cnattach }, 210 { "PMAG-FB ", pxg_cnattach },
211 { "PMAGB-FA", pxg_cnattach }, 211 { "PMAGB-FA", pxg_cnattach },
212 { "PMAGB-FB", pxg_cnattach }, 212 { "PMAGB-FB", pxg_cnattach },
213#endif 213#endif
214}; 214};
215 215
216int 216int
217tcfb_cnattach(int slotno) 217tcfb_cnattach(int slotno)
218{ 218{
219 paddr_t tcaddr; 219 paddr_t tcaddr;
220 char tcname[TC_ROM_LLEN]; 220 char tcname[TC_ROM_LLEN];
221 int i; 221 int i;
222 222
223 tcaddr = promcall(callv->_slot_address, slotno); 223 tcaddr = promcall(callv->_slot_address, slotno);
224 if (tc_badaddr(tcaddr) || tc_checkslot(tcaddr, tcname) == 0) 224 if (tc_badaddr(tcaddr) || tc_checkslot(tcaddr, tcname, NULL) == 0)
225 panic("TC console designated by PROM does not exist!?"); 225 panic("TC console designated by PROM does not exist!?");
226 226
227 for (i = 0; i < __arraycount(cnboards); i++) { 227 for (i = 0; i < __arraycount(cnboards); i++) {
228 if (strncmp(tcname, cnboards[i].cb_tcname, TC_ROM_LLEN) == 0) 228 if (strncmp(tcname, cnboards[i].cb_tcname, TC_ROM_LLEN) == 0)
229 break; 229 break;
230 } 230 }
231 231
232 if (i == __arraycount(cnboards)) 232 if (i == __arraycount(cnboards))
233 return (0); 233 return (0);
234 234
235 (cnboards[i].cb_cnattach)((tc_addr_t)TC_PHYS_TO_UNCACHED(tcaddr)); 235 (cnboards[i].cb_cnattach)((tc_addr_t)TC_PHYS_TO_UNCACHED(tcaddr));
236 return (1); 236 return (1);
237} 237}
238 238
239#endif /* NWSDISPLAY */ 239#endif /* NWSDISPLAY */

cvs diff -r1.120 -r1.121 src/sys/arch/vax/conf/files.vax (switch to unified diff)

--- src/sys/arch/vax/conf/files.vax 2015/07/05 03:06:27 1.120
+++ src/sys/arch/vax/conf/files.vax 2017/06/09 17:55:18 1.121
@@ -1,415 +1,415 @@ @@ -1,415 +1,415 @@
1# $NetBSD: files.vax,v 1.120 2015/07/05 03:06:27 matt Exp $ 1# $NetBSD: files.vax,v 1.121 2017/06/09 17:55:18 flxd Exp $
2# 2#
3# new style config file for vax architecture 3# new style config file for vax architecture
4# 4#
5 5
6# maxpartitions must be first item in files.${ARCH}.newconf 6# maxpartitions must be first item in files.${ARCH}.newconf
7maxpartitions 8 7maxpartitions 8
8 8
9maxusers 8 32 64 9maxusers 8 32 64
10 10
11device mainbus { }: bus 11device mainbus { }: bus
12attach mainbus at root 12attach mainbus at root
13 13
14# Define a bunch of devices, needed in more than one place. 14# Define a bunch of devices, needed in more than one place.
15device cpu 15device cpu
16device mem 16device mem
17device mba { drive = -1 }: bus 17device mba { drive = -1 }: bus
18 18
19defflag opt_cputype.h VAX780 VAX750 VAX730 19defflag opt_cputype.h VAX780 VAX750 VAX730
20 VAX8200 VAX8800 VAX8600 VAX610 20 VAX8200 VAX8800 VAX8600 VAX610
21 VAX6200 VAX6300 VAX6400 VAX6500 VAX6600 21 VAX6200 VAX6300 VAX6400 VAX6500 VAX6600
22 VAX410 VAX43 VAX46 VAX48 VAX49 VAX53 22 VAX410 VAX43 VAX46 VAX48 VAX49 VAX53
23 VAX630 VAX650 VAX660 VAX670 VAX680 VAXANY 23 VAX630 VAX650 VAX660 VAX670 VAX680 VAXANY
24 24
25defflag opt_emulate.h NO_INSN_EMULATE 25defflag opt_emulate.h NO_INSN_EMULATE
26 26
27defpseudo leds 27defpseudo leds
28file arch/vax/vsa/leds.c leds needs-flag 28file arch/vax/vsa/leds.c leds needs-flag
29 29
30# CPU on mainbus 30# CPU on mainbus
31attach cpu at mainbus with cpu_mainbus 31attach cpu at mainbus with cpu_mainbus
32 32
33# NMI on KA88 33# NMI on KA88
34device nmi { slot=-1 }: bus 34device nmi { slot=-1 }: bus
35attach nmi at mainbus with nmi_mainbus 35attach nmi at mainbus with nmi_mainbus
36file arch/vax/vax/nmi_mainbus.c nmi 36file arch/vax/vax/nmi_mainbus.c nmi
37 37
38# Abus and related devices 38# Abus and related devices
39device abus {}: bus 39device abus {}: bus
40attach abus at mainbus with abus_mainbus 40attach abus at mainbus with abus_mainbus
41file arch/vax/vax/ka860.c vax8600 41file arch/vax/vax/ka860.c vax8600
42file arch/vax/vax/crl.c vax8600 42file arch/vax/vax/crl.c vax8600
43 43
44# SBI and related devices 44# SBI and related devices
45device sbi { tr=-1 }: bus 45device sbi { tr=-1 }: bus
46attach sbi at mainbus with sbi_mainbus 46attach sbi at mainbus with sbi_mainbus
47attach sbi at abus with sbi_abus 47attach sbi at abus with sbi_abus
48file arch/vax/vax/sbi.c sbi 48file arch/vax/vax/sbi.c sbi
49 49
50attach mem at sbi with mem_sbi 50attach mem at sbi with mem_sbi
51file arch/vax/vax/ka780.c vax780 | mem_sbi | vaxany 51file arch/vax/vax/ka780.c vax780 | mem_sbi | vaxany
52file arch/vax/vax/cfl.c vax780 | mem_sbi | vaxany 52file arch/vax/vax/cfl.c vax780 | mem_sbi | vaxany
53 53
54# CMI and related devices 54# CMI and related devices
55device cmi { tr=-1 }: bus 55device cmi { tr=-1 }: bus
56attach cmi at mainbus 56attach cmi at mainbus
57file arch/vax/vax/cmi.c cmi 57file arch/vax/vax/cmi.c cmi
58 58
59attach mem at cmi with mem_cmi 59attach mem at cmi with mem_cmi
60file arch/vax/vax/ka750.c vax750 | mem_cmi | vaxany 60file arch/vax/vax/ka750.c vax750 | mem_cmi | vaxany
61file arch/vax/vax/ctu.c vax750 | vax730 | mem_cmi | vaxany 61file arch/vax/vax/ctu.c vax750 | vax730 | mem_cmi | vaxany
62 62
63# Direct unibus interface 63# Direct unibus interface
64device ubi { tr=-1 } 64device ubi { tr=-1 }
65attach ubi at mainbus 65attach ubi at mainbus
66file arch/vax/vax/ubi.c ubi 66file arch/vax/vax/ubi.c ubi
67 67
68attach mem at ubi with mem_ubi 68attach mem at ubi with mem_ubi
69file arch/vax/vax/ka730.c vax730 | mem_ubi | vaxany 69file arch/vax/vax/ka730.c vax730 | mem_ubi | vaxany
70 70
71device vsbus { csr }: bus 71device vsbus { csr }: bus
72attach vsbus at mainbus 72attach vsbus at mainbus
73file arch/vax/vsa/vsbus.c vsbus 73file arch/vax/vsa/vsbus.c vsbus
74file arch/vax/vsa/vsbus_dma.c vsbus & (vax46 | vax48 | vax49 | 74file arch/vax/vsa/vsbus_dma.c vsbus & (vax46 | vax48 | vax49 |
75 vax53 | vaxany) 75 vax53 | vaxany)
76 76
77device ze: sgec, arp, ether, ifnet 77device ze: sgec, arp, ether, ifnet
78attach ze at mainbus with ze_mainbus 78attach ze at mainbus with ze_mainbus
79file arch/vax/if/if_ze.c ze_mainbus 79file arch/vax/if/if_ze.c ze_mainbus
80 80
81attach le at mainbus with le_mainbus: le24 81attach le at mainbus with le_mainbus: le24
82file arch/vax/if/if_le.c le_mainbus 82file arch/vax/if/if_le.c le_mainbus
83 83
84attach mba at sbi with mba_sbi 84attach mba at sbi with mba_sbi
85attach mba at cmi with mba_cmi 85attach mba at cmi with mba_cmi
86file arch/vax/mba/mba.c mba needs-flag 86file arch/vax/mba/mba.c mba needs-flag
87 87
88device hp: disk 88device hp: disk
89attach hp at mba 89attach hp at mba
90file arch/vax/mba/hp.c hp needs-flag 90file arch/vax/mba/hp.c hp needs-flag
91 91
92device ht: tape 92device ht: tape
93attach ht at mba 93attach ht at mba
94file arch/vax/mba/ht.c ht needs-flag 94file arch/vax/mba/ht.c ht needs-flag
95 95
96# 96#
97# Bus-independent support for DEC devices 97# Bus-independent support for DEC devices
98# 98#
99include "dev/dec/files.dec" 99include "dev/dec/files.dec"
100 100
101# Memory Disk for install floppy 101# Memory Disk for install floppy
102file dev/md_root.c memory_disk_hooks 102file dev/md_root.c memory_disk_hooks
103 103
104# MSCP device drivers 104# MSCP device drivers
105include "dev/mscp/files.mscp" 105include "dev/mscp/files.mscp"
106 106
107# Unibus/Q22 bus definitions 107# Unibus/Q22 bus definitions
108include "dev/qbus/files.uba" 108include "dev/qbus/files.uba"
109 109
110# TurboCHANNEL bus support and device drivers 110# TurboCHANNEL bus support and device drivers
111include "dev/tc/files.tc" 111include "dev/tc/files.tc"
112 112
113attach tc at vsbus with tcbus 113attach tc at vsbus with tc_vsbus
114file arch/vax/vsa/tc_vsbus.c tcbus 114file arch/vax/vsa/tc_vsbus.c tc_vsbus
115 115
116attach uba at mainbus with uba_mainbus 116attach uba at mainbus with uba_mainbus
117file arch/vax/uba/uba_mainbus.c uba_mainbus 117file arch/vax/uba/uba_mainbus.c uba_mainbus
118attach uba at sbi with uba_sbi 118attach uba at sbi with uba_sbi
119file arch/vax/uba/uba_sbi.c uba_sbi 119file arch/vax/uba/uba_sbi.c uba_sbi
120attach uba at cmi with uba_cmi 120attach uba at cmi with uba_cmi
121file arch/vax/uba/uba_cmi.c uba_cmi 121file arch/vax/uba/uba_cmi.c uba_cmi
122attach uba at ubi with uba_ubi 122attach uba at ubi with uba_ubi
123file arch/vax/uba/uba_ubi.c uba_ubi 123file arch/vax/uba/uba_ubi.c uba_ubi
124 124
125# BI bus definitions 125# BI bus definitions
126include "dev/bi/files.bi" 126include "dev/bi/files.bi"
127 127
128attach bi at mainbus with bi_mainbus 128attach bi at mainbus with bi_mainbus
129file arch/vax/bi/bi_mainbus.c bi_mainbus 129file arch/vax/bi/bi_mainbus.c bi_mainbus
130attach bi at nmi with bi_nmi 130attach bi at nmi with bi_nmi
131file arch/vax/bi/bi_nmi.c bi_nmi 131file arch/vax/bi/bi_nmi.c bi_nmi
132 132
133# VAX CPUs at BI, do not belong in MI code. 133# VAX CPUs at BI, do not belong in MI code.
134attach cpu at bi with cpu_bi 134attach cpu at bi with cpu_bi
135attach mem at bi with mem_bi 135attach mem at bi with mem_bi
136 136
137# VAX CPUs at NMI 137# VAX CPUs at NMI
138attach cpu at nmi with cpu_nmi 138attach cpu at nmi with cpu_nmi
139attach mem at nmi with mem_nmi 139attach mem at nmi with mem_nmi
140 140
141# XMI bus definitions 141# XMI bus definitions
142include "dev/xmi/files.xmi" 142include "dev/xmi/files.xmi"
143 143
144attach xmi at mainbus with xmi_mainbus 144attach xmi at mainbus with xmi_mainbus
145file arch/vax/vax/xmi_mainbus.c xmi_mainbus 145file arch/vax/vax/xmi_mainbus.c xmi_mainbus
146 146
147# VAX CPUs at XMI, do not belong in MI code. 147# VAX CPUs at XMI, do not belong in MI code.
148attach cpu at xmi with cpu_xmi 148attach cpu at xmi with cpu_xmi
149attach mem at xmi with mem_xmi 149attach mem at xmi with mem_xmi
150 150
151attach dz at vsbus with dz_vsbus 151attach dz at vsbus with dz_vsbus
152file arch/vax/vsa/dz_vsbus.c dz_vsbus | smg 152file arch/vax/vsa/dz_vsbus.c dz_vsbus | smg
153 153
154attach lkkbd at dz with dzkbd 154attach lkkbd at dz with dzkbd
155file dev/dec/dzkbd.c dzkbd needs-flag 155file dev/dec/dzkbd.c dzkbd needs-flag
156 156
157# XXX alpha and pmax call this vsms 157# XXX alpha and pmax call this vsms
158device lkms: wsmousedev 158device lkms: wsmousedev
159attach lkms at dz with dzms 159attach lkms at dz with dzms
160file dev/dec/dzms.c dzms needs-flag 160file dev/dec/dzms.c dzms needs-flag
161 161
162# RD-type disks at VS2000's onboard MFM-controller 162# RD-type disks at VS2000's onboard MFM-controller
163device hdc { drive = -1 } 163device hdc { drive = -1 }
164attach hdc at vsbus 164attach hdc at vsbus
165file arch/vax/vsa/hdc9224.c ry | hdc | rd needs-flag 165file arch/vax/vsa/hdc9224.c ry | hdc | rd needs-flag
166 166
167device rd: disk 167device rd: disk
168attach rd at hdc 168attach rd at hdc
169 169
170device ry: disk 170device ry: disk
171attach ry at hdc 171attach ry at hdc
172 172
173# 173#
174# Machine-independent SCSI driver. 174# Machine-independent SCSI driver.
175# 175#
176include "dev/scsipi/files.scsipi" 176include "dev/scsipi/files.scsipi"
177 177
178# builtin NCR5380 SCSI-controller on VAXstation 178# builtin NCR5380 SCSI-controller on VAXstation
179device si: scsi, ncr5380sbc 179device si: scsi, ncr5380sbc
180attach si at vsbus with si_vsbus 180attach si at vsbus with si_vsbus
181file arch/vax/vsa/ncr.c si_vsbus 181file arch/vax/vsa/ncr.c si_vsbus
182 182
183# Monochrome framebuffer on VS3100. 183# Monochrome framebuffer on VS3100.
184device smg: displaydev, wsemuldisplaydev 184device smg: displaydev, wsemuldisplaydev
185attach smg at vsbus 185attach smg at vsbus
186file arch/vax/vsa/smg.c smg needs-flag 186file arch/vax/vsa/smg.c smg needs-flag
187 187
188# Monochrome QVSS framebuffer on qbus (VCB01) 188# Monochrome QVSS framebuffer on qbus (VCB01)
189device qv {}: displaydev, wsemuldisplaydev 189device qv {}: displaydev, wsemuldisplaydev
190attach qv at uba 190attach qv at uba
191attach genfb at qv with genfb_qv 191attach genfb at qv with genfb_qv
192file arch/vax/uba/qv.c qv|genfb_qv needs-flag 192file arch/vax/uba/qv.c qv|genfb_qv needs-flag
193 193
194device qvaux { line=-1 }: tty 194device qvaux { line=-1 }: tty
195attach qvaux at qv  195attach qvaux at qv
196file arch/vax/uba/qvaux.c qvaux needs-flag 196file arch/vax/uba/qvaux.c qvaux needs-flag
197 197
198attach lkkbd at qvaux with qvkbd 198attach lkkbd at qvaux with qvkbd
199file arch/vax/uba/qvkbd.c qvkbd needs-flag 199file arch/vax/uba/qvkbd.c qvkbd needs-flag
200 200
201attach lkms at qvaux with qvms 201attach lkms at qvaux with qvms
202file arch/vax/uba/qvms.c qvms needs-flag 202file arch/vax/uba/qvms.c qvms needs-flag
203 203
204# Color framebuffer on VS4000/60. 204# Color framebuffer on VS4000/60.
205device lcg: displaydev, wsemuldisplaydev 205device lcg: displaydev, wsemuldisplaydev
206attach lcg at vsbus 206attach lcg at vsbus
207file arch/vax/vsa/lcg.c lcg needs-flag 207file arch/vax/vsa/lcg.c lcg needs-flag
208 208
209# Color framebuffer on VS4000/90. 209# Color framebuffer on VS4000/90.
210device spx: displaydev, wsemuldisplaydev 210device spx: displaydev, wsemuldisplaydev
211attach spx at vsbus 211attach spx at vsbus
212file arch/vax/vsa/spx.c spx needs-flag 212file arch/vax/vsa/spx.c spx needs-flag
213 213
214# LANCE ethernet controller on VAXstation 214# LANCE ethernet controller on VAXstation
215attach le at vsbus with le_vsbus: le24 215attach le at vsbus with le_vsbus: le24
216file arch/vax/if/if_le_vsbus.c le_vsbus 216file arch/vax/if/if_le_vsbus.c le_vsbus
217 217
218# builtin NCR53C95 SCSI Controlller on VAXstation 4000 VLC/60/9x 218# builtin NCR53C95 SCSI Controlller on VAXstation 4000 VLC/60/9x
219#device asc: scsi, ncr53c9x 219#device asc: scsi, ncr53c9x
220attach asc at vsbus with asc_vsbus 220attach asc at vsbus with asc_vsbus
221file arch/vax/vsa/asc_vsbus.c asc_vsbus 221file arch/vax/vsa/asc_vsbus.c asc_vsbus
222 222
223# These devices aren't tested (or even compiled!) 223# These devices aren't tested (or even compiled!)
224# They are just included here to make some files happy ;) 224# They are just included here to make some files happy ;)
225# 225#
226 226
227# Ikonas framebuffer 227# Ikonas framebuffer
228device ik 228device ik
229attach ik at uba 229attach ik at uba
230file arch/vax/uba/ik.c ik needs-flag 230file arch/vax/uba/ik.c ik needs-flag
231 231
232device vs 232device vs
233attach vs at uba 233attach vs at uba
234file arch/vax/uba/vs.c vs needs-flag 234file arch/vax/uba/vs.c vs needs-flag
235 235
236# RK06/07 on UBA 236# RK06/07 on UBA
237device rk: disk 237device rk: disk
238attach rk at uba 238attach rk at uba
239file arch/vax/uba/rk.c rk needs-flag 239file arch/vax/uba/rk.c rk needs-flag
240 240
241# TM11/TE10 at UBA 241# TM11/TE10 at UBA
242device te: tape 242device te: tape
243attach te at uba 243attach te at uba
244file arch/vax/uba/tm.c te needs-flag 244file arch/vax/uba/tm.c te needs-flag
245 245
246# TU78 at MBA 246# TU78 at MBA
247device mu: tape 247device mu: tape
248attach mu at mba 248attach mu at mba
249file arch/vax/mba/mt.c mu needs-flag 249file arch/vax/mba/mt.c mu needs-flag
250 250
251# DN-11 on UBA 251# DN-11 on UBA
252device dn # XXX? 252device dn # XXX?
253attach dn at uba 253attach dn at uba
254file arch/vax/uba/dn.c dn needs-flag 254file arch/vax/uba/dn.c dn needs-flag
255 255
256# IDC (RB730) on UBA (VAX 11/730) 256# IDC (RB730) on UBA (VAX 11/730)
257device idc { drive=-1 } 257device idc { drive=-1 }
258attach idc at uba 258attach idc at uba
259device rb: disk 259device rb: disk
260attach rb at idc 260attach rb at idc
261file arch/vax/uba/idc.c rb needs-flag 261file arch/vax/uba/idc.c rb needs-flag
262 262
263# LP-11 at UBA 263# LP-11 at UBA
264device lp 264device lp
265attach lp at uba 265attach lp at uba
266file arch/vax/uba/lp.c lp needs-flag 266file arch/vax/uba/lp.c lp needs-flag
267 267
268# ???? at UBA 268# ???? at UBA
269device lpa 269device lpa
270attach lpa at uba 270attach lpa at uba
271file arch/vax/uba/lpa.c lpa needs-flag 271file arch/vax/uba/lpa.c lpa needs-flag
272 272
273# PS2 at UBA 273# PS2 at UBA
274device ps 274device ps
275attach ps at uba 275attach ps at uba
276file arch/vax/uba/ps.c ps needs-flag 276file arch/vax/uba/ps.c ps needs-flag
277 277
278# SC-21/SC-31 at UBA 278# SC-21/SC-31 at UBA
279device sc { drive=-1 } 279device sc { drive=-1 }
280attach sc at uba 280attach sc at uba
281device up: disk 281device up: disk
282attach up at sc 282attach up at sc
283file arch/vax/uba/up.c up needs-flag 283file arch/vax/uba/up.c up needs-flag
284 284
285# TU45 at UBA 285# TU45 at UBA
286device ut { drive=-1} 286device ut { drive=-1}
287attach ut at uba 287attach ut at uba
288device tj: tape 288device tj: tape
289attach tj at ut 289attach tj at ut
290file arch/vax/uba/ut.c tj needs-flag 290file arch/vax/uba/ut.c tj needs-flag
291 291
292# TU58/DECtape II 292# TU58/DECtape II
293device uu: tape 293device uu: tape
294attach uu at uba 294attach uu at uba
295file arch/vax/uba/uu.c uu needs-flag 295file arch/vax/uba/uu.c uu needs-flag
296 296
297# Benson-Varian plotter at UBA 297# Benson-Varian plotter at UBA
298device va { drive=-1} 298device va { drive=-1}
299attach va at uba 299attach va at uba
300device vz 300device vz
301attach vz at va 301attach vz at va
302file arch/vax/uba/va.c va needs-flag 302file arch/vax/uba/va.c va needs-flag
303 303
304# Versatec plotter at UBA 304# Versatec plotter at UBA
305device vp 305device vp
306attach vp at uba 306attach vp at uba
307file arch/vax/uba/vp.c vp needs-flag 307file arch/vax/uba/vp.c vp needs-flag
308 308
309# ACC LH/DH IMP on UBA 309# ACC LH/DH IMP on UBA
310device acc: ifnet 310device acc: ifnet
311attach acc at uba 311attach acc at uba
312file arch/vax/if/if_acc.c acc needs-flag 312file arch/vax/if/if_acc.c acc needs-flag
313 313
314# DR11C at UBA 314# DR11C at UBA
315device ct # XXX 315device ct # XXX
316attach ct at uba 316attach ct at uba
317file arch/vax/uba/ct.c ct needs-flag 317file arch/vax/uba/ct.c ct needs-flag
318 318
319# A/D-converter on UBA 319# A/D-converter on UBA
320device ad 320device ad
321attach ad at uba 321attach ad at uba
322file arch/vax/uba/ad.c ad needs-flag 322file arch/vax/uba/ad.c ad needs-flag
323 323
324# DH-11/DM-11 on UBA 324# DH-11/DM-11 on UBA
325device dh # XXX? 325device dh # XXX?
326attach dh at uba 326attach dh at uba
327file arch/vax/uba/dh.c dh needs-flag 327file arch/vax/uba/dh.c dh needs-flag
328 328
329# Vaxstation 4000 audio 329# Vaxstation 4000 audio
330device vsaudio: audiobus, am7930 330device vsaudio: audiobus, am7930
331attach vsaudio at vsbus 331attach vsaudio at vsbus
332file arch/vax/vsa/vsaudio.c vsaudio needs-flag 332file arch/vax/vsa/vsaudio.c vsaudio needs-flag
333 333
334# These are general files needed for compilation. 334# These are general files needed for compilation.
335file dev/cons.c 335file dev/cons.c
336file dev/cninit.c 336file dev/cninit.c
337file arch/vax/vax/locore.c 337file arch/vax/vax/locore.c
338file arch/vax/vax/clock.c 338file arch/vax/vax/clock.c
339file arch/vax/vax/core_machdep.c coredump 339file arch/vax/vax/core_machdep.c coredump
340file arch/vax/vax/gencons.c vax8600 | vax780 | vax750 | vax630 | 340file arch/vax/vax/gencons.c vax8600 | vax780 | vax750 | vax630 |
341 vax8200 | vax680 | vax650 | vax660 | 341 vax8200 | vax680 | vax650 | vax660 |
342 vax670 | vaxany 342 vax670 | vaxany
343file arch/vax/vax/pmap.c 343file arch/vax/vax/pmap.c
344file arch/vax/vax/machdep.c 344file arch/vax/vax/machdep.c
345file arch/vax/vax/ka820.c vax8200 | vaxany 345file arch/vax/vax/ka820.c vax8200 | vaxany
346file arch/vax/vax/crx.c vax8200 | vaxany 346file arch/vax/vax/crx.c vax8200 | vaxany
347file arch/vax/vax/ka88.c vax8800 | vaxany 347file arch/vax/vax/ka88.c vax8800 | vaxany
348file arch/vax/vax/ka6400.c vax6400 | vaxany 348file arch/vax/vax/ka6400.c vax6400 | vaxany
349file arch/vax/vax/ka410.c vax410 | vaxany 349file arch/vax/vax/ka410.c vax410 | vaxany
350file arch/vax/vax/ka43.c vax43 | vaxany 350file arch/vax/vax/ka43.c vax43 | vaxany
351file arch/vax/vax/ka46.c vax46 | vaxany 351file arch/vax/vax/ka46.c vax46 | vaxany
352file arch/vax/vax/ka48.c vax48 | vaxany 352file arch/vax/vax/ka48.c vax48 | vaxany
353file arch/vax/vax/ka49.c vax49 | vaxany 353file arch/vax/vax/ka49.c vax49 | vaxany
354file arch/vax/vax/ka53.c vax53 | vaxany 354file arch/vax/vax/ka53.c vax53 | vaxany
355file arch/vax/vax/ka610.c vax610 | vaxany 355file arch/vax/vax/ka610.c vax610 | vaxany
356file arch/vax/vax/ka630.c vax630 | vaxany 356file arch/vax/vax/ka630.c vax630 | vaxany
357file arch/vax/vax/ka650.c vax650 | vaxany 357file arch/vax/vax/ka650.c vax650 | vaxany
358file arch/vax/vax/ka660.c vax660 | vaxany 358file arch/vax/vax/ka660.c vax660 | vaxany
359file arch/vax/vax/ka670.c vax670 | vaxany 359file arch/vax/vax/ka670.c vax670 | vaxany
360file arch/vax/vax/ka680.c vax680 | vaxany 360file arch/vax/vax/ka680.c vax680 | vaxany
361file arch/vax/vax/emulate.S !no_insn_emulate 361file arch/vax/vax/emulate.S !no_insn_emulate
362file arch/vax/vax/unimpl_emul.S !no_insn_emulate 362file arch/vax/vax/unimpl_emul.S !no_insn_emulate
363file arch/vax/vax/lock_stubs.S 363file arch/vax/vax/lock_stubs.S
364file arch/vax/vax/scb.c 364file arch/vax/vax/scb.c
365file arch/vax/vax/opcodes.c 365file arch/vax/vax/opcodes.c
366file arch/vax/vax/conf.c 366file arch/vax/vax/conf.c
367file arch/vax/vax/trap.c 367file arch/vax/vax/trap.c
368file arch/vax/vax/bus_dma.c 368file arch/vax/vax/bus_dma.c
369file arch/vax/vax/bus_mem.c 369file arch/vax/vax/bus_mem.c
370file arch/vax/vax/procfs_machdep.c procfs 370file arch/vax/vax/procfs_machdep.c procfs
371file arch/vax/vax/sgmap.c 371file arch/vax/vax/sgmap.c
372file arch/vax/vax/sig_machdep.c 372file arch/vax/vax/sig_machdep.c
373file arch/vax/vax/syscall.c 373file arch/vax/vax/syscall.c
374file arch/vax/vax/vm_machdep.c 374file arch/vax/vax/vm_machdep.c
375file arch/vax/vax/findcpu.c 375file arch/vax/vax/findcpu.c
376file arch/vax/vax/autoconf.c 376file arch/vax/vax/autoconf.c
377file arch/vax/vax/ns_cksum.c ns 377file arch/vax/vax/ns_cksum.c ns
378file arch/vax/vax/disksubr.c disk | tape 378file arch/vax/vax/disksubr.c disk | tape
379file arch/vax/vax/db_machdep.c ddb 379file arch/vax/vax/db_machdep.c ddb
380file arch/vax/vax/db_disasm.c ddb 380file arch/vax/vax/db_disasm.c ddb
381file arch/vax/uba/uba_dma.c uba 381file arch/vax/uba/uba_dma.c uba
382file arch/vax/vax/multicpu.c multiprocessor 382file arch/vax/vax/multicpu.c multiprocessor
383 383
384# Binary compatibility with previous NetBSD releases (COMPAT_XX) 384# Binary compatibility with previous NetBSD releases (COMPAT_XX)
385file arch/vax/vax/compat_13_machdep.c compat_13 | compat_ultrix | 385file arch/vax/vax/compat_13_machdep.c compat_13 | compat_ultrix |
386 compat_ibcs2 386 compat_ibcs2
387file arch/vax/vax/compat_16_machdep.c compat_16 | compat_ultrix 387file arch/vax/vax/compat_16_machdep.c compat_16 | compat_ultrix
388 388
389include "compat/ibcs2/files.ibcs2" 389include "compat/ibcs2/files.ibcs2"
390file arch/vax/vax/ibcs2_machdep.c compat_ibcs2 390file arch/vax/vax/ibcs2_machdep.c compat_ibcs2
391 391
392include "compat/ultrix/files.ultrix" 392include "compat/ultrix/files.ultrix"
393 393
394include "compat/vax1k/files.vax1k" 394include "compat/vax1k/files.vax1k"
395 395
396# Dom h{ra f}r vara kvar s} l{nge f}r vi se vilka vi beh|ver... 396# Dom h{ra f}r vara kvar s} l{nge f}r vi se vilka vi beh|ver...
397#arch/vax/vax/dkbad.c standard 397#arch/vax/vax/dkbad.c standard
398#arch/vax/vax/ka730.c standard 398#arch/vax/vax/ka730.c standard
399#arch/vax/vax/iidr.o optional ii 399#arch/vax/vax/iidr.o optional ii
400#arch/vax/vax/iidrsys.o optional ii 400#arch/vax/vax/iidrsys.o optional ii
401#arch/vax/vax/iidr_glob.o optional ii 401#arch/vax/vax/iidr_glob.o optional ii
402#arch/vax/if/if_css.c optional css imp device-driver 402#arch/vax/if/if_css.c optional css imp device-driver
403#arch/vax/if/if_dp.c optional dp device-driver 403#arch/vax/if/if_dp.c optional dp device-driver
404#arch/vax/if/if_ddn.c optional ddn device-driver 404#arch/vax/if/if_ddn.c optional ddn device-driver
405#arch/vax/if/if_dmv.c optional dmv device-driver 405#arch/vax/if/if_dmv.c optional dmv device-driver
406#arch/vax/if/if_ec.c optional ec device-driver 406#arch/vax/if/if_ec.c optional ec device-driver
407#arch/vax/if/if_en.c optional en device-driver 407#arch/vax/if/if_en.c optional en device-driver
408#arch/vax/if/if_ex.c optional ex device-driver 408#arch/vax/if/if_ex.c optional ex device-driver
409#arch/vax/if/if_hdh.c optional hdh device-driver 409#arch/vax/if/if_hdh.c optional hdh device-driver
410#arch/vax/if/if_hy.c optional hy device-driver 410#arch/vax/if/if_hy.c optional hy device-driver
411#arch/vax/if/if_pcl.c optional pcl device-driver 411#arch/vax/if/if_pcl.c optional pcl device-driver
412#arch/vax/if/if_vv.c optional vv device-driver 412#arch/vax/if/if_vv.c optional vv device-driver
413#arch/vax/if/raw_hy.c optional hy device-driver 413#arch/vax/if/raw_hy.c optional hy device-driver
414 414
415include "arch/vax/conf/majors.vax" 415include "arch/vax/conf/majors.vax"

cvs diff -r1.7 -r1.8 src/sys/arch/vax/vsa/tc_vsbus.c (switch to unified diff)

--- src/sys/arch/vax/vsa/tc_vsbus.c 2011/06/05 16:12:50 1.7
+++ src/sys/arch/vax/vsa/tc_vsbus.c 2017/06/09 17:55:18 1.8
@@ -1,147 +1,434 @@ @@ -1,147 +1,434 @@
1/* $NetBSD: tc_vsbus.c,v 1.7 2011/06/05 16:12:50 christos Exp $ */ 1/* $NetBSD: tc_vsbus.c,v 1.8 2017/06/09 17:55:18 flxd Exp $ */
2/*- 2/*-
3 * Copyright (c) 2008 The NetBSD Foundation, Inc. 3 * Copyright (c) 2008 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Matt Thomas <matt@3am-software.com>. 7 * by Matt Thomas <matt@3am-software.com>.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the 15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution. 16 * documentation and/or other materials provided with the distribution.
17 * 17 *
18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE. 28 * POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
 31#include <sys/cdefs.h>
 32__KERNEL_RCSID(0, "$NetBSD: tc_vsbus.c,v 1.8 2017/06/09 17:55:18 flxd Exp $");
 33
31#include <sys/param.h> 34#include <sys/param.h>
32#include <sys/bus.h> 35#include <sys/bus.h>
33#include <sys/cpu.h> 36#include <sys/cpu.h>
34#include <sys/device.h> 37#include <sys/device.h>
35 38
 39#include <machine/cpu.h>
36#include <machine/pte.h> 40#include <machine/pte.h>
37#include <machine/scb.h> 41#include <machine/scb.h>
 42#include <machine/sid.h>
38#include <machine/vsbus.h> 43#include <machine/vsbus.h>
 44
39#include <dev/tc/tcvar.h> 45#include <dev/tc/tcvar.h>
40 46
41static int tcbus_match(device_t, cfdata_t, void *); 47#define NSLOTS 1
42static void tcbus_attach(device_t, device_t, void *); 
43 48
44struct tcbus_softc { 49struct tc_vsbus_softc {
45 struct tc_softc sc_tc; 50 struct tc_softc sc_tc;
46 struct tc_slotdesc sc_slots[1]; 51 struct tc_slotdesc sc_slots[NSLOTS];
47 struct vax_bus_dma_tag sc_dmatag; 52 struct vax_bus_dma_tag sc_dmatag;
48 struct vax_sgmap sc_sgmap; 53 struct vax_sgmap sc_sgmap;
49 struct evcnt sc_ev; 54 struct evcnt sc_ev;
50 bus_space_handle_t sc_memh; 55 int (*sc_intr_func)(void *);
 56 void *sc_intr_arg;
 57 bus_space_tag_t sc_bst;
 58 bus_space_handle_t sc_bsh_csr;
 59 int sc_cvec;
51}; 60};
52 61
53static bus_dma_tag_t tcbus_dmat; 62static int tc_vsbus_match(device_t, cfdata_t, void *);
 63static void tc_vsbus_attach(device_t, device_t, void *);
 64
 65static int tc_vsbus_dma_init(device_t);
 66static bus_dma_tag_t tc_vsbus_get_dma_tag(int);
 67
 68static void tc_vsbus_intr(void *);
 69static void tc_vsbus_intr_establish(device_t, void *, int, int (*)(void *),
 70 void *);
 71static void tc_vsbus_intr_disestablish(device_t, void *);
 72static const struct evcnt *tc_vsbus_intr_evcnt(device_t, void *);
 73
 74static int vax_tc_bus_space_map(void *, bus_addr_t, bus_size_t, int,
 75 bus_space_handle_t *, int);
 76static int vax_tc_bus_space_subregion(void *, bus_space_handle_t, bus_size_t,
 77 bus_size_t, bus_space_handle_t *);
 78static void vax_tc_bus_space_unmap(void *, bus_space_handle_t, bus_size_t, int);
 79static int vax_tc_bus_space_alloc(void *, bus_addr_t, bus_addr_t, bus_size_t,
 80 bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
 81static void vax_tc_bus_space_free(void *, bus_space_handle_t, bus_size_t);
 82static paddr_t vax_tc_bus_space_mmap(void *, bus_addr_t, off_t, int, int);
 83
 84CFATTACH_DECL_NEW(tc_vsbus, sizeof(struct tc_vsbus_softc),
 85 tc_vsbus_match, tc_vsbus_attach, 0, 0);
 86
 87static bus_dma_tag_t tc_vsbus_dmat;
 88
 89struct vax_bus_space vax_tc_bus_space = {
 90 NULL,
 91 vax_tc_bus_space_map,
 92 vax_tc_bus_space_unmap,
 93 vax_tc_bus_space_subregion,
 94 vax_tc_bus_space_alloc,
 95 vax_tc_bus_space_free,
 96 vax_tc_bus_space_mmap,
 97};
 98
 99/*
 100 * taken from KA46 System Board Specification, KA46-0-DBF, Rev. X.02,
 101 * 10 October 1990
 102 */
 103#define KA46_BWF0 0x20080014
 104#define KA46_BWF0_ADP __BIT(31)
 105#define KA46_BWF0_SZ 4
 106
 107/*
 108 * taken from KA49 Processor Module Specification V 1.1, 20 August 1992
 109 */
 110#define KA49_CFG 0x25800000
 111#define KA49_CFG_BA __BIT(0)
 112#define KA49_CFG_SZ 2
 113
 114/*
 115 * taken from Pmariah TURBOchannel Adapter Specification, 29 November 1991
 116 */
 117#define KA4x_TCA_BASE 0x30000000
 118#define KA4x_TCA_DIAG_TRIG (KA4x_TCA_BASE + 0x4000000)
 119#define KA4x_TCA_MAP_CHK_SEQ (KA4x_TCA_BASE + 0x4800000)
 120#define KA4x_TCA_FIFO_DIAG (KA4x_TCA_BASE + 0x5000000)
 121#define KA4x_TCA_SGMAP (KA4x_TCA_BASE + 0x5800000)
 122#define KA4x_TCA_DIAG_ROM (KA4x_TCA_BASE + 0x6000000)
 123#define KA4x_TCA_CSR (KA4x_TCA_BASE + 0x6800000)
 124#define KA4x_TCA_CSR_BLK_SZ __BITS(0, 2) /* 0x00007 RW */
 125#define KA4x_TCA_CSR_SPARE __BIT(3) /* 0x00008 RW */
 126#define KA4x_TCA_CSR_BAD_PAR __BITS(4, 7) /* 0x000f0 RW */
 127#define KA4x_TCA_CSR_RST_TC __BIT(8) /* 0x00100 RW */
 128#define KA4x_TCA_CSR_EN_MAP __BIT(9) /* 0x00200 RW */
 129#define KA4x_TCA_CSR_INVAL_REF __BIT(10) /* 0x00400 RW1C */
 130#define KA4x_TCA_CSR_TC_TMO __BIT(11) /* 0x00800 RW */
 131#define KA4x_TCA_CSR_EN_TC_IRQ __BIT(12) /* 0x01000 RW */
 132#define KA4x_TCA_CSR_TC_IRQ __BIT(13) /* 0x02000 R */
 133#define KA4x_TCA_CSR_ERR __BIT(14) /* 0x04000 RW1C */
 134#define KA4x_TCA_CSR_ALT_CYC_ST __BIT(15) /* 0x08000 RW */
 135#define KA4x_TCA_CSR_EN_PAR __BIT(16) /* 0x10000 RW */
 136#define KA4x_TCA_CSR_FIFO_EMPTY __BIT(17) /* 0x20000 R */
 137#define KA4x_TCA_CSR_SZ 4
 138
 139static int
 140tc_vsbus_match(device_t parent, cfdata_t cfdata, void *aux)
 141{
 142 struct vsbus_attach_args * const va = aux;
 143 uint32_t *csr;
 144 bus_space_tag_t bst = va->va_memt;
 145 bus_space_handle_t bsh;
 146 int found, rc;
 147
 148 if (va->va_paddr != KA4x_TCA_CSR)
 149 return 0;
 150
 151 /* Bus adaptor present? */
 152 switch (vax_boardtype) {
 153 case VAX_BTYP_46:
 154 if (bus_space_map(bst, KA46_BWF0, KA46_BWF0_SZ, 0, &bsh))
 155 return 0;
 156 found = ((bus_space_read_4(bst, bsh, 0) & KA46_BWF0_ADP) != 0);
 157 bus_space_unmap(bst, bsh, KA46_BWF0_SZ);
 158 /*
 159 * On VS4000/60, although interrupting on a real vector, fool
 160 * vsbus interrupt, as no interrupt bit will be set in
 161 * vsbus_softc's sc_intreq for TC adaptor.
 162 */
 163 rc = 20;
 164 break;
 165 case VAX_BTYP_49:
 166 if (bus_space_map(bst, KA49_CFG, KA49_CFG_SZ, 0, &bsh))
 167 return 0;
 168 found = ((bus_space_read_2(bst, bsh, 0) & KA49_CFG_BA) != 0);
 169 bus_space_unmap(bst, bsh, KA49_CFG_SZ);
 170 rc = 10;
 171 break;
 172 default:
 173 return 0;
 174 }
 175 if (!found)
 176 return 0;
 177
 178 /* XXX Assume a found bus adaptor is the TC bus adaptor. */
 179
 180 /* Force interrupt. */
 181 csr = (uint32_t *)va->va_addr;
 182 *csr |= KA4x_TCA_CSR_TC_TMO;
 183 DELAY(10000);
 184 *csr &= ~KA4x_TCA_CSR_TC_TMO;
 185 DELAY(10000);
 186
 187 return rc;
 188}
 189
 190#define INIT_SLOTSZ 1
 191
 192static void
 193tc_vsbus_attach(device_t parent, device_t self, void *aux)
 194{
 195 struct tcbus_attach_args tba;
 196 struct vsbus_attach_args * const va = aux;
 197 struct tc_vsbus_softc * const sc = device_private(self);
 198 struct tc_rommap *rommap;
 199 bus_space_tag_t bst = va->va_memt;
 200 bus_space_handle_t bsh_csr, bsh_slot;
 201 const bus_size_t slotb = 4194304;
 202 uint32_t csr;
 203 int error, slotsz;
 204
 205 sc->sc_cvec = va->va_cvec;
54 206
55CFATTACH_DECL_NEW(tcbus, sizeof(struct tcbus_softc), 207 error = bus_space_map(bst, KA4x_TCA_CSR, KA4x_TCA_CSR_SZ, 0, &bsh_csr);
56 tcbus_match, tcbus_attach, 0, 0); 208 if (error) {
 209 aprint_normal(": failed to map TCA CSR: %d\n", error);
 210 return;
 211 }
 212 sc->sc_bst = bst;
 213 sc->sc_bsh_csr = bsh_csr;
 214
 215 /* Deassert TC option reset and clean up. */
 216 csr = bus_space_read_4(bst, bsh_csr, 0);
 217 csr &= ~(KA4x_TCA_CSR_TC_TMO | KA4x_TCA_CSR_RST_TC);
 218 csr |= KA4x_TCA_CSR_ERR | KA4x_TCA_CSR_INVAL_REF;
 219 bus_space_write_4(bst, bsh_csr, 0, csr);
 220
 221 /*
 222 * Map initial number of "slots" (4 MB each) to read the option ROM
 223 * header.
 224 */
 225 error = bus_space_map(bst, KA4x_TCA_BASE, INIT_SLOTSZ * slotb,
 226 BUS_SPACE_MAP_LINEAR, &bsh_slot);
 227 if (error) {
 228 aprint_normal(": failed to map TC slot: %d", error);
 229 goto fail;
 230 }
 231 /* Determine number of slots required from option ROM header. */
 232 slotsz = 0;
 233 if (tc_checkslot((tc_addr_t)bus_space_vaddr(bst, bsh_slot), NULL,
 234 &rommap))
 235 slotsz = rommap->tcr_ssize.v;
 236 if (slotsz == 0) {
 237 /* Invalid option ROM header or no option present. */
 238 bus_space_unmap(bst, bsh_slot, INIT_SLOTSZ * slotb);
 239 goto fail;
 240 } else if (slotsz > INIT_SLOTSZ) {
 241 /* Remap with actual slot size required. */
 242 bus_space_unmap(bst, bsh_slot, INIT_SLOTSZ * slotb);
 243 error = bus_space_map(bst, KA4x_TCA_BASE, slotsz * slotb,
 244 BUS_SPACE_MAP_LINEAR, &bsh_slot);
 245 if (error) {
 246 aprint_normal(": failed to map TC slot: %d", error);
 247 goto fail;
 248 }
 249 } else
 250 slotsz = INIT_SLOTSZ;
 251
 252 /* Pass pre-mapped space for TC drivers not bus_space'ified yet. */
 253 sc->sc_slots[0].tcs_addr = (tc_addr_t)bus_space_vaddr(bst, bsh_slot);
 254 sc->sc_slots[0].tcs_cookie = sc;
 255 sc->sc_slots[0].tcs_used = 0;
 256
 257 tba.tba_busname = "tc";
 258 /* Tag with custom methods for pre-mapped bus_space. */
 259 tba.tba_memt = &vax_tc_bus_space;
 260 tba.tba_speed = TC_SPEED_12_5_MHZ;
 261 tba.tba_nslots = __arraycount(sc->sc_slots);
 262 tba.tba_slots = sc->sc_slots;
 263 tba.tba_nbuiltins = 0;
 264 tba.tba_intr_evcnt = tc_vsbus_intr_evcnt;
 265 tba.tba_intr_establish = tc_vsbus_intr_establish;
 266 tba.tba_intr_disestablish = tc_vsbus_intr_disestablish;
 267 tba.tba_get_dma_tag = tc_vsbus_get_dma_tag;
 268
 269 error = tc_vsbus_dma_init(self);
 270 if (error) {
 271 aprint_normal(": failed to init DMA: %d", error);
 272 bus_space_unmap(bst, bsh_slot, slotsz * slotb);
 273 goto fail;
 274 }
 275
 276 evcnt_attach_dynamic(&sc->sc_ev, EVCNT_TYPE_INTR, NULL,
 277 device_xname(self), "intr");
 278
 279 /* Enable SGDMA and option IRQ now. */
 280 csr = bus_space_read_4(bst, bsh_csr, 0);
 281 csr &= ~(KA4x_TCA_CSR_TC_TMO | KA4x_TCA_CSR_RST_TC);
 282 csr |= KA4x_TCA_CSR_ERR | KA4x_TCA_CSR_EN_TC_IRQ |
 283 KA4x_TCA_CSR_INVAL_REF | KA4x_TCA_CSR_EN_MAP;
 284 bus_space_write_4(bst, bsh_csr, 0, csr);
 285
 286 /* XXX: why not config_found(9)?? */
 287 tcattach(parent, self, &tba);
 288
 289 return;
 290
 291fail:
 292 aprint_normal("\n");
 293 /* Clear possible timeout bit which asserts TC interrupt. */
 294 csr = bus_space_read_4(bst, bsh_csr, 0);
 295 csr &= ~KA4x_TCA_CSR_TC_TMO;
 296 bus_space_write_4(bst, bsh_csr, 0, csr);
 297 bus_space_unmap(bst, bsh_csr, KA4x_TCA_CSR_SZ);
 298}
 299
 300static int
 301tc_vsbus_dma_init(device_t dev)
 302{
 303 struct tc_vsbus_softc * const sc = device_private(dev);
 304 struct pte *pte;
 305 bus_dma_tag_t dmat = &sc->sc_dmatag;
 306 bus_space_tag_t bst = sc->sc_bst;
 307 bus_space_handle_t bsh;
 308 const bus_size_t ptecnt = 8192;
 309 const bus_size_t mapsize = ptecnt * sizeof(pte[0]);
 310 int error;
 311
 312 vax_sgmap_dmatag_init(dmat, sc, ptecnt);
 313
 314 dmat->_sgmap = &sc->sc_sgmap;
 315
 316 error = bus_space_map(bst, KA4x_TCA_SGMAP, mapsize,
 317 BUS_SPACE_MAP_LINEAR, &bsh);
 318 if (error)
 319 return error;
 320 bus_space_set_region_4(bst, bsh, 0, 0, ptecnt);
 321 pte = bus_space_vaddr(bst, bsh);
 322
 323 /* Initialize the SGMAP. */
 324 vax_sgmap_init(dmat, &sc->sc_sgmap, "tc_sgmap", dmat->_wbase,
 325 dmat->_wsize, pte, 0);
 326
 327 tc_vsbus_dmat = dmat;
 328
 329 return 0;
 330}
57 331
58static bus_dma_tag_t 332static bus_dma_tag_t
59tcbus_get_dma_tag(int slotno) 333tc_vsbus_get_dma_tag(int slotno)
60{ 334{
61 return tcbus_dmat; 335
 336 return tc_vsbus_dmat;
 337}
 338
 339static void
 340tc_vsbus_intr(void *arg)
 341{
 342 struct tc_vsbus_softc * const sc = arg;
 343 bus_space_tag_t bst = sc->sc_bst;
 344 bus_space_handle_t bsh = sc->sc_bsh_csr;
 345 uint32_t csr;
 346
 347 sc->sc_ev.ev_count++;
 348
 349 csr = bus_space_read_4(bst, bsh, 0);
 350 if (__predict_true((csr & KA4x_TCA_CSR_TC_IRQ) == 0)) /* active low */
 351 sc->sc_intr_func(sc->sc_intr_arg);
 352
 353 /* Clear possible timeout bit which asserts TC interrupt. */
 354 csr = bus_space_read_4(bst, bsh, 0);
 355 csr &= ~KA4x_TCA_CSR_TC_TMO;
 356 bus_space_write_4(bst, bsh, 0, csr);
62} 357}
63 358
64static void 359static void
65tcbus_intr_establish(device_t dv, void *cookie, int level, 360tc_vsbus_intr_establish(device_t dv, void *cookie, int level,
66 int (*func)(void *), void *arg) 361 int (*func)(void *), void *arg)
67{ 362{
68 struct tcbus_softc * const sc = cookie; 363 struct tc_vsbus_softc * const sc = cookie;
 364
 365 sc->sc_intr_func = func;
 366 sc->sc_intr_arg = arg;
69 367
70 scb_vecalloc(0x51, (void (*)(void *)) func, arg, SCB_ISTACK, 368 scb_vecalloc(sc->sc_cvec, tc_vsbus_intr, sc, SCB_ISTACK, &sc->sc_ev);
71 &sc->sc_ev); 
72} 369}
73 370
74static void 371static void
75tcbus_intr_disestablish(device_t dv, void *cookie) 372tc_vsbus_intr_disestablish(device_t dv, void *cookie)
76{ 373{
 374
 375 /* Do nothing. */
77} 376}
78 377
79static const struct evcnt * 378static const struct evcnt *
80tcbus_intr_evcnt(device_t dv, void *cookie) 379tc_vsbus_intr_evcnt(device_t dv, void *cookie)
81{ 380{
82 return NULL; 381 struct tc_vsbus_softc * const sc = device_private(dv);
 382
 383 return &sc->sc_ev;
83} 384}
84 385
85int 386static int
86tcbus_match(device_t parent, cfdata_t cfdata, void *aux) 387vax_tc_bus_space_map(void *t, bus_addr_t pa, bus_size_t size, int cacheable,
 388 bus_space_handle_t *bshp, int f2)
87{ 389{
 390
 391 /* bus_space is pre-mapped, so "pa" is a virtual address already. */
 392 *bshp = pa;
88 return 0; 393 return 0;
89} 394}
90 395
91#define KA4x_TURBO 0x30000000 396static int
92#define KA4x_TURBOMAPS 0x35800000 397vax_tc_bus_space_subregion(void *t, bus_space_handle_t h, bus_size_t o,
93#define KA4x_TURBOCSR 0x36800000 398 bus_size_t s, bus_space_handle_t *hp)
94 
95void 
96tcbus_attach(device_t parent, device_t self, void *aux) 
97{ 399{
98 struct vsbus_attach_args * const va = aux; 
99 struct tcbus_softc * const sc = device_private(self); 
100 struct tcbus_attach_args tba; 
101 struct pte *pte; 
102 const size_t nentries = 32768; 
103 int error; 
104 int i; 
105 400
106 error = bus_space_map(va->va_memt, KA4x_TURBO, 0x10000, 401 *hp = h + o;
107 BUS_SPACE_MAP_LINEAR, &sc->sc_memh); 402 return 0;
108 if (error) { 403}
109 aprint_error(": failed to map TC slot 0: %d\n", error); 
110 return; 
111 } 
112 404
113 sc->sc_slots[0].tcs_addr = sc->sc_memh; 405static void
114 sc->sc_slots[0].tcs_cookie = sc; 406vax_tc_bus_space_unmap(void *t, bus_space_handle_t h, bus_size_t size, int f)
 407{
115 408
116 tba.tba_speed = TC_SPEED_12_5_MHZ; 409 /* Do nothing. */
117 tba.tba_slots = sc->sc_slots; 410}
118 tba.tba_nslots = 1; 
119 tba.tba_intr_evcnt = tcbus_intr_evcnt; 
120 tba.tba_intr_establish = tcbus_intr_establish; 
121 tba.tba_intr_disestablish = tcbus_intr_disestablish; 
122 tba.tba_get_dma_tag = tcbus_get_dma_tag; 
123 
124 vax_sgmap_dmatag_init(&sc->sc_dmatag, sc, nentries); 
125 pte = (struct pte *) vax_map_physmem(KA4x_TURBOMAPS, 
126 nentries * sizeof(pte[0])); 
127 411
128 for (i = nentries; i > 0; ) 412static int
129 ((uint32_t *) pte)[--i] = 0; 413vax_tc_bus_space_alloc(void *t, bus_addr_t rs, bus_addr_t re, bus_size_t s,
 414 bus_size_t a, bus_size_t b, int f, bus_addr_t *ap, bus_space_handle_t *hp)
 415{
130 416
131 sc->sc_dmatag._sgmap = &sc->sc_sgmap; 417 panic("vax_tc_bus_space_alloc not implemented");
132 /* 418}
133 * Initialize the SGMAP. 
134 */ 
135 vax_sgmap_init(&sc->sc_dmatag, &sc->sc_sgmap, "tc_sgmap", 
136 sc->sc_dmatag._wbase, sc->sc_dmatag._wsize, pte, 0); 
137 419
138 aprint_normal("\n"); 420static void
 421vax_tc_bus_space_free(void *t, bus_space_handle_t h, bus_size_t s)
 422{
139 423
140 aprint_verbose_dev(self, "32K entry DMA SGMAP at PA 0x%x (VA %p)\n", 424 panic("vax_tc_bus_space_free not implemented");
141 KA4x_TURBOMAPS, pte); 425}
142 426
143 tcbus_dmat = &sc->sc_dmatag; 427static paddr_t
 428vax_tc_bus_space_mmap(void *v, bus_addr_t addr, off_t off, int prot, int flags)
 429{
 430 bus_addr_t rv;
144 431
145 /* XXX: why not config_found(9)?? */ 432 rv = addr + off;
146 tcattach(parent, self, &tba); 433 return btop(rv);
147} 434}

cvs diff -r1.54 -r1.55 src/sys/dev/tc/tc.c (switch to unified diff)

--- src/sys/dev/tc/tc.c 2016/12/12 17:03:41 1.54
+++ src/sys/dev/tc/tc.c 2017/06/09 17:55:18 1.55
@@ -1,327 +1,329 @@ @@ -1,327 +1,329 @@
1/* $NetBSD: tc.c,v 1.54 2016/12/12 17:03:41 flxd Exp $ */ 1/* $NetBSD: tc.c,v 1.55 2017/06/09 17:55:18 flxd Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994, 1995 Carnegie-Mellon University. 4 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Author: Chris G. Demetriou 7 * Author: Chris G. Demetriou
8 * 8 *
9 * Permission to use, copy, modify and distribute this software and 9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright 10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the 11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions 12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation. 13 * thereof, and that both notices appear in supporting documentation.
14 * 14 *
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 * 18 *
19 * Carnegie Mellon requests users of this software to return to 19 * Carnegie Mellon requests users of this software to return to
20 * 20 *
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science 22 * School of Computer Science
23 * Carnegie Mellon University 23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890 24 * Pittsburgh PA 15213-3890
25 * 25 *
26 * any improvements or extensions that they make and grant Carnegie the 26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes. 27 * rights to redistribute these changes.
28 */ 28 */
29 29
30#include <sys/cdefs.h> 30#include <sys/cdefs.h>
31__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.54 2016/12/12 17:03:41 flxd Exp $"); 31__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.55 2017/06/09 17:55:18 flxd Exp $");
32 32
33#include "opt_tcverbose.h" 33#include "opt_tcverbose.h"
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38 38
39#include <machine/cpu.h> /* for badaddr */ 39#include <machine/cpu.h> /* for badaddr */
40 40
41#include <dev/tc/tcreg.h> 41#include <dev/tc/tcreg.h>
42#include <dev/tc/tcvar.h> 42#include <dev/tc/tcvar.h>
43#include <dev/tc/tcdevs.h> 43#include <dev/tc/tcdevs.h>
44 44
45#include "locators.h" 45#include "locators.h"
46 46
47/* Definition of the driver for autoconfig. */ 47/* Definition of the driver for autoconfig. */
48static int tcmatch(device_t, cfdata_t, void *); 48static int tcmatch(device_t, cfdata_t, void *);
49 49
50CFATTACH_DECL_NEW(tc, sizeof(struct tc_softc), 50CFATTACH_DECL_NEW(tc, sizeof(struct tc_softc),
51 tcmatch, tcattach, NULL, NULL); 51 tcmatch, tcattach, NULL, NULL);
52 52
53extern struct cfdriver tc_cd; 53extern struct cfdriver tc_cd;
54 54
55static int tcprint(void *, const char *); 55static int tcprint(void *, const char *);
56static void tc_devinfo(const char *, char *, size_t); 56static void tc_devinfo(const char *, char *, size_t);
57 57
58static int 58static int
59tcmatch(device_t parent, cfdata_t cf, void *aux) 59tcmatch(device_t parent, cfdata_t cf, void *aux)
60{ 60{
61 struct tcbus_attach_args *tba = aux; 61 struct tcbus_attach_args *tba = aux;
62 62
63 if (strcmp(tba->tba_busname, cf->cf_name)) 63 if (strcmp(tba->tba_busname, cf->cf_name))
64 return (0); 64 return (0);
65 65
66 return (1); 66 return (1);
67} 67}
68 68
69void 69void
70tcattach(device_t parent, device_t self, void *aux) 70tcattach(device_t parent, device_t self, void *aux)
71{ 71{
72 struct tc_softc *sc = device_private(self); 72 struct tc_softc *sc = device_private(self);
73 struct tcbus_attach_args *tba = aux; 73 struct tcbus_attach_args *tba = aux;
74 struct tc_attach_args ta; 74 struct tc_attach_args ta;
75 const struct tc_builtin *builtin; 75 const struct tc_builtin *builtin;
76 struct tc_slotdesc *slot; 76 struct tc_slotdesc *slot;
77 tc_addr_t tcaddr; 77 tc_addr_t tcaddr;
78 int i; 78 int i;
79 int locs[TCCF_NLOCS]; 79 int locs[TCCF_NLOCS];
80 80
81 sc->sc_dev = self; 81 sc->sc_dev = self;
82 82
83 printf(": %s MHz clock\n", 83 printf(": %s MHz clock\n",
84 tba->tba_speed == TC_SPEED_25_MHZ ? "25" : "12.5"); 84 tba->tba_speed == TC_SPEED_25_MHZ ? "25" : "12.5");
85 85
86 /* 86 /*
87 * Save important CPU/chipset information. 87 * Save important CPU/chipset information.
88 */ 88 */
89 sc->sc_speed = tba->tba_speed; 89 sc->sc_speed = tba->tba_speed;
90 sc->sc_nslots = tba->tba_nslots; 90 sc->sc_nslots = tba->tba_nslots;
91 sc->sc_slots = tba->tba_slots; 91 sc->sc_slots = tba->tba_slots;
92 sc->sc_intr_evcnt = tba->tba_intr_evcnt; 92 sc->sc_intr_evcnt = tba->tba_intr_evcnt;
93 sc->sc_intr_establish = tba->tba_intr_establish; 93 sc->sc_intr_establish = tba->tba_intr_establish;
94 sc->sc_intr_disestablish = tba->tba_intr_disestablish; 94 sc->sc_intr_disestablish = tba->tba_intr_disestablish;
95 sc->sc_get_dma_tag = tba->tba_get_dma_tag; 95 sc->sc_get_dma_tag = tba->tba_get_dma_tag;
96 96
97 /* 97 /*
98 * Try to configure each built-in device 98 * Try to configure each built-in device
99 */ 99 */
100 for (i = 0; i < tba->tba_nbuiltins; i++) { 100 for (i = 0; i < tba->tba_nbuiltins; i++) {
101 builtin = &tba->tba_builtins[i]; 101 builtin = &tba->tba_builtins[i];
102 102
103 /* sanity check! */ 103 /* sanity check! */
104 if (builtin->tcb_slot > sc->sc_nslots) 104 if (builtin->tcb_slot > sc->sc_nslots)
105 panic("tcattach: builtin %d slot > nslots", i); 105 panic("tcattach: builtin %d slot > nslots", i);
106 106
107 /* 107 /*
108 * Make sure device is really there, because some 108 * Make sure device is really there, because some
109 * built-in devices are really optional. 109 * built-in devices are really optional.
110 */ 110 */
111 tcaddr = sc->sc_slots[builtin->tcb_slot].tcs_addr + 111 tcaddr = sc->sc_slots[builtin->tcb_slot].tcs_addr +
112 builtin->tcb_offset; 112 builtin->tcb_offset;
113 if (tc_badaddr(tcaddr)) 113 if (tc_badaddr(tcaddr))
114 continue; 114 continue;
115 115
116 /* 116 /*
117 * Set up the device attachment information. 117 * Set up the device attachment information.
118 */ 118 */
119 strncpy(ta.ta_modname, builtin->tcb_modname, TC_ROM_LLEN); 119 strncpy(ta.ta_modname, builtin->tcb_modname, TC_ROM_LLEN);
120 ta.ta_memt = tba->tba_memt; 120 ta.ta_memt = tba->tba_memt;
121 ta.ta_dmat = (*sc->sc_get_dma_tag)(builtin->tcb_slot); 121 ta.ta_dmat = (*sc->sc_get_dma_tag)(builtin->tcb_slot);
122 ta.ta_modname[TC_ROM_LLEN] = '\0'; 122 ta.ta_modname[TC_ROM_LLEN] = '\0';
123 ta.ta_slot = builtin->tcb_slot; 123 ta.ta_slot = builtin->tcb_slot;
124 ta.ta_offset = builtin->tcb_offset; 124 ta.ta_offset = builtin->tcb_offset;
125 ta.ta_addr = tcaddr; 125 ta.ta_addr = tcaddr;
126 ta.ta_cookie = builtin->tcb_cookie; 126 ta.ta_cookie = builtin->tcb_cookie;
127 ta.ta_busspeed = sc->sc_speed; 127 ta.ta_busspeed = sc->sc_speed;
128 128
129 /* 129 /*
130 * Mark the slot as used, so we don't check it later. 130 * Mark the slot as used, so we don't check it later.
131 */ 131 */
132 sc->sc_slots[builtin->tcb_slot].tcs_used = 1; 132 sc->sc_slots[builtin->tcb_slot].tcs_used = 1;
133 133
134 locs[TCCF_SLOT] = builtin->tcb_slot; 134 locs[TCCF_SLOT] = builtin->tcb_slot;
135 locs[TCCF_OFFSET] = builtin->tcb_offset; 135 locs[TCCF_OFFSET] = builtin->tcb_offset;
136 /* 136 /*
137 * Attach the device. 137 * Attach the device.
138 */ 138 */
139 config_found_sm_loc(self, "tc", locs, &ta, 139 config_found_sm_loc(self, "tc", locs, &ta,
140 tcprint, config_stdsubmatch); 140 tcprint, config_stdsubmatch);
141 } 141 }
142 142
143 /* 143 /*
144 * Try to configure each unused slot, last to first. 144 * Try to configure each unused slot, last to first.
145 */ 145 */
146 for (i = sc->sc_nslots - 1; i >= 0; i--) { 146 for (i = sc->sc_nslots - 1; i >= 0; i--) {
147 slot = &sc->sc_slots[i]; 147 slot = &sc->sc_slots[i];
148 148
149 /* If already checked above, don't look again now. */ 149 /* If already checked above, don't look again now. */
150 if (slot->tcs_used) 150 if (slot->tcs_used)
151 continue; 151 continue;
152 152
153 /* 153 /*
154 * Make sure something is there, and find out what it is. 154 * Make sure something is there, and find out what it is.
155 */ 155 */
156 tcaddr = slot->tcs_addr; 156 tcaddr = slot->tcs_addr;
157 if (tc_badaddr(tcaddr)) 157 if (tc_badaddr(tcaddr))
158 continue; 158 continue;
159 if (tc_checkslot(tcaddr, ta.ta_modname) == 0) 159 if (tc_checkslot(tcaddr, ta.ta_modname, NULL) == 0)
160 continue; 160 continue;
161 161
162 /* 162 /*
163 * Set up the rest of the attachment information. 163 * Set up the rest of the attachment information.
164 */ 164 */
165 ta.ta_memt = tba->tba_memt; 165 ta.ta_memt = tba->tba_memt;
166 ta.ta_dmat = (*sc->sc_get_dma_tag)(i); 166 ta.ta_dmat = (*sc->sc_get_dma_tag)(i);
167 ta.ta_slot = i; 167 ta.ta_slot = i;
168 ta.ta_offset = 0; 168 ta.ta_offset = 0;
169 ta.ta_addr = tcaddr; 169 ta.ta_addr = tcaddr;
170 ta.ta_cookie = slot->tcs_cookie; 170 ta.ta_cookie = slot->tcs_cookie;
171 171
172 /* 172 /*
173 * Mark the slot as used. 173 * Mark the slot as used.
174 */ 174 */
175 slot->tcs_used = 1; 175 slot->tcs_used = 1;
176 176
177 locs[TCCF_SLOT] = i; 177 locs[TCCF_SLOT] = i;
178 locs[TCCF_OFFSET] = 0; 178 locs[TCCF_OFFSET] = 0;
179 /* 179 /*
180 * Attach the device. 180 * Attach the device.
181 */ 181 */
182 config_found_sm_loc(self, "tc", locs, &ta, 182 config_found_sm_loc(self, "tc", locs, &ta,
183 tcprint, config_stdsubmatch); 183 tcprint, config_stdsubmatch);
184 } 184 }
185} 185}
186 186
187static int 187static int
188tcprint(void *aux, const char *pnp) 188tcprint(void *aux, const char *pnp)
189{ 189{
190 struct tc_attach_args *ta = aux; 190 struct tc_attach_args *ta = aux;
191 char devinfo[256]; 191 char devinfo[256];
192 192
193 if (pnp) { 193 if (pnp) {
194 tc_devinfo(ta->ta_modname, devinfo, sizeof(devinfo)); 194 tc_devinfo(ta->ta_modname, devinfo, sizeof(devinfo));
195 aprint_normal("%s at %s", devinfo, pnp); 195 aprint_normal("%s at %s", devinfo, pnp);
196 } 196 }
197 aprint_normal(" slot %d offset 0x%x", ta->ta_slot, ta->ta_offset); 197 aprint_normal(" slot %d offset 0x%x", ta->ta_slot, ta->ta_offset);
198 return (UNCONF); 198 return (UNCONF);
199} 199}
200 200
201 201
202static const tc_offset_t tc_slot_romoffs[] = { 202static const tc_offset_t tc_slot_romoffs[] = {
203 TC_SLOT_ROM, 203 TC_SLOT_ROM,
204#ifndef __vax__ 
205 TC_SLOT_PROTOROM, 204 TC_SLOT_PROTOROM,
206#endif 
207}; 205};
208 206
209static int 207static int
210tc_check_romp(const struct tc_rommap *romp) 208tc_check_romp(const struct tc_rommap *romp)
211{ 209{
212 210
213 switch (romp->tcr_width.v) { 211 switch (romp->tcr_width.v) {
214 case 1: 212 case 1:
215 case 2: 213 case 2:
216 case 4: 214 case 4:
217 break; 215 break;
218 216
219 default: 217 default:
220 return 0; 218 return 0;
221 } 219 }
222 220
223 if (romp->tcr_stride.v != 4) 221 if (romp->tcr_stride.v != 4)
224 return 0; 222 return 0;
225 223
226 for (size_t j = 0; j < romp->tcr_width.v; j++) { 224 for (size_t j = 0; j < romp->tcr_width.v; j++) {
227 if (romp->tcr_test[j + 0 * romp->tcr_stride.v] != 0x55 || 225 if (romp->tcr_test[j + 0 * romp->tcr_stride.v] != 0x55 ||
228 romp->tcr_test[j + 1 * romp->tcr_stride.v] != 0x00 || 226 romp->tcr_test[j + 1 * romp->tcr_stride.v] != 0x00 ||
229 romp->tcr_test[j + 2 * romp->tcr_stride.v] != 0xaa || 227 romp->tcr_test[j + 2 * romp->tcr_stride.v] != 0xaa ||
230 romp->tcr_test[j + 3 * romp->tcr_stride.v] != 0xff) 228 romp->tcr_test[j + 3 * romp->tcr_stride.v] != 0xff)
231 return 0; 229 return 0;
232 } 230 }
233 return 1; 231 return 1;
234} 232}
235 233
236int 234int
237tc_checkslot(tc_addr_t slotbase, char *namep) 235tc_checkslot(tc_addr_t slotbase, char *namep, struct tc_rommap **rompp)
238{ 236{
239 struct tc_rommap *romp; 237 struct tc_rommap *romp;
240 int i, j; 238 int i, j;
241 239
242 for (i = 0; i < __arraycount(tc_slot_romoffs); i++) { 240 for (i = 0; i < __arraycount(tc_slot_romoffs); i++) {
243 romp = (struct tc_rommap *) 241 romp = (struct tc_rommap *)
244 (slotbase + tc_slot_romoffs[i]); 242 (slotbase + tc_slot_romoffs[i]);
245 243
246 if (!tc_check_romp(romp)) 244 if (!tc_check_romp(romp))
247 continue; 245 continue;
248 246
249 for (j = 0; j < TC_ROM_LLEN; j++) 247 if (namep != NULL) {
250 namep[j] = romp->tcr_modname[j].v; 248 for (j = 0; j < TC_ROM_LLEN; j++)
251 namep[j] = '\0'; 249 namep[j] = romp->tcr_modname[j].v;
 250 namep[j] = '\0';
 251 }
 252 if (rompp != NULL)
 253 *rompp = romp;
252 return (1); 254 return (1);
253 } 255 }
254 return (0); 256 return (0);
255} 257}
256 258
257const struct evcnt * 259const struct evcnt *
258tc_intr_evcnt(device_t dev, void *cookie) 260tc_intr_evcnt(device_t dev, void *cookie)
259{ 261{
260 struct tc_softc *sc = device_lookup_private(&tc_cd, 0); 262 struct tc_softc *sc = device_lookup_private(&tc_cd, 0);
261 263
262 return ((*sc->sc_intr_evcnt)(dev, cookie)); 264 return ((*sc->sc_intr_evcnt)(dev, cookie));
263} 265}
264 266
265void 267void
266tc_intr_establish(device_t dev, void *cookie, int level, 268tc_intr_establish(device_t dev, void *cookie, int level,
267 int (*handler)(void *), void *arg) 269 int (*handler)(void *), void *arg)
268{ 270{
269 struct tc_softc *sc = device_lookup_private(&tc_cd, 0); 271 struct tc_softc *sc = device_lookup_private(&tc_cd, 0);
270 272
271 (*sc->sc_intr_establish)(dev, cookie, level, handler, arg); 273 (*sc->sc_intr_establish)(dev, cookie, level, handler, arg);
272} 274}
273 275
274void 276void
275tc_intr_disestablish(device_t dev, void *cookie) 277tc_intr_disestablish(device_t dev, void *cookie)
276{ 278{
277 struct tc_softc *sc = device_lookup_private(&tc_cd, 0); 279 struct tc_softc *sc = device_lookup_private(&tc_cd, 0);
278 280
279 (*sc->sc_intr_disestablish)(dev, cookie); 281 (*sc->sc_intr_disestablish)(dev, cookie);
280} 282}
281 283
282#ifdef TCVERBOSE 284#ifdef TCVERBOSE
283/* 285/*
284 * Descriptions of of known devices. 286 * Descriptions of of known devices.
285 */ 287 */
286struct tc_knowndev { 288struct tc_knowndev {
287 const char *id, *driver, *description; 289 const char *id, *driver, *description;
288}; 290};
289 291
290#include <dev/tc/tcdevs_data.h> 292#include <dev/tc/tcdevs_data.h>
291#endif /* TCVERBOSE */ 293#endif /* TCVERBOSE */
292 294
293static void 295static void
294tc_devinfo(const char *id, char *cp, size_t l) 296tc_devinfo(const char *id, char *cp, size_t l)
295{ 297{
296 const char *driver, *description; 298 const char *driver, *description;
297#ifdef TCVERBOSE 299#ifdef TCVERBOSE
298 const struct tc_knowndev *tdp; 300 const struct tc_knowndev *tdp;
299 int match; 301 int match;
300 const char *unmatched = "unknown "; 302 const char *unmatched = "unknown ";
301#else 303#else
302 const char *unmatched = ""; 304 const char *unmatched = "";
303#endif 305#endif
304 306
305 driver = NULL; 307 driver = NULL;
306 description = id; 308 description = id;
307 309
308#ifdef TCVERBOSE 310#ifdef TCVERBOSE
309 /* find the device in the table, if possible. */ 311 /* find the device in the table, if possible. */
310 tdp = tc_knowndevs; 312 tdp = tc_knowndevs;
311 while (tdp->id != NULL) { 313 while (tdp->id != NULL) {
312 /* check this entry for a match */ 314 /* check this entry for a match */
313 match = !strcmp(tdp->id, id); 315 match = !strcmp(tdp->id, id);
314 if (match) { 316 if (match) {
315 driver = tdp->driver; 317 driver = tdp->driver;
316 description = tdp->description; 318 description = tdp->description;
317 break; 319 break;
318 } 320 }
319 tdp++; 321 tdp++;
320 } 322 }
321#endif 323#endif
322 324
323 if (driver == NULL) 325 if (driver == NULL)
324 snprintf(cp, l, "%sdevice %s", unmatched, id); 326 snprintf(cp, l, "%sdevice %s", unmatched, id);
325 else 327 else
326 snprintf(cp, l, "%s (%s)", driver, description); 328 snprintf(cp, l, "%s (%s)", driver, description);
327} 329}

cvs diff -r1.26 -r1.27 src/sys/dev/tc/tcvar.h (switch to unified diff)

--- src/sys/dev/tc/tcvar.h 2011/06/04 01:57:34 1.26
+++ src/sys/dev/tc/tcvar.h 2017/06/09 17:55:18 1.27
@@ -1,155 +1,155 @@ @@ -1,155 +1,155 @@
1/* $NetBSD: tcvar.h,v 1.26 2011/06/04 01:57:34 tsutsui Exp $ */ 1/* $NetBSD: tcvar.h,v 1.27 2017/06/09 17:55:18 flxd Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995 Carnegie-Mellon University. 4 * Copyright (c) 1995 Carnegie-Mellon University.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Author: Chris G. Demetriou 7 * Author: Chris G. Demetriou
8 * 8 *
9 * Permission to use, copy, modify and distribute this software and 9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright 10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the 11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions 12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation. 13 * thereof, and that both notices appear in supporting documentation.
14 * 14 *
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 * 18 *
19 * Carnegie Mellon requests users of this software to return to 19 * Carnegie Mellon requests users of this software to return to
20 * 20 *
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science 22 * School of Computer Science
23 * Carnegie Mellon University 23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890 24 * Pittsburgh PA 15213-3890
25 * 25 *
26 * any improvements or extensions that they make and grant Carnegie the 26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes. 27 * rights to redistribute these changes.
28 */ 28 */
29 29
30#ifndef __DEV_TC_TCVAR_H__ 30#ifndef __DEV_TC_TCVAR_H__
31#define __DEV_TC_TCVAR_H__ 31#define __DEV_TC_TCVAR_H__
32 32
33/* 33/*
34 * Definitions for TURBOchannel autoconfiguration. 34 * Definitions for TURBOchannel autoconfiguration.
35 */ 35 */
36 36
37#include <sys/bus.h> 37#include <sys/bus.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <dev/tc/tcreg.h> 39#include <dev/tc/tcreg.h>
40 40
41/* 41/*
42 * Machine-dependent definitions. 42 * Machine-dependent definitions.
43 */ 43 */
44#include <machine/tc_machdep.h> 44#include <machine/tc_machdep.h>
45 45
46/* 46/*
47 * In the long run, the following block will go completely away. 47 * In the long run, the following block will go completely away.
48 * For now, the MI TC code still uses the old TC_IPL_ names 48 * For now, the MI TC code still uses the old TC_IPL_ names
49 * and not the new IPL_ names. 49 * and not the new IPL_ names.
50 */ 50 */
51#if 1 51#if 1
52/* 52/*
53 * Map the new definitions to the old. 53 * Map the new definitions to the old.
54 */ 54 */
55#include <sys/intr.h> 55#include <sys/intr.h>
56 56
57#define tc_intrlevel_t int 57#define tc_intrlevel_t int
58 58
59#define TC_IPL_NONE IPL_NONE 59#define TC_IPL_NONE IPL_NONE
60#define TC_IPL_BIO IPL_BIO 60#define TC_IPL_BIO IPL_BIO
61#define TC_IPL_NET IPL_NET 61#define TC_IPL_NET IPL_NET
62#define TC_IPL_TTY IPL_TTY 62#define TC_IPL_TTY IPL_TTY
63#define TC_IPL_CLOCK IPL_CLOCK 63#define TC_IPL_CLOCK IPL_CLOCK
64#endif /* 1 */ 64#endif /* 1 */
65 65
66struct tc_softc { 66struct tc_softc {
67 device_t sc_dev; 67 device_t sc_dev;
68 68
69 int sc_speed; 69 int sc_speed;
70 int sc_nslots; 70 int sc_nslots;
71 struct tc_slotdesc *sc_slots; 71 struct tc_slotdesc *sc_slots;
72 72
73 const struct evcnt *(*sc_intr_evcnt)(device_t, void *); 73 const struct evcnt *(*sc_intr_evcnt)(device_t, void *);
74 void (*sc_intr_establish)(device_t, void *, 74 void (*sc_intr_establish)(device_t, void *,
75 int, int (*)(void *), void *); 75 int, int (*)(void *), void *);
76 void (*sc_intr_disestablish)(device_t, void *); 76 void (*sc_intr_disestablish)(device_t, void *);
77 bus_dma_tag_t (*sc_get_dma_tag)(int); 77 bus_dma_tag_t (*sc_get_dma_tag)(int);
78}; 78};
79 79
80/* 80/*
81 * Arguments used to attach TURBOchannel busses. 81 * Arguments used to attach TURBOchannel busses.
82 */ 82 */
83struct tcbus_attach_args { 83struct tcbus_attach_args {
84 const char *tba_busname; /* XXX should be common */ 84 const char *tba_busname; /* XXX should be common */
85 bus_space_tag_t tba_memt; 85 bus_space_tag_t tba_memt;
86 86
87 /* Bus information */ 87 /* Bus information */
88 u_int tba_speed; /* see TC_SPEED_* below */ 88 u_int tba_speed; /* see TC_SPEED_* below */
89 u_int tba_nslots; 89 u_int tba_nslots;
90 struct tc_slotdesc *tba_slots; 90 struct tc_slotdesc *tba_slots;
91 u_int tba_nbuiltins; 91 u_int tba_nbuiltins;
92 const struct tc_builtin *tba_builtins; 92 const struct tc_builtin *tba_builtins;
93 93
94 94
95 /* TC bus resource management; XXX will move elsewhere eventually. */ 95 /* TC bus resource management; XXX will move elsewhere eventually. */
96 const struct evcnt *(*tba_intr_evcnt)(device_t, void *); 96 const struct evcnt *(*tba_intr_evcnt)(device_t, void *);
97 void (*tba_intr_establish)(device_t, void *, 97 void (*tba_intr_establish)(device_t, void *,
98 int, int (*)(void *), void *); 98 int, int (*)(void *), void *);
99 void (*tba_intr_disestablish)(device_t, void *); 99 void (*tba_intr_disestablish)(device_t, void *);
100 bus_dma_tag_t (*tba_get_dma_tag)(int); 100 bus_dma_tag_t (*tba_get_dma_tag)(int);
101}; 101};
102 102
103/* 103/*
104 * Arguments used to attach TURBOchannel devices. 104 * Arguments used to attach TURBOchannel devices.
105 */ 105 */
106struct tc_attach_args { 106struct tc_attach_args {
107 bus_space_tag_t ta_memt; 107 bus_space_tag_t ta_memt;
108 bus_dma_tag_t ta_dmat; 108 bus_dma_tag_t ta_dmat;
109 109
110 char ta_modname[TC_ROM_LLEN+1]; 110 char ta_modname[TC_ROM_LLEN+1];
111 u_int ta_slot; 111 u_int ta_slot;
112 tc_offset_t ta_offset; 112 tc_offset_t ta_offset;
113 tc_addr_t ta_addr; 113 tc_addr_t ta_addr;
114 void *ta_cookie; 114 void *ta_cookie;
115 u_int ta_busspeed; /* see TC_SPEED_* below */ 115 u_int ta_busspeed; /* see TC_SPEED_* below */
116}; 116};
117 117
118/* 118/*
119 * Description of TURBOchannel slots, provided by machine-dependent 119 * Description of TURBOchannel slots, provided by machine-dependent
120 * code to the TURBOchannel bus driver. 120 * code to the TURBOchannel bus driver.
121 */ 121 */
122struct tc_slotdesc { 122struct tc_slotdesc {
123 tc_addr_t tcs_addr; 123 tc_addr_t tcs_addr;
124 void *tcs_cookie; 124 void *tcs_cookie;
125 int tcs_used; 125 int tcs_used;
126}; 126};
127 127
128/* 128/*
129 * Description of built-in TURBOchannel devices, provided by 129 * Description of built-in TURBOchannel devices, provided by
130 * machine-dependent code to the TURBOchannel bus driver. 130 * machine-dependent code to the TURBOchannel bus driver.
131 */ 131 */
132struct tc_builtin { 132struct tc_builtin {
133 const char *tcb_modname; 133 const char *tcb_modname;
134 u_int tcb_slot; 134 u_int tcb_slot;
135 tc_offset_t tcb_offset; 135 tc_offset_t tcb_offset;
136 void *tcb_cookie; 136 void *tcb_cookie;
137}; 137};
138 138
139/* 139/*
140 * Interrupt establishment functions. 140 * Interrupt establishment functions.
141 */ 141 */
142int tc_checkslot(tc_addr_t, char *); 142int tc_checkslot(tc_addr_t, char *, struct tc_rommap **);
143void tcattach(device_t, device_t, void *); 143void tcattach(device_t, device_t, void *);
144const struct evcnt *tc_intr_evcnt(device_t, void *); 144const struct evcnt *tc_intr_evcnt(device_t, void *);
145void tc_intr_establish(device_t, void *, int, int (*)(void *), 145void tc_intr_establish(device_t, void *, int, int (*)(void *),
146 void *); 146 void *);
147void tc_intr_disestablish(device_t, void *); 147void tc_intr_disestablish(device_t, void *);
148 148
149/* 149/*
150 * Miscellaneous definitions. 150 * Miscellaneous definitions.
151 */ 151 */
152#define TC_SPEED_12_5_MHZ 0 /* 12.5MHz TC bus */ 152#define TC_SPEED_12_5_MHZ 0 /* 12.5MHz TC bus */
153#define TC_SPEED_25_MHZ 1 /* 25MHz TC bus */ 153#define TC_SPEED_25_MHZ 1 /* 25MHz TC bus */
154 154
155#endif /* __DEV_TC_TCVAR_H__ */ 155#endif /* __DEV_TC_TCVAR_H__ */