diff options
| author | Mike Smith <msmith@FreeBSD.org> | 2000-10-28 23:07:13 +0000 |
|---|---|---|
| committer | Mike Smith <msmith@FreeBSD.org> | 2000-10-28 23:07:13 +0000 |
| commit | f53e8493fb48d72218a6127c831b67cd495ed905 (patch) | |
| tree | 59d74f62f031dde2159fe4ffe0bed005d354e449 | |
| parent | 14a7806366db51dc60a487423629ab3ef97be9d3 (diff) | |
Notes
| -rw-r--r-- | sys/dev/pci/pci.c | 15 | ||||
| -rw-r--r-- | sys/pci/pci.c | 15 |
2 files changed, 28 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 255cc2e854c40..5bf9b37842fb4 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -985,7 +985,14 @@ pci_add_map(device_t pcib, int b, int s, int f, int reg, else printf(", enabled\n"); } - + + /* + * This code theoretically does the right thing, but has + * undesirable side effects in some cases where + * peripherals respond oddly to having these bits + * enabled. Leave them alone by default. + */ +#ifdef PCI_ENABLE_IO_MODES /* Turn on resources that have been left off by a lazy BIOS */ if (type == SYS_RES_IOPORT && !pci_porten(pcib, b, s, f)) { cmd = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_COMMAND, 2); @@ -997,6 +1004,12 @@ pci_add_map(device_t pcib, int b, int s, int f, int reg, cmd |= PCIM_CMD_MEMEN; PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND, cmd, 2); } +#else + if (type == SYS_RES_IOPORT && !pci_porten(cfg)) + return 1; + if (type == SYS_RES_MEMORY && !pci_memen(cfg)) + return 1; +#endif resource_list_add(rl, type, reg, base, base + (1 << ln2size) - 1, diff --git a/sys/pci/pci.c b/sys/pci/pci.c index 255cc2e854c40..5bf9b37842fb4 100644 --- a/sys/pci/pci.c +++ b/sys/pci/pci.c @@ -985,7 +985,14 @@ pci_add_map(device_t pcib, int b, int s, int f, int reg, else printf(", enabled\n"); } - + + /* + * This code theoretically does the right thing, but has + * undesirable side effects in some cases where + * peripherals respond oddly to having these bits + * enabled. Leave them alone by default. + */ +#ifdef PCI_ENABLE_IO_MODES /* Turn on resources that have been left off by a lazy BIOS */ if (type == SYS_RES_IOPORT && !pci_porten(pcib, b, s, f)) { cmd = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_COMMAND, 2); @@ -997,6 +1004,12 @@ pci_add_map(device_t pcib, int b, int s, int f, int reg, cmd |= PCIM_CMD_MEMEN; PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND, cmd, 2); } +#else + if (type == SYS_RES_IOPORT && !pci_porten(cfg)) + return 1; + if (type == SYS_RES_MEMORY && !pci_memen(cfg)) + return 1; +#endif resource_list_add(rl, type, reg, base, base + (1 << ln2size) - 1, |
