Do not pre-allocate resources for BAR's on ATA MASTERDEV's thats on

the standard ATA primary and secondary addresses.

Reintroduce the size 1 ALTIO space so that we can have both ATA and
floppies back working.
This commit is contained in:
Søren Schmidt 2004-04-20 20:57:29 +00:00
parent c968be6d98
commit 470fcc93b9
2 changed files with 12 additions and 3 deletions

View File

@ -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) {

View File

@ -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;