diff options
author | HummyPkg <af123@hummypkg.org.uk> | 2017-04-21 10:22:39 +0000 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2017-04-21 13:06:10 -0400 |
commit | df950592be5771afa05177cbbef90ff275f2526f (patch) | |
tree | 090c0434bef78a2909e9cae28afeeca6dcce878a | |
parent | b1cdc7203182cbb9ef6b7bc6085ee5b8dbee793b (diff) | |
download | illumos-joyent-df950592be5771afa05177cbbef90ff275f2526f.tar.gz |
8088 Add support for LSI Intruder and Cutlass cards.
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@omniti.com>
-rw-r--r-- | usr/src/pkg/manifests/driver-storage-mr_sas.mf | 13 | ||||
-rw-r--r-- | usr/src/uts/common/io/mr_sas/ld_pd_map.c | 12 | ||||
-rw-r--r-- | usr/src/uts/common/io/mr_sas/mr_sas.c | 18 | ||||
-rw-r--r-- | usr/src/uts/common/io/mr_sas/mr_sas.h | 20 | ||||
-rw-r--r-- | usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c | 32 |
5 files changed, 54 insertions, 41 deletions
diff --git a/usr/src/pkg/manifests/driver-storage-mr_sas.mf b/usr/src/pkg/manifests/driver-storage-mr_sas.mf index 32a138a184..d1b39a659e 100644 --- a/usr/src/pkg/manifests/driver-storage-mr_sas.mf +++ b/usr/src/pkg/manifests/driver-storage-mr_sas.mf @@ -23,6 +23,7 @@ # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2013 Nexenta Systems, Inc. All rights reserved. # Copyright 2015 Garrett D'Amore <garrett@damore.org> +# Copyright 2017 Citrus IT Limited. All rights reserved. # # @@ -45,21 +46,29 @@ dir path=usr/share/man/man7d $(sparc_ONLY)driver name=mr_sas class=scsi-self-identifying \ alias=pci1000,78 \ alias=pci1000,79 \ + alias=pciex1000,52 \ + alias=pciex1000,53 \ alias=pciex1000,5b \ alias=pciex1000,5d \ alias=pciex1000,5f \ alias=pciex1000,71 \ alias=pciex1000,73 \ alias=pciex1000,78 \ - alias=pciex1000,79 + alias=pciex1000,79 \ + alias=pciex1000,ce \ + alias=pciex1000,cf $(i386_ONLY)driver name=mr_sas class=scsi-self-identifying \ + alias=pciex1000,52 \ + alias=pciex1000,53 \ alias=pciex1000,5b \ alias=pciex1000,5d \ alias=pciex1000,5f \ alias=pciex1000,71 \ alias=pciex1000,73 \ alias=pciex1000,78 \ - alias=pciex1000,79 + alias=pciex1000,79 \ + alias=pciex1000,ce \ + alias=pciex1000,cf file path=kernel/drv/$(ARCH64)/mr_sas group=sys $(i386_ONLY)file path=kernel/drv/mr_sas group=sys file path=kernel/drv/mr_sas.conf group=sys diff --git a/usr/src/uts/common/io/mr_sas/ld_pd_map.c b/usr/src/uts/common/io/mr_sas/ld_pd_map.c index 829904afc0..0f2798a790 100644 --- a/usr/src/uts/common/io/mr_sas/ld_pd_map.c +++ b/usr/src/uts/common/io/mr_sas/ld_pd_map.c @@ -23,6 +23,7 @@ */ /* * Copyright 2015 Garrett D'Amore <garrett@damore.org> + * Copyright 2017 Citrus IT Limited. All rights reserved. */ #include <sys/scsi/scsi.h> @@ -212,7 +213,6 @@ MR_GetPhyParams(struct mrsas_instance *instance, U32 ld, U64 stripRow, U32 rowMod; U32 armQ; U32 arm; - U16 devid = instance->device_id; ASSERT(raid->rowDataSize != 0); @@ -254,11 +254,8 @@ MR_GetPhyParams(struct mrsas_instance *instance, U32 ld, U64 stripRow, *pDevHandle = MR_PdDevHandleGet(pd, map); } else { *pDevHandle = MR_PD_INVALID; /* set dev handle as invalid. */ - if ((raid->level >= 5) && - ((devid != PCI_DEVICE_ID_LSI_INVADER) || - ((devid == PCI_DEVICE_ID_LSI_INVADER || - (devid == PCI_DEVICE_ID_LSI_FURY)) && - raid->regTypeReqOnRead != REGION_TYPE_UNUSED))) { + if (raid->level >= 5 && (!instance->gen3 || + raid->regTypeReqOnRead != REGION_TYPE_UNUSED)) { pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE; } else if (raid->level == 1) { /* Get Alternate Pd. */ @@ -403,8 +400,7 @@ MR_BuildRaidContext(struct mrsas_instance *instance, pRAID_Context->timeoutValue = map->raidMap.fpPdIoTimeoutSec; - if ((instance->device_id == PCI_DEVICE_ID_LSI_INVADER) || - (instance->device_id == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { pRAID_Context->regLockFlags = (isRead) ? raid->regTypeReqOnRead : raid->regTypeReqOnWrite; } else { diff --git a/usr/src/uts/common/io/mr_sas/mr_sas.c b/usr/src/uts/common/io/mr_sas/mr_sas.c index 1bb6cec1d2..4e3fe4dcce 100644 --- a/usr/src/uts/common/io/mr_sas/mr_sas.c +++ b/usr/src/uts/common/io/mr_sas/mr_sas.c @@ -45,7 +45,7 @@ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Bayard G. Bell. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. - * Copyright 2015 Citrus IT Limited. All rights reserved. + * Copyright 2015, 2017 Citrus IT Limited. All rights reserved. * Copyright 2015 Garrett D'Amore <garrett@damore.org> */ @@ -565,9 +565,16 @@ mrsas_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) /* initialize function pointers */ switch (device_id) { - case PCI_DEVICE_ID_LSI_TBOLT: case PCI_DEVICE_ID_LSI_INVADER: case PCI_DEVICE_ID_LSI_FURY: + case PCI_DEVICE_ID_LSI_INTRUDER: + case PCI_DEVICE_ID_LSI_INTRUDER_24: + case PCI_DEVICE_ID_LSI_CUTLASS_52: + case PCI_DEVICE_ID_LSI_CUTLASS_53: + dev_err(dip, CE_CONT, "?Gen3 device detected\n"); + instance->gen3 = 1; + /* FALLTHROUGH */ + case PCI_DEVICE_ID_LSI_TBOLT: dev_err(dip, CE_CONT, "?TBOLT device detected\n"); instance->func_ptr = @@ -584,6 +591,7 @@ mrsas_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * certain other features are available to a Skinny * HBA. */ + dev_err(dip, CE_CONT, "?Skinny device detected\n"); instance->skinny = 1; /* FALLTHRU */ @@ -1596,7 +1604,7 @@ mrsas_quiesce(dev_info_t *dip) /*ARGSUSED*/ static int mrsas_tran_tgt_init(dev_info_t *hba_dip, dev_info_t *tgt_dip, - scsi_hba_tran_t *tran, struct scsi_device *sd) + scsi_hba_tran_t *tran, struct scsi_device *sd) { struct mrsas_instance *instance; uint16_t tgt = sd->sd_address.a_target; @@ -1772,8 +1780,8 @@ mrsas_name_node(dev_info_t *dip, char *name, int len) */ static struct scsi_pkt * mrsas_tran_init_pkt(struct scsi_address *ap, register struct scsi_pkt *pkt, - struct buf *bp, int cmdlen, int statuslen, int tgtlen, - int flags, int (*callback)(), caddr_t arg) + struct buf *bp, int cmdlen, int statuslen, int tgtlen, + int flags, int (*callback)(), caddr_t arg) { struct scsa_cmd *acmd; struct mrsas_instance *instance; diff --git a/usr/src/uts/common/io/mr_sas/mr_sas.h b/usr/src/uts/common/io/mr_sas/mr_sas.h index 8f27cbdf21..fe4c3659af 100644 --- a/usr/src/uts/common/io/mr_sas/mr_sas.h +++ b/usr/src/uts/common/io/mr_sas/mr_sas.h @@ -45,6 +45,7 @@ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright 2015 Garrett D'Amore <garrett@damore.org> + * Copyright 2017 Citrus IT Limited. All rights reserved. */ #ifndef _MR_SAS_H_ @@ -61,8 +62,8 @@ extern "C" { /* * MegaRAID SAS2.0 Driver meta data */ -#define MRSAS_VERSION "6.503.00.00ILLUMOS" -#define MRSAS_RELDATE "July 30, 2012" +#define MRSAS_VERSION "6.503.00.00ILLUMOS-20170421" +#define MRSAS_RELDATE "April 21, 2017" #define MRSAS_TRUE 1 #define MRSAS_FALSE 0 @@ -90,13 +91,23 @@ extern "C" { /* * MegaRAID SAS2.0 supported controllers */ -#define PCI_DEVICE_ID_LSI_2108VDE 0x0078 -#define PCI_DEVICE_ID_LSI_2108V 0x0079 + +/* Skinny */ #define PCI_DEVICE_ID_LSI_SKINNY 0x0071 #define PCI_DEVICE_ID_LSI_SKINNY_NEW 0x0073 +/* Liberator series (Gen2) */ +#define PCI_DEVICE_ID_LSI_2108VDE 0x0078 +#define PCI_DEVICE_ID_LSI_2108V 0x0079 +/* Thunderbolt series */ #define PCI_DEVICE_ID_LSI_TBOLT 0x005b +/* Invader series (Gen3) */ #define PCI_DEVICE_ID_LSI_INVADER 0x005d #define PCI_DEVICE_ID_LSI_FURY 0x005f +#define PCI_DEVICE_ID_LSI_INTRUDER 0x00ce +#define PCI_DEVICE_ID_LSI_INTRUDER_24 0x00cf +#define PCI_DEVICE_ID_LSI_CUTLASS_52 0x0052 +#define PCI_DEVICE_ID_LSI_CUTLASS_53 0x0053 +/* Ventura series not yet supported */ /* * Register Index for 2108 Controllers. @@ -602,6 +613,7 @@ typedef struct mrsas_instance { uint8_t skinny; uint8_t tbolt; + uint8_t gen3; uint16_t reply_read_index; uint16_t reply_size; /* Single Reply struct size */ uint16_t raid_io_msg_size; /* Single message size */ diff --git a/usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c b/usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c index 929ae8056e..9ff12ffb07 100644 --- a/usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c +++ b/usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c @@ -17,7 +17,7 @@ /* * Copyright 2013 Nexenta Systems, Inc. All rights reserved. - * Copyright 2015 Citrus IT Limited. All rights reserved. + * Copyright 2015, 2017 Citrus IT Limited. All rights reserved. * Copyright 2015 Garrett D'Amore <garrett@damore.org> */ @@ -1252,7 +1252,6 @@ mr_sas_tbolt_build_sgl(struct mrsas_instance *instance, Mpi25IeeeSgeChain64_t *scsi_raid_io_sgl_ieee = NULL; ddi_acc_handle_t acc_handle = instance->mpi2_frame_pool_dma_obj.acc_handle; - uint16_t devid = instance->device_id; con_log(CL_ANN1, (CE_NOTE, "chkpnt: Building Chained SGL :%d", __LINE__)); @@ -1296,8 +1295,7 @@ mr_sas_tbolt_build_sgl(struct mrsas_instance *instance, scsi_raid_io_sgl_ieee = (Mpi25IeeeSgeChain64_t *)&scsi_raid_io->SGL.IeeeChain; - if ((devid == PCI_DEVICE_ID_LSI_INVADER) || - (devid == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { Mpi25IeeeSgeChain64_t *sgl_ptr_end = scsi_raid_io_sgl_ieee; sgl_ptr_end += instance->max_sge_in_main_msg - 1; @@ -1313,8 +1311,7 @@ mr_sas_tbolt_build_sgl(struct mrsas_instance *instance, ddi_put8(acc_handle, &scsi_raid_io_sgl_ieee->Flags, 0); - if ((devid == PCI_DEVICE_ID_LSI_INVADER) || - (devid == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { if (i == (numElements - 1)) { ddi_put8(acc_handle, &scsi_raid_io_sgl_ieee->Flags, @@ -1342,8 +1339,7 @@ mr_sas_tbolt_build_sgl(struct mrsas_instance *instance, con_log(CL_ANN1, (CE_NOTE, "[Chain Element index]:%x", i)); - if ((devid == PCI_DEVICE_ID_LSI_INVADER) || - (devid == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { uint16_t ioFlags = ddi_get16(acc_handle, &scsi_raid_io->IoFlags); @@ -1366,8 +1362,7 @@ mr_sas_tbolt_build_sgl(struct mrsas_instance *instance, ddi_put8(acc_handle, &ieeeChainElement->NextChainOffset, 0); - if ((devid == PCI_DEVICE_ID_LSI_INVADER) || - (devid == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { ddi_put8(acc_handle, &ieeeChainElement->Flags, IEEE_SGE_FLAGS_CHAIN_ELEMENT); } else { @@ -1402,8 +1397,7 @@ mr_sas_tbolt_build_sgl(struct mrsas_instance *instance, ddi_put8(acc_handle, &scsi_raid_io_sgl_ieee->Flags, 0); - if ((devid == PCI_DEVICE_ID_LSI_INVADER) || - (devid == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { if (i == (numElements - 1)) { ddi_put8(acc_handle, &scsi_raid_io_sgl_ieee->Flags, @@ -1443,7 +1437,6 @@ mrsas_tbolt_build_cmd(struct mrsas_instance *instance, struct scsi_address *ap, uint32_t lba_count = 0; uint32_t start_lba_hi = 0; uint32_t start_lba_lo = 0; - uint16_t devid = instance->device_id; ddi_acc_handle_t acc_handle = instance->mpi2_frame_pool_dma_obj.acc_handle; struct mrsas_cmd *cmd = NULL; @@ -1678,8 +1671,7 @@ mrsas_tbolt_build_cmd(struct mrsas_instance *instance, struct scsi_address *ap, (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << MPI2_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - if ((devid == PCI_DEVICE_ID_LSI_INVADER) || - (devid == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { uint8_t regLockFlags = ddi_get8(acc_handle, &scsi_raid_io->RaidContext.regLockFlags); uint16_t IoFlags = ddi_get16(acc_handle, @@ -1743,8 +1735,7 @@ mrsas_tbolt_build_cmd(struct mrsas_instance *instance, struct scsi_address *ap, &scsi_raid_io->RaidContext.timeoutValue, local_map_ptr->raidMap.fpPdIoTimeoutSec); - if ((devid == PCI_DEVICE_ID_LSI_INVADER) || - (devid == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { uint8_t regLockFlags = ddi_get8(acc_handle, &scsi_raid_io->RaidContext.regLockFlags); @@ -1849,9 +1840,7 @@ mrsas_tbolt_build_cmd(struct mrsas_instance *instance, struct scsi_address *ap, ddi_put8(acc_handle, &scsi_raid_io->LUN[1], acmd->lun); - if (instance->fast_path_io && - ((instance->device_id == PCI_DEVICE_ID_LSI_INVADER) || - (instance->device_id == PCI_DEVICE_ID_LSI_FURY))) { + if (instance->fast_path_io && instance->gen3) { uint16_t IoFlags = ddi_get16(acc_handle, &scsi_raid_io->IoFlags); IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; @@ -2269,8 +2258,7 @@ mr_sas_tbolt_build_mfi_cmd(struct mrsas_instance *instance, /* get raid message frame pointer */ scsi_raid_io = (Mpi2RaidSCSIIORequest_t *)cmd->scsi_io_request; - if ((instance->device_id == PCI_DEVICE_ID_LSI_INVADER) || - (instance->device_id == PCI_DEVICE_ID_LSI_FURY)) { + if (instance->gen3) { Mpi25IeeeSgeChain64_t *sgl_ptr_end = (Mpi25IeeeSgeChain64_t *) &scsi_raid_io->SGL.IeeeChain; sgl_ptr_end += instance->max_sge_in_main_msg - 1; |