Commit b06ff102 authored by Sreekanth Reddy's avatar Sreekanth Reddy Committed by Martin K. Petersen

scsi: mpt3sas: Use Component img header to get Package ver

The firmware image layout has been changed for Aero controllers. All
compatible HBAs have to get Firmware Package version from Component Image
Header layout.

The Signature field in FW header is set to 0xEB000042 for products
compatible with Component Image Header.

For compatible controllers, driver fetches firmware package version from
ApplicationSpecific field of Component Image Header.

Link: https://lore.kernel.org/r/1568379890-18347-11-git-send-email-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 29f571f8
...@@ -4242,10 +4242,12 @@ _base_display_OEMs_branding(struct MPT3SAS_ADAPTER *ioc) ...@@ -4242,10 +4242,12 @@ _base_display_OEMs_branding(struct MPT3SAS_ADAPTER *ioc)
static int static int
_base_display_fwpkg_version(struct MPT3SAS_ADAPTER *ioc) _base_display_fwpkg_version(struct MPT3SAS_ADAPTER *ioc)
{ {
Mpi2FWImageHeader_t *FWImgHdr; Mpi2FWImageHeader_t *fw_img_hdr;
Mpi26ComponentImageHeader_t *cmp_img_hdr;
Mpi25FWUploadRequest_t *mpi_request; Mpi25FWUploadRequest_t *mpi_request;
Mpi2FWUploadReply_t mpi_reply; Mpi2FWUploadReply_t mpi_reply;
int r = 0; int r = 0;
u32 package_version = 0;
void *fwpkg_data = NULL; void *fwpkg_data = NULL;
dma_addr_t fwpkg_data_dma; dma_addr_t fwpkg_data_dma;
u16 smid, ioc_status; u16 smid, ioc_status;
...@@ -4302,14 +4304,26 @@ _base_display_fwpkg_version(struct MPT3SAS_ADAPTER *ioc) ...@@ -4302,14 +4304,26 @@ _base_display_fwpkg_version(struct MPT3SAS_ADAPTER *ioc)
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
MPI2_IOCSTATUS_MASK; MPI2_IOCSTATUS_MASK;
if (ioc_status == MPI2_IOCSTATUS_SUCCESS) { if (ioc_status == MPI2_IOCSTATUS_SUCCESS) {
FWImgHdr = (Mpi2FWImageHeader_t *)fwpkg_data; fw_img_hdr = (Mpi2FWImageHeader_t *)fwpkg_data;
if (FWImgHdr->PackageVersion.Word) { if (le32_to_cpu(fw_img_hdr->Signature) ==
ioc_info(ioc, "FW Package Version (%02d.%02d.%02d.%02d)\n", MPI26_IMAGE_HEADER_SIGNATURE0_MPI26) {
FWImgHdr->PackageVersion.Struct.Major, cmp_img_hdr =
FWImgHdr->PackageVersion.Struct.Minor, (Mpi26ComponentImageHeader_t *)
FWImgHdr->PackageVersion.Struct.Unit, (fwpkg_data);
FWImgHdr->PackageVersion.Struct.Dev); package_version =
} le32_to_cpu(
cmp_img_hdr->ApplicationSpecific);
} else
package_version =
le32_to_cpu(
fw_img_hdr->PackageVersion.Word);
if (package_version)
ioc_info(ioc,
"FW Package Ver(%02d.%02d.%02d.%02d)\n",
((package_version) & 0xFF000000) >> 24,
((package_version) & 0x00FF0000) >> 16,
((package_version) & 0x0000FF00) >> 8,
(package_version) & 0x000000FF);
} else { } else {
_debug_dump_mf(&mpi_reply, _debug_dump_mf(&mpi_reply,
sizeof(Mpi2FWUploadReply_t)/4); sizeof(Mpi2FWUploadReply_t)/4);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment