From 9f7eef096f274e3e79f4f8a19c09b9d4d1f65036 Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 31 Oct 2005 18:31:16 +0000 Subject: 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 --- sys/pci/viapm.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'sys') 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 __FBSDID("$FreeBSD$"); +#include "opt_isa.h" + #include #include #include @@ -39,6 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_ISA +#include +#include +#endif #include #include @@ -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 -- cgit v1.1