Index: boot/common/loader.8 =================================================================== RCS file: /home/ncvs/src/sys/boot/common/loader.8,v retrieving revision 1.47 diff -u -r1.47 loader.8 --- boot/common/loader.8 2002/08/30 11:10:59 1.47 +++ boot/common/loader.8 2002/11/10 14:01:00 @@ -422,6 +422,15 @@ respectively. An invalid suffix will result in the variable being ignored by the kernel. +.It Va hw.pci.enable_io_modes +Enable PCI resources which are left off by some BIOSes or are not +enabled correctly by the device driver. +Tunable value set to ON (1) by default, but this may cause problems +with some peripherals. +.It Va hw.pci_allow_unsupported_io_range +Allow the PCI bridge to pass through an unsupported memory range +assigned by the BIOS. +Tunable value set to OFF (0) by default. .It Va kern.maxusers Set the size of a number of statically allocated system tables; see .Xr tuning 7 Index: dev/pci/pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/pci/pci.c,v retrieving revision 1.204 diff -u -r1.204 pci.c --- dev/pci/pci.c 2002/10/16 19:11:59 1.204 +++ dev/pci/pci.c 2002/11/10 14:01:04 @@ -165,7 +165,7 @@ /* sysctl vars */ SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD, 0, "PCI bus tuning parameters"); -int pci_enable_io_modes = 1; +static int pci_enable_io_modes = 1; TUNABLE_INT("hw.pci.enable_io_modes", (int *)&pci_enable_io_modes); SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_modes, CTLFLAG_RW, &pci_enable_io_modes, 1, Index: dev/pci/pci_pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/pci/pci_pci.c,v retrieving revision 1.17 diff -u -r1.17 pci_pci.c --- dev/pci/pci_pci.c 2002/09/06 22:14:00 1.17 +++ dev/pci/pci_pci.c 2002/11/10 14:01:05 @@ -38,6 +38,7 @@ #include #include #include +#include #include @@ -90,6 +91,18 @@ DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0); /* + * sysctl and tunable vars + */ +static int pci_allow_unsupported_io_range = 0; +TUNABLE_INT("hw.pci.allow_unsupported_io_range", + (int *)&pci_allow_unsupported_io_range); +SYSCTL_DECL(_hw_pci); +SYSCTL_INT(_hw_pci, OID_AUTO, allow_unsupported_io_range, CTLFLAG_RD, + &pci_allow_unsupported_io_range, 0, + "Allows the PCI Bridge to pass through an unsupported memory range " + "assigned by the BIOS."); + +/* * Generic device interface */ static int @@ -288,21 +301,23 @@ switch (type) { case SYS_RES_IOPORT: if (!pcib_is_isa_io(start)) { -#ifndef PCI_ALLOW_UNSUPPORTED_IO_RANGE - if (start < sc->iobase) - start = sc->iobase; - if (end > sc->iolimit) - end = sc->iolimit; - if (end < start) - start = 0; -#else - if (start < sc->iobase) - printf("start (%lx) < sc->iobase (%x)\n", start, sc->iobase); - if (end > sc->iolimit) - printf("end (%lx) > sc->iolimit (%x)\n", end, sc->iolimit); - if (end < start) - printf("end (%lx) < start (%lx)\n", end, start); -#endif + if (!pci_allow_unsupported_io_range) { + if (start < sc->iobase) + start = sc->iobase; + if (end > sc->iolimit) + end = sc->iolimit; + if (end < start) + start = 0; + } else { + if (start < sc->iobase) + printf("start (%lx) < sc->iobase (%x)\n", start, + sc->iobase); + if (end > sc->iolimit) + printf("end (%lx) > sc->iolimit (%x)\n", + end, sc->iolimit); + if (end < start) + printf("end (%lx) < start (%lx)\n", end, start); + } } if (!pcib_is_isa_io(start) && ((start < sc->iobase) || (end > sc->iolimit))) { @@ -325,21 +340,23 @@ */ case SYS_RES_MEMORY: if (!pcib_is_isa_mem(start)) { -#ifndef PCI_ALLOW_UNSUPPORTED_IO_RANGE - if (start < sc->membase && end >= sc->membase) - start = sc->membase; - if (end > sc->memlimit) - end = sc->memlimit; - if (end < start) - start = 0; -#else - if (start < sc->membase && end > sc->membase) - printf("start (%lx) < sc->membase (%x)\n", start, sc->membase); - if (end > sc->memlimit) - printf("end (%lx) > sc->memlimit (%x)\n", end, sc->memlimit); - if (end < start) - printf("end (%lx) < start (%lx)\n", end, start); -#endif + if (!pci_allow_unsupported_io_range) { + if (start < sc->membase && end >= sc->membase) + start = sc->membase; + if (end > sc->memlimit) + end = sc->memlimit; + if (end < start) + start = 0; + } else { + if (start < sc->membase && end > sc->membase) + printf("start (%lx) < sc->membase (%x)\n", + start, sc->membase); + if (end > sc->memlimit) + printf("end (%lx) > sc->memlimit (%x)\n", + end, sc->memlimit); + if (end < start) + printf("end (%lx) < start (%lx)\n", end, start); + } } if (!pcib_is_isa_mem(start) && (((start < sc->membase) || (end > sc->memlimit)) && @@ -351,9 +368,8 @@ device_get_name(child), device_get_unit(child), start, end, sc->membase, sc->memlimit, sc->pmembase, sc->pmemlimit); -#ifndef PCI_ALLOW_UNSUPPORTED_IO_RANGE - return(NULL); -#endif + if (!pci_allow_unsupported_io_range) + return (NULL); } if (bootverbose) device_printf(sc->dev, "device %s%d requested decoded memory range 0x%lx-0x%lx\n",