2 * Copyright (c) 1994,1995 Stefan Esser, Wolfgang StanglMeier
3 * Copyright (c) 2000 Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000 BSDi
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #include <sys/cdefs.h>
32 __FBSDID("$FreeBSD$");
35 * PCI:EISA bridge support
38 #include <sys/param.h>
39 #include <sys/kernel.h>
40 #include <sys/module.h>
43 #include <dev/pci/pcivar.h>
44 #include <dev/pci/pcireg.h>
46 static int eisab_probe(device_t dev);
47 static int eisab_attach(device_t dev);
49 static device_method_t eisab_methods[] = {
50 /* Device interface */
51 DEVMETHOD(device_probe, eisab_probe),
52 DEVMETHOD(device_attach, eisab_attach),
53 DEVMETHOD(device_shutdown, bus_generic_shutdown),
54 DEVMETHOD(device_suspend, bus_generic_suspend),
55 DEVMETHOD(device_resume, bus_generic_resume),
58 DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
59 DEVMETHOD(bus_release_resource, bus_generic_release_resource),
60 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
61 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
62 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
63 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
68 static driver_t eisab_driver = {
74 static devclass_t eisab_devclass;
76 DRIVER_MODULE(eisab, pci, eisab_driver, eisab_devclass, 0, 0);
79 eisab_probe(device_t dev)
84 * Generic match by class/subclass.
86 if ((pci_get_class(dev) == PCIC_BRIDGE) &&
87 (pci_get_subclass(dev) == PCIS_BRIDGE_EISA))
91 * Some bridges don't correctly report their class.
93 switch (pci_get_devid(dev)) {
94 case 0x04828086: /* may show up as PCI-HOST or 0:0 */
102 device_set_desc(dev, "PCI-EISA bridge");
109 eisab_attach(device_t dev)
112 * Attach an EISA bus. Note that we can only have one EISA bus.
114 if (!devclass_get_device(devclass_find("eisa"), 0))
115 device_add_child(dev, "eisa", -1);
118 * Attach an ISA bus as well, since the EISA bus may have ISA
119 * cards installed, and we may have no EISA support in the system.
121 if (!devclass_get_device(devclass_find("isa"), 0))
122 device_add_child(dev, "isa", -1);
124 bus_generic_attach(dev);