summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-10-31 18:31:16 +0000
committerjhb <jhb@FreeBSD.org>2005-10-31 18:31:16 +0000
commit9f7eef096f274e3e79f4f8a19c09b9d4d1f65036 (patch)
tree51a2c7b7befac11aed19c8d93e5de518e4638a2a /sys
parente9bc61e47f0d61a0c26a2c3e3adc857bbdb4925e (diff)
downloadFreeBSD-src-9f7eef096f274e3e79f4f8a19c09b9d4d1f65036.zip
FreeBSD-src-9f7eef096f274e3e79f4f8a19c09b9d4d1f65036.tar.gz
Some of the VIA pm and propm devices are actually the same device as the
PCI-ISA bridge. Thus, when viapm0 or viapropm0 attaches, isab0 dosen't attach so there is no isa0 bus hung off of that bridge. In the non-ACPI case, legacy0 will add an isa0 anyway as a fail-safe, but ACPI assumes that any ISA bus will be enumerated via a bridge. To fix this, call isab_attach() to attach an isa0 ISA child bus device if the pm or propm device we are probing is a PCI-ISA bridge. Both drivers now have to implement the bus_if interface via the generic methods for resource allocation, etc. to work. Also, we now add 2 new ISA bus drivers that attach to viapm and viapropm devices. PR: kern/87363 Reported by: Oliver Fromme olli at secnetix dot de Tested by: glebius MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/pci/viapm.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/sys/pci/viapm.c b/sys/pci/viapm.c
index 685eccd..d553484 100644
--- a/sys/pci/viapm.c
+++ b/sys/pci/viapm.c
@@ -27,6 +27,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_isa.h"
+
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
@@ -39,6 +41,10 @@ __FBSDID("$FreeBSD$");
#include <machine/resource.h>
#include <sys/rman.h>
+#ifdef DEV_ISA
+#include <isa/isavar.h>
+#include <isa/isa_common.h>
+#endif
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@@ -369,6 +375,12 @@ viapm_pro_attach(device_t dev)
VIAPM_OUTB(SMBHCTRL, VIAPM_INB(SMBHCTRL) | SMBHCTRL_ENABLE);
#endif
+#ifdef DEV_ISA
+ /* If this device is a PCI-ISA bridge, then attach an ISA bus. */
+ if ((pci_get_class(dev) == PCIC_BRIDGE) &&
+ (pci_get_subclass(dev) == PCIS_BRIDGE_ISA))
+ isab_attach(dev);
+#endif
return 0;
error:
@@ -880,6 +892,15 @@ static device_method_t viapm_methods[] = {
DEVMETHOD(iicbb_getsda, viabb_getsda),
DEVMETHOD(iicbb_reset, viabb_reset),
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
{ 0, 0 }
};
@@ -907,6 +928,15 @@ static device_method_t viapropm_methods[] = {
DEVMETHOD(smbus_bwrite, viasmb_bwrite),
DEVMETHOD(smbus_bread, viasmb_bread),
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
{ 0, 0 }
};
@@ -920,7 +950,14 @@ DRIVER_MODULE(viapm, pci, viapm_driver, viapm_devclass, 0, 0);
DRIVER_MODULE(viapropm, pci, viapropm_driver, viapropm_devclass, 0, 0);
MODULE_DEPEND(viapm, pci, 1, 1, 1);
-MODULE_DEPEND(viaprom, pci, 1, 1, 1);
+MODULE_DEPEND(viapropm, pci, 1, 1, 1);
MODULE_DEPEND(viapm, iicbb, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER);
MODULE_DEPEND(viapropm, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
MODULE_VERSION(viapm, 1);
+
+#ifdef DEV_ISA
+DRIVER_MODULE(isa, viapm, isa_driver, isa_devclass, 0, 0);
+DRIVER_MODULE(isa, viapropm, isa_driver, isa_devclass, 0, 0);
+MODULE_DEPEND(viapm, isa, 1, 1, 1);
+MODULE_DEPEND(viapropm, isa, 1, 1, 1);
+#endif
OpenPOWER on IntegriCloud