Try a bit harder to test for ATA/ATAPI HW to probe, this is to avoid

some of the false comrades some devices fakes...
This commit is contained in:
Søren Schmidt 2000-10-30 20:45:24 +00:00
parent 7e17175887
commit afaa0eb776
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=68005

View File

@ -818,13 +818,25 @@ ata_probe(device_t dev)
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
DELAY(1);
status0 = inb(scp->ioaddr + ATA_STATUS);
if ((status0 & 0xf8) != 0xf8 && status0 != 0xa5) {
outb(scp->ioaddr + ATA_ERROR, 0x58);
outb(scp->ioaddr + ATA_CYL_LSB, 0xa5);
if (inb(scp->ioaddr + ATA_ERROR) != 0x58 &&
inb(scp->ioaddr + ATA_CYL_LSB) == 0xa5)
mask |= 0x01;
}
outb(scp->ioaddr + ATA_DRIVE, ATA_D_IBM | ATA_SLAVE);
DELAY(1);
status1 = inb(scp->ioaddr + ATA_STATUS);
if ((status0 & 0xf8) != 0xf8 && status0 != 0xa5)
mask |= 0x01;
if ((status1 & 0xf8) != 0xf8 && status1 != 0xa5)
if ((status1 & 0xf8) != 0xf8 && status1 != 0xa5) {
outb(scp->ioaddr + ATA_ERROR, 0x58);
outb(scp->ioaddr + ATA_CYL_LSB, 0xa5);
if (inb(scp->ioaddr + ATA_ERROR) != 0x58 &&
inb(scp->ioaddr + ATA_CYL_LSB) == 0xa5)
mask |= 0x02;
}
if (bootverbose)
ata_printf(scp, -1, "mask=%02x status0=%02x status1=%02x\n",
mask, status0, status1);