diff options
author | sos <sos@FreeBSD.org> | 2000-10-30 20:45:24 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2000-10-30 20:45:24 +0000 |
commit | 0b401166119d8fc0ee2b434bc8cd7d1724da7706 (patch) | |
tree | 76158ad638bbbd3b9470495883e069a2daf2c7cc | |
parent | 47715a6eb1b3ed693c33121a410b0027b999c52f (diff) | |
download | FreeBSD-src-0b401166119d8fc0ee2b434bc8cd7d1724da7706.zip FreeBSD-src-0b401166119d8fc0ee2b434bc8cd7d1724da7706.tar.gz |
Try a bit harder to test for ATA/ATAPI HW to probe, this is to avoid
some of the false comrades some devices fakes...
-rw-r--r-- | sys/dev/ata/ata-all.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 2cd0565..6195767 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -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); |