Add support for MegaRAID Fury cards. The main change needed to boot from a

9341-4i controller was to ensure that scatter/gather lists are ended with
an end-of-list marker. Both the mrsas and Linux megaraid_sas drivers use
this marker with Invader cards as well, so we do the same thing, though
it is apparently not strictly necessary.

Reviewed by:	ambrisko
Tested by:	ambrisko (Invader card)
MFC after:	3 weeks
Sponsored by:	Sandvine Inc.
This commit is contained in:
Mark Johnston 2014-02-06 02:54:04 +00:00
parent 632a44e83a
commit 3b8ad66ea9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261535
3 changed files with 29 additions and 6 deletions

View File

@ -136,7 +136,8 @@ struct mfi_ident {
{0x1000, 0x005b, 0x8086, 0x9265, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25DB080"},
{0x1000, 0x005b, 0x8086, 0x9285, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Intel (R) RAID Controller RS25NB008"},
{0x1000, 0x005b, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "ThunderBolt"},
{0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS, "Invader"},
{0x1000, 0x005d, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS| MFI_FLAGS_INVADER, "Invader"},
{0x1000, 0x005f, 0xffff, 0xffff, MFI_FLAGS_SKINNY| MFI_FLAGS_TBOLT| MFI_FLAGS_MRSAS| MFI_FLAGS_FURY, "Fury"},
{0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078, "Dell PERC 6"},
{0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"},
{0x1000, 0x0071, 0xffff, 0xffff, MFI_FLAGS_SKINNY, "Drake Skinny"},

View File

@ -850,7 +850,8 @@ mfi_tbolt_build_ldio(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
io_request = cmd->io_request;
io_request->RaidContext.TargetID = device_id;
io_request->RaidContext.Status = 0;
io_request->RaidContext.exStatus =0;
io_request->RaidContext.exStatus = 0;
io_request->RaidContext.regLockFlags = 0;
start_lba_lo = mfi_cmd->cm_frame->io.lba_lo;
start_lba_hi = mfi_cmd->cm_frame->io.lba_hi;
@ -945,6 +946,7 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
uint8_t i, sg_processed, sg_to_process;
uint8_t sge_count, sge_idx;
union mfi_sgl *os_sgl;
pMpi25IeeeSgeChain64_t sgl_end;
/*
* Return 0 if there is no data transfer
@ -968,6 +970,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
else
sge_idx = sge_count;
if (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY)) {
sgl_end = sgl_ptr + (sc->max_SGEs_in_main_message - 1);
sgl_end->Flags = 0;
}
for (i = 0; i < sge_idx; i++) {
/*
* For 32bit BSD we are getting 32 bit SGL's from OS
@ -981,7 +988,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
sgl_ptr->Length = os_sgl->sg32[i].len;
sgl_ptr->Address = os_sgl->sg32[i].addr;
}
sgl_ptr->Flags = 0;
if (i == sge_count - 1 &&
(sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY)))
sgl_ptr->Flags = MPI25_IEEE_SGE_FLAGS_END_OF_LIST;
else
sgl_ptr->Flags = 0;
sgl_ptr++;
cmd->io_request->ChainOffset = 0;
}
@ -996,8 +1007,11 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
sg_chain = sgl_ptr;
/* Prepare chain element */
sg_chain->NextChainOffset = 0;
sg_chain->Flags = (MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT |
MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR);
if (sc->mfi_flags & (MFI_FLAGS_INVADER | MFI_FLAGS_FURY))
sg_chain->Flags = MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT;
else
sg_chain->Flags = MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT |
MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR;
sg_chain->Length = (sizeof(MPI2_SGE_IO_UNION) *
(sge_count - sg_processed));
sg_chain->Address = cmd->sg_frame_phys_addr;
@ -1010,7 +1024,13 @@ mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
sgl_ptr->Length = os_sgl->sg32[i].len;
sgl_ptr->Address = os_sgl->sg32[i].addr;
}
sgl_ptr->Flags = 0;
if (i == sge_count - 1 &&
(sc->mfi_flags &
(MFI_FLAGS_INVADER | MFI_FLAGS_FURY)))
sgl_ptr->Flags =
MPI25_IEEE_SGE_FLAGS_END_OF_LIST;
else
sgl_ptr->Flags = 0;
sgl_ptr++;
}
}

View File

@ -200,6 +200,8 @@ struct mfi_softc {
#define MFI_FLAGS_SKINNY (1<<7)
#define MFI_FLAGS_TBOLT (1<<8)
#define MFI_FLAGS_MRSAS (1<<9)
#define MFI_FLAGS_INVADER (1<<10)
#define MFI_FLAGS_FURY (1<<11)
// Start: LSIP200113393
bus_dma_tag_t verbuf_h_dmat;
bus_dmamap_t verbuf_h_dmamap;