summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2018-06-19 10:32:42 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2018-06-19 10:32:42 +0000
commit9858609484afeefbe0c4f3c55a6f11a06f331c0b (patch)
tree5ae4ab26588be34a02ba82ba403eff0ded48989c /sys
parentbac4fa6654bf0efb9872dce770fd81c1b57b42db (diff)
Add support for SAS3.5 controllers. This involves reordering
initialisation so we get the controller capabilities first, allowing a soft reset instead of hard reset. The new controllers don't work after a hard reset, and older generations seem fine either way. tested by robert@ on a sas3408, by dlg@ on a sas2008 (on sparc64) and by me on a sas3008. ok dlg@ robert@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/mpii.c32
-rw-r--r--sys/dev/pci/mpiireg.h3
2 files changed, 24 insertions, 11 deletions
diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c
index c1f523a39b4..7393dd9c9f1 100644
--- a/sys/dev/pci/mpii.c
+++ b/sys/dev/pci/mpii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpii.c,v 1.113 2017/12/12 11:18:32 mpi Exp $ */
+/* $OpenBSD: mpii.c,v 1.114 2018/06/19 10:32:41 jmatthew Exp $ */
/*
* Copyright (c) 2010, 2012 Mike Belopuhov
* Copyright (c) 2009 James Giannoules
@@ -431,7 +431,13 @@ static const struct pci_matchid mpii_devices[] = {
{ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3108_1 },
{ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3108_2 },
{ PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3108_3 },
- { PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3108_4 }
+ { PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3108_4 },
+ { PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3408 },
+ { PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3416 },
+ { PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3508 },
+ { PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3508_1 },
+ { PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3516 },
+ { PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS3516_1 }
};
int
@@ -492,13 +498,13 @@ mpii_attach(struct device *parent, struct device *self, void *aux)
}
printf(": %s\n", pci_intr_string(sc->sc_pc, ih));
- if (mpii_init(sc) != 0) {
- printf("%s: unable to initialize ioc\n", DEVNAME(sc));
+ if (mpii_iocfacts(sc) != 0) {
+ printf("%s: unable to get iocfacts\n", DEVNAME(sc));
goto unmap;
}
- if (mpii_iocfacts(sc) != 0) {
- printf("%s: unable to get iocfacts\n", DEVNAME(sc));
+ if (mpii_init(sc) != 0) {
+ printf("%s: unable to initialize ioc\n", DEVNAME(sc));
goto unmap;
}
@@ -556,7 +562,8 @@ mpii_attach(struct device *parent, struct device *self, void *aux)
/* XXX bail on unsupported porttype? */
if ((sc->sc_porttype == MPII_PORTFACTS_PORTTYPE_SAS_PHYSICAL) ||
- (sc->sc_porttype == MPII_PORTFACTS_PORTTYPE_SAS_VIRTUAL)) {
+ (sc->sc_porttype == MPII_PORTFACTS_PORTTYPE_SAS_VIRTUAL) ||
+ (sc->sc_porttype == MPII_PORTFACTS_PORTTYPE_TRI_MODE)) {
if (mpii_eventnotify(sc) != 0) {
printf("%s: unable to enable events\n", DEVNAME(sc));
goto free_queues;
@@ -876,7 +883,8 @@ mpii_scsi_probe(struct scsi_link *link)
int flags;
if ((sc->sc_porttype != MPII_PORTFACTS_PORTTYPE_SAS_PHYSICAL) &&
- (sc->sc_porttype != MPII_PORTFACTS_PORTTYPE_SAS_VIRTUAL))
+ (sc->sc_porttype != MPII_PORTFACTS_PORTTYPE_SAS_VIRTUAL) &&
+ (sc->sc_porttype != MPII_PORTFACTS_PORTTYPE_TRI_MODE))
return (ENXIO);
dev = sc->sc_devs[link->target];
@@ -1261,12 +1269,16 @@ mpii_iocfacts(struct mpii_softc *sc)
if (ISSET(lemtoh32(&ifp.ioc_capabilities),
MPII_IOCFACTS_CAPABILITY_INTEGRATED_RAID))
SET(sc->sc_flags, MPII_F_RAID);
+ if (ISSET(lemtoh32(&ifp.ioc_capabilities),
+ MPII_IOCFACTS_CAPABILITY_EVENT_REPLAY))
+ sc->sc_ioc_event_replay = 1;
sc->sc_max_cmds = MIN(lemtoh16(&ifp.request_credit),
MPII_REQUEST_CREDIT);
- /* SAS3 controllers have different sgl layouts */
- if (ifp.msg_version_maj == 2 && ifp.msg_version_min == 5)
+ /* SAS3 and 3.5 controllers have different sgl layouts */
+ if (ifp.msg_version_maj == 2 && ((ifp.msg_version_min == 5)
+ || (ifp.msg_version_min == 6)))
SET(sc->sc_flags, MPII_F_SAS3);
/*
diff --git a/sys/dev/pci/mpiireg.h b/sys/dev/pci/mpiireg.h
index 759072e50ef..544a304227b 100644
--- a/sys/dev/pci/mpiireg.h
+++ b/sys/dev/pci/mpiireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpiireg.h,v 1.12 2017/01/16 18:09:35 mikeb Exp $ */
+/* $OpenBSD: mpiireg.h,v 1.13 2018/06/19 10:32:41 jmatthew Exp $ */
/*
* Copyright (c) 2010 Mike Belopuhov
* Copyright (c) 2009 James Giannoules
@@ -524,6 +524,7 @@ struct mpii_msg_portfacts_reply {
#define MPII_PORTFACTS_PORTTYPE_ISCSI (0x20)
#define MPII_PORTFACTS_PORTTYPE_SAS_PHYSICAL (0x30)
#define MPII_PORTFACTS_PORTTYPE_SAS_VIRTUAL (0x31)
+#define MPII_PORTFACTS_PORTTYPE_TRI_MODE (0x40)
u_int16_t reserved6;
u_int16_t max_posted_cmd_buffers;