pcib.c revision 1.1.12.2 1 1.1.12.2 ad /* $NetBSD: pcib.c,v 1.1.12.2 2007/12/03 19:04:30 ad Exp $ */
2 1.1.12.2 ad
3 1.1.12.2 ad /*-
4 1.1.12.2 ad * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
5 1.1.12.2 ad * All rights reserved.
6 1.1.12.2 ad *
7 1.1.12.2 ad * This code is derived from software contributed to The NetBSD Foundation
8 1.1.12.2 ad * by Jason R. Thorpe.
9 1.1.12.2 ad *
10 1.1.12.2 ad * Redistribution and use in source and binary forms, with or without
11 1.1.12.2 ad * modification, are permitted provided that the following conditions
12 1.1.12.2 ad * are met:
13 1.1.12.2 ad * 1. Redistributions of source code must retain the above copyright
14 1.1.12.2 ad * notice, this list of conditions and the following disclaimer.
15 1.1.12.2 ad * 2. Redistributions in binary form must reproduce the above copyright
16 1.1.12.2 ad * notice, this list of conditions and the following disclaimer in the
17 1.1.12.2 ad * documentation and/or other materials provided with the distribution.
18 1.1.12.2 ad * 3. All advertising materials mentioning features or use of this software
19 1.1.12.2 ad * must display the following acknowledgement:
20 1.1.12.2 ad * This product includes software developed by the NetBSD
21 1.1.12.2 ad * Foundation, Inc. and its contributors.
22 1.1.12.2 ad * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1.12.2 ad * contributors may be used to endorse or promote products derived
24 1.1.12.2 ad * from this software without specific prior written permission.
25 1.1.12.2 ad *
26 1.1.12.2 ad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1.12.2 ad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1.12.2 ad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1.12.2 ad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1.12.2 ad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1.12.2 ad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1.12.2 ad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1.12.2 ad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1.12.2 ad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1.12.2 ad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1.12.2 ad * POSSIBILITY OF SUCH DAMAGE.
37 1.1.12.2 ad */
38 1.1.12.2 ad
39 1.1.12.2 ad #include <sys/cdefs.h>
40 1.1.12.2 ad __KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.1.12.2 2007/12/03 19:04:30 ad Exp $");
41 1.1.12.2 ad
42 1.1.12.2 ad #include <sys/types.h>
43 1.1.12.2 ad #include <sys/param.h>
44 1.1.12.2 ad #include <sys/systm.h>
45 1.1.12.2 ad #include <sys/device.h>
46 1.1.12.2 ad
47 1.1.12.2 ad #include <machine/bus.h>
48 1.1.12.2 ad
49 1.1.12.2 ad #include <dev/isa/isavar.h>
50 1.1.12.2 ad
51 1.1.12.2 ad #include <dev/pci/pcivar.h>
52 1.1.12.2 ad #include <dev/pci/pcireg.h>
53 1.1.12.2 ad
54 1.1.12.2 ad #include <dev/pci/pcidevs.h>
55 1.1.12.2 ad
56 1.1.12.2 ad #include "isa.h"
57 1.1.12.2 ad
58 1.1.12.2 ad int pcibmatch(struct device *, struct cfdata *, void *);
59 1.1.12.2 ad void pcibattach(struct device *, struct device *, void *);
60 1.1.12.2 ad
61 1.1.12.2 ad CFATTACH_DECL(pcib, sizeof(struct device),
62 1.1.12.2 ad pcibmatch, pcibattach, NULL, NULL);
63 1.1.12.2 ad
64 1.1.12.2 ad void pcib_callback(struct device *);
65 1.1.12.2 ad
66 1.1.12.2 ad int
67 1.1.12.2 ad pcibmatch(struct device *parent, struct cfdata *match, void *aux)
68 1.1.12.2 ad {
69 1.1.12.2 ad struct pci_attach_args *pa = aux;
70 1.1.12.2 ad
71 1.1.12.2 ad #if 0
72 1.1.12.2 ad /*
73 1.1.12.2 ad * PCI-ISA bridges are matched on class/subclass.
74 1.1.12.2 ad * This list contains only the bridges where correct
75 1.1.12.2 ad * (or incorrect) behaviour is not yet confirmed.
76 1.1.12.2 ad */
77 1.1.12.2 ad switch (PCI_VENDOR(pa->pa_id)) {
78 1.1.12.2 ad case PCI_VENDOR_INTEL:
79 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
80 1.1.12.2 ad case PCI_PRODUCT_INTEL_82426EX:
81 1.1.12.2 ad case PCI_PRODUCT_INTEL_82380AB:
82 1.1.12.2 ad return (1);
83 1.1.12.2 ad }
84 1.1.12.2 ad break;
85 1.1.12.2 ad
86 1.1.12.2 ad case PCI_VENDOR_UMC:
87 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
88 1.1.12.2 ad case PCI_PRODUCT_UMC_UM8886F:
89 1.1.12.2 ad case PCI_PRODUCT_UMC_UM82C886:
90 1.1.12.2 ad return (1);
91 1.1.12.2 ad }
92 1.1.12.2 ad break;
93 1.1.12.2 ad case PCI_VENDOR_ALI:
94 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
95 1.1.12.2 ad case PCI_PRODUCT_ALI_M1449:
96 1.1.12.2 ad case PCI_PRODUCT_ALI_M1543:
97 1.1.12.2 ad return (1);
98 1.1.12.2 ad }
99 1.1.12.2 ad break;
100 1.1.12.2 ad case PCI_VENDOR_COMPAQ:
101 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
102 1.1.12.2 ad case PCI_PRODUCT_COMPAQ_PCI_ISA_BRIDGE:
103 1.1.12.2 ad return (1);
104 1.1.12.2 ad }
105 1.1.12.2 ad break;
106 1.1.12.2 ad case PCI_VENDOR_VIATECH:
107 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
108 1.1.12.2 ad case PCI_PRODUCT_VIATECH_VT82C570MV:
109 1.1.12.2 ad case PCI_PRODUCT_VIATECH_VT82C586_ISA:
110 1.1.12.2 ad return (1);
111 1.1.12.2 ad }
112 1.1.12.2 ad break;
113 1.1.12.2 ad }
114 1.1.12.2 ad #endif
115 1.1.12.2 ad
116 1.1.12.2 ad /*
117 1.1.12.2 ad * some special cases:
118 1.1.12.2 ad */
119 1.1.12.2 ad switch (PCI_VENDOR(pa->pa_id)) {
120 1.1.12.2 ad case PCI_VENDOR_INTEL:
121 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
122 1.1.12.2 ad case PCI_PRODUCT_INTEL_SIO:
123 1.1.12.2 ad /*
124 1.1.12.2 ad * The Intel SIO identifies itself as a
125 1.1.12.2 ad * miscellaneous prehistoric.
126 1.1.12.2 ad */
127 1.1.12.2 ad case PCI_PRODUCT_INTEL_82371MX:
128 1.1.12.2 ad /*
129 1.1.12.2 ad * The Intel 82371MX identifies itself erroneously as a
130 1.1.12.2 ad * miscellaneous bridge.
131 1.1.12.2 ad */
132 1.1.12.2 ad case PCI_PRODUCT_INTEL_82371AB_ISA:
133 1.1.12.2 ad /*
134 1.1.12.2 ad * Some Intel 82371AB PCI-ISA bridge identifies
135 1.1.12.2 ad * itself as miscellaneous bridge.
136 1.1.12.2 ad */
137 1.1.12.2 ad return (1);
138 1.1.12.2 ad }
139 1.1.12.2 ad break;
140 1.1.12.2 ad case PCI_VENDOR_SIS:
141 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
142 1.1.12.2 ad case PCI_PRODUCT_SIS_85C503:
143 1.1.12.2 ad /*
144 1.1.12.2 ad * The SIS 85C503 identifies itself as a
145 1.1.12.2 ad * miscellaneous prehistoric.
146 1.1.12.2 ad */
147 1.1.12.2 ad return (1);
148 1.1.12.2 ad }
149 1.1.12.2 ad break;
150 1.1.12.2 ad case PCI_VENDOR_VIATECH:
151 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
152 1.1.12.2 ad case PCI_PRODUCT_VIATECH_VT82C686A_SMB:
153 1.1.12.2 ad /*
154 1.1.12.2 ad * The VIA VT82C686A SMBus Controller itself as
155 1.1.12.2 ad * ISA bridge, but it's wrong !
156 1.1.12.2 ad */
157 1.1.12.2 ad return (0);
158 1.1.12.2 ad }
159 1.1.12.2 ad /*
160 1.1.12.2 ad * The Cyrix cs5530 PCI host bridge does not have a broken
161 1.1.12.2 ad * latch on the i8254 clock core, unlike its predecessors
162 1.1.12.2 ad * the cs5510 and cs5520. This reverses the setting from
163 1.1.12.2 ad * i386/i386/identcpu.c where it arguably should not have
164 1.1.12.2 ad * been set in the first place. XXX
165 1.1.12.2 ad */
166 1.1.12.2 ad case PCI_VENDOR_CYRIX:
167 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
168 1.1.12.2 ad case PCI_PRODUCT_CYRIX_CX5530_PCIB:
169 1.1.12.2 ad {
170 1.1.12.2 ad extern int clock_broken_latch;
171 1.1.12.2 ad
172 1.1.12.2 ad clock_broken_latch = 0;
173 1.1.12.2 ad }
174 1.1.12.2 ad return(1);
175 1.1.12.2 ad }
176 1.1.12.2 ad break;
177 1.1.12.2 ad }
178 1.1.12.2 ad
179 1.1.12.2 ad if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
180 1.1.12.2 ad PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_ISA) {
181 1.1.12.2 ad return (1);
182 1.1.12.2 ad }
183 1.1.12.2 ad
184 1.1.12.2 ad return (0);
185 1.1.12.2 ad }
186 1.1.12.2 ad
187 1.1.12.2 ad void
188 1.1.12.2 ad pcibattach(struct device *parent, struct device *self, void *aux)
189 1.1.12.2 ad {
190 1.1.12.2 ad struct pci_attach_args *pa = aux;
191 1.1.12.2 ad char devinfo[256];
192 1.1.12.2 ad
193 1.1.12.2 ad aprint_naive("\n");
194 1.1.12.2 ad aprint_normal("\n");
195 1.1.12.2 ad
196 1.1.12.2 ad /*
197 1.1.12.2 ad * Just print out a description and defer configuration
198 1.1.12.2 ad * until all PCI devices have been attached.
199 1.1.12.2 ad */
200 1.1.12.2 ad pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
201 1.1.12.2 ad aprint_normal("%s: %s (rev. 0x%02x)\n", self->dv_xname, devinfo,
202 1.1.12.2 ad PCI_REVISION(pa->pa_class));
203 1.1.12.2 ad
204 1.1.12.2 ad config_defer(self, pcib_callback);
205 1.1.12.2 ad }
206 1.1.12.2 ad
207 1.1.12.2 ad void
208 1.1.12.2 ad pcib_callback(struct device *self)
209 1.1.12.2 ad {
210 1.1.12.2 ad struct isabus_attach_args iba;
211 1.1.12.2 ad
212 1.1.12.2 ad /*
213 1.1.12.2 ad * Attach the ISA bus behind this bridge.
214 1.1.12.2 ad */
215 1.1.12.2 ad memset(&iba, 0, sizeof(iba));
216 1.1.12.2 ad iba.iba_iot = X86_BUS_SPACE_IO;
217 1.1.12.2 ad iba.iba_memt = X86_BUS_SPACE_MEM;
218 1.1.12.2 ad #if NISA > 0
219 1.1.12.2 ad iba.iba_dmat = &isa_bus_dma_tag;
220 1.1.12.2 ad #endif
221 1.1.12.2 ad config_found_ia(self, "isabus", &iba, isabusprint);
222 1.1.12.2 ad }
223 1.1.12.2 ad /* $NetBSD: pcib.c,v 1.1.12.2 2007/12/03 19:04:30 ad Exp $ */
224 1.1.12.2 ad
225 1.1.12.2 ad /*-
226 1.1.12.2 ad * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
227 1.1.12.2 ad * All rights reserved.
228 1.1.12.2 ad *
229 1.1.12.2 ad * This code is derived from software contributed to The NetBSD Foundation
230 1.1.12.2 ad * by Jason R. Thorpe.
231 1.1.12.2 ad *
232 1.1.12.2 ad * Redistribution and use in source and binary forms, with or without
233 1.1.12.2 ad * modification, are permitted provided that the following conditions
234 1.1.12.2 ad * are met:
235 1.1.12.2 ad * 1. Redistributions of source code must retain the above copyright
236 1.1.12.2 ad * notice, this list of conditions and the following disclaimer.
237 1.1.12.2 ad * 2. Redistributions in binary form must reproduce the above copyright
238 1.1.12.2 ad * notice, this list of conditions and the following disclaimer in the
239 1.1.12.2 ad * documentation and/or other materials provided with the distribution.
240 1.1.12.2 ad * 3. All advertising materials mentioning features or use of this software
241 1.1.12.2 ad * must display the following acknowledgement:
242 1.1.12.2 ad * This product includes software developed by the NetBSD
243 1.1.12.2 ad * Foundation, Inc. and its contributors.
244 1.1.12.2 ad * 4. Neither the name of The NetBSD Foundation nor the names of its
245 1.1.12.2 ad * contributors may be used to endorse or promote products derived
246 1.1.12.2 ad * from this software without specific prior written permission.
247 1.1.12.2 ad *
248 1.1.12.2 ad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
249 1.1.12.2 ad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
250 1.1.12.2 ad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
251 1.1.12.2 ad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
252 1.1.12.2 ad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
253 1.1.12.2 ad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
254 1.1.12.2 ad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
255 1.1.12.2 ad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
256 1.1.12.2 ad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
257 1.1.12.2 ad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
258 1.1.12.2 ad * POSSIBILITY OF SUCH DAMAGE.
259 1.1.12.2 ad */
260 1.1.12.2 ad
261 1.1.12.2 ad #include <sys/cdefs.h>
262 1.1.12.2 ad __KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.1.12.2 2007/12/03 19:04:30 ad Exp $");
263 1.1.12.2 ad
264 1.1.12.2 ad #include <sys/types.h>
265 1.1.12.2 ad #include <sys/param.h>
266 1.1.12.2 ad #include <sys/systm.h>
267 1.1.12.2 ad #include <sys/device.h>
268 1.1.12.2 ad
269 1.1.12.2 ad #include <machine/bus.h>
270 1.1.12.2 ad
271 1.1.12.2 ad #include <dev/isa/isavar.h>
272 1.1.12.2 ad
273 1.1.12.2 ad #include <dev/pci/pcivar.h>
274 1.1.12.2 ad #include <dev/pci/pcireg.h>
275 1.1.12.2 ad
276 1.1.12.2 ad #include <dev/pci/pcidevs.h>
277 1.1.12.2 ad
278 1.1.12.2 ad #include "isa.h"
279 1.1.12.2 ad
280 1.1.12.2 ad int pcibmatch(struct device *, struct cfdata *, void *);
281 1.1.12.2 ad void pcibattach(struct device *, struct device *, void *);
282 1.1.12.2 ad
283 1.1.12.2 ad CFATTACH_DECL(pcib, sizeof(struct device),
284 1.1.12.2 ad pcibmatch, pcibattach, NULL, NULL);
285 1.1.12.2 ad
286 1.1.12.2 ad void pcib_callback(struct device *);
287 1.1.12.2 ad
288 1.1.12.2 ad int
289 1.1.12.2 ad pcibmatch(struct device *parent, struct cfdata *match, void *aux)
290 1.1.12.2 ad {
291 1.1.12.2 ad struct pci_attach_args *pa = aux;
292 1.1.12.2 ad
293 1.1.12.2 ad #if 0
294 1.1.12.2 ad /*
295 1.1.12.2 ad * PCI-ISA bridges are matched on class/subclass.
296 1.1.12.2 ad * This list contains only the bridges where correct
297 1.1.12.2 ad * (or incorrect) behaviour is not yet confirmed.
298 1.1.12.2 ad */
299 1.1.12.2 ad switch (PCI_VENDOR(pa->pa_id)) {
300 1.1.12.2 ad case PCI_VENDOR_INTEL:
301 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
302 1.1.12.2 ad case PCI_PRODUCT_INTEL_82426EX:
303 1.1.12.2 ad case PCI_PRODUCT_INTEL_82380AB:
304 1.1.12.2 ad return (1);
305 1.1.12.2 ad }
306 1.1.12.2 ad break;
307 1.1.12.2 ad
308 1.1.12.2 ad case PCI_VENDOR_UMC:
309 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
310 1.1.12.2 ad case PCI_PRODUCT_UMC_UM8886F:
311 1.1.12.2 ad case PCI_PRODUCT_UMC_UM82C886:
312 1.1.12.2 ad return (1);
313 1.1.12.2 ad }
314 1.1.12.2 ad break;
315 1.1.12.2 ad case PCI_VENDOR_ALI:
316 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
317 1.1.12.2 ad case PCI_PRODUCT_ALI_M1449:
318 1.1.12.2 ad case PCI_PRODUCT_ALI_M1543:
319 1.1.12.2 ad return (1);
320 1.1.12.2 ad }
321 1.1.12.2 ad break;
322 1.1.12.2 ad case PCI_VENDOR_COMPAQ:
323 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
324 1.1.12.2 ad case PCI_PRODUCT_COMPAQ_PCI_ISA_BRIDGE:
325 1.1.12.2 ad return (1);
326 1.1.12.2 ad }
327 1.1.12.2 ad break;
328 1.1.12.2 ad case PCI_VENDOR_VIATECH:
329 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
330 1.1.12.2 ad case PCI_PRODUCT_VIATECH_VT82C570MV:
331 1.1.12.2 ad case PCI_PRODUCT_VIATECH_VT82C586_ISA:
332 1.1.12.2 ad return (1);
333 1.1.12.2 ad }
334 1.1.12.2 ad break;
335 1.1.12.2 ad }
336 1.1.12.2 ad #endif
337 1.1.12.2 ad
338 1.1.12.2 ad /*
339 1.1.12.2 ad * some special cases:
340 1.1.12.2 ad */
341 1.1.12.2 ad switch (PCI_VENDOR(pa->pa_id)) {
342 1.1.12.2 ad case PCI_VENDOR_INTEL:
343 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
344 1.1.12.2 ad case PCI_PRODUCT_INTEL_SIO:
345 1.1.12.2 ad /*
346 1.1.12.2 ad * The Intel SIO identifies itself as a
347 1.1.12.2 ad * miscellaneous prehistoric.
348 1.1.12.2 ad */
349 1.1.12.2 ad case PCI_PRODUCT_INTEL_82371MX:
350 1.1.12.2 ad /*
351 1.1.12.2 ad * The Intel 82371MX identifies itself erroneously as a
352 1.1.12.2 ad * miscellaneous bridge.
353 1.1.12.2 ad */
354 1.1.12.2 ad case PCI_PRODUCT_INTEL_82371AB_ISA:
355 1.1.12.2 ad /*
356 1.1.12.2 ad * Some Intel 82371AB PCI-ISA bridge identifies
357 1.1.12.2 ad * itself as miscellaneous bridge.
358 1.1.12.2 ad */
359 1.1.12.2 ad return (1);
360 1.1.12.2 ad }
361 1.1.12.2 ad break;
362 1.1.12.2 ad case PCI_VENDOR_SIS:
363 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
364 1.1.12.2 ad case PCI_PRODUCT_SIS_85C503:
365 1.1.12.2 ad /*
366 1.1.12.2 ad * The SIS 85C503 identifies itself as a
367 1.1.12.2 ad * miscellaneous prehistoric.
368 1.1.12.2 ad */
369 1.1.12.2 ad return (1);
370 1.1.12.2 ad }
371 1.1.12.2 ad break;
372 1.1.12.2 ad case PCI_VENDOR_VIATECH:
373 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
374 1.1.12.2 ad case PCI_PRODUCT_VIATECH_VT82C686A_SMB:
375 1.1.12.2 ad /*
376 1.1.12.2 ad * The VIA VT82C686A SMBus Controller itself as
377 1.1.12.2 ad * ISA bridge, but it's wrong !
378 1.1.12.2 ad */
379 1.1.12.2 ad return (0);
380 1.1.12.2 ad }
381 1.1.12.2 ad /*
382 1.1.12.2 ad * The Cyrix cs5530 PCI host bridge does not have a broken
383 1.1.12.2 ad * latch on the i8254 clock core, unlike its predecessors
384 1.1.12.2 ad * the cs5510 and cs5520. This reverses the setting from
385 1.1.12.2 ad * i386/i386/identcpu.c where it arguably should not have
386 1.1.12.2 ad * been set in the first place. XXX
387 1.1.12.2 ad */
388 1.1.12.2 ad case PCI_VENDOR_CYRIX:
389 1.1.12.2 ad switch (PCI_PRODUCT(pa->pa_id)) {
390 1.1.12.2 ad case PCI_PRODUCT_CYRIX_CX5530_PCIB:
391 1.1.12.2 ad {
392 1.1.12.2 ad extern int clock_broken_latch;
393 1.1.12.2 ad
394 1.1.12.2 ad clock_broken_latch = 0;
395 1.1.12.2 ad }
396 1.1.12.2 ad return(1);
397 1.1.12.2 ad }
398 1.1.12.2 ad break;
399 1.1.12.2 ad }
400 1.1.12.2 ad
401 1.1.12.2 ad if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
402 1.1.12.2 ad PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_ISA) {
403 1.1.12.2 ad return (1);
404 1.1.12.2 ad }
405 1.1.12.2 ad
406 1.1.12.2 ad return (0);
407 1.1.12.2 ad }
408 1.1.12.2 ad
409 1.1.12.2 ad void
410 1.1.12.2 ad pcibattach(struct device *parent, struct device *self, void *aux)
411 1.1.12.2 ad {
412 1.1.12.2 ad struct pci_attach_args *pa = aux;
413 1.1.12.2 ad char devinfo[256];
414 1.1.12.2 ad
415 1.1.12.2 ad aprint_naive("\n");
416 1.1.12.2 ad aprint_normal("\n");
417 1.1.12.2 ad
418 1.1.12.2 ad /*
419 1.1.12.2 ad * Just print out a description and defer configuration
420 1.1.12.2 ad * until all PCI devices have been attached.
421 1.1.12.2 ad */
422 1.1.12.2 ad pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
423 1.1.12.2 ad aprint_normal("%s: %s (rev. 0x%02x)\n", self->dv_xname, devinfo,
424 1.1.12.2 ad PCI_REVISION(pa->pa_class));
425 1.1.12.2 ad
426 1.1.12.2 ad config_defer(self, pcib_callback);
427 1.1.12.2 ad }
428 1.1.12.2 ad
429 1.1.12.2 ad void
430 1.1.12.2 ad pcib_callback(struct device *self)
431 1.1.12.2 ad {
432 1.1.12.2 ad struct isabus_attach_args iba;
433 1.1.12.2 ad
434 1.1.12.2 ad /*
435 1.1.12.2 ad * Attach the ISA bus behind this bridge.
436 1.1.12.2 ad */
437 1.1.12.2 ad memset(&iba, 0, sizeof(iba));
438 1.1.12.2 ad iba.iba_iot = X86_BUS_SPACE_IO;
439 1.1.12.2 ad iba.iba_memt = X86_BUS_SPACE_MEM;
440 1.1.12.2 ad #if NISA > 0
441 1.1.12.2 ad iba.iba_dmat = &isa_bus_dma_tag;
442 1.1.12.2 ad #endif
443 1.1.12.2 ad config_found_ia(self, "isabus", &iba, isabusprint);
444 1.1.12.2 ad }
445