diff options
author | sos <sos@FreeBSD.org> | 2007-02-17 16:56:39 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2007-02-17 16:56:39 +0000 |
commit | ed5cb12fbe994c362c4ab2d40dd8be72d4a364cc (patch) | |
tree | 31424ae52139540ad3eabf13397afd2881b3526c /sys/dev | |
parent | f6f8eb8e88eb2140016fa12c1edf6947d949e048 (diff) | |
download | FreeBSD-src-ed5cb12fbe994c362c4ab2d40dd8be72d4a364cc.zip FreeBSD-src-ed5cb12fbe994c362c4ab2d40dd8be72d4a364cc.tar.gz |
Add support for chipsets that has NULL'd BAR's for legacy ports.
This allows DMA to be used on a fine little geode system I got here and
most like on lots of older systems like that.
HW donated by: Paul Ghering
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-pci.c | 18 | ||||
-rw-r--r-- | sys/dev/pci/pci.c | 4 |
2 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index fc3585a..1acd68d 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -59,10 +59,14 @@ static MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI"); int ata_legacy(device_t dev) { - return ((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV) && - ((pci_read_config(dev, PCIR_PROGIF, 1) & - (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) != - (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))); + return (((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV)&& + ((pci_read_config(dev, PCIR_PROGIF, 1) & + (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) != + (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) || + (!pci_read_config(dev, PCIR_BAR(0), 4) && + !pci_read_config(dev, PCIR_BAR(1), 4) && + !pci_read_config(dev, PCIR_BAR(2), 4) && + !pci_read_config(dev, PCIR_BAR(3), 4))); } int @@ -211,11 +215,7 @@ ata_pci_attach(device_t dev) /* attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { - if (unit == 0 && (pci_get_progif(dev) & 0x81) == 0x80) { - device_add_child(dev, "ata", unit); - continue; - } - if (unit == 1 && (pci_get_progif(dev) & 0x84) == 0x80) { + if ((unit == 0 || unit == 1) && ata_legacy(dev)) { device_add_child(dev, "ata", unit); continue; } diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index fae9ba2..dd55f16 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -2231,7 +2231,9 @@ pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask) /* ATA devices needs special map treatment */ if ((pci_get_class(dev) == PCIC_STORAGE) && (pci_get_subclass(dev) == PCIS_STORAGE_IDE) && - (pci_get_progif(dev) & PCIP_STORAGE_IDE_MASTERDEV)) + ((pci_get_progif(dev) & PCIP_STORAGE_IDE_MASTERDEV) || + (!pci_read_config(dev, PCIR_BAR(0), 4) && + !pci_read_config(dev, PCIR_BAR(2), 4))) ) pci_ata_maps(pcib, bus, dev, b, s, f, rl, force, prefetchmask); else for (i = 0; i < cfg->nummaps;) |