diff options
| -rw-r--r-- | sys/dev/ata/ata-pci.c | 6 | ||||
| -rw-r--r-- | sys/dev/pci/pci.c | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 3e4154094ff3..471d64077f41 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -260,8 +260,8 @@ ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, case ATA_ALTADDR_RID: if (ATA_MASTERDEV(dev)) { - start = (unit ? ATA_SECONDARY : ATA_PRIMARY) + ATA_ALTOFFSET-2; - count = 4; + start = (unit ? ATA_SECONDARY : ATA_PRIMARY) + ATA_ALTOFFSET; + count = ATA_ALTIOSIZE; end = start + count - 1; } myrid = 0x14 + 8 * unit; @@ -402,7 +402,7 @@ ata_pci_allocate(device_t dev, struct ata_channel *ch) ch->r_io[i].offset = i; } ch->r_io[ATA_ALTSTAT].res = altio; - ch->r_io[ATA_ALTSTAT].offset = 2; + ch->r_io[ATA_ALTSTAT].offset = 0; ch->r_io[ATA_IDX_ADDR].res = io; if (ctlr->r_res1) { diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index f7b7450d27c3..f23ab79d44d7 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -824,6 +824,15 @@ pci_add_map(device_t pcib, device_t bus, device_t dev, */ if (base == 0) return 1; + + /* if this is an ATA MASTERDEV on std addresses, resources are bogus */ + 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_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) + return 1; + start = base; end = base + (1 << ln2size) - 1; count = 1 << ln2size; |
