Web Server forum
Back To The Forum Home!Search!Private Messaging System

This is Interesting: Free IT Magazines Now Free shipping to   
Web Server Talk Web Server Talk > Unix and Linux reviews > OpenBSD > OpenBSD Technical topics > Marvell 88SE61xx SATA




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Marvell 88SE61xx SATA  
Mike Belopuhov


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-31-07 06:16 PM

Greetings,

If you have one of the unsupported Marvell 88SE61xx SATA-II controllers,
there is a chance to step up and test a small diff.

This applies to the owners of 6111, 6120, 6121, 6122, 6140, 6141 and 6145.
(test if unsure 

Please email me test results (dmesg) as well as basic discription
of the device (e.g. mainboard model, PATA ports presence) directly.

Please note that you need recent -current sources to compile a kernel
with this patch applied.  Also this patch doesn't add support for
PATA found on some controllers, thus only SATA ports will work.

Thanks,
Mike

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);
}






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:43 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 

Back To The Top
Home | Usercp | Faq | Register