summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-12-05 10:30:54 +0000
committermav <mav@FreeBSD.org>2009-12-05 10:30:54 +0000
commit9216a4ce0f93b0b415c80289886f2cc2b225df9f (patch)
tree8525ce6611afe069ef6efe81e74e0e127e60d037 /sys/dev/ata
parent3840fefd31d4463807536452ea25bc14c1b2adad (diff)
downloadFreeBSD-src-9216a4ce0f93b0b415c80289886f2cc2b225df9f.zip
FreeBSD-src-9216a4ce0f93b0b415c80289886f2cc2b225df9f.tar.gz
On Soft Reset, read device signature from FIS receive area, instead of
PxSIG register. It works better for NVidia chipsets. ahci(4) does the same. PR: kern/140472, i386/138668
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/chipsets/ata-ahci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ata/chipsets/ata-ahci.c b/sys/dev/ata/chipsets/ata-ahci.c
index 0f76a8d..e4a7cd1 100644
--- a/sys/dev/ata/chipsets/ata-ahci.c
+++ b/sys/dev/ata/chipsets/ata-ahci.c
@@ -824,11 +824,10 @@ ata_ahci_hardreset(device_t dev, int port, uint32_t *signature)
static u_int32_t
ata_ahci_softreset(device_t dev, int port)
{
- struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
- int offset = ch->unit << 7;
struct ata_ahci_cmd_tab *ctp =
(struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET);
+ u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40;
if (bootverbose)
device_printf(dev, "software reset port %d...\n", port);
@@ -865,7 +864,10 @@ ata_ahci_softreset(device_t dev, int port)
return (-1);
}
- return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset);
+ return (((u_int32_t)fis[6] << 24) |
+ ((u_int32_t)fis[5] << 16) |
+ ((u_int32_t)fis[4] << 8) |
+ (u_int32_t)fis[12]);
}
static void
OpenPOWER on IntegriCloud