summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2007-02-12 17:17:31 +0000
committersos <sos@FreeBSD.org>2007-02-12 17:17:31 +0000
commitb10953d03a6284d751e547961ef7a8061228ba1b (patch)
tree1761af9d51ddb5c6a356ee11b3eb7b5f2044cbec /sys/dev/ata
parent7afc90147a1e022b2f9f26da7c4d03f618b1f2f8 (diff)
downloadFreeBSD-src-b10953d03a6284d751e547961ef7a8061228ba1b.zip
FreeBSD-src-b10953d03a6284d751e547961ef7a8061228ba1b.tar.gz
Rearrange the SATA connect logic so that we so that we pickup ATAPI devices.
The rest of the logic should be in place for most supporting chipsets.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata-chipset.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c
index af174f2..3c853cf 100644
--- a/sys/dev/ata/ata-chipset.c
+++ b/sys/dev/ata/ata-chipset.c
@@ -315,9 +315,8 @@ ata_sata_connect(struct ata_channel *ch)
/* clear SATA error register */
ATA_IDX_OUTL(ch, ATA_SERROR, ATA_IDX_INL(ch, ATA_SERROR));
- /* find out what type device we got poll for spec'd 31 seconds */
+ /* poll 31 seconds for device ready */
/* XXX SOS 10 secs for now as I have little patience */
- ch->devices = 0;
for (timeout = 0; timeout < 1000; timeout++) {
if (ATA_IDX_INB(ch, ATA_STATUS) & ATA_S_BUSY)
DELAY(10000);
@@ -326,16 +325,9 @@ ata_sata_connect(struct ata_channel *ch)
}
if (bootverbose)
device_printf(ch->dev, "SATA connect ready time=%dms\n", timeout * 10);
- if (timeout < 1000) {
- if ((ATA_IDX_INB(ch, ATA_CYL_LSB) == ATAPI_MAGIC_LSB) &&
- (ATA_IDX_INB(ch, ATA_CYL_MSB) == ATAPI_MAGIC_MSB))
- ch->devices = ATA_ATAPI_MASTER;
- else
- ch->devices = ATA_ATA_MASTER;
- }
- if (bootverbose)
- device_printf(ch->dev, "sata_connect devices=0x%b\n",
- ch->devices, "\20\3ATAPI_MASTER\1ATA_MASTER");
+
+ /* do a reset and find out what type device we've got */
+ ata_generic_reset(ch->dev);
return 1;
}
OpenPOWER on IntegriCloud