summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2008-04-19 01:18:40 +0000
committerDamien Miller <djm@cvs.openbsd.org>2008-04-19 01:18:40 +0000
commitfee43a053805f4933951b7d78241781f8ae7a500 (patch)
tree9c7e85cdf0c074faf367a778ccd6b99668b10d3f /sys/dev
parent6cb93110cadadebeb39944e273766149084876d8 (diff)
add a driver flag to force the negotiation of SATA 1 transfers
(1.5Gb/s). Useful where faster speeds are unstable; ok dlg@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/ahci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c
index 487bd871734..847aac346bc 100644
--- a/sys/dev/pci/ahci.c
+++ b/sys/dev/pci/ahci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahci.c,v 1.138 2008/04/08 19:30:09 kettenis Exp $ */
+/* $OpenBSD: ahci.c,v 1.139 2008/04/19 01:18:39 djm Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -1354,8 +1354,12 @@ ahci_port_portreset(struct ahci_port *ap)
/* Perform device detection */
ahci_pwrite(ap, AHCI_PREG_SCTL, 0);
delay(10000);
- r = AHCI_PREG_SCTL_IPM_DISABLED | AHCI_PREG_SCTL_SPD_ANY |
- AHCI_PREG_SCTL_DET_INIT;
+ r = AHCI_PREG_SCTL_IPM_DISABLED | AHCI_PREG_SCTL_DET_INIT;
+ if ((ap->ap_sc->sc_dev.dv_cfdata->cf_flags & 0x01) != 0) {
+ DPRINTF(AHCI_D_VERBOSE, "%s: forcing GEN1\n", PORTNAME(ap));
+ r |= AHCI_PREG_SCTL_SPD_GEN1;
+ } else
+ r |= AHCI_PREG_SCTL_SPD_ANY;
ahci_pwrite(ap, AHCI_PREG_SCTL, r);
delay(10000); /* wait at least 1ms for COMRESET to be sent */
r &= ~AHCI_PREG_SCTL_DET_INIT;