Any chance this will work? I found it here.
Code:
Index: dev/pci/ahci.c
========================================
===========================
RCS file: /cvs/src/sys/dev/pci/ahci.c,v
retrieving revision 1.130
diff -u -p -r1.130 ahci.c
--- dev/pci/ahci.c 2007/10/27 10:51:21 1.130
+++ dev/pci/ahci.c 2007/10/31 15:56:27
@@ -34,7 +34,7 @@
#include <dev/ata/atascsi.h>
/* change to AHCI_DEBUG for dmesg spam */
-#define NO_AHCI_DEBUG
+#define AHCI_DEBUG
#ifdef AHCI_DEBUG
#define DPRINTF(m, f...) do { if ((ahcidebug & (m)) == (m)) printf(f);
} \
@@ -387,8 +387,9 @@ struct ahci_softc {
bus_dma_tag_t sc_dmat;
int sc_flags;
-#define AHCI_F_NO_NCQ (1<<0)
-#define AHCI_F_NO_FER (1<<1)
+#define AHCI_F_NO_NCQ (1<<0)
+#define AHCI_F_NO_FR (1<<1)
+#define AHCI_F_NO_CR (1<<2)
u_int sc_ncmds;
@@ -419,12 +420,28 @@ int ahci_vt8251_attach(struct ahci_sof
struct pci_attach_args *);
int ahci_ati_ixp600_attach(struct ahci_softc *,
struct pci_attach_args *);
+int ahci_88se61xx_attach(struct ahci_softc *,
+ struct pci_attach_args *);
static const struct ahci_device ahci_devices[] = {
{ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_
VT8251_SATA,
ahci_no_match, ahci_vt8251_attach },
{ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_IXP_SATA
_600,
- NULL, ahci_ati_ixp600_attach }
+ NULL, ahci_ati_ixp600_attach },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_
88SE6111,
+ NULL, ahci_88se61xx_attach },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_
88SE6120,
+ NULL, ahci_88se61xx_attach },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_
88SE6121,
+ NULL, ahci_88se61xx_attach },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_
88SE6122,
+ NULL, ahci_88se61xx_attach },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_
88SE6140,
+ NULL, ahci_88se61xx_attach },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_
88SE6141,
+ NULL, ahci_88se61xx_attach },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_
88SE6145,
+ NULL, ahci_88se61xx_attach }
};
int ahci_pci_match(struct device *, void *, void *);
@@ -554,8 +571,16 @@ ahci_vt8251_attach(struct ahci_softc *sc
int
ahci_ati_ixp600_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
+{
+ sc->sc_flags |= AHCI_F_NO_FR;
+
+ return (0);
+}
+
+ int
+ahci_88se61xx_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
{
- sc->sc_flags |= AHCI_F_NO_FER;
+ sc->sc_flags |= AHCI_F_NO_FR | AHCI_F_NO_CR | AHCI_F_NO_NCQ;
return (0);
}
@@ -911,6 +936,8 @@ ahci_port_alloc(struct ahci_softc *sc, u
goto freeport;
}
+ printf("preg=0x%x\n", cmd);
+
/* Allocate a CCB for each command slot */
ap->ap_ccbs = malloc(sizeof(struct ahci_ccb) * sc->sc_ncmds, M_DEVBUF,
M_NOWAIT | M_ZERO);
@@ -1014,6 +1041,9 @@ nomem:
DPRINTF(AHCI_D_VERBOSE, "%s: detected device on port %d\n",
DEVNAME(sc), port);
+ printf("preg=0x%x\n",
+ ahci_pread(ap, AHCI_PREG_CMD) & ~AHCI_PREG_CMD_ICC);
+
/* Enable command transfers on port */
if (ahci_port_start(ap, 0)) {
printf("%s: failed to start command DMA on port %d, "
@@ -1084,8 +1114,7 @@ ahci_port_start(struct ahci_port *ap, in
/* Turn on FRE (and ST) */
r = ahci_pread(ap, AHCI_PREG_CMD) & ~AHCI_PREG_CMD_ICC;
- if (!(ap->ap_sc->sc_flags & AHCI_F_NO_FER))
- r |= AHCI_PREG_CMD_FRE;
+ r |= AHCI_PREG_CMD_FRE;
if (!fre_only)
r |= AHCI_PREG_CMD_ST;
ahci_pwrite(ap, AHCI_PREG_CMD, r);
@@ -1098,16 +1127,22 @@ ahci_port_start(struct ahci_port *ap, in
ap->ap_sc->sc_ccc_ports_cur);
}
#endif
+
+ printf("preg=0x%x\n",
+ ahci_pread(ap, AHCI_PREG_CMD) & ~AHCI_PREG_CMD_ICC);
- if (!(ap->ap_sc->sc_flags & AHCI_F_NO_FER)) {
+ if (!(ap->ap_sc->sc_flags & AHCI_F_NO_FR)) {
/* Wait for FR to come on */
if (ahci_pwait_set(ap, AHCI_PREG_CMD, AHCI_PREG_CMD_FR))
return (2);
}
- /* Wait for CR to come on */
- if (!fre_only && ahci_pwait_set(ap, AHCI_PREG_CMD, AHCI_PREG_CMD_CR))
- return (1);
+ if (!(ap->ap_sc->sc_flags & AHCI_F_NO_CR)) {
+ /* Wait for CR to come on */
+ if (!fre_only && ahci_pwait_set(ap, AHCI_PREG_CMD,
+ AHCI_PREG_CMD_CR))
+ return (1);
+ }
return (0);
}