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/ata/ata-pci.c | |
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/ata/ata-pci.c')
-rw-r--r-- | sys/dev/ata/ata-pci.c | 18 |
1 files changed, 9 insertions, 9 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; } |